-
Notifications
You must be signed in to change notification settings - Fork 1
/
utama.s
138 lines (133 loc) · 3.06 KB
/
utama.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
; utama.c in Assembly
;
;
.section __TEXT,__text,regular,pure_instructions
.build_version macos, 14, 0 sdk_version 14, 5
.globl _main ; -- Begin function main
.p2align 2
_main: ; @main
.cfi_startproc
; %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
stp x29, x30, [sp, #32] ; 16-byte Folded Spill
add x29, sp, #32
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur wzr, [x29, #-4]
adrp x0, l_.str@PAGE
add x0, x0, l_.str@PAGEOFF
bl _printf
mov x9, sp
sub x8, x29, #8
str x8, [x9]
adrp x0, l_.str.1@PAGE
add x0, x0, l_.str.1@PAGEOFF
bl _scanf
ldur w8, [x29, #-8]
subs w8, w8, #3
cset w8, ne
tbnz w8, #0, LBB0_2
b LBB0_1
LBB0_1:
ldur w9, [x29, #-8]
; implicit-def: $x8
mov x8, x9
mov x9, sp
str x8, [x9]
adrp x0, l_.str.2@PAGE
add x0, x0, l_.str.2@PAGEOFF
bl _printf
b LBB0_9
LBB0_2:
ldur w8, [x29, #-8]
mov w10, #2
sdiv w9, w8, w10
mul w9, w9, w10
subs w8, w8, w9
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, LBB0_4
b LBB0_3
LBB0_3:
ldur w9, [x29, #-8]
; implicit-def: $x8
mov x8, x9
mov x9, sp
str x8, [x9]
adrp x0, l_.str.3@PAGE
add x0, x0, l_.str.3@PAGEOFF
bl _printf
b LBB0_8
LBB0_4:
stur wzr, [x29, #-12]
b LBB0_5
LBB0_5: ; =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-12]
ldur w9, [x29, #-8]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_7
b LBB0_6
LBB0_6: ; in Loop: Header=BB0_5 Depth=1
ldur w9, [x29, #-8]
; implicit-def: $x8
mov x8, x9
mov x9, sp
str x8, [x9]
adrp x0, l_.str.4@PAGE
add x0, x0, l_.str.4@PAGEOFF
bl _printf
ldur w8, [x29, #-12]
add w8, w8, #1
stur w8, [x29, #-12]
b LBB0_5
LBB0_7:
b LBB0_8
LBB0_8:
b LBB0_9
LBB0_9:
str wzr, [sp, #16]
b LBB0_10
LBB0_10: ; =>This Inner Loop Header: Depth=1
ldr w8, [sp, #16]
ldur w9, [x29, #-8]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, LBB0_13
b LBB0_11
LBB0_11: ; in Loop: Header=BB0_10 Depth=1
ldr w9, [sp, #16]
; implicit-def: $x8
mov x8, x9
mov x9, sp
str x8, [x9]
adrp x0, l_.str.2@PAGE
add x0, x0, l_.str.2@PAGEOFF
bl _printf
b LBB0_12
LBB0_12: ; in Loop: Header=BB0_10 Depth=1
ldr w8, [sp, #16]
add w8, w8, #1
str w8, [sp, #16]
b LBB0_10
LBB0_13:
mov w0, #0
ldp x29, x30, [sp, #32] ; 16-byte Folded Reload
add sp, sp, #48
ret
.cfi_endproc
; -- End function
.section __TEXT,__cstring,cstring_literals
l_.str: ; @.str
.asciz "Sila masukkan sebuah nombor bulat: "
l_.str.1: ; @.str.1
.asciz "%d"
l_.str.2: ; @.str.2
.asciz "%d\n"
l_.str.3: ; @.str.3
.asciz "%d ialah genap!\n"
l_.str.4: ; @.str.4
.asciz "%d ialah ganjil!\n"
.subsections_via_symbols