Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .intel_syntax noprefix
- .text
- .global main
- main:
- push ebp
- mov ebp, esp
- call yolo00
- mov eax, 0
- mov esp,ebp
- pop ebp
- ret
- puti0:
- push ebp
- mov ebp, esp
- push edi
- push ebx
- push esi
- mov esi, DWORD PTR [ebp+16]
- push esi
- mov eax, OFFSET FLAT:printf_int
- push eax
- call printf
- add esp, 8
- pop esi
- pop ebx
- pop edi
- mov esp,ebp
- pop ebp
- ret
- putc0:
- push ebp
- mov ebp, esp
- push edi
- push ebx
- push esi
- mov esi, DWORD PTR [ebp+16]
- push esi
- mov eax, OFFSET FLAT:printf_char
- push eax
- call printf
- add esp, 8
- pop esi
- pop ebx
- pop edi
- mov esp,ebp
- pop ebp
- ret
- puts0:
- push ebp
- mov ebp, esp
- push edi
- push ebx
- push esi
- mov eax, DWORD PTR [ebp+16]
- push eax
- mov eax, OFFSET FLAT:printf_string
- push eax
- call printf
- add esp, 8
- pop esi
- pop ebx
- pop edi
- mov esp,ebp
- pop ebp
- ret
- geti0:
- push ebp
- mov ebp, esp
- push edi
- push ebx
- push esi
- mov eax, OFFSET FLAT:prompt_int
- push eax
- call printf
- add esp, 4
- mov eax, DWORD PTR [ebp+12]
- push eax
- mov eax, OFFSET FLAT:int_fmt
- push eax
- call scanf
- add esp, 8
- pop esi
- pop ebx
- pop edi
- mov esp,ebp
- pop ebp
- ret
- getc0:
- push ebp
- mov ebp, esp
- push edi
- push ebx
- push esi
- mov eax, OFFSET FLAT:prompt_char
- push eax
- call printf
- add esp, 4
- lea eax, DWORD PTR [ebp+12]
- push eax
- mov eax, OFFSET FLAT:char_fmt
- push eax
- call scanf
- add esp, 8
- pop esi
- pop ebx
- pop edi
- mov esp,ebp
- pop ebp
- ret
- gets0:
- push ebp
- push edi
- push ebx
- push esi
- push esi
- mov eax, DWORD PTR stdin
- push eax
- mov eax, DWORD PTR [ebp+16]
- push eax
- mov eax, DWORD PTR [ebp+20]
- push eax
- call fgets
- add esp, 12
- mov eax, DWORD PTR [ebp+12]
- push eax
- call strchr
- add esp, 8
- cmp eax, 0
- je grace_gets_no_newline
- mov BYTE PTR [eax], 0
- grace_gets_no_newline:
- pop esi
- pop ebx
- pop edi
- mov esp,ebp
- pop ebp
- ret
- abs0:
- push ebp
- mov ebp, esp
- push edi
- push ebx
- push esi
- mov eax, DWORD PTR [ebp+16]
- mov edx, 0
- cmp eax, edx
- jl abs_neg
- jmp abs_pos
- abs_neg:
- neg eax
- mov esi, DWORD PTR [ebp+12]
- mov DWORD PTR [esi], eax
- pop esi
- pop ebx
- pop edi
- mov esp,ebp
- pop ebp
- ret
- abs_pos:
- mov esi, DWORD PTR [ebp+12]
- mov DWORD PTR [esi], eax
- pop esi
- pop ebx
- pop edi
- mov esp,ebp
- pop ebp
- ret
- ord0:
- push ebp
- mov ebp, esp
- push edi
- push ebx
- push esi
- mov ebx, DWORD PTR [ebx+16]
- mov esi, DWORD PTR [ebp+12]
- mov DWORD PTR [esi], ebx
- pop esi
- pop ebx
- pop edi
- mov esp,ebp
- pop ebp
- ret
- chr0:
- push ebp
- mov ebp, esp
- push edi
- push ebx
- push esi
- mov ebx, DWORD PTR [ebx+16]
- mov esi, DWORD PTR [ebp+12]
- mov DWORD PTR [esi], ebx
- pop esi
- pop ebx
- pop edi
- mov esp,ebp
- pop ebp
- ret
- # 1:unit,yolo1,-,-
- yolo11:
- push ebp
- mov ebp, esp
- sub esp, 72
- push edi
- push ebx
- push esi
- # 2:*,4,5,$1
- mov eax, 5
- mov ecx, 4
- imul ecx
- mov DWORD PTR [ebp-4], eax
- # 3:+,base,$1,$2
- mov eax, DWORD PTR [ebp-4]
- mov edx, 0
- add eax, edx
- mov DWORD PTR [ebp-8], eax
- # 4:+,$2,4,$3
- mov eax, 4
- mov edx, DWORD PTR [ebp-8]
- add eax, edx
- mov DWORD PTR [ebp-12], eax
- # 5:array,x,$3,$4
- mov eax, DWORD PTR [ebp-12]
- mov ecx, 4
- imul ecx
- mov esi, DWORD PTR [ebp+16]
- lea ecx, DWORD PTR [esi]
- add eax, ecx
- mov DWORD PTR [ebp-16], eax
- # 6::=,5,-,[$4]
- mov ecx, 5
- mov edi, DWORD PTR [ebp-16]
- mov DWORD PTR [edi], ecx
- # 7:*,4,5,$5
- mov eax, 5
- mov ecx, 4
- imul ecx
- mov DWORD PTR [ebp-20], eax
- # 8:+,base,$5,$6
- mov eax, DWORD PTR [ebp-20]
- mov edx, 0
- add eax, edx
- mov DWORD PTR [ebp-24], eax
- # 9:+,$6,4,$7
- mov eax, 4
- mov edx, DWORD PTR [ebp-24]
- add eax, edx
- mov DWORD PTR [ebp-28], eax
- # 10:array,x,$7,$8
- mov eax, DWORD PTR [ebp-28]
- mov ecx, 4
- imul ecx
- mov esi, DWORD PTR [ebp+16]
- lea ecx, DWORD PTR [esi]
- add eax, ecx
- mov DWORD PTR [ebp-32], eax
- # 11:par,[$8],V,-
- mov edi, DWORD PTR [ebp-32]
- mov eax, DWORD PTR [edi]
- push eax
- # 12:call,-,-,puti
- push eax
- mov esi,DWORD PTR [ebp+8]
- push esi
- call puti0
- add esp, 12
- # 13::=,3,-,seed
- mov ecx, 3
- mov esi, DWORD PTR [ebp+8]
- mov DWORD PTR [esi-4], ecx
- # 14:+,3,seed,$9
- mov esi, DWORD PTR [ebp+8]
- mov eax, DWORD PTR [esi-4]
- mov edx, 3
- add eax, edx
- mov DWORD PTR [ebp-36], eax
- # 15:*,4,5,$10
- mov eax, 5
- mov ecx, 4
- imul ecx
- mov DWORD PTR [ebp-40], eax
- # 16:+,base,$10,$11
- mov eax, DWORD PTR [ebp-40]
- mov edx, 0
- add eax, edx
- mov DWORD PTR [ebp-44], eax
- # 17:+,$11,4,$12
- mov eax, 4
- mov edx, DWORD PTR [ebp-44]
- add eax, edx
- mov DWORD PTR [ebp-48], eax
- # 18:array,x,$12,$13
- mov eax, DWORD PTR [ebp-48]
- mov ecx, 4
- imul ecx
- mov esi, DWORD PTR [ebp+16]
- lea ecx, DWORD PTR [esi]
- add eax, ecx
- mov DWORD PTR [ebp-52], eax
- # 19:+,[$13],$9,$14
- mov eax, DWORD PTR [ebp-36]
- mov edi, DWORD PTR [ebp-52]
- mov edx, DWORD PTR [edi]
- add eax, edx
- mov DWORD PTR [ebp-56], eax
- # 20::=,[$14],-,seed
- mov edi, DWORD PTR [ebp-56]
- mov ecx, DWORD PTR [edi]
- mov esi, DWORD PTR [ebp+8]
- mov DWORD PTR [esi-4], ecx
- # 21:par,seed,V,-
- mov esi, DWORD PTR [ebp+8]
- mov eax, DWORD PTR [esi-4]
- push eax
- # 22:call,-,-,puti
- push eax
- mov esi,DWORD PTR [ebp+8]
- push esi
- call puti0
- add esp, 12
- # 23:*,4,5,$15
- mov eax, 5
- mov ecx, 4
- imul ecx
- mov DWORD PTR [ebp-60], eax
- # 24:+,base,$15,$16
- mov eax, DWORD PTR [ebp-60]
- mov edx, 0
- add eax, edx
- mov DWORD PTR [ebp-64], eax
- # 25:+,$16,4,$17
- mov eax, 4
- mov edx, DWORD PTR [ebp-64]
- add eax, edx
- mov DWORD PTR [ebp-68], eax
- # 26:array,x,$17,$18
- mov eax, DWORD PTR [ebp-68]
- mov ecx, 4
- imul ecx
- mov esi, DWORD PTR [ebp+16]
- lea ecx, DWORD PTR [esi]
- add eax, ecx
- mov DWORD PTR [ebp-72], eax
- # 27::=,[$18],-,$$
- mov edi, DWORD PTR [ebp-72]
- mov ecx, DWORD PTR [edi]
- mov esi, DWORD PTR [ebp+12]
- mov DWORD PTR [esi], ecx
- # 28:RET,-,-,-
- pop esi
- pop ebx
- pop edi
- add esp, 72
- pop ebp
- ret
- # 29:endu,yolo1,-,-
- pop esi
- pop ebx
- pop edi
- add esp, 72
- pop ebp
- ret
- # 30:unit,yolo0,-,-
- yolo00:
- push ebp
- mov ebp, esp
- sub esp, 180
- push edi
- push ebx
- push esi
- # 32:par,i,V,-
- mov eax, DWORD PTR [ebp-8]
- push eax
- # 31:par,x,R,-
- lea esi, DWORD PTR [ebp-108]
- push esi
- # 34:call,-,-,yolo1
- # 33:par,$19,RET,-
- lea esi, DWORD PTR [ebp-128]
- push esi
- push ebp
- call yolo11
- add esp, 12
- # 36:par,seed,V,-
- mov eax, DWORD PTR [ebp-4]
- push eax
- # 35:par,x,R,-
- lea esi, DWORD PTR [ebp-108]
- push esi
- # 38:call,-,-,yolo1
- # 37:par,$20,RET,-
- lea esi, DWORD PTR [ebp-132]
- push esi
- push ebp
- call yolo11
- add esp, 12
- # 39:+,$20,15,$21
- mov eax, 15
- mov edx, DWORD PTR [ebp-132]
- add eax, edx
- mov DWORD PTR [ebp-136], eax
- # 40::=,$21,-,seed
- mov ecx, DWORD PTR [ebp-136]
- mov DWORD PTR [ebp-4], ecx
- # 41:par,seed,V,-
- mov eax, DWORD PTR [ebp-4]
- push eax
- # 42:call,-,-,puti
- push eax
- push DWORD PTR [ebp+8]
- call puti0
- add esp, 12
- # 44:call,-,-,geti
- # 43:par,$22,RET,-
- lea esi, DWORD PTR [ebp-140]
- push esi
- push DWORD PTR [ebp+8]
- call geti0
- add esp, 4
- # 45::=,$22,-,seed
- mov ecx, DWORD PTR [ebp-140]
- mov DWORD PTR [ebp-4], ecx
- # 46:par,seed,V,-
- mov eax, DWORD PTR [ebp-4]
- push eax
- # 47:call,-,-,puti
- push eax
- push DWORD PTR [ebp+8]
- call puti0
- add esp, 12
- # 48:uminus,5,-,$23
- mov eax, 5
- neg eax
- mov DWORD PTR [ebp-144], eax
- # 49::=,$23,-,seed
- mov ecx, DWORD PTR [ebp-144]
- mov DWORD PTR [ebp-4], ecx
- # 50:par,seed,V,-
- mov eax, DWORD PTR [ebp-4]
- push eax
- # 51:call,-,-,puti
- push eax
- push DWORD PTR [ebp+8]
- call puti0
- add esp, 12
- # 52:par,seed,V,-
- mov eax, DWORD PTR [ebp-4]
- push eax
- # 54:call,-,-,abs
- # 53:par,$24,RET,-
- lea esi, DWORD PTR [ebp-148]
- push esi
- push DWORD PTR [ebp+8]
- call abs0
- add esp, 8
- # 55::=,$24,-,seed
- mov ecx, DWORD PTR [ebp-148]
- mov DWORD PTR [ebp-4], ecx
- # 56:par,seed,V,-
- mov eax, DWORD PTR [ebp-4]
- push eax
- # 57:call,-,-,puti
- push eax
- push DWORD PTR [ebp+8]
- call puti0
- add esp, 12
- # 58:par,seed,V,-
- mov eax, DWORD PTR [ebp-4]
- push eax
- # 60:call,-,-,abs
- # 59:par,$25,RET,-
- lea esi, DWORD PTR [ebp-152]
- push esi
- push DWORD PTR [ebp+8]
- call abs0
- add esp, 8
- # 61:par,$25,V,-
- mov eax, DWORD PTR [ebp-152]
- push eax
- # 62:call,-,-,puti
- push eax
- push DWORD PTR [ebp+8]
- call puti0
- add esp, 12
- # 63:par,'c',V,-
- mov eax, OFFSET FLAT:string1
- push eax
- # 65:call,-,-,ord
- # 64:par,$26,RET,-
- lea esi, DWORD PTR [ebp-156]
- push esi
- push DWORD PTR [ebp+8]
- call ord0
- add esp, 8
- # 66::=,$26,-,seed
- mov ecx, DWORD PTR [ebp-156]
- mov DWORD PTR [ebp-4], ecx
- # 67:par,seed,V,-
- mov eax, DWORD PTR [ebp-4]
- push eax
- # 68:call,-,-,puti
- push eax
- push DWORD PTR [ebp+8]
- call puti0
- add esp, 12
- # 69:par,'c',V,-
- mov eax, OFFSET FLAT:string2
- push eax
- # 71:call,-,-,ord
- # 70:par,$27,RET,-
- lea esi, DWORD PTR [ebp-160]
- push esi
- push DWORD PTR [ebp+8]
- call ord0
- add esp, 8
- # 72:par,$27,V,-
- mov eax, DWORD PTR [ebp-160]
- push eax
- # 73:call,-,-,puti
- push eax
- push DWORD PTR [ebp+8]
- call puti0
- add esp, 12
- # 74:-,3,seed,$28
- mov eax, DWORD PTR [ebp-4]
- mov edx, 3
- sub eax, edx
- mov DWORD PTR [ebp-164], eax
- # 75::=,$28,-,seed
- mov ecx, DWORD PTR [ebp-164]
- mov DWORD PTR [ebp-4], ecx
- # 76:par,seed,V,-
- mov eax, DWORD PTR [ebp-4]
- push eax
- # 77:call,-,-,puti
- push eax
- push DWORD PTR [ebp+8]
- call puti0
- add esp, 12
- # 78:*,5,seed,$29
- mov eax, DWORD PTR [ebp-4]
- mov ecx, 5
- imul ecx
- mov DWORD PTR [ebp-168], eax
- # 79::=,$29,-,seed
- mov ecx, DWORD PTR [ebp-168]
- mov DWORD PTR [ebp-4], ecx
- # 80:par,seed,V,-
- mov eax, DWORD PTR [ebp-4]
- push eax
- # 81:call,-,-,puti
- push eax
- push DWORD PTR [ebp+8]
- call puti0
- add esp, 12
- # 82:%,5,seed,$30
- mov eax, DWORD PTR [ebp-4]
- cdq
- mov ecx, 5
- idiv ecx
- mov DWORD PTR [ebp-172], edx
- # 83::=,$30,-,seed
- mov ecx, DWORD PTR [ebp-172]
- mov DWORD PTR [ebp-4], ecx
- # 84:par,seed,V,-
- mov eax, DWORD PTR [ebp-4]
- push eax
- # 85:call,-,-,puti
- push eax
- push DWORD PTR [ebp+8]
- call puti0
- add esp, 12
- # 86:/,5,seed,$31
- mov eax, DWORD PTR [ebp-4]
- cdq
- mov ecx, 5
- idiv ecx
- mov DWORD PTR [ebp-176], eax
- # 87::=,$31,-,seed
- mov ecx, DWORD PTR [ebp-176]
- mov DWORD PTR [ebp-4], ecx
- # 88:par,seed,V,-
- mov eax, DWORD PTR [ebp-4]
- push eax
- # 89:call,-,-,puti
- push eax
- push DWORD PTR [ebp+8]
- call puti0
- add esp, 12
- # 90:uminus,5,-,$32
- mov eax, 5
- neg eax
- mov DWORD PTR [ebp-180], eax
- # 91::=,$32,-,seed
- mov ecx, DWORD PTR [ebp-180]
- mov DWORD PTR [ebp-4], ecx
- # 92:par,seed,V,-
- mov eax, DWORD PTR [ebp-4]
- push eax
- # 93:call,-,-,puti
- push eax
- push DWORD PTR [ebp+8]
- call puti0
- add esp, 12
- # 94:endu,yolo0,-,-
- pop esi
- pop ebx
- pop edi
- add esp, 180
- pop ebp
- ret
- .data
- string1: .asciz "c"
- string2: .asciz "c"
- int_fmt: .asciz "%d"
- char_fmt: .asciz "%c"
- string_fmt: .asciz "%c\n"
- printf_int: .asciz "%d\n"
- printf_char: .asciz "%c\n"
- printf_string: .asciz "%s\n"
- prompt_int: .asciz "Enter a number\n"
- prompt_char: .asciz "Enter a character\n"
- prompt_string: .asciz "Enter a string"
- prompt_string2: .asciz "with length %d characters\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement