DEV1-21-22/Exemples/main.s

159 lines
3.8 KiB
ArmAsm
Raw Normal View History

2021-09-28 09:15:52 +02:00
.section __TEXT,__text,regular,pure_instructions
.build_version macos, 11, 0 sdk_version 11, 1
.globl _main ; -- Begin function main
.p2align 2
_main: ; @main
.cfi_startproc
; %bb.0:
2021-09-28 11:03:21 +02:00
sub sp, sp, #112 ; =112
stp x29, x30, [sp, #96] ; 16-byte Folded Spill
add x29, sp, #96 ; =96
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
adrp x8, l_.str.1@PAGE
add x8, x8, l_.str.1@PAGEOFF
adrp x9, l_.str.5@PAGE
add x9, x9, l_.str.5@PAGEOFF
stur wzr, [x29, #-4]
stur w0, [x29, #-8]
stur x1, [x29, #-16]
adrp x0, l_.str@PAGE
add x0, x0, l_.str@PAGEOFF
stur x8, [x29, #-40] ; 8-byte Folded Spill
str x9, [sp, #48] ; 8-byte Folded Spill
bl _printf
ldur x8, [x29, #-40] ; 8-byte Folded Reload
mov x0, x8
mov x9, sp
sub x10, x29, #20 ; =20
str x10, [x9]
bl _scanf
adrp x8, l_.str.2@PAGE
add x8, x8, l_.str.2@PAGEOFF
mov x0, x8
bl _printf
ldur x8, [x29, #-40] ; 8-byte Folded Reload
mov x0, x8
mov x9, sp
sub x10, x29, #24 ; =24
str x10, [x9]
bl _scanf
adrp x8, l_.str.3@PAGE
add x8, x8, l_.str.3@PAGEOFF
mov x0, x8
bl _printf
ldur x8, [x29, #-40] ; 8-byte Folded Reload
mov x0, x8
mov x9, sp
sub x10, x29, #28 ; =28
str x10, [x9]
bl _scanf
ldur w11, [x29, #-20]
; implicit-def: $x1
mov x1, x11
ldur w11, [x29, #-24]
; implicit-def: $x2
mov x2, x11
ldur w11, [x29, #-28]
; implicit-def: $x3
mov x3, x11
adrp x8, l_.str.4@PAGE
add x8, x8, l_.str.4@PAGEOFF
mov x0, x8
mov x8, sp
str x1, [x8]
str x2, [x8, #8]
str x3, [x8, #16]
bl _printf
ldur w11, [x29, #-20]
ldur w12, [x29, #-24]
cmp w11, w12
b.lt LBB0_3
; %bb.1:
ldur w8, [x29, #-20]
ldur w9, [x29, #-28]
cmp w8, w9
b.lt LBB0_3
; %bb.2:
ldur w8, [x29, #-20]
; implicit-def: $x0
mov x0, x8
ldr x9, [sp, #48] ; 8-byte Folded Reload
str x0, [sp, #40] ; 8-byte Folded Spill
mov x0, x9
mov x10, sp
ldr x11, [sp, #40] ; 8-byte Folded Reload
str x11, [x10]
bl _printf
LBB0_3:
ldur w8, [x29, #-24]
ldur w9, [x29, #-20]
cmp w8, w9
b.lt LBB0_6
; %bb.4:
ldur w8, [x29, #-24]
ldur w9, [x29, #-28]
cmp w8, w9
b.lt LBB0_6
; %bb.5:
ldur w8, [x29, #-24]
; implicit-def: $x0
mov x0, x8
ldr x9, [sp, #48] ; 8-byte Folded Reload
str x0, [sp, #32] ; 8-byte Folded Spill
mov x0, x9
mov x10, sp
ldr x11, [sp, #32] ; 8-byte Folded Reload
str x11, [x10]
bl _printf
LBB0_6:
ldur w8, [x29, #-28]
ldur w9, [x29, #-20]
cmp w8, w9
b.lt LBB0_9
; %bb.7:
ldur w8, [x29, #-28]
ldur w9, [x29, #-24]
cmp w8, w9
b.lt LBB0_9
; %bb.8:
ldur w8, [x29, #-28]
; implicit-def: $x0
mov x0, x8
ldr x9, [sp, #48] ; 8-byte Folded Reload
str x0, [sp, #24] ; 8-byte Folded Spill
mov x0, x9
mov x10, sp
ldr x11, [sp, #24] ; 8-byte Folded Reload
str x11, [x10]
bl _printf
LBB0_9:
2021-09-28 09:15:52 +02:00
mov w8, #0
mov x0, x8
2021-09-28 11:03:21 +02:00
ldp x29, x30, [sp, #96] ; 16-byte Folded Reload
add sp, sp, #112 ; =112
2021-09-28 09:15:52 +02:00
ret
.cfi_endproc
; -- End function
2021-09-28 11:03:21 +02:00
.section __TEXT,__cstring,cstring_literals
l_.str: ; @.str
.asciz "Entrer un premier entier : "
l_.str.1: ; @.str.1
.asciz "%d"
l_.str.2: ; @.str.2
.asciz "Entrer un deuxieme entier : "
l_.str.3: ; @.str.3
.asciz "Entrer un troisieme entier : "
l_.str.4: ; @.str.4
.asciz "Entiers lus : %d, %d, %d\n"
l_.str.5: ; @.str.5
.asciz "Max = %d\n"
2021-09-28 09:15:52 +02:00
.subsections_via_symbols