Result

WA

Duration

485ms

Code [DL]

global i
global buf
global a
global get_int: function
global write_int: function
global main: function


SECTION .text   align=1 execute

get_int:; Function begin
        push    ebp
        mov     ebp, esp
        sub     esp, 24
        mov     dword [ebp-0CH], 0
?_001:  sub     esp, 4
        push    1
        pop edx
        push    buf
        pop ecx
        push    0
        pop ebx
        push 3
        pop eax
        ;call    read
        int 0x80
        add     esp, 16
        movzx   eax, byte [buf]
        cmp     al, 10
        jz      ?_002
        movzx   eax, byte [buf]
        cmp     al, 32
        jz      ?_002
        mov     edx, dword [ebp-0CH]
        mov     eax, edx
        shl     eax, 2
        add     eax, edx
        add     eax, eax
        mov     edx, eax
        movzx   eax, byte [buf]
        movsx   eax, al
        sub     eax, 48
        add     eax, edx
        mov     dword [ebp-0CH], eax
        jmp     ?_001

?_002:  mov     eax, dword [ebp-0CH]
        leave
        ret
; get_int End of function

write_int:; Function begin
        push    ebp
        mov     ebp, esp
        sub     esp, 8
        cmp     dword [ebp+8H], 0
        jle     ?_003
        mov     ecx, dword [ebp+8H]
        mov     edx, 1717986919
        mov     eax, ecx
        imul    edx
        sar     edx, 2
        mov     eax, ecx
        sar     eax, 31
        sub     edx, eax
        mov     eax, edx
        sub     esp, 12
        push    eax
        call    write_int
        add     esp, 16
        mov     ecx, dword [ebp+8H]
        mov     edx, 1717986919
        mov     eax, ecx
        imul    edx
        sar     edx, 2
        mov     eax, ecx
        sar     eax, 31
        sub     edx, eax
        mov     eax, edx
        shl     eax, 2
        add     eax, edx
        add     eax, eax
        sub     ecx, eax
        mov     edx, ecx
        mov     eax, edx
        add     eax, 48
        mov     byte [buf], al
        sub     esp, 4
        push    1
        pop edx
        push    buf
        pop ecx
        push    1
        pop ebx
        push 4
        pop eax
        int 0x80
        add     esp, 16
?_003:  nop
        leave
        ret
; write_int End of function

main:   ; Function begin
        lea     ecx, [esp+4H]
        and     esp, 0FFFFFFF0H
        push    dword [ecx-4H]
        push    ebp
        mov     ebp, esp
        push    esi
        push    ebx
        push    ecx
        sub     esp, 28
        mov     dword [ebp-1CH], 0
        jmp     ?_006

?_004:  call    get_int
        mov     edx, eax
        mov     eax, dword [ebp-1CH]
        mov     dword [a+eax*4], edx
        cmp     dword [ebp-1CH], 2
        jle     ?_005
        mov     eax, dword [ebp-1CH]
        mov     ebx, dword [a+eax*4]
        mov     ecx, dword [ebp-1CH]
        mov     edx, 1431655766
        mov     eax, ecx
        imul    edx
        mov     eax, ecx
        sar     eax, 31
        sub     edx, eax
        mov     eax, edx
        mov     edx, eax
        add     edx, edx
        add     edx, eax
        mov     eax, ecx
        sub     eax, edx
        mov     eax, dword [a+eax*4]
        sub     ebx, eax
        mov     edx, ebx
        mov     eax, dword [ebp-1CH]
        mov     dword [a+eax*4], edx
?_005:  add     dword [ebp-1CH], 1
?_006:  cmp     dword [ebp-1CH], 11
        jle     ?_004
        mov     eax, dword [a+0CH]
        mov     ecx, dword [a+1CH]
        mov     edx, dword [a+2CH]
        imul    ecx, edx
        mov     ebx, dword [a+20H]
        mov     edx, dword [a+28H]
        imul    edx, ebx
        sub     ecx, edx
        mov     edx, ecx
        imul    edx, eax
        mov     eax, dword [a+10H]
        mov     ebx, dword [a+20H]
        mov     ecx, dword [a+24H]
        imul    ebx, ecx
        mov     esi, dword [a+2CH]
        mov     ecx, dword [a+18H]
        imul    ecx, esi
        sub     ebx, ecx
        mov     ecx, ebx
        imul    eax, ecx
        lea     esi, [edx+eax]
        mov     eax, dword [a+14H]
        mov     ecx, dword [a+28H]
        mov     edx, dword [a+18H]
        imul    ecx, edx
        mov     ebx, dword [a+1CH]
        mov     edx, dword [a+24H]
        imul    edx, ebx
        sub     ecx, edx
        mov     edx, ecx
        imul    eax, edx
        lea     ecx, [esi+eax]
        mov     edx, 715827883
        mov     eax, ecx
        imul    edx
        mov     eax, ecx
        sar     eax, 31
        sub     edx, eax
        mov     eax, edx
        sub     esp, 12
        push    eax
        call    write_int
        add     esp, 16
        mov     eax, 0
        lea     esp, [ebp-0CH]
        pop     ecx
        pop     ebx
        pop     esi
        pop     ebp
        lea     esp, [ecx-4H]
        ret
; main End of function


SECTION .data   align=1 noexecute


SECTION .bss    align=1 noexecute

stdin

53 22 28
55 08 92
24 64 19
18 09 18

stdout

stderr

/tmp/code.asm:9: warning: Unknown section attribute 'execute' ignored on declaration of section `.text'
/tmp/code.asm:200: warning: Unknown section attribute 'noexecute' ignored on declaration of section `.data'
/tmp/code.asm:203: warning: Unknown section attribute 'noexecute' ignored on declaration of section `.bss'
/tmp/code.asm:4: error: symbol `function' not defined before use
/tmp/code.asm:5: error: symbol `function' not defined before use
/tmp/code.asm:6: error: symbol `function' not defined before use
/tmp/code.asm:19: error: symbol `buf' undefined
/tmp/code.asm:28: error: symbol `buf' undefined
/tmp/code.asm:31: error: symbol `buf' undefined
/tmp/code.asm:40: error: symbol `buf' undefined
/tmp/code.asm:87: error: symbol `buf' undefined
/tmp/code.asm:91: error: symbol `buf' undefined
/tmp/code.asm:120: error: symbol `a' undefined
/tmp/code.asm:124: error: symbol `a' undefined
/tmp/code.asm:138: error: symbol `a' undefined
/tmp/code.asm:142: error: symbol `a' undefined
/tmp/code.asm:146: error: symbol `a' undefined
/tmp/code.asm:147: error: symbol `a' undefined
/tmp/code.asm:148: error: symbol `a' undefined
/tmp/code.asm:150: error: symbol `a' undefined
/tmp/code.asm:151: error: symbol `a' undefined
/tmp/code.asm:156: error: symbol `a' undefined
/tmp/code.asm:157: error: symbol `a' undefined
/tmp/code.asm:158: error: symbol `a' undefined
/tmp/code.asm:160: error: symbol `a' undefined
/tmp/code.asm:161: error: symbol `a' undefined
/tmp/code.asm:167: error: symbol `a' undefined
/tmp/code.asm:168: error: symbol `a' undefined
/tmp/code.asm:169: error: symbol `a' undefined
/tmp/code.asm:171: error: symbol `a' undefined
/tmp/code.asm:172: error: symbol `a' undefined
gcc: error: /tmp/code.o: No such file or directory
gcc: fatal error: no input files
compilation terminated.
/bin/script: 16: /bin/script: /tmp/code: not found
rm: cannot remove '/tmp/code.o': No such file or directory
rm: cannot remove '/tmp/code': No such file or directory

strace