extern io_get_udec, io_print_udec
section .bss
x resd 1
y resd 1
section .text
global foo
global main
foo:
push ebp
mov ebp, esp
sub esp, 4
mov eax, dword [ebp + 12]
div dword [ebp + 8]
cmp edx, 0
jne .go
mov eax, dword [ebp + 8]
leave
ret
.go:
mov dword [ebp + 12], dword [ebp + 8]
mov dword [ebp + 8], edx
push dword [ebp + 12]
push dword [ebp + 8]
call foo
add esp, 8
main:
call io_get_udec
mov ebx, eax
call io_get_udec
mov eax, edi
call io_get_udec
mov eax, esi
.L1:
cmp ebx, 1
je .end1
call io_get_udec
mov edx, esi
mul edx
call io_get_udec
mul edi
mul esi
add edi, edx
.end1:
cmp esi, edi
jge .if1
push edi
push esi
.if1:
push esi
push edi
jmp .end
.end:
call foo
add esp, 8
call io_print_udec
xor eax, eax