Skip to content

Instantly share code, notes, and snippets.

@mrquincle
Created February 21, 2014 15:15
Show Gist options
  • Save mrquincle/9136005 to your computer and use it in GitHub Desktop.
Save mrquincle/9136005 to your computer and use it in GitHub Desktop.
The RFDLoader dissambled (this is to flash the RFduino and communicates with its bootloader)
RFduino
Are parts of http://code.google.com/p/optiboot/ used? This is GPL!
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rsp - Killed Regs: rbp rdi
__Z21stk500_read_signaturev: // stk500_read_signature()
0000000100001cc0 55 push rbp ; XREF=0x100003341
0000000100001cc1 4889E5 mov rbp, rsp
0000000100001cc4 BF75000000 mov edi, 0x75
0000000100001cc9 E8A2FAFFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001cce BF20000000 mov edi, 0x20
0000000100001cd3 E898FAFFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001cd8 BF14000000 mov edi, 0x14
0000000100001cdd E82E000000 call __ZL5matchh ; match(unsigned char)
0000000100001ce2 BF52000000 mov edi, 0x52
0000000100001ce7 E824000000 call __ZL5matchh ; match(unsigned char)
0000000100001cec BF46000000 mov edi, 0x46
0000000100001cf1 E81A000000 call __ZL5matchh ; match(unsigned char)
0000000100001cf6 BF01000000 mov edi, 0x1
0000000100001cfb E810000000 call __ZL5matchh ; match(unsigned char)
0000000100001d00 BF10000000 mov edi, 0x10
0000000100001d05 E806000000 call __ZL5matchh ; match(unsigned char)
0000000100001d0a 5D pop rbp
0000000100001d0b C3 ret
; endp
Compare with http://baldwisdom.com/bootloading/
Avrdude/Arduino IDE: #75#20 STK_READ_SIGN, SYNC_CRC_EOP (read device signature)
Target/Arduino UNO: #14#1E#95#0F#10 STK_INSYNC, (three byte signature), STK_OK
So, here the response is #14#52#46#01#10
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rsp - Killed Regs: rbp rdi
__Z29stk500_enter_programming_modev: // stk500_enter_programming_mode()
0000000100001d60 55 push rbp ; XREF=0x100003346
0000000100001d61 4889E5 mov rbp, rsp
0000000100001d64 BF50000000 mov edi, 0x50
0000000100001d69 E802FAFFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001d6e BF20000000 mov edi, 0x20
0000000100001d73 E8F8F9FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001d78 E823FFFFFF call __ZL22stk500_normal_responsev ; stk500_normal_response()
0000000100001d7d 5D pop rbp
0000000100001d7e C3 ret
; endp
0000000100001d7f 90 nop
Enter Programming mode. Avrdude/Arduino IDE: #50#20 STK_ENTER_PROGMODE, SYNC_CRC_EOP
Target/Arduino UNO: #14#10 STK_INSYNC, STK_OK -
And the RFduino bootloader does a "normal response" which is indeed #14#10.
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rdi - Killed Regs: rax rcx rsp rbp rdi
__Z19stk500_load_addressj: // stk500_load_address(unsigned int)
0000000100001d80 55 push rbp ; XREF=0x100002edc
0000000100001d81 4889E5 mov rbp, rsp
0000000100001d84 4883EC10 sub rsp, 0x10
0000000100001d88 B855000000 mov eax, 0x55
0000000100001d8d 897DFC mov dword [ss:rbp-0x10+var_12], edi
0000000100001d90 8B7DFC mov edi, dword [ss:rbp-0x10+var_12]
0000000100001d93 C1EF0A shr edi, 0xa
0000000100001d96 897DFC mov dword [ss:rbp-0x10+var_12], edi
0000000100001d99 89C7 mov edi, eax
0000000100001d9b E8D0F9FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001da0 8B45FC mov eax, dword [ss:rbp-0x10+var_12]
0000000100001da3 25FF000000 and eax, 0xff
0000000100001da8 88C1 mov cl, al
0000000100001daa 0FB6F9 movzx edi, cl
0000000100001dad E8BEF9FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001db2 8B45FC mov eax, dword [ss:rbp-0x10+var_12]
0000000100001db5 C1E808 shr eax, 0x8
0000000100001db8 25FF000000 and eax, 0xff
0000000100001dbd 88C1 mov cl, al
0000000100001dbf 0FB6F9 movzx edi, cl
0000000100001dc2 E8A9F9FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001dc7 BF20000000 mov edi, 0x20
0000000100001dcc E89FF9FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001dd1 E8CAFEFFFF call __ZL22stk500_normal_responsev ; stk500_normal_response()
0000000100001dd6 4883C410 add rsp, 0x10
0000000100001dda 5D pop rbp
0000000100001ddb C3 ret
; endp
0000000100001ddc 0F1F4000 nop dword [ds:rax+0x0]
Here’s where we actually get started. This specifies the address in Flash where the follwoing PROGRAM_PAGE data goes.
Avrdude/Arduino IDE: #55#00#00#20 STK_LOAD_ADDRESS, 0×0000, SYNC_CRC_EOP
Target/Arduino UNO: #14#10 STK_INSYNC, STK_OK
So, indeed there is something sent like #55#..#..#20
And then the actual data. Note that the data is in the same order as the bytes in the Intel Hex file
Avrdude/Arduino IDE:
#64#00#80#46#0C#94#61#00#0C#94#7E#00#0C#94#7E#00#0C#94#7E#00#0C
#94#7E#00#0C#94#7E#00#0C#94#7E#00#0C#94#7E#00#0C#94#7E#00#0C#94
#7E#00#0C#94#7E#00#0C#94#7E#00#0C#94#7E#00#0C#94#7E#00#0C#94#7E
#00#0C#94#7E#00#0C#94#9A#00#0C#94#7E#00#0C#94#7E#00#0C#94#7E#00
#0C#94#7E#00#0C#94#7E#00#0C#94#7E#00#0C#94#7E#00#0C#94#7E#00#0C
#94#7E#00#00#00#00#00#24#00#27#00#2A#00#00#00#00#00#25#00#28#00#2B
#00#00#00#00#00#20
STK_PROGRAM_PAGE, 0×0080 (page size), ‘F’(flash memory), data bytes…,SYNC_CRC_EOP
Target/Arduino UNO: #14#10 STK_INSYNC, STK_OK
And apparently we can now start sending the .hex file.
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rsi rdi - Killed Regs: rax rcx rsp rbp rsi rdi
__Z19stk500_program_pagePhi: // stk500_program_page(unsigned char*, int)
0000000100001de0 55 push rbp ; XREF=0x100002ee8
0000000100001de1 4889E5 mov rbp, rsp
0000000100001de4 4883EC10 sub rsp, 0x10
0000000100001de8 B864000000 mov eax, 0x64
0000000100001ded 48897DF8 mov qword [ss:rbp-0x10+var_8], rdi
0000000100001df1 8975F4 mov dword [ss:rbp-0x10+var_4], esi
0000000100001df4 89C7 mov edi, eax
0000000100001df6 E875F9FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001dfb 8B45F4 mov eax, dword [ss:rbp-0x10+var_4]
0000000100001dfe C1F808 sar eax, 0x8
0000000100001e01 25FF000000 and eax, 0xff
0000000100001e06 88C1 mov cl, al
0000000100001e08 0FB6F9 movzx edi, cl
0000000100001e0b E860F9FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001e10 8B45F4 mov eax, dword [ss:rbp-0x10+var_4]
0000000100001e13 25FF000000 and eax, 0xff
0000000100001e18 88C1 mov cl, al
0000000100001e1a 0FB6F9 movzx edi, cl
0000000100001e1d E84EF9FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001e22 BF46000000 mov edi, 0x46
0000000100001e27 E844F9FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001e2c 488B7DF8 mov rdi, qword [ss:rbp-0x10+var_8]
0000000100001e30 8B75F4 mov esi, dword [ss:rbp-0x10+var_4]
0000000100001e33 E8E8F8FFFF call __Z8uart_putPhi ; uart_put(unsigned char*, int)
0000000100001e38 BF20000000 mov edi, 0x20
0000000100001e3d E82EF9FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001e42 E859FEFFFF call __ZL22stk500_normal_responsev ; stk500_normal_response()
0000000100001e47 4883C410 add rsp, 0x10
0000000100001e4b 5D pop rbp
0000000100001e4c C3 ret
; endp
0000000100001e4d 0F1F00 nop dword [ds:rax]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rsi rdi - Killed Regs: rax rcx rbp rdi
__Z16stk500_read_pagePhi: // stk500_read_page(unsigned char*, int)
0000000100001e50 55 push rbp ; XREF=0x100002f22
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rsi rdi - Killed Regs: rax rcx rbp rdi
__Z16stk500_read_pagePhi: // stk500_read_page(unsigned char*, int)
0000000100001e50 55 push rbp ; XREF=0x100002f22
0000000100001e51 4889E5 mov rbp, rsp
0000000100001e54 4883EC10 sub rsp, 0x10
0000000100001e58 B874000000 mov eax, 0x74
0000000100001e5d 48897DF8 mov qword [ss:rbp-0x10+var_8], rdi
0000000100001e61 8975F4 mov dword [ss:rbp-0x10+var_4], esi
0000000100001e64 89C7 mov edi, eax
0000000100001e66 E805F9FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001e6b 8B45F4 mov eax, dword [ss:rbp-0x10+var_4]
0000000100001e6e C1F808 sar eax, 0x8
0000000100001e71 25FF000000 and eax, 0xff
0000000100001e76 88C1 mov cl, al
0000000100001e78 0FB6F9 movzx edi, cl
0000000100001e7b E8F0F8FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001e80 8B45F4 mov eax, dword [ss:rbp-0x10+var_4]
0000000100001e83 25FF000000 and eax, 0xff
0000000100001e88 88C1 mov cl, al
0000000100001e8a 0FB6F9 movzx edi, cl
0000000100001e8d E8DEF8FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001e92 BF46000000 mov edi, 0x46
0000000100001e97 E8D4F8FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001e9c BF20000000 mov edi, 0x20
0000000100001ea1 E8CAF8FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001ea6 BF14000000 mov edi, 0x14
0000000100001eab E860FEFFFF call __ZL5matchh ; match(unsigned char)
0000000100001eb0 C745F000000000 mov dword [ss:rbp-0x10+var_0], 0x0
; Basic Block Input Regs: rbp - Killed Regs: rax
0000000100001eb7 8B45F0 mov eax, dword [ss:rbp-0x10+var_0] ; XREF=0x100001ede
0000000100001eba 3B45F4 cmp eax, dword [ss:rbp-0x10+var_4]
0000000100001ebd 0F8D20000000 jnl 0x100001ee3
; Basic Block Input Regs: rax rbp - Killed Regs: rax rcx rdx rbp
0000000100001ec3 E8D8F8FFFF call __Z8uart_getv ; uart_get()
0000000100001ec8 48634DF0 movsxd rcx, dword [ss:rbp-0x10+var_0]
0000000100001ecc 488B55F8 mov rdx, qword [ss:rbp-0x10+var_8]
0000000100001ed0 88040A mov byte [ds:rdx+rcx], al
0000000100001ed3 8B45F0 mov eax, dword [ss:rbp-0x10+var_0]
0000000100001ed6 0501000000 add eax, 0x1
0000000100001edb 8945F0 mov dword [ss:rbp-0x10+var_0], eax
0000000100001ede E9D4FFFFFF jmp 0x100001eb7
; Basic Block Input Regs: <nothing> - Killed Regs: rsp rbp rdi
0000000100001ee3 BF10000000 mov edi, 0x10 ; XREF=0x100001ebd
0000000100001ee8 E823FEFFFF call __ZL5matchh ; match(unsigned char)
0000000100001eed 4883C410 add rsp, 0x10
0000000100001ef1 5D pop rbp
0000000100001ef2 C3 ret
; endp
0000000100001ef3 666666662E0F1F840000000000 nop word [cs:rax+rax+0x0]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rsp - Killed Regs: rbp rdi
__Z29stk500_leave_programming_modev: // stk500_leave_programming_mode()
0000000100001f00 55 push rbp ; XREF=0x100003350
0000000100001f01 4889E5 mov rbp, rsp
0000000100001f04 BF51000000 mov edi, 0x51
0000000100001f09 E862F8FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001f0e BF20000000 mov edi, 0x20
0000000100001f13 E858F8FFFF call __Z8uart_puth ; uart_put(unsigned char)
0000000100001f18 E883FDFFFF call __ZL22stk500_normal_responsev ; stk500_normal_response()
0000000100001f1d 5D pop rbp
0000000100001f1e C3 ret
; endp
0000000100001f1f 90 nop
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rax rdi - Killed Regs: rbp rsi rdi
__Z9ihex_loadPKc: // ihex_load(char const*)
0000000100001f20 55 push rbp ; XREF=0x100003321
0000000100001f21 4889E5 mov rbp, rsp
0000000100001f24 4883EC10 sub rsp, 0x10
0000000100001f28 488D353B170000 lea rsi, qword [ds:0x10000366a] ; "rb"
0000000100001f2f 48897DF8 mov qword [ss:rbp-0x10+var_8], rdi
0000000100001f33 C7057322000000000000 mov dword [ds:__ZL6lineno], 0x0
0000000100001f3d C7056D22000000000000 mov dword [ds:__ZL8extended], 0x0
0000000100001f47 C6056A22000000 mov byte [ds:__ZL3eof], 0x0
0000000100001f4e 488B7DF8 mov rdi, qword [ss:rbp-0x10+var_8]
0000000100001f52 E879140000 call imp___stubs__fopen
0000000100001f57 48890562220000 mov qword [ds:__ZL2in], rax
0000000100001f5e 48813D5722000000000000 cmp qword [ds:__ZL2in], 0x0
0000000100001f69 0F8511000000 jne 0x100001f80
; Basic Block Input Regs: <nothing> - Killed Regs: rax rbp rdi
0000000100001f6f 488D3DF7160000 lea rdi, qword [ds:0x10000366d] ; "Cannot open ihex file"
0000000100001f76 B000 mov al, 0x0
0000000100001f78 E8030D0000 call __Z5errorPKcz ; error(char const*, ...)
0000000100001f7d 8945F4 mov dword [ss:rbp-0x10+var_4], eax
; Basic Block Input Regs: <nothing> - Killed Regs: rax rcx
0000000100001f80 48813D3522000000000000 cmp qword [ds:__ZL2in], 0x0 ; XREF=0x100001f69
0000000100001f8b 0F95C0 setne al
0000000100001f8e 3401 xor al, 0x1
0000000100001f90 2401 and al, 0x1
0000000100001f92 0FB6C8 movzx ecx, al
0000000100001f95 4881F900000000 cmp rcx, 0x0
0000000100001f9c 0F841F000000 je 0x100001fc1
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
0000000100001fa2 488D3DDA160000 lea rdi, qword [ds:0x100003683] ; "ihex_load"
0000000100001fa9 488D35DD160000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
0000000100001fb0 BA0D010000 mov edx, 0x10d
0000000100001fb5 488D0DDA160000 lea rcx, qword [ds:0x100003696] ; "in"
0000000100001fbc E8C1130000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100001fc1 E900000000 jmp 0x100001fc6 ; XREF=0x100001f9c
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100001fc6 E900000000 jmp 0x100001fcb ; XREF=0x100001fc1
; Basic Block Input Regs: rax - Killed Regs: <nothing>
0000000100001fcb E830000000 call __ZL7readrecv ; readrec() XREF=0x100001fc6, 0x100001fdd
0000000100001fd0 A801 test al, 0x1
0000000100001fd2 0F8505000000 jne 0x100001fdd
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100001fd8 E905000000 jmp 0x100001fe2
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100001fdd E9E9FFFFFF jmp 0x100001fcb ; XREF=0x100001fd2
; Basic Block Input Regs: rax - Killed Regs: rsp rbp rdi
0000000100001fe2 488B3DD7210000 mov rdi, qword [ds:__ZL2in] ; XREF=0x100001fd8
0000000100001fe9 E8D0130000 call imp___stubs__fclose
0000000100001fee 8945F0 mov dword [ss:rbp-0x10+var_0], eax
0000000100001ff1 4883C410 add rsp, 0x10
0000000100001ff5 5D pop rbp
0000000100001ff6 C3 ret
; endp
0000000100001ff7 660F1F840000000000 nop word [ds:rax+rax+0x0]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: <nothing> - Killed Regs: rax rbp rsi rdi
__ZL7readrecv: // readrec()
0000000100002000 55 push rbp ; XREF=0x100001fcb
0000000100002001 4889E5 mov rbp, rsp
0000000100002004 4881ECA0000000 sub rsp, 0xa0
000000010000200b 488B052E200000 mov rax, qword [ds:imp___got____stack_chk_guard]
0000000100002012 488B00 mov rax, qword [ds:rax]
0000000100002015 488945F8 mov qword [ss:rbp-0xa0+var_152], rax
0000000100002019 BE40000000 mov esi, 0x40
000000010000201e 488D7DB0 lea rdi, qword [ss:rbp-0xa0+var_80]
0000000100002022 E819050000 call __ZL8readlinePhi ; readline(unsigned char*, int)
0000000100002027 8945AC mov dword [ss:rbp-0xa0+var_76], eax
000000010000202a 817DAC00000000 cmp dword [ss:rbp-0xa0+var_76], 0x0
0000000100002031 0F8509000000 jne 0x100002040
; Basic Block Input Regs: <nothing> - Killed Regs: rbp
0000000100002037 C645F700 mov byte [ss:rbp-0xa0+var_151], 0x0
000000010000203b E9BA040000 jmp 0x1000024fa
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp rsi
0000000100002040 8B45AC mov eax, dword [ss:rbp-0xa0+var_76] ; XREF=0x100002031
0000000100002043 2D01000000 sub eax, 0x1
0000000100002048 2D02000000 sub eax, 0x2
000000010000204d 2D01000000 sub eax, 0x1
0000000100002052 2D01000000 sub eax, 0x1
0000000100002057 8945A8 mov dword [ss:rbp-0xa0+var_72], eax
000000010000205a 8B45A8 mov eax, dword [ss:rbp-0xa0+var_72]
000000010000205d 0FB64DB0 movzx ecx, byte [ss:rbp-0xa0+var_80]
0000000100002061 39C8 cmp eax, ecx
0000000100002063 0F94C2 sete dl
0000000100002066 80F201 xor dl, 0x1
0000000100002069 80E201 and dl, 0x1
000000010000206c 0FB6F2 movzx esi, dl
000000010000206f 4881FE00000000 cmp rsi, 0x0
0000000100002076 0F841F000000 je 0x10000209b
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
000000010000207c 488D3D16160000 lea rdi, qword [ds:0x100003699] ; "readrec"
0000000100002083 488D3503160000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
000000010000208a BAB4000000 mov edx, 0xb4
000000010000208f 488D0D0B160000 lea rcx, qword [ds:0x1000036a1] ; "ndata == buf[0]"
0000000100002096 E8E7120000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
000000010000209b E900000000 jmp 0x1000020a0 ; XREF=0x100002076
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rbp rsi rdi
00000001000020a0 488D7DB0 lea rdi, qword [ss:rbp-0xa0+var_80] ; XREF=0x10000209b
00000001000020a4 8B45AC mov eax, dword [ss:rbp-0xa0+var_76]
00000001000020a7 2D01000000 sub eax, 0x1
00000001000020ac 89C6 mov esi, eax
00000001000020ae E81D080000 call __ZL8checksumPhi ; checksum(unsigned char*, int)
00000001000020b3 8845A7 mov byte [ss:rbp-0xa0+var_71], al
00000001000020b6 8B75AC mov esi, dword [ss:rbp-0xa0+var_76]
00000001000020b9 81EE01000000 sub esi, 0x1
00000001000020bf 4863FE movsxd rdi, esi
00000001000020c2 0FB6743DB0 movzx esi, byte [ss:rbp+rdi-0xa0+var_80]
00000001000020c7 0FB64DA7 movzx ecx, byte [ss:rbp-0xa0+var_71]
00000001000020cb 39CE cmp esi, ecx
00000001000020cd 0F842E000000 je 0x100002101
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp rsi rdi
00000001000020d3 488D3DD7150000 lea rdi, qword [ds:0x1000036b1] ; "checksum mismatch on line %d: got=%02x, expecting=%02x"
00000001000020da 8B35D0200000 mov esi, dword [ds:__ZL6lineno]
00000001000020e0 8B45AC mov eax, dword [ss:rbp-0xa0+var_76]
00000001000020e3 2D01000000 sub eax, 0x1
00000001000020e8 4863C8 movsxd rcx, eax
00000001000020eb 0FB6540DB0 movzx edx, byte [ss:rbp+rcx-0xa0+var_80]
00000001000020f0 0FB64DA7 movzx ecx, byte [ss:rbp-0xa0+var_71]
00000001000020f4 B000 mov al, 0x0
00000001000020f6 E8850B0000 call __Z5errorPKcz ; error(char const*, ...)
00000001000020fb 89856CFFFFFF mov dword [ss:rbp-0xa0+var_12], eax
; Basic Block Input Regs: <nothing> - Killed Regs: rax rcx rdx rbp rdi
0000000100002101 488D45B0 lea rax, qword [ss:rbp-0xa0+var_80] ; XREF=0x1000020cd
0000000100002105 480501000000 add rax, 0x1
000000010000210b 4889C7 mov rdi, rax
000000010000210e E82D080000 call __ZL11get_be_wordPh ; get_be_word(unsigned char*)
0000000100002113 668945A4 mov word [ss:rbp-0xa0+var_68], ax
0000000100002117 0FB64DB3 movzx ecx, byte [ss:rbp-0xa0+var_83]
000000010000211b 894DA0 mov dword [ss:rbp-0xa0+var_64], ecx
000000010000211e 8A1594200000 mov dl, byte [ds:__ZL3eof]
0000000100002124 80F201 xor dl, 0x1
0000000100002127 80F201 xor dl, 0x1
000000010000212a 80E201 and dl, 0x1
000000010000212d 0FB6FA movzx edi, dl
0000000100002130 4881FF00000000 cmp rdi, 0x0
0000000100002137 0F841F000000 je 0x10000215c
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
000000010000213d 488D3D55150000 lea rdi, qword [ds:0x100003699] ; "readrec"
0000000100002144 488D3542150000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
000000010000214b BABD000000 mov edx, 0xbd
0000000100002150 488D0D91150000 lea rcx, qword [ds:0x1000036e8] ; "! eof"
0000000100002157 E826120000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
000000010000215c E900000000 jmp 0x100002161 ; XREF=0x100002137
; Basic Block Input Regs: rbp - Killed Regs: <nothing>
0000000100002161 817DA000000000 cmp dword [ss:rbp-0xa0+var_64], 0x0 ; XREF=0x10000215c
0000000100002168 0F85FB000000 jne 0x100002269
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rbp rdi
000000010000216e 8B0540200000 mov eax, dword [ds:__ZL8extended]
0000000100002174 0FB74DA4 movzx ecx, word [ss:rbp-0xa0+var_68]
0000000100002178 09C8 or eax, ecx
000000010000217a 89459C mov dword [ss:rbp-0xa0+var_60], eax
000000010000217d 8B7D9C mov edi, dword [ss:rbp-0xa0+var_60]
0000000100002180 E8EB070000 call __ZL4findj ; find(unsigned int)
0000000100002185 48894590 mov qword [ss:rbp-0xa0+var_48], rax
0000000100002189 48817D9000000000 cmp qword [ss:rbp-0xa0+var_48], 0x0
0000000100002191 0F8452000000 je 0x1000021e9
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx
0000000100002197 488B4590 mov rax, qword [ss:rbp-0xa0+var_48]
000000010000219b 8B4804 mov ecx, dword [ds:rax+0x4]
000000010000219e 488B4590 mov rax, qword [ss:rbp-0xa0+var_48]
00000001000021a2 034810 add ecx, dword [ds:rax+0x10]
00000001000021a5 3B4D9C cmp ecx, dword [ss:rbp-0xa0+var_60]
00000001000021a8 0F94C2 sete dl
00000001000021ab 80F201 xor dl, 0x1
00000001000021ae 80E201 and dl, 0x1
00000001000021b1 0FB6C2 movzx eax, dl
00000001000021b4 483D00000000 cmp rax, 0x0
00000001000021ba 0F841F000000 je 0x1000021df
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
00000001000021c0 488D3DD2140000 lea rdi, qword [ds:0x100003699] ; "readrec"
00000001000021c7 488D35BF140000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
00000001000021ce BAC6000000 mov edx, 0xc6
00000001000021d3 488D0D14150000 lea rcx, qword [ds:0x1000036ee] ; "rec->vma + rec->cb == vma"
00000001000021da E8A3110000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000021df E900000000 jmp 0x1000021e4 ; XREF=0x1000021ba
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000021e4 E91D000000 jmp 0x100002206 ; XREF=0x1000021df
; Basic Block Input Regs: rax - Killed Regs: rax rcx rbp
00000001000021e9 E812080000 call __ZL5allocv ; alloc() XREF=0x100002191
00000001000021ee 48894590 mov qword [ss:rbp-0xa0+var_48], rax
00000001000021f2 8B4D9C mov ecx, dword [ss:rbp-0xa0+var_60]
00000001000021f5 488B4590 mov rax, qword [ss:rbp-0xa0+var_48]
00000001000021f9 894804 mov dword [ds:rax+0x4], ecx
00000001000021fc 488B4590 mov rax, qword [ss:rbp-0xa0+var_48]
0000000100002200 C70000000000 mov dword [ds:rax], 0x0
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rsi rdi r8
0000000100002206 488B4590 mov rax, qword [ss:rbp-0xa0+var_48] ; XREF=0x1000021e4
000000010000220a 488B7808 mov rdi, qword [ds:rax+0x8]
000000010000220e 488B4590 mov rax, qword [ss:rbp-0xa0+var_48]
0000000100002212 8B4810 mov ecx, dword [ds:rax+0x10]
0000000100002215 034DA8 add ecx, dword [ss:rbp-0xa0+var_72]
0000000100002218 4863F1 movsxd rsi, ecx
000000010000221b E8E0110000 call imp___stubs__realloc
0000000100002220 488D75B0 lea rsi, qword [ss:rbp-0xa0+var_80]
0000000100002224 488B7D90 mov rdi, qword [ss:rbp-0xa0+var_48]
0000000100002228 48894708 mov qword [ds:rdi+0x8], rax
000000010000222c 488B4590 mov rax, qword [ss:rbp-0xa0+var_48]
0000000100002230 488B4008 mov rax, qword [ds:rax+0x8]
0000000100002234 488B7D90 mov rdi, qword [ss:rbp-0xa0+var_48]
0000000100002238 48637F10 movsxd rdi, dword [ds:rdi+0x10]
000000010000223c 4801F8 add rax, rdi
000000010000223f 4881C604000000 add rsi, 0x4
0000000100002246 486355A8 movsxd rdx, dword [ss:rbp-0xa0+var_72]
000000010000224a 4889C7 mov rdi, rax
000000010000224d E890110000 call imp___stubs__memcpy
0000000100002252 8B4DA8 mov ecx, dword [ss:rbp-0xa0+var_72]
0000000100002255 488B4590 mov rax, qword [ss:rbp-0xa0+var_48]
0000000100002259 448B4010 mov r8d, dword [ds:rax+0x10]
000000010000225d 4101C8 add r8d, ecx
0000000100002260 44894010 mov dword [ds:rax+0x10], r8d
0000000100002264 E98D020000 jmp 0x1000024f6
; Basic Block Input Regs: rbp - Killed Regs: <nothing>
0000000100002269 817DA001000000 cmp dword [ss:rbp-0xa0+var_64], 0x1 ; XREF=0x100002168
0000000100002270 0F850C000000 jne 0x100002282
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100002276 C6053B1F000001 mov byte [ds:__ZL3eof], 0x1
000000010000227d E96F020000 jmp 0x1000024f1
; Basic Block Input Regs: rbp - Killed Regs: <nothing>
0000000100002282 817DA002000000 cmp dword [ss:rbp-0xa0+var_64], 0x2 ; XREF=0x100002270
0000000100002289 0F8571000000 jne 0x100002300
; Basic Block Input Regs: rbp - Killed Regs: rax rcx
000000010000228f 817DA802000000 cmp dword [ss:rbp-0xa0+var_72], 0x2
0000000100002296 0F94C0 sete al
0000000100002299 3401 xor al, 0x1
000000010000229b 2401 and al, 0x1
000000010000229d 0FB6C8 movzx ecx, al
00000001000022a0 4881F900000000 cmp rcx, 0x0
00000001000022a7 0F841F000000 je 0x1000022cc
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
00000001000022ad 488D3DE5130000 lea rdi, qword [ds:0x100003699] ; "readrec"
00000001000022b4 488D35D2130000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
00000001000022bb BADA000000 mov edx, 0xda
00000001000022c0 488D0D41140000 lea rcx, qword [ds:0x100003708] ; "ndata == 2"
00000001000022c7 E8B6100000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000022cc E900000000 jmp 0x1000022d1 ; XREF=0x1000022a7
; Basic Block Input Regs: <nothing> - Killed Regs: rax rcx rdi
00000001000022d1 488D45B0 lea rax, qword [ss:rbp-0xa0+var_80] ; XREF=0x1000022cc
00000001000022d5 480504000000 add rax, 0x4
00000001000022db 4889C7 mov rdi, rax
00000001000022de E85D060000 call __ZL11get_be_wordPh ; get_be_word(unsigned char*)
00000001000022e3 0FB7C8 movzx ecx, ax
00000001000022e6 890DC81E0000 mov dword [ds:__ZL8extended], ecx
00000001000022ec 8B0DC21E0000 mov ecx, dword [ds:__ZL8extended]
00000001000022f2 C1E104 shl ecx, 0x4
00000001000022f5 890DB91E0000 mov dword [ds:__ZL8extended], ecx
00000001000022fb E9EC010000 jmp 0x1000024ec
; Basic Block Input Regs: rbp - Killed Regs: <nothing>
0000000100002300 817DA003000000 cmp dword [ss:rbp-0xa0+var_64], 0x3 ; XREF=0x100002289
0000000100002307 0F859E000000 jne 0x1000023ab
; Basic Block Input Regs: rbp - Killed Regs: rax rcx
000000010000230d 817DA804000000 cmp dword [ss:rbp-0xa0+var_72], 0x4
0000000100002314 0F94C0 sete al
0000000100002317 3401 xor al, 0x1
0000000100002319 2401 and al, 0x1
000000010000231b 0FB6C8 movzx ecx, al
000000010000231e 4881F900000000 cmp rcx, 0x0
0000000100002325 0F841F000000 je 0x10000234a
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
000000010000232b 488D3D67130000 lea rdi, qword [ds:0x100003699] ; "readrec"
0000000100002332 488D3554130000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
0000000100002339 BAE2000000 mov edx, 0xe2
000000010000233e 488D0DCE130000 lea rcx, qword [ds:0x100003713] ; "ndata == 4"
0000000100002345 E838100000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
000000010000234a E900000000 jmp 0x10000234f ; XREF=0x100002325
; Basic Block Input Regs: <nothing> - Killed Regs: rax rcx rdx rbp rdi
000000010000234f 488D45B0 lea rax, qword [ss:rbp-0xa0+var_80] ; XREF=0x10000234a
0000000100002353 480504000000 add rax, 0x4
0000000100002359 4889C7 mov rdi, rax
000000010000235c E8DF050000 call __ZL11get_be_wordPh ; get_be_word(unsigned char*)
0000000100002361 488D7DB0 lea rdi, qword [ss:rbp-0xa0+var_80]
0000000100002365 6689458E mov word [ss:rbp-0xa0+var_46], ax
0000000100002369 4881C706000000 add rdi, 0x6
0000000100002370 E8CB050000 call __ZL11get_be_wordPh ; get_be_word(unsigned char*)
0000000100002375 6689458C mov word [ss:rbp-0xa0+var_44], ax
0000000100002379 0FB74D8E movzx ecx, word [ss:rbp-0xa0+var_46]
000000010000237d C1E104 shl ecx, 0x4
0000000100002380 0FB7558C movzx edx, word [ss:rbp-0xa0+var_44]
0000000100002384 09D1 or ecx, edx
0000000100002386 894D88 mov dword [ss:rbp-0xa0+var_40], ecx
0000000100002389 E872060000 call __ZL5allocv ; alloc()
000000010000238e 48894580 mov qword [ss:rbp-0xa0+var_32], rax
0000000100002392 8B4D88 mov ecx, dword [ss:rbp-0xa0+var_40]
0000000100002395 488B4580 mov rax, qword [ss:rbp-0xa0+var_32]
0000000100002399 894804 mov dword [ds:rax+0x4], ecx
000000010000239c 488B4580 mov rax, qword [ss:rbp-0xa0+var_32]
00000001000023a0 C70003000000 mov dword [ds:rax], 0x3
00000001000023a6 E93C010000 jmp 0x1000024e7
; Basic Block Input Regs: rbp - Killed Regs: <nothing>
00000001000023ab 817DA004000000 cmp dword [ss:rbp-0xa0+var_64], 0x4 ; XREF=0x100002307
00000001000023b2 0F8571000000 jne 0x100002429
; Basic Block Input Regs: rbp - Killed Regs: rax rcx
00000001000023b8 817DA802000000 cmp dword [ss:rbp-0xa0+var_72], 0x2
00000001000023bf 0F94C0 sete al
00000001000023c2 3401 xor al, 0x1
00000001000023c4 2401 and al, 0x1
00000001000023c6 0FB6C8 movzx ecx, al
00000001000023c9 4881F900000000 cmp rcx, 0x0
00000001000023d0 0F841F000000 je 0x1000023f5
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
00000001000023d6 488D3DBC120000 lea rdi, qword [ds:0x100003699] ; "readrec"
00000001000023dd 488D35A9120000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
00000001000023e4 BAEE000000 mov edx, 0xee
00000001000023e9 488D0D18130000 lea rcx, qword [ds:0x100003708] ; "ndata == 2"
00000001000023f0 E88D0F0000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000023f5 E900000000 jmp 0x1000023fa ; XREF=0x1000023d0
; Basic Block Input Regs: <nothing> - Killed Regs: rax rcx rdi
00000001000023fa 488D45B0 lea rax, qword [ss:rbp-0xa0+var_80] ; XREF=0x1000023f5
00000001000023fe 480504000000 add rax, 0x4
0000000100002404 4889C7 mov rdi, rax
0000000100002407 E834050000 call __ZL11get_be_wordPh ; get_be_word(unsigned char*)
000000010000240c 0FB7C8 movzx ecx, ax
000000010000240f 890D9F1D0000 mov dword [ds:__ZL8extended], ecx
0000000100002415 8B0D991D0000 mov ecx, dword [ds:__ZL8extended]
000000010000241b C1E110 shl ecx, 0x10
000000010000241e 890D901D0000 mov dword [ds:__ZL8extended], ecx
0000000100002424 E9B9000000 jmp 0x1000024e2
; Basic Block Input Regs: rbp - Killed Regs: <nothing>
0000000100002429 817DA005000000 cmp dword [ss:rbp-0xa0+var_64], 0x5 ; XREF=0x1000023b2
0000000100002430 0F8588000000 jne 0x1000024be
; Basic Block Input Regs: rbp - Killed Regs: rax rcx
0000000100002436 817DA804000000 cmp dword [ss:rbp-0xa0+var_72], 0x4
000000010000243d 0F94C0 sete al
0000000100002440 3401 xor al, 0x1
0000000100002442 2401 and al, 0x1
0000000100002444 0FB6C8 movzx ecx, al
0000000100002447 4881F900000000 cmp rcx, 0x0
000000010000244e 0F841F000000 je 0x100002473
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
0000000100002454 488D3D3E120000 lea rdi, qword [ds:0x100003699] ; "readrec"
000000010000245b 488D352B120000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
0000000100002462 BAF6000000 mov edx, 0xf6
0000000100002467 488D0DA5120000 lea rcx, qword [ds:0x100003713] ; "ndata == 4"
000000010000246e E80F0F0000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100002473 E900000000 jmp 0x100002478 ; XREF=0x10000244e
; Basic Block Input Regs: <nothing> - Killed Regs: rax rcx rbp rdi
0000000100002478 488D45B0 lea rax, qword [ss:rbp-0xa0+var_80] ; XREF=0x100002473
000000010000247c 480504000000 add rax, 0x4
0000000100002482 4889C7 mov rdi, rax
0000000100002485 E8E6050000 call __ZL12get_be_dwordPh ; get_be_dword(unsigned char*)
000000010000248a 89857CFFFFFF mov dword [ss:rbp-0xa0+var_28], eax
0000000100002490 E86B050000 call __ZL5allocv ; alloc()
0000000100002495 48898570FFFFFF mov qword [ss:rbp-0xa0+var_16], rax
000000010000249c 8B8D7CFFFFFF mov ecx, dword [ss:rbp-0xa0+var_28]
00000001000024a2 488B8570FFFFFF mov rax, qword [ss:rbp-0xa0+var_16]
00000001000024a9 894804 mov dword [ds:rax+0x4], ecx
00000001000024ac 488B8570FFFFFF mov rax, qword [ss:rbp-0xa0+var_16]
00000001000024b3 C70005000000 mov dword [ds:rax], 0x5
00000001000024b9 E91F000000 jmp 0x1000024dd
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
00000001000024be 488D3DD4110000 lea rdi, qword [ds:0x100003699] ; "readrec" XREF=0x100002430
00000001000024c5 488D35C1110000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
00000001000024cc BAFE000000 mov edx, 0xfe
00000001000024d1 488D0D46120000 lea rcx, qword [ds:0x10000371e] ; "false"
00000001000024d8 E8A50E0000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000024dd E900000000 jmp 0x1000024e2 ; XREF=0x1000024b9
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000024e2 E900000000 jmp 0x1000024e7 ; XREF=0x100002424, 0x1000024dd
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000024e7 E900000000 jmp 0x1000024ec ; XREF=0x1000023a6, 0x1000024e2
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000024ec E900000000 jmp 0x1000024f1 ; XREF=0x1000022fb, 0x1000024e7
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000024f1 E900000000 jmp 0x1000024f6 ; XREF=0x10000227d, 0x1000024ec
; Basic Block Input Regs: <nothing> - Killed Regs: rbp
00000001000024f6 C645F701 mov byte [ss:rbp-0xa0+var_151], 0x1 ; XREF=0x100002264, 0x1000024f1
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp
00000001000024fa 488B053F1B0000 mov rax, qword [ds:imp___got____stack_chk_guard] ; XREF=0x10000203b
0000000100002501 8A4DF7 mov cl, byte [ss:rbp-0xa0+var_151]
0000000100002504 488B00 mov rax, qword [ds:rax]
0000000100002507 488B55F8 mov rdx, qword [ss:rbp-0xa0+var_152]
000000010000250b 4839D0 cmp rax, rdx
000000010000250e 888D6BFFFFFF mov byte [ss:rbp-0xa0+var_11], cl
0000000100002514 0F8514000000 jne 0x10000252e
; Basic Block Input Regs: rbp - Killed Regs: rax rsp rbp
000000010000251a 8A856BFFFFFF mov al, byte [ss:rbp-0xa0+var_11]
0000000100002520 2401 and al, 0x1
0000000100002522 0FB6C0 movzx eax, al
0000000100002525 4881C4A0000000 add rsp, 0xa0
000000010000252c 5D pop rbp
000000010000252d C3 ret
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
000000010000252e E85B0E0000 call imp___stubs____stack_chk_fail ; XREF=0x100002514
0000000100002533 666666662E0F1F840000000000 nop word [cs:rax+rax+0x0]
; endp
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rsi rdi - Killed Regs: rax rcx rdx rbp rsi rdi
__ZL8readlinePhi: // readline(unsigned char*, int)
0000000100002540 55 push rbp ; XREF=0x100002022
0000000100002541 4889E5 mov rbp, rsp
0000000100002544 4881ECC0000000 sub rsp, 0xc0
000000010000254b 488B05EE1A0000 mov rax, qword [ds:imp___got____stack_chk_guard]
0000000100002552 488B00 mov rax, qword [ds:rax]
0000000100002555 488945F8 mov qword [ss:rbp-0xc0+var_184], rax
0000000100002559 B980000000 mov ecx, 0x80
000000010000255e 488D8560FFFFFF lea rax, qword [ss:rbp-0xc0+var_32]
0000000100002565 48897DE8 mov qword [ss:rbp-0xc0+var_168], rdi
0000000100002569 8975E4 mov dword [ss:rbp-0xc0+var_164], esi
000000010000256c 488B154D1C0000 mov rdx, qword [ds:__ZL2in]
0000000100002573 4889C7 mov rdi, rax
0000000100002576 89CE mov esi, ecx
0000000100002578 E84D0E0000 call imp___stubs__fgets
000000010000257d 483D00000000 cmp rax, 0x0
0000000100002583 0F850C000000 jne 0x100002595
; Basic Block Input Regs: <nothing> - Killed Regs: rbp
0000000100002589 C745F400000000 mov dword [ss:rbp-0xc0+var_180], 0x0
0000000100002590 E9FD020000 jmp 0x100002892
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx
0000000100002595 8B05151C0000 mov eax, dword [ds:__ZL6lineno] ; XREF=0x100002583
000000010000259b 0501000000 add eax, 0x1
00000001000025a0 89050A1C0000 mov dword [ds:__ZL6lineno], eax
00000001000025a6 0FBE8560FFFFFF movsx eax, byte [ss:rbp-0xc0+var_32]
00000001000025ad 3D3A000000 cmp eax, 0x3a
00000001000025b2 0F94C1 sete cl
00000001000025b5 80F101 xor cl, 0x1
00000001000025b8 80E101 and cl, 0x1
00000001000025bb 0FB6D1 movzx edx, cl
00000001000025be 4881FA00000000 cmp rdx, 0x0
00000001000025c5 0F841F000000 je 0x1000025ea
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
00000001000025cb 488D3D52110000 lea rdi, qword [ds:0x100003724] ; "readline"
00000001000025d2 488D35B4100000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
00000001000025d9 BA8F000000 mov edx, 0x8f
00000001000025de 488D0D48110000 lea rcx, qword [ds:0x10000372d] ; "line[0] == ':'"
00000001000025e5 E8980D0000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000025ea E900000000 jmp 0x1000025ef ; XREF=0x1000025c5
; Basic Block Input Regs: rax - Killed Regs: rax rcx rdx rbp rdi
00000001000025ef 488DBD60FFFFFF lea rdi, qword [ss:rbp-0xc0+var_32] ; XREF=0x1000025ea
00000001000025f6 E8170E0000 call imp___stubs__strlen
00000001000025fb 89C1 mov ecx, eax
00000001000025fd 898D5CFFFFFF mov dword [ss:rbp-0xc0+var_28], ecx
0000000100002603 8B8D5CFFFFFF mov ecx, dword [ss:rbp-0xc0+var_28]
0000000100002609 81E902000000 sub ecx, 0x2
000000010000260f 4863C1 movsxd rax, ecx
0000000100002612 0FBE8C0560FFFFFF movsx ecx, byte [ss:rbp+rax-0xc0+var_32]
000000010000261a 81F90D000000 cmp ecx, 0xd
0000000100002620 0F94C2 sete dl
0000000100002623 80F201 xor dl, 0x1
0000000100002626 80E201 and dl, 0x1
0000000100002629 0FB6C2 movzx eax, dl
000000010000262c 483D00000000 cmp rax, 0x0
0000000100002632 0F841F000000 je 0x100002657
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
0000000100002638 488D3DE5100000 lea rdi, qword [ds:0x100003724] ; "readline"
000000010000263f 488D3547100000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
0000000100002646 BA93000000 mov edx, 0x93
000000010000264b 488D0DEA100000 lea rcx, qword [ds:0x10000373c] ; "line[len - 2] == '\\r'"
0000000100002652 E82B0D0000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100002657 E900000000 jmp 0x10000265c ; XREF=0x100002632
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx
000000010000265c 8B855CFFFFFF mov eax, dword [ss:rbp-0xc0+var_28] ; XREF=0x100002657
0000000100002662 2D01000000 sub eax, 0x1
0000000100002667 4863C8 movsxd rcx, eax
000000010000266a 0FBE840D60FFFFFF movsx eax, byte [ss:rbp+rcx-0xc0+var_32]
0000000100002672 3D0A000000 cmp eax, 0xa
0000000100002677 0F94C2 sete dl
000000010000267a 80F201 xor dl, 0x1
000000010000267d 80E201 and dl, 0x1
0000000100002680 0FB6CA movzx ecx, dl
0000000100002683 4881F900000000 cmp rcx, 0x0
000000010000268a 0F841F000000 je 0x1000026af
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
0000000100002690 488D3D8D100000 lea rdi, qword [ds:0x100003724] ; "readline"
0000000100002697 488D35EF0F0000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
000000010000269e BA94000000 mov edx, 0x94
00000001000026a3 488D0DA8100000 lea rcx, qword [ds:0x100003752] ; "line[len - 1] == '\\n'"
00000001000026aa E8D30C0000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000026af E900000000 jmp 0x1000026b4 ; XREF=0x10000268a
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx
00000001000026b4 8B855CFFFFFF mov eax, dword [ss:rbp-0xc0+var_28] ; XREF=0x1000026af
00000001000026ba 2501000000 and eax, 0x1
00000001000026bf 3D00000000 cmp eax, 0x0
00000001000026c4 0F95C1 setne cl
00000001000026c7 80F101 xor cl, 0x1
00000001000026ca 80E101 and cl, 0x1
00000001000026cd 0FB6D1 movzx edx, cl
00000001000026d0 4881FA00000000 cmp rdx, 0x0
00000001000026d7 0F841F000000 je 0x1000026fc
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
00000001000026dd 488D3D40100000 lea rdi, qword [ds:0x100003724] ; "readline"
00000001000026e4 488D35A20F0000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
00000001000026eb BA96000000 mov edx, 0x96
00000001000026f0 488D0D71100000 lea rcx, qword [ds:0x100003768] ; "(len & 0x01) != 0"
00000001000026f7 E8860C0000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000026fc E900000000 jmp 0x100002701 ; XREF=0x1000026d7
; Basic Block Input Regs: <nothing> - Killed Regs: rbp
0000000100002701 C78558FFFFFF00000000 mov dword [ss:rbp-0xc0+var_24], 0x0 ; XREF=0x1000026fc
000000010000270b C78554FFFFFF01000000 mov dword [ss:rbp-0xc0+var_20], 0x1
; Basic Block Input Regs: rbp - Killed Regs: rax rcx
0000000100002715 8B8554FFFFFF mov eax, dword [ss:rbp-0xc0+var_20] ; XREF=0x100002884
000000010000271b 8B8D5CFFFFFF mov ecx, dword [ss:rbp-0xc0+var_28]
0000000100002721 81E902000000 sub ecx, 0x2
0000000100002727 39C8 cmp eax, ecx
0000000100002729 0F8D5A010000 jnl 0x100002889
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp rdi
000000010000272f 48638554FFFFFF movsxd rax, dword [ss:rbp-0xc0+var_20]
0000000100002736 0FBEBC0560FFFFFF movsx edi, byte [ss:rbp+rax-0xc0+var_32]
000000010000273e E8AD030000 call __ZL6xdigitc ; xdigit(char)
0000000100002743 898550FFFFFF mov dword [ss:rbp-0xc0+var_16], eax
0000000100002749 81BD50FFFFFF00000000 cmp dword [ss:rbp-0xc0+var_16], 0x0
0000000100002753 0F9DC1 setnl cl
0000000100002756 80F101 xor cl, 0x1
0000000100002759 80E101 and cl, 0x1
000000010000275c 0FB6D1 movzx edx, cl
000000010000275f 4881FA00000000 cmp rdx, 0x0
0000000100002766 0F841F000000 je 0x10000278b
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
000000010000276c 488D3DB10F0000 lea rdi, qword [ds:0x100003724] ; "readline"
0000000100002773 488D35130F0000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
000000010000277a BA9C000000 mov edx, 0x9c
000000010000277f 488D0DF40F0000 lea rcx, qword [ds:0x10000377a] ; "x1 >= 0"
0000000100002786 E8F70B0000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
000000010000278b E900000000 jmp 0x100002790 ; XREF=0x100002766
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp rdi
0000000100002790 8B8554FFFFFF mov eax, dword [ss:rbp-0xc0+var_20] ; XREF=0x10000278b
0000000100002796 0501000000 add eax, 0x1
000000010000279b 4863C8 movsxd rcx, eax
000000010000279e 0FBEBC0D60FFFFFF movsx edi, byte [ss:rbp+rcx-0xc0+var_32]
00000001000027a6 E845030000 call __ZL6xdigitc ; xdigit(char)
00000001000027ab 89854CFFFFFF mov dword [ss:rbp-0xc0+var_12], eax
00000001000027b1 81BD4CFFFFFF00000000 cmp dword [ss:rbp-0xc0+var_12], 0x0
00000001000027bb 0F9DC2 setnl dl
00000001000027be 80F201 xor dl, 0x1
00000001000027c1 80E201 and dl, 0x1
00000001000027c4 0FB6CA movzx ecx, dl
00000001000027c7 4881F900000000 cmp rcx, 0x0
00000001000027ce 0F841F000000 je 0x1000027f3
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
00000001000027d4 488D3D490F0000 lea rdi, qword [ds:0x100003724] ; "readline"
00000001000027db 488D35AB0E0000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
00000001000027e2 BA9F000000 mov edx, 0x9f
00000001000027e7 488D0D940F0000 lea rcx, qword [ds:0x100003782] ; "x2 >= 0"
00000001000027ee E88F0B0000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000027f3 E900000000 jmp 0x1000027f8 ; XREF=0x1000027ce
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp rsi
00000001000027f8 8B8550FFFFFF mov eax, dword [ss:rbp-0xc0+var_16] ; XREF=0x1000027f3
00000001000027fe C1E004 shl eax, 0x4
0000000100002801 0B854CFFFFFF or eax, dword [ss:rbp-0xc0+var_12]
0000000100002807 88C1 mov cl, al
0000000100002809 48639558FFFFFF movsxd rdx, dword [ss:rbp-0xc0+var_24]
0000000100002810 488B75E8 mov rsi, qword [ss:rbp-0xc0+var_168]
0000000100002814 880C16 mov byte [ds:rsi+rdx], cl
0000000100002817 8B8558FFFFFF mov eax, dword [ss:rbp-0xc0+var_24]
000000010000281d 0501000000 add eax, 0x1
0000000100002822 898558FFFFFF mov dword [ss:rbp-0xc0+var_24], eax
0000000100002828 8B8558FFFFFF mov eax, dword [ss:rbp-0xc0+var_24]
000000010000282e 3B45E4 cmp eax, dword [ss:rbp-0xc0+var_164]
0000000100002831 0F9CC1 setl cl
0000000100002834 80F101 xor cl, 0x1
0000000100002837 80E101 and cl, 0x1
000000010000283a 0FB6D1 movzx edx, cl
000000010000283d 4881FA00000000 cmp rdx, 0x0
0000000100002844 0F841F000000 je 0x100002869
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
000000010000284a 488D3DD30E0000 lea rdi, qword [ds:0x100003724] ; "readline"
0000000100002851 488D35350E0000 lea rsi, qword [ds:0x10000368d] ; "ihex.cpp"
0000000100002858 BAA4000000 mov edx, 0xa4
000000010000285d 488D0D260F0000 lea rcx, qword [ds:0x10000378a] ; "n < cb"
0000000100002864 E8190B0000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100002869 E900000000 jmp 0x10000286e ; XREF=0x100002844
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
000000010000286e E900000000 jmp 0x100002873 ; XREF=0x100002869
; Basic Block Input Regs: rbp - Killed Regs: rax rbp
0000000100002873 8B8554FFFFFF mov eax, dword [ss:rbp-0xc0+var_20] ; XREF=0x10000286e
0000000100002879 0502000000 add eax, 0x2
000000010000287e 898554FFFFFF mov dword [ss:rbp-0xc0+var_20], eax
0000000100002884 E98CFEFFFF jmp 0x100002715
; Basic Block Input Regs: rbp - Killed Regs: rax rbp
0000000100002889 8B8558FFFFFF mov eax, dword [ss:rbp-0xc0+var_24] ; XREF=0x100002729
000000010000288f 8945F4 mov dword [ss:rbp-0xc0+var_180], eax
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp
0000000100002892 488B05A7170000 mov rax, qword [ds:imp___got____stack_chk_guard] ; XREF=0x100002590
0000000100002899 8B4DF4 mov ecx, dword [ss:rbp-0xc0+var_180]
000000010000289c 488B00 mov rax, qword [ds:rax]
000000010000289f 488B55F8 mov rdx, qword [ss:rbp-0xc0+var_184]
00000001000028a3 4839D0 cmp rax, rdx
00000001000028a6 898D48FFFFFF mov dword [ss:rbp-0xc0+var_8], ecx
00000001000028ac 0F850F000000 jne 0x1000028c1
; Basic Block Input Regs: rbp - Killed Regs: rax rsp rbp
00000001000028b2 8B8548FFFFFF mov eax, dword [ss:rbp-0xc0+var_8]
00000001000028b8 4881C4C0000000 add rsp, 0xc0
00000001000028bf 5D pop rbp
00000001000028c0 C3 ret
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000028c1 E8C80A0000 call imp___stubs____stack_chk_fail ; XREF=0x1000028ac
00000001000028c6 662E0F1F840000000000 nop word [cs:rax+rax+0x0]
; endp
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rsi rdi - Killed Regs: rbp
__ZL8checksumPhi: // checksum(unsigned char*, int)
00000001000028d0 55 push rbp ; XREF=0x1000020ae
00000001000028d1 4889E5 mov rbp, rsp
00000001000028d4 48897DF8 mov qword [ss:rbp-0x0+var_m8], rdi
00000001000028d8 8975F4 mov dword [ss:rbp-0x0+var_m12], esi
00000001000028db C645F300 mov byte [ss:rbp-0x0+var_m13], 0x0
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rbp
00000001000028df 8B45F4 mov eax, dword [ss:rbp-0x0+var_m12] ; XREF=0x10000291a
00000001000028e2 89C1 mov ecx, eax
00000001000028e4 81C1FFFFFFFF add ecx, 0xffffffff
00000001000028ea 894DF4 mov dword [ss:rbp-0x0+var_m12], ecx
00000001000028ed 3D00000000 cmp eax, 0x0
00000001000028f2 0F8427000000 je 0x10000291f
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp rsi rdi
00000001000028f8 488B45F8 mov rax, qword [ss:rbp-0x0+var_m8]
00000001000028fc 4889C1 mov rcx, rax
00000001000028ff 4881C101000000 add rcx, 0x1
0000000100002906 48894DF8 mov qword [ss:rbp-0x0+var_m8], rcx
000000010000290a 0FB610 movzx edx, byte [ds:rax]
000000010000290d 0FB675F3 movzx esi, byte [ss:rbp-0x0+var_m13]
0000000100002911 01D6 add esi, edx
0000000100002913 4088F7 mov dil, sil
0000000100002916 40887DF3 mov byte [ss:rbp-0x0+var_m13], dil
000000010000291a E9C0FFFFFF jmp 0x1000028df
; Basic Block Input Regs: rsp rbp - Killed Regs: rax rcx rdx rbp
000000010000291f B800010000 mov eax, 0x100 ; XREF=0x1000028f2
0000000100002924 0FB64DF3 movzx ecx, byte [ss:rbp-0x0+var_m13]
0000000100002928 29C8 sub eax, ecx
000000010000292a 88C2 mov dl, al
000000010000292c 0FB6C2 movzx eax, dl
000000010000292f 5D pop rbp
0000000100002930 C3 ret
; endp
0000000100002931 6666666666662E0F1F840000000000 nop word [cs:rax+rax+0x0]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rsp rdi - Killed Regs: rax rcx rdx rbp rdi
__ZL11get_be_wordPh: // get_be_word(unsigned char*)
0000000100002940 55 push rbp ; XREF=0x10000210e, 0x1000022de, 0x10000235c, 0x100002370, 0x100002407
0000000100002941 4889E5 mov rbp, rsp
0000000100002944 48897DF8 mov qword [ss:rbp-0x0+var_m8], rdi
0000000100002948 488B7DF8 mov rdi, qword [ss:rbp-0x0+var_m8]
000000010000294c 0FB607 movzx eax, byte [ds:rdi]
000000010000294f C1E008 shl eax, 0x8
0000000100002952 488B7DF8 mov rdi, qword [ss:rbp-0x0+var_m8]
0000000100002956 0FB64F01 movzx ecx, byte [ds:rdi+0x1]
000000010000295a 09C8 or eax, ecx
000000010000295c 6689C2 mov dx, ax
000000010000295f 0FB7C2 movzx eax, dx
0000000100002962 5D pop rbp
0000000100002963 C3 ret
; endp
0000000100002964 6666662E0F1F840000000000 nop word [cs:rax+rax+0x0]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rdi - Killed Regs: rax rbp
__ZL4findj: // find(unsigned int)
0000000100002970 55 push rbp ; XREF=0x100002180
0000000100002971 4889E5 mov rbp, rsp
0000000100002974 897DF4 mov dword [ss:rbp-0x0+var_m12], edi
0000000100002977 488B0572180000 mov rax, qword [ds:_recs]
000000010000297e 488945E8 mov qword [ss:rbp-0x0+var_m24], rax
; Basic Block Input Regs: rbp - Killed Regs: <nothing>
0000000100002982 48817DE800000000 cmp qword [ss:rbp-0x0+var_m24], 0x0 ; XREF=0x1000029e7
000000010000298a 0F845C000000 je 0x1000029ec
; Basic Block Input Regs: rbp - Killed Regs: rax
0000000100002990 488B45E8 mov rax, qword [ss:rbp-0x0+var_m24]
0000000100002994 813800000000 cmp dword [ds:rax], 0x0
000000010000299a 0F853B000000 jne 0x1000029db
; Basic Block Input Regs: rbp - Killed Regs: rax rcx
00000001000029a0 8B45F4 mov eax, dword [ss:rbp-0x0+var_m12]
00000001000029a3 488B4DE8 mov rcx, qword [ss:rbp-0x0+var_m24]
00000001000029a7 3B4104 cmp eax, dword [ds:rcx+0x4]
00000001000029aa 0F8226000000 jc 0x1000029d6
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx
00000001000029b0 8B45F4 mov eax, dword [ss:rbp-0x0+var_m12]
00000001000029b3 488B4DE8 mov rcx, qword [ss:rbp-0x0+var_m24]
00000001000029b7 8B5104 mov edx, dword [ds:rcx+0x4]
00000001000029ba 488B4DE8 mov rcx, qword [ss:rbp-0x0+var_m24]
00000001000029be 035110 add edx, dword [ds:rcx+0x10]
00000001000029c1 39D0 cmp eax, edx
00000001000029c3 0F870D000000 ja 0x1000029d6
; Basic Block Input Regs: rbp - Killed Regs: rax rbp
00000001000029c9 488B45E8 mov rax, qword [ss:rbp-0x0+var_m24]
00000001000029cd 488945F8 mov qword [ss:rbp-0x0+var_m8], rax
00000001000029d1 E91E000000 jmp 0x1000029f4
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000029d6 E900000000 jmp 0x1000029db ; XREF=0x1000029aa, 0x1000029c3
; Basic Block Input Regs: rbp - Killed Regs: rax rbp
00000001000029db 488B45E8 mov rax, qword [ss:rbp-0x0+var_m24] ; XREF=0x10000299a, 0x1000029d6
00000001000029df 488B4018 mov rax, qword [ds:rax+0x18]
00000001000029e3 488945E8 mov qword [ss:rbp-0x0+var_m24], rax
00000001000029e7 E996FFFFFF jmp 0x100002982
; Basic Block Input Regs: <nothing> - Killed Regs: rbp
00000001000029ec 48C745F800000000 mov qword [ss:rbp-0x0+var_m8], 0x0 ; XREF=0x10000298a
; Basic Block Input Regs: rsp rbp - Killed Regs: rax rbp
00000001000029f4 488B45F8 mov rax, qword [ss:rbp-0x0+var_m8] ; XREF=0x1000029d1
00000001000029f8 5D pop rbp
00000001000029f9 C3 ret
; endp
00000001000029fa 660F1F440000 nop word [ds:rax+rax+0x0]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rax - Killed Regs: rbp rsi rdi
__ZL5allocv: // alloc()
0000000100002a00 55 push rbp ; XREF=0x1000021e9, 0x100002389, 0x100002490
0000000100002a01 4889E5 mov rbp, rsp
0000000100002a04 4883EC10 sub rsp, 0x10
0000000100002a08 48BF0100000000000000 mov rdi, 0x1
0000000100002a12 48BE2000000000000000 mov rsi, 0x20
0000000100002a1c E87F090000 call imp___stubs__calloc
0000000100002a21 488945F8 mov qword [ss:rbp-0x10+var_8], rax
0000000100002a25 48813DC017000000000000 cmp qword [ds:_recs], 0x0
0000000100002a30 0F841A000000 je 0x100002a50
; Basic Block Input Regs: rax - Killed Regs: rax rcx rbp
0000000100002a36 E875000000 call __ZL4lastv ; last()
0000000100002a3b 488945F0 mov qword [ss:rbp-0x10+var_0], rax
0000000100002a3f 488B45F8 mov rax, qword [ss:rbp-0x10+var_8]
0000000100002a43 488B4DF0 mov rcx, qword [ss:rbp-0x10+var_0]
0000000100002a47 48894118 mov qword [ds:rcx+0x18], rax
0000000100002a4b E90B000000 jmp 0x100002a5b
; Basic Block Input Regs: rbp - Killed Regs: rax
0000000100002a50 488B45F8 mov rax, qword [ss:rbp-0x10+var_8] ; XREF=0x100002a30
0000000100002a54 48890595170000 mov qword [ds:_recs], rax
; Basic Block Input Regs: rbp - Killed Regs: rax rsp rbp
0000000100002a5b 488B45F8 mov rax, qword [ss:rbp-0x10+var_8] ; XREF=0x100002a4b
0000000100002a5f 4883C410 add rsp, 0x10
0000000100002a63 5D pop rbp
0000000100002a64 C3 ret
; endp
0000000100002a65 66662E0F1F840000000000 nop word [cs:rax+rax+0x0]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rsp rdi - Killed Regs: rax rcx rbp rdi
__ZL12get_be_dwordPh: // get_be_dword(unsigned char*)
0000000100002a70 55 push rbp ; XREF=0x100002485
0000000100002a71 4889E5 mov rbp, rsp
0000000100002a74 48897DF8 mov qword [ss:rbp-0x0+var_m8], rdi
0000000100002a78 488B7DF8 mov rdi, qword [ss:rbp-0x0+var_m8]
0000000100002a7c 0FB607 movzx eax, byte [ds:rdi]
0000000100002a7f C1E018 shl eax, 0x18
0000000100002a82 488B7DF8 mov rdi, qword [ss:rbp-0x0+var_m8]
0000000100002a86 0FB64F01 movzx ecx, byte [ds:rdi+0x1]
0000000100002a8a C1E110 shl ecx, 0x10
0000000100002a8d 09C8 or eax, ecx
0000000100002a8f 488B7DF8 mov rdi, qword [ss:rbp-0x0+var_m8]
0000000100002a93 0FB64F02 movzx ecx, byte [ds:rdi+0x2]
0000000100002a97 C1E108 shl ecx, 0x8
0000000100002a9a 09C8 or eax, ecx
0000000100002a9c 488B7DF8 mov rdi, qword [ss:rbp-0x0+var_m8]
0000000100002aa0 0FB64F03 movzx ecx, byte [ds:rdi+0x3]
0000000100002aa4 09C8 or eax, ecx
0000000100002aa6 5D pop rbp
0000000100002aa7 C3 ret
; endp
0000000100002aa8 0F1F840000000000 nop dword [ds:rax+rax+0x0]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: <nothing> - Killed Regs: rax rbp
__ZL4lastv: // last()
0000000100002ab0 55 push rbp ; XREF=0x100002a36
0000000100002ab1 4889E5 mov rbp, rsp
0000000100002ab4 488B0535170000 mov rax, qword [ds:_recs]
0000000100002abb 488945F8 mov qword [ss:rbp-0x0+var_m8], rax
; Basic Block Input Regs: rbp - Killed Regs: rax
0000000100002abf 488B45F8 mov rax, qword [ss:rbp-0x0+var_m8] ; XREF=0x100002add
0000000100002ac3 4881781800000000 cmp qword [ds:rax+0x18], 0x0
0000000100002acb 0F8411000000 je 0x100002ae2
; Basic Block Input Regs: rbp - Killed Regs: rax rbp
0000000100002ad1 488B45F8 mov rax, qword [ss:rbp-0x0+var_m8]
0000000100002ad5 488B4018 mov rax, qword [ds:rax+0x18]
0000000100002ad9 488945F8 mov qword [ss:rbp-0x0+var_m8], rax
0000000100002add E9DDFFFFFF jmp 0x100002abf
; Basic Block Input Regs: rsp rbp - Killed Regs: rax rbp
0000000100002ae2 488B45F8 mov rax, qword [ss:rbp-0x0+var_m8] ; XREF=0x100002acb
0000000100002ae6 5D pop rbp
0000000100002ae7 C3 ret
; endp
0000000100002ae8 0F1F840000000000 nop dword [ds:rax+rax+0x0]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rdi - Killed Regs: rax rbp rdi
__ZL6xdigitc: // xdigit(char)
0000000100002af0 55 push rbp ; XREF=0x10000273e, 0x1000027a6
0000000100002af1 4889E5 mov rbp, rsp
0000000100002af4 4883EC10 sub rsp, 0x10
0000000100002af8 4088F8 mov al, dil
0000000100002afb 8845FF mov byte [ss:rbp-0x10+var_15], al
0000000100002afe 0FBE7DFF movsx edi, byte [ss:rbp-0x10+var_15]
0000000100002b02 E869080000 call imp___stubs___Z7isdigiti ; isdigit(int)
0000000100002b07 3D00000000 cmp eax, 0x0
0000000100002b0c 0F8411000000 je 0x100002b23
; Basic Block Input Regs: rbp - Killed Regs: rax rbp
0000000100002b12 0FBE45FF movsx eax, byte [ss:rbp-0x10+var_15]
0000000100002b16 2D30000000 sub eax, 0x30
0000000100002b1b 8945F8 mov dword [ss:rbp-0x10+var_8], eax
0000000100002b1e E916000000 jmp 0x100002b39
; Basic Block Input Regs: rbp - Killed Regs: rax rbp rdi
0000000100002b23 0FBE7DFF movsx edi, byte [ss:rbp-0x10+var_15] ; XREF=0x100002b0c
0000000100002b27 E84A080000 call imp___stubs___Z7toloweri ; tolower(int)
0000000100002b2c 2D61000000 sub eax, 0x61
0000000100002b31 050A000000 add eax, 0xa
0000000100002b36 8945F8 mov dword [ss:rbp-0x10+var_8], eax
; Basic Block Input Regs: rbp - Killed Regs: rax rsp rbp
0000000100002b39 8B45F8 mov eax, dword [ss:rbp-0x10+var_8] ; XREF=0x100002b1e
0000000100002b3c 4883C410 add rsp, 0x10
0000000100002b40 5D pop rbp
0000000100002b41 C3 ret
; endp
0000000100002b42 90 nop
0000000100002b43 90 nop
0000000100002b44 90 nop
0000000100002b45 90 nop
0000000100002b46 90 nop
0000000100002b47 90 nop
0000000100002b48 90 nop
0000000100002b49 90 nop
0000000100002b4a 90 nop
0000000100002b4b 90 nop
0000000100002b4c 90 nop
0000000100002b4d 90 nop
0000000100002b4e 90 nop
0000000100002b4f 90 nop
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rdi - Killed Regs: rsp rbp rsi rdi
__Z7isdigiti: // isdigit(int)
0000000100002b50 55 push rbp ; XREF=0x100004048
0000000100002b51 4889E5 mov rbp, rsp
0000000100002b54 4883EC10 sub rsp, 0x10
0000000100002b58 48BE0004000000000000 mov rsi, 0x400
0000000100002b62 897DFC mov dword [ss:rbp-0x10+var_12], edi
0000000100002b65 8B7DFC mov edi, dword [ss:rbp-0x10+var_12]
0000000100002b68 E80F080000 call imp___stubs___Z9__isctypeim ; __isctype(int, unsigned long)
0000000100002b6d 4883C410 add rsp, 0x10
0000000100002b71 5D pop rbp
0000000100002b72 C3 ret
; endp
0000000100002b73 666666662E0F1F840000000000 nop word [cs:rax+rax+0x0]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rdi - Killed Regs: rsp rbp rdi
__Z7toloweri: // tolower(int)
0000000100002b80 55 push rbp ; XREF=0x100004050
0000000100002b81 4889E5 mov rbp, rsp
0000000100002b84 4883EC10 sub rsp, 0x10
0000000100002b88 897DFC mov dword [ss:rbp-0x10+var_12], edi
0000000100002b8b 8B7DFC mov edi, dword [ss:rbp-0x10+var_12]
0000000100002b8e E801080000 call imp___stubs____tolower
0000000100002b93 4883C410 add rsp, 0x10
0000000100002b97 5D pop rbp
0000000100002b98 C3 ret
; endp
0000000100002b99 0F1F8000000000 nop dword [ds:rax+0x0]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rsi rdi - Killed Regs: rbp
__Z9__isctypeim: // __isctype(int, unsigned long)
0000000100002ba0 55 push rbp ; XREF=0x100004058
0000000100002ba1 4889E5 mov rbp, rsp
0000000100002ba4 897DFC mov dword [ss:rbp-0x0+var_m4], edi
0000000100002ba7 488975F0 mov qword [ss:rbp-0x0+var_m16], rsi
0000000100002bab 817DFC00000000 cmp dword [ss:rbp-0x0+var_m4], 0x0
0000000100002bb2 0F8C0D000000 jl 0x100002bc5
; Basic Block Input Regs: rbp - Killed Regs: <nothing>
0000000100002bb8 817DFC00010000 cmp dword [ss:rbp-0x0+var_m4], 0x100
0000000100002bbf 0F8C0D000000 jl 0x100002bd2
; Basic Block Input Regs: <nothing> - Killed Regs: rax rbp
0000000100002bc5 B800000000 mov eax, 0x0 ; XREF=0x100002bb2
0000000100002bca 8945EC mov dword [ss:rbp-0x0+var_m20], eax
0000000100002bcd E92B000000 jmp 0x100002bfd
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp rsi
0000000100002bd2 488B055F140000 mov rax, qword [ds:imp___got___DefaultRuneLocale] ; XREF=0x100002bbf
0000000100002bd9 48634DFC movsxd rcx, dword [ss:rbp-0x0+var_m4]
0000000100002bdd 8B44883C mov eax, dword [ds:rax+rcx*4+0x3c]
0000000100002be1 482345F0 and rax, qword [ss:rbp-0x0+var_m16]
0000000100002be5 483D00000000 cmp rax, 0x0
0000000100002beb 0F95C2 setne dl
0000000100002bee 80F201 xor dl, 0x1
0000000100002bf1 80F201 xor dl, 0x1
0000000100002bf4 80E201 and dl, 0x1
0000000100002bf7 0FB6F2 movzx esi, dl
0000000100002bfa 8975EC mov dword [ss:rbp-0x0+var_m20], esi
; Basic Block Input Regs: rsp rbp - Killed Regs: rax rbp
0000000100002bfd 8B45EC mov eax, dword [ss:rbp-0x0+var_m20] ; XREF=0x100002bcd
0000000100002c00 5D pop rbp
0000000100002c01 C3 ret
; endp
0000000100002c02 90 nop
0000000100002c03 90 nop
0000000100002c04 90 nop
0000000100002c05 90 nop
0000000100002c06 90 nop
0000000100002c07 90 nop
0000000100002c08 90 nop
0000000100002c09 90 nop
0000000100002c0a 90 nop
0000000100002c0b 90 nop
0000000100002c0c 90 nop
0000000100002c0d 90 nop
0000000100002c0e 90 nop
0000000100002c0f 90 nop
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: <nothing> - Killed Regs: rax rsp rbp rdi
__Z7successv: // success()
0000000100002c10 55 push rbp ; XREF=0x10000335f
0000000100002c11 4889E5 mov rbp, rsp
0000000100002c14 4883EC10 sub rsp, 0x10
0000000100002c18 488D3D720B0000 lea rdi, qword [ds:0x100003791] ; "##############\\n"
0000000100002c1f B000 mov al, 0x0
0000000100002c21 E8CE070000 call imp___stubs__printf
0000000100002c26 488D3D740B0000 lea rdi, qword [ds:0x1000037a1] ; " SUCCESS !\\n"
0000000100002c2d 8945FC mov dword [ss:rbp-0x10+var_12], eax
0000000100002c30 B000 mov al, 0x0
0000000100002c32 E8BD070000 call imp___stubs__printf
0000000100002c37 488D3D530B0000 lea rdi, qword [ds:0x100003791] ; "##############\\n"
0000000100002c3e 8945F8 mov dword [ss:rbp-0x10+var_8], eax
0000000100002c41 B000 mov al, 0x0
0000000100002c43 E8AC070000 call imp___stubs__printf
0000000100002c48 8945F4 mov dword [ss:rbp-0x10+var_4], eax
0000000100002c4b 4883C410 add rsp, 0x10
0000000100002c4f 5D pop rbp
0000000100002c50 C3 ret
; endp
0000000100002c51 6666666666662E0F1F840000000000 nop word [cs:rax+rax+0x0]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: <nothing> - Killed Regs: rax rsp rbp rdi
__Z4failv: // fail()
0000000100002c60 55 push rbp ; XREF=0x100002dff
0000000100002c61 4889E5 mov rbp, rsp
0000000100002c64 4883EC10 sub rsp, 0x10
0000000100002c68 488D3D400B0000 lea rdi, qword [ds:0x1000037af] ; "fail.......fail.......fail.......\\n"
0000000100002c6f B000 mov al, 0x0
0000000100002c71 E87E070000 call imp___stubs__printf
0000000100002c76 8945FC mov dword [ss:rbp-0x10+var_12], eax
0000000100002c79 4883C410 add rsp, 0x10
0000000100002c7d 5D pop rbp
0000000100002c7e C3 ret
; endp
0000000100002c7f 90 nop
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rax rcx rdx rbp rsi rdi r8 r9 - Killed Regs: rbp xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
__Z5errorPKcz: // error(char const*, ...)
0000000100002c80 55 push rbp ; XREF=0x100001d47, 0x1000017d1, 0x10000197e, 0x100001762, 0x100002f98, 0x100001481, ...
0000000100002c81 4889E5 mov rbp, rsp
0000000100002c84 4881ECB0010000 sub rsp, 0x1b0
0000000100002c8b 84C0 test al, al
0000000100002c8d 0F29BD10FFFFFF movaps xmm7, xmmword [ss:rbp-0x1b0+var_192]
0000000100002c94 0F29B500FFFFFF movaps xmm6, xmmword [ss:rbp-0x1b0+var_176]
0000000100002c9b 0F29ADF0FEFFFF movaps xmm5, xmmword [ss:rbp-0x1b0+var_160]
0000000100002ca2 0F29A5E0FEFFFF movaps xmm4, xmmword [ss:rbp-0x1b0+var_144]
0000000100002ca9 0F299DD0FEFFFF movaps xmm3, xmmword [ss:rbp-0x1b0+var_128]
0000000100002cb0 0F2995C0FEFFFF movaps xmm2, xmmword [ss:rbp-0x1b0+var_112]
0000000100002cb7 0F298DB0FEFFFF movaps xmm1, xmmword [ss:rbp-0x1b0+var_96]
0000000100002cbe 0F2985A0FEFFFF movaps xmm0, xmmword [ss:rbp-0x1b0+var_80]
0000000100002cc5 4889BD98FEFFFF mov qword [ss:rbp-0x1b0+var_72], rdi
0000000100002ccc 4C898D90FEFFFF mov qword [ss:rbp-0x1b0+var_64], r9
0000000100002cd3 4C898588FEFFFF mov qword [ss:rbp-0x1b0+var_56], r8
0000000100002cda 48898D80FEFFFF mov qword [ss:rbp-0x1b0+var_48], rcx
0000000100002ce1 48899578FEFFFF mov qword [ss:rbp-0x1b0+var_40], rdx
0000000100002ce8 4889B570FEFFFF mov qword [ss:rbp-0x1b0+var_32], rsi
0000000100002cef 0F8461000000 je 0x100002d56
; Basic Block Input Regs: rbp - Killed Regs: xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7
0000000100002cf5 0F2885A0FEFFFF movaps xmm0, xmmword [ss:rbp-0x1b0+var_80]
0000000100002cfc 0F298550FFFFFF movaps xmm0, xmmword [ss:rbp-0x1b0+var_256]
0000000100002d03 0F288DB0FEFFFF movaps xmm1, xmmword [ss:rbp-0x1b0+var_96]
0000000100002d0a 0F298D60FFFFFF movaps xmm1, xmmword [ss:rbp-0x1b0+var_272]
0000000100002d11 0F2895C0FEFFFF movaps xmm2, xmmword [ss:rbp-0x1b0+var_112]
0000000100002d18 0F299570FFFFFF movaps xmm2, xmmword [ss:rbp-0x1b0+var_288]
0000000100002d1f 0F289DD0FEFFFF movaps xmm3, xmmword [ss:rbp-0x1b0+var_128]
0000000100002d26 0F295D80 movaps xmm3, xmmword [ss:rbp-0x1b0+var_304]
0000000100002d2a 0F28A5E0FEFFFF movaps xmm4, xmmword [ss:rbp-0x1b0+var_144]
0000000100002d31 0F296590 movaps xmm4, xmmword [ss:rbp-0x1b0+var_320]
0000000100002d35 0F28ADF0FEFFFF movaps xmm5, xmmword [ss:rbp-0x1b0+var_160]
0000000100002d3c 0F296DA0 movaps xmm5, xmmword [ss:rbp-0x1b0+var_336]
0000000100002d40 0F28B500FFFFFF movaps xmm6, xmmword [ss:rbp-0x1b0+var_176]
0000000100002d47 0F2975B0 movaps xmm6, xmmword [ss:rbp-0x1b0+var_352]
0000000100002d4b 0F28BD10FFFFFF movaps xmm7, xmmword [ss:rbp-0x1b0+var_192]
0000000100002d52 0F297DC0 movaps xmm7, xmmword [ss:rbp-0x1b0+var_368]
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp rsi rdi r8 r9
0000000100002d56 488B8590FEFFFF mov rax, qword [ss:rbp-0x1b0+var_64] ; XREF=0x100002cef
0000000100002d5d 48898548FFFFFF mov qword [ss:rbp-0x1b0+var_248], rax
0000000100002d64 488B8D88FEFFFF mov rcx, qword [ss:rbp-0x1b0+var_56]
0000000100002d6b 48898D40FFFFFF mov qword [ss:rbp-0x1b0+var_240], rcx
0000000100002d72 488B9580FEFFFF mov rdx, qword [ss:rbp-0x1b0+var_48]
0000000100002d79 48899538FFFFFF mov qword [ss:rbp-0x1b0+var_232], rdx
0000000100002d80 488BB578FEFFFF mov rsi, qword [ss:rbp-0x1b0+var_40]
0000000100002d87 4889B530FFFFFF mov qword [ss:rbp-0x1b0+var_224], rsi
0000000100002d8e 488BBD70FEFFFF mov rdi, qword [ss:rbp-0x1b0+var_32]
0000000100002d95 4889BD28FFFFFF mov qword [ss:rbp-0x1b0+var_216], rdi
0000000100002d9c 4C8B8598FEFFFF mov r8, qword [ss:rbp-0x1b0+var_72]
0000000100002da3 4C8D4DD0 lea r9, qword [ss:rbp-0x1b0+var_384]
0000000100002da7 4C8945F0 mov qword [ss:rbp-0x1b0+var_416], r8
0000000100002dab 4C8D8520FFFFFF lea r8, qword [ss:rbp-0x1b0+var_208]
0000000100002db2 4D894110 mov qword [ds:r9+0x10], r8
0000000100002db6 4C8D4510 lea r8, qword [ss:rbp-0x1b0+arg_0]
0000000100002dba 4D894108 mov qword [ds:r9+0x8], r8
0000000100002dbe 41C7410430000000 mov dword [ds:r9+0x4], 0x30
0000000100002dc6 41C70108000000 mov dword [ds:r9], 0x8
0000000100002dcd 488D75D0 lea rsi, qword [ss:rbp-0x1b0+var_384]
0000000100002dd1 488B7DF0 mov rdi, qword [ss:rbp-0x1b0+var_416]
0000000100002dd5 E850060000 call imp___stubs__vprintf
0000000100002dda 488D4DD0 lea rcx, qword [ss:rbp-0x1b0+var_384]
0000000100002dde 488D3DED090000 lea rdi, qword [ds:0x1000037d2] ; "\\n"
0000000100002de5 89856CFEFFFF mov dword [ss:rbp-0x1b0+var_28], eax
0000000100002deb B000 mov al, 0x0
0000000100002ded 48898D60FEFFFF mov qword [ss:rbp-0x1b0+var_16], rcx
0000000100002df4 E8FB050000 call imp___stubs__printf
0000000100002df9 89855CFEFFFF mov dword [ss:rbp-0x1b0+var_12], eax
0000000100002dff E85CFEFFFF call __Z4failv ; fail()
0000000100002e04 BF01000000 mov edi, 0x1
0000000100002e09 E8AA050000 call imp___stubs__exit
; endp
0000000100002e0e 6690 nop
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rdi - Killed Regs: rax rcx rdx rbp
__Z7programP6_rec_t: // program(_rec_t*)
0000000100002e10 55 push rbp ; XREF=0x100003058
0000000100002e11 4889E5 mov rbp, rsp
0000000100002e14 4881EC40040000 sub rsp, 0x440
0000000100002e1b 488B051E120000 mov rax, qword [ds:imp___got____stack_chk_guard]
0000000100002e22 488B00 mov rax, qword [ds:rax]
0000000100002e25 488945F8 mov qword [ss:rbp-0x440+var_1080], rax
0000000100002e29 48897DF0 mov qword [ss:rbp-0x440+var_1072], rdi
0000000100002e2d 488B45F0 mov rax, qword [ss:rbp-0x440+var_1072]
0000000100002e31 8B4804 mov ecx, dword [ds:rax+0x4]
0000000100002e34 894DEC mov dword [ss:rbp-0x440+var_1068], ecx
0000000100002e37 488B45F0 mov rax, qword [ss:rbp-0x440+var_1072]
0000000100002e3b 488B4008 mov rax, qword [ds:rax+0x8]
0000000100002e3f 488945E0 mov qword [ss:rbp-0x440+var_1056], rax
0000000100002e43 488B45F0 mov rax, qword [ss:rbp-0x440+var_1072]
0000000100002e47 8B4810 mov ecx, dword [ds:rax+0x10]
0000000100002e4a 894DDC mov dword [ss:rbp-0x440+var_1052], ecx
0000000100002e4d 8B4DEC mov ecx, dword [ss:rbp-0x440+var_1068]
0000000100002e50 81E1FF030000 and ecx, 0x3ff
0000000100002e56 81F900000000 cmp ecx, 0x0
0000000100002e5c 0F94C2 sete dl
0000000100002e5f 80F201 xor dl, 0x1
0000000100002e62 80E201 and dl, 0x1
0000000100002e65 0FB6C2 movzx eax, dl
0000000100002e68 483D00000000 cmp rax, 0x0
0000000100002e6e 0F841F000000 je 0x100002e93
; Basic Block Input Regs: <nothing> - Killed Regs: rcx rdx rsi rdi
0000000100002e74 488D3D59090000 lea rdi, qword [ds:0x1000037d4] ; "program"
0000000100002e7b 488D355A090000 lea rsi, qword [ds:0x1000037dc] ; "main.cpp"
0000000100002e82 BA50000000 mov edx, 0x50
0000000100002e87 488D0D57090000 lea rcx, qword [ds:0x1000037e5] ; "(vma & 0x3ff) == 0"
0000000100002e8e E8EF040000 call imp___stubs____assert_rtn
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100002e93 E900000000 jmp 0x100002e98 ; XREF=0x100002e6e
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100002e98 E900000000 jmp 0x100002e9d ; XREF=0x100002e93
; Basic Block Input Regs: rbp - Killed Regs: <nothing>
0000000100002e9d 817DDC00000000 cmp dword [ss:rbp-0x440+var_1052], 0x0 ; XREF=0x100002e98, 0x100002fe9
0000000100002ea4 0F8444010000 je 0x100002fee
; Basic Block Input Regs: rbp - Killed Regs: <nothing>
0000000100002eaa 817DDC00040000 cmp dword [ss:rbp-0x440+var_1052], 0x400
0000000100002eb1 0F8610000000 jbe 0x100002ec7
; Basic Block Input Regs: <nothing> - Killed Regs: rax rbp
0000000100002eb7 B800040000 mov eax, 0x400
0000000100002ebc 8985C8FBFFFF mov dword [ss:rbp-0x440+var_8], eax
0000000100002ec2 E909000000 jmp 0x100002ed0
; Basic Block Input Regs: rbp - Killed Regs: rax rbp
0000000100002ec7 8B45DC mov eax, dword [ss:rbp-0x440+var_1052] ; XREF=0x100002eb1
0000000100002eca 8985C8FBFFFF mov dword [ss:rbp-0x440+var_8], eax
; Basic Block Input Regs: rbp - Killed Regs: rax rbp rsi rdi
0000000100002ed0 8B85C8FBFFFF mov eax, dword [ss:rbp-0x440+var_8] ; XREF=0x100002ec2
0000000100002ed6 8945D8 mov dword [ss:rbp-0x440+var_1048], eax
0000000100002ed9 8B7DEC mov edi, dword [ss:rbp-0x440+var_1068]
0000000100002edc E89FEEFFFF call __Z19stk500_load_addressj ; stk500_load_address(unsigned int)
0000000100002ee1 488B7DE0 mov rdi, qword [ss:rbp-0x440+var_1056]
0000000100002ee5 8B75D8 mov esi, dword [ss:rbp-0x440+var_1048]
0000000100002ee8 E8F3EEFFFF call __Z19stk500_program_pagePhi ; stk500_program_page(unsigned char*, int)
0000000100002eed 803D0D14000000 cmp byte [ds:_fast], 0x0
0000000100002ef4 0F85C9000000 jne 0x100002fc3
; Basic Block Input Regs: rbp - Killed Regs: rax rdx rbp rsi rdi
0000000100002efa BE00000000 mov esi, 0x0
0000000100002eff 48BA0004000000000000 mov rdx, 0x400
0000000100002f09 488D85D0FBFFFF lea rax, qword [ss:rbp-0x440+var_16]
0000000100002f10 4889C7 mov rdi, rax
0000000100002f13 E8D0040000 call imp___stubs__memset
0000000100002f18 488DBDD0FBFFFF lea rdi, qword [ss:rbp-0x440+var_16]
0000000100002f1f 8B75D8 mov esi, dword [ss:rbp-0x440+var_1048]
0000000100002f22 E829EFFFFF call __Z16stk500_read_pagePhi ; stk500_read_page(unsigned char*, int)
0000000100002f27 C785CCFBFFFF00000000 mov dword [ss:rbp-0x440+var_12], 0x0
; Basic Block Input Regs: rbp - Killed Regs: rax
0000000100002f31 8B85CCFBFFFF mov eax, dword [ss:rbp-0x440+var_12] ; XREF=0x100002fb9
0000000100002f37 3B45D8 cmp eax, dword [ss:rbp-0x440+var_1048]
0000000100002f3a 0F837E000000 jnc 0x100002fbe
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rsi
0000000100002f40 486385CCFBFFFF movsxd rax, dword [ss:rbp-0x440+var_12]
0000000100002f47 0FB68C05D0FBFFFF movzx ecx, byte [ss:rbp+rax-0x440+var_16]
0000000100002f4f 486385CCFBFFFF movsxd rax, dword [ss:rbp-0x440+var_12]
0000000100002f56 488B55E0 mov rdx, qword [ss:rbp-0x440+var_1056]
0000000100002f5a 0FB63402 movzx esi, byte [ds:rdx+rax]
0000000100002f5e 39F1 cmp ecx, esi
0000000100002f60 0F843D000000 je 0x100002fa3
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp rsi rdi
0000000100002f66 488D3D8B080000 lea rdi, qword [ds:0x1000037f8] ; "verify failed - address %08x, write %02x, read %02x"
0000000100002f6d 8B45EC mov eax, dword [ss:rbp-0x440+var_1068]
0000000100002f70 0385CCFBFFFF add eax, dword [ss:rbp-0x440+var_12]
0000000100002f76 48638DCCFBFFFF movsxd rcx, dword [ss:rbp-0x440+var_12]
0000000100002f7d 488B55E0 mov rdx, qword [ss:rbp-0x440+var_1056]
0000000100002f81 0FB6140A movzx edx, byte [ds:rdx+rcx]
0000000100002f85 48638DCCFBFFFF movsxd rcx, dword [ss:rbp-0x440+var_12]
0000000100002f8c 0FB68C0DD0FBFFFF movzx ecx, byte [ss:rbp+rcx-0x440+var_16]
0000000100002f94 89C6 mov esi, eax
0000000100002f96 B000 mov al, 0x0
0000000100002f98 E8E3FCFFFF call __Z5errorPKcz ; error(char const*, ...)
0000000100002f9d 8985C4FBFFFF mov dword [ss:rbp-0x440+var_4], eax
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100002fa3 E900000000 jmp 0x100002fa8 ; XREF=0x100002f60
; Basic Block Input Regs: rbp - Killed Regs: rax rbp
0000000100002fa8 8B85CCFBFFFF mov eax, dword [ss:rbp-0x440+var_12] ; XREF=0x100002fa3
0000000100002fae 0501000000 add eax, 0x1
0000000100002fb3 8985CCFBFFFF mov dword [ss:rbp-0x440+var_12], eax
0000000100002fb9 E973FFFFFF jmp 0x100002f31
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100002fbe E900000000 jmp 0x100002fc3 ; XREF=0x100002f3a
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp rsi
0000000100002fc3 8B45D8 mov eax, dword [ss:rbp-0x440+var_1048] ; XREF=0x100002ef4, 0x100002fbe
0000000100002fc6 8B4DEC mov ecx, dword [ss:rbp-0x440+var_1068]
0000000100002fc9 01C1 add ecx, eax
0000000100002fcb 894DEC mov dword [ss:rbp-0x440+var_1068], ecx
0000000100002fce 8B45D8 mov eax, dword [ss:rbp-0x440+var_1048]
0000000100002fd1 488B55E0 mov rdx, qword [ss:rbp-0x440+var_1056]
0000000100002fd5 89C6 mov esi, eax
0000000100002fd7 4801F2 add rdx, rsi
0000000100002fda 488955E0 mov qword [ss:rbp-0x440+var_1056], rdx
0000000100002fde 8B45D8 mov eax, dword [ss:rbp-0x440+var_1048]
0000000100002fe1 8B4DDC mov ecx, dword [ss:rbp-0x440+var_1052]
0000000100002fe4 29C1 sub ecx, eax
0000000100002fe6 894DDC mov dword [ss:rbp-0x440+var_1052], ecx
0000000100002fe9 E9AFFEFFFF jmp 0x100002e9d
; Basic Block Input Regs: rbp - Killed Regs: rax rcx
0000000100002fee 488B054B100000 mov rax, qword [ds:imp___got____stack_chk_guard] ; XREF=0x100002ea4
0000000100002ff5 488B00 mov rax, qword [ds:rax]
0000000100002ff8 488B4DF8 mov rcx, qword [ss:rbp-0x440+var_1080]
0000000100002ffc 4839C8 cmp rax, rcx
0000000100002fff 0F8509000000 jne 0x10000300e
; Basic Block Input Regs: <nothing> - Killed Regs: rsp rbp
0000000100003005 4881C440040000 add rsp, 0x440
000000010000300c 5D pop rbp
000000010000300d C3 ret
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
000000010000300e E87B030000 call imp___stubs____stack_chk_fail ; XREF=0x100002fff
0000000100003013 666666662E0F1F840000000000 nop word [cs:rax+rax+0x0]
; endp
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: <nothing> - Killed Regs: rax rbp
__Z12ihex_programv: // ihex_program()
0000000100003020 55 push rbp ; XREF=0x10000334b
0000000100003021 4889E5 mov rbp, rsp
0000000100003024 4883EC10 sub rsp, 0x10
0000000100003028 488D05C1110000 lea rax, qword [ds:_recs]
000000010000302f 488B00 mov rax, qword [ds:rax]
0000000100003032 488945F8 mov qword [ss:rbp-0x10+var_8], rax
; Basic Block Input Regs: rbp - Killed Regs: <nothing>
0000000100003036 48817DF800000000 cmp qword [ss:rbp-0x10+var_8], 0x0 ; XREF=0x100003069
000000010000303e 0F842A000000 je 0x10000306e
; Basic Block Input Regs: rbp - Killed Regs: rax
0000000100003044 488B45F8 mov rax, qword [ss:rbp-0x10+var_8]
0000000100003048 813800000000 cmp dword [ds:rax], 0x0
000000010000304e 0F8509000000 jne 0x10000305d
; Basic Block Input Regs: rbp - Killed Regs: rdi
0000000100003054 488B7DF8 mov rdi, qword [ss:rbp-0x10+var_8]
0000000100003058 E8B3FDFFFF call __Z7programP6_rec_t ; program(_rec_t*)
; Basic Block Input Regs: rbp - Killed Regs: rax rbp
000000010000305d 488B45F8 mov rax, qword [ss:rbp-0x10+var_8] ; XREF=0x10000304e
0000000100003061 488B4018 mov rax, qword [ds:rax+0x18]
0000000100003065 488945F8 mov qword [ss:rbp-0x10+var_8], rax
0000000100003069 E9C8FFFFFF jmp 0x100003036
; Basic Block Input Regs: <nothing> - Killed Regs: rsp rbp
000000010000306e 4883C410 add rsp, 0x10 ; XREF=0x10000303e
0000000100003072 5D pop rbp
0000000100003073 C3 ret
; endp
0000000100003074 6666662E0F1F840000000000 nop word [cs:rax+rax+0x0]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: <nothing> - Killed Regs: rax rbp
__Z9ihex_freev: // ihex_free()
0000000100003080 55 push rbp ; XREF=0x10000335a
0000000100003081 4889E5 mov rbp, rsp
0000000100003084 4883EC10 sub rsp, 0x10
0000000100003088 488D0561110000 lea rax, qword [ds:_recs]
000000010000308f 488B00 mov rax, qword [ds:rax]
0000000100003092 488945F8 mov qword [ss:rbp-0x10+var_8], rax
; Basic Block Input Regs: rbp - Killed Regs: <nothing>
0000000100003096 48817DF800000000 cmp qword [ss:rbp-0x10+var_8], 0x0 ; XREF=0x1000030d1
000000010000309e 0F8432000000 je 0x1000030d6
; Basic Block Input Regs: rbp - Killed Regs: rax rbp rdi
00000001000030a4 488B45F8 mov rax, qword [ss:rbp-0x10+var_8]
00000001000030a8 488945F0 mov qword [ss:rbp-0x10+var_0], rax
00000001000030ac 488B45F0 mov rax, qword [ss:rbp-0x10+var_0]
00000001000030b0 488B4018 mov rax, qword [ds:rax+0x18]
00000001000030b4 488945F8 mov qword [ss:rbp-0x10+var_8], rax
00000001000030b8 488B45F0 mov rax, qword [ss:rbp-0x10+var_0]
00000001000030bc 488B7808 mov rdi, qword [ds:rax+0x8]
00000001000030c0 E811030000 call imp___stubs__free
00000001000030c5 488B45F0 mov rax, qword [ss:rbp-0x10+var_0]
00000001000030c9 4889C7 mov rdi, rax
00000001000030cc E805030000 call imp___stubs__free
00000001000030d1 E9C0FFFFFF jmp 0x100003096
; Basic Block Input Regs: <nothing> - Killed Regs: rsp rbp
00000001000030d6 4883C410 add rsp, 0x10 ; XREF=0x10000309e
00000001000030da 5D pop rbp
00000001000030db C3 ret
; endp
00000001000030dc 0F1F4000 nop dword [ds:rax+0x0]
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rsi rdi - Killed Regs: rbp
__Z10parse_argsiPPKc: // parse_args(int, char const**)
00000001000030e0 55 push rbp ; XREF=0x10000326d
00000001000030e1 4889E5 mov rbp, rsp
00000001000030e4 4883EC30 sub rsp, 0x30
00000001000030e8 897DFC mov dword [ss:rbp-0x30+var_44], edi
00000001000030eb 488975F0 mov qword [ss:rbp-0x30+var_32], rsi
00000001000030ef C745EC01000000 mov dword [ss:rbp-0x30+var_28], 0x1
; Basic Block Input Regs: rbp - Killed Regs: rax
00000001000030f6 8B45EC mov eax, dword [ss:rbp-0x30+var_28] ; XREF=0x100003245
00000001000030f9 3B45FC cmp eax, dword [ss:rbp-0x30+var_44]
00000001000030fc 0F8D48010000 jnl 0x10000324a
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx
0000000100003102 486345EC movsxd rax, dword [ss:rbp-0x30+var_28]
0000000100003106 488B4DF0 mov rcx, qword [ss:rbp-0x30+var_32]
000000010000310a 488B04C1 mov rax, qword [ds:rcx+rax*8]
000000010000310e 0FBE10 movsx edx, byte [ds:rax]
0000000100003111 81FA2D000000 cmp edx, 0x2d
0000000100003117 0F8571000000 jne 0x10000318e
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp rdi
000000010000311d 486345EC movsxd rax, dword [ss:rbp-0x30+var_28]
0000000100003121 488B4DF0 mov rcx, qword [ss:rbp-0x30+var_32]
0000000100003125 488B04C1 mov rax, qword [ds:rcx+rax*8]
0000000100003129 8A5001 mov dl, byte [ds:rax+0x1]
000000010000312c 8855EB mov byte [ss:rbp-0x30+var_27], dl
000000010000312f 0FBE7DEB movsx edi, byte [ss:rbp-0x30+var_27]
0000000100003133 E83E020000 call imp___stubs___Z7toloweri ; tolower(int)
0000000100003138 3D71000000 cmp eax, 0x71
000000010000313d 0F850C000000 jne 0x10000314f
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100003143 C605B611000001 mov byte [ds:_quiet], 0x1
000000010000314a E93A000000 jmp 0x100003189
; Basic Block Input Regs: rax rbp - Killed Regs: rdi
000000010000314f 0FBE7DEB movsx edi, byte [ss:rbp-0x30+var_27] ; XREF=0x10000313d
0000000100003153 E81E020000 call imp___stubs___Z7toloweri ; tolower(int)
0000000100003158 3D66000000 cmp eax, 0x66
000000010000315d 0F850C000000 jne 0x10000316f
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100003163 C6059711000001 mov byte [ds:_fast], 0x1
000000010000316a E915000000 jmp 0x100003184
; Basic Block Input Regs: rbp - Killed Regs: rax rbp rsi rdi
000000010000316f 488D3DB6060000 lea rdi, qword [ds:0x10000382c] ; "argument '%c' not understood" XREF=0x10000315d
0000000100003176 0FBE75EB movsx esi, byte [ss:rbp-0x30+var_27]
000000010000317a B000 mov al, 0x0
000000010000317c E8FFFAFFFF call __Z5errorPKcz ; error(char const*, ...)
0000000100003181 8945E4 mov dword [ss:rbp-0x30+var_20], eax
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100003184 E900000000 jmp 0x100003189 ; XREF=0x10000316a
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100003189 E9A7000000 jmp 0x100003235 ; XREF=0x10000314a, 0x100003184
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
000000010000318e 803D6B10000000 cmp byte [ds:_port], 0x0 ; XREF=0x100003117
0000000100003195 0F8533000000 jne 0x1000031ce
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp rsi rdi
000000010000319b 488D3D5E100000 lea rdi, qword [ds:_port]
00000001000031a2 48BE8000000000000000 mov rsi, 0x80
00000001000031ac 488D1596060000 lea rdx, qword [ds:0x100003849] ; "%s"
00000001000031b3 486345EC movsxd rax, dword [ss:rbp-0x30+var_28]
00000001000031b7 488B4DF0 mov rcx, qword [ss:rbp-0x30+var_32]
00000001000031bb 488B0CC1 mov rcx, qword [ds:rcx+rax*8]
00000001000031bf B000 mov al, 0x0
00000001000031c1 E846020000 call imp___stubs__snprintf
00000001000031c6 8945E0 mov dword [ss:rbp-0x30+var_16], eax
00000001000031c9 E962000000 jmp 0x100003230
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000031ce 803DAB10000000 cmp byte [ds:_ihex_file], 0x0 ; XREF=0x100003195
00000001000031d5 0F8533000000 jne 0x10000320e
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rdx rbp rsi rdi
00000001000031db 488D3D9E100000 lea rdi, qword [ds:_ihex_file]
00000001000031e2 48BE8000000000000000 mov rsi, 0x80
00000001000031ec 488D1556060000 lea rdx, qword [ds:0x100003849] ; "%s"
00000001000031f3 486345EC movsxd rax, dword [ss:rbp-0x30+var_28]
00000001000031f7 488B4DF0 mov rcx, qword [ss:rbp-0x30+var_32]
00000001000031fb 488B0CC1 mov rcx, qword [ds:rcx+rax*8]
00000001000031ff B000 mov al, 0x0
0000000100003201 E806020000 call imp___stubs__snprintf
0000000100003206 8945DC mov dword [ss:rbp-0x30+var_12], eax
0000000100003209 E91D000000 jmp 0x10000322b
; Basic Block Input Regs: rbp - Killed Regs: rax rcx rbp rsi rdi
000000010000320e 488D3D37060000 lea rdi, qword [ds:0x10000384c] ; "argument '%s' not understood" XREF=0x1000031d5
0000000100003215 486345EC movsxd rax, dword [ss:rbp-0x30+var_28]
0000000100003219 488B4DF0 mov rcx, qword [ss:rbp-0x30+var_32]
000000010000321d 488B34C1 mov rsi, qword [ds:rcx+rax*8]
0000000100003221 B000 mov al, 0x0
0000000100003223 E858FAFFFF call __Z5errorPKcz ; error(char const*, ...)
0000000100003228 8945D8 mov dword [ss:rbp-0x30+var_8], eax
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
000000010000322b E900000000 jmp 0x100003230 ; XREF=0x100003209
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100003230 E900000000 jmp 0x100003235 ; XREF=0x1000031c9, 0x10000322b
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
0000000100003235 E900000000 jmp 0x10000323a ; XREF=0x100003189, 0x100003230
; Basic Block Input Regs: rbp - Killed Regs: rax rbp
000000010000323a 8B45EC mov eax, dword [ss:rbp-0x30+var_28] ; XREF=0x100003235
000000010000323d 0501000000 add eax, 0x1
0000000100003242 8945EC mov dword [ss:rbp-0x30+var_28], eax
0000000100003245 E9ACFEFFFF jmp 0x1000030f6
; Basic Block Input Regs: <nothing> - Killed Regs: rsp rbp
000000010000324a 4883C430 add rsp, 0x30 ; XREF=0x1000030fc
000000010000324e 5D pop rbp
000000010000324f C3 ret
; endp
================ B E G I N N I N G O F P R O C E D U R E ================
; Basic Block Input Regs: rsi rdi - Killed Regs: rbp rsi rdi
_main:
0000000100003250 55 push rbp ; XREF=0x10000141f
0000000100003251 4889E5 mov rbp, rsp
0000000100003254 4883EC30 sub rsp, 0x30
0000000100003258 C745FC00000000 mov dword [ss:rbp-0x30+var_44], 0x0
000000010000325f 897DF8 mov dword [ss:rbp-0x30+var_40], edi
0000000100003262 488975F0 mov qword [ss:rbp-0x30+var_32], rsi
0000000100003266 8B7DF8 mov edi, dword [ss:rbp-0x30+var_40]
0000000100003269 488B75F0 mov rsi, qword [ss:rbp-0x30+var_32]
000000010000326d E86EFEFFFF call __Z10parse_argsiPPKc ; parse_args(int, char const**)
0000000100003272 803D8710000000 cmp byte [ds:_quiet], 0x0
0000000100003279 0F8544000000 jne 0x1000032c3
; Basic Block Input Regs: <nothing> - Killed Regs: rax rbp rdi
000000010000327f 488D3DE3050000 lea rdi, qword [ds:0x100003869] ; "RFDLoader v1.2\\n"
0000000100003286 B000 mov al, 0x0
0000000100003288 E867010000 call imp___stubs__printf
000000010000328d 488D3DE5050000 lea rdi, qword [ds:0x100003879] ; "Copyright (c) 2013, RF Digital Corp.\\n"
0000000100003294 8945EC mov dword [ss:rbp-0x30+var_28], eax
0000000100003297 B000 mov al, 0x0
0000000100003299 E856010000 call imp___stubs__printf
000000010000329e 488D3DFA050000 lea rdi, qword [ds:0x10000389f] ; "All rights reserved.\\n"
00000001000032a5 8945E8 mov dword [ss:rbp-0x30+var_24], eax
00000001000032a8 B000 mov al, 0x0
00000001000032aa E845010000 call imp___stubs__printf
00000001000032af 488D3D1C050000 lea rdi, qword [ds:0x1000037d2] ; "\\n"
00000001000032b6 8945E4 mov dword [ss:rbp-0x30+var_20], eax
00000001000032b9 B000 mov al, 0x0
00000001000032bb E834010000 call imp___stubs__printf
00000001000032c0 8945E0 mov dword [ss:rbp-0x30+var_16], eax
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000032c3 803D360F000000 cmp byte [ds:_port], 0x0 ; XREF=0x100003279
00000001000032ca 0F840D000000 je 0x1000032dd
; Basic Block Input Regs: <nothing> - Killed Regs: <nothing>
00000001000032d0 803DA90F000000 cmp byte [ds:_ihex_file], 0x0
00000001000032d7 0F853D000000 jne 0x10000331a
; Basic Block Input Regs: <nothing> - Killed Regs: rax rbp rdi
00000001000032dd 488D3DD1050000 lea rdi, qword [ds:0x1000038b5] ; "syntax: RFDLoader [-q] [-v] <port> <ihex_file>\\n" XREF=0x1000032ca
00000001000032e4 B000 mov al, 0x0
00000001000032e6 E809010000 call imp___stubs__printf
00000001000032eb 488D3DF3050000 lea rdi, qword [ds:0x1000038e5] ; " -q = quiet\\n"
00000001000032f2 8945DC mov dword [ss:rbp-0x30+var_12], eax
00000001000032f5 B000 mov al, 0x0
00000001000032f7 E8F8000000 call imp___stubs__printf
00000001000032fc 488D3DF0050000 lea rdi, qword [ds:0x1000038f3] ; " -f = fast (no verify)\\n"
0000000100003303 8945D8 mov dword [ss:rbp-0x30+var_8], eax
0000000100003306 B000 mov al, 0x0
0000000100003308 E8E7000000 call imp___stubs__printf
000000010000330d BF01000000 mov edi, 0x1
0000000100003312 8945D4 mov dword [ss:rbp-0x30+var_4], eax
0000000100003315 E89E000000 call imp___stubs__exit
; Basic Block Input Regs: <nothing> - Killed Regs: rax rsp rbp rsi rdi
000000010000331a 488D3D5F0F0000 lea rdi, qword [ds:_ihex_file] ; XREF=0x1000032d7
0000000100003321 E8FAEBFFFF call __Z9ihex_loadPKc ; ihex_load(char const*)
0000000100003326 488D3DD30E0000 lea rdi, qword [ds:_port]
000000010000332d BE00C20100 mov esi, 0x1c200
0000000100003332 E8F9E0FFFF call __Z9uart_openPKci ; uart_open(char const*, int)
0000000100003337 E894E6FFFF call __Z13arduino_resetv ; arduino_reset()
000000010000333c E8FFE8FFFF call __Z11stk500_syncv ; stk500_sync()
0000000100003341 E87AE9FFFF call __Z21stk500_read_signaturev ; stk500_read_signature()
0000000100003346 E815EAFFFF call __Z29stk500_enter_programming_modev ; stk500_enter_programming_mode()
000000010000334b E8D0FCFFFF call __Z12ihex_programv ; ihex_program()
0000000100003350 E8ABEBFFFF call __Z29stk500_leave_programming_modev ; stk500_leave_programming_mode()
0000000100003355 E826E3FFFF call __Z10uart_closev ; uart_close()
000000010000335a E821FDFFFF call __Z9ihex_freev ; ihex_free()
000000010000335f E8ACF8FFFF call __Z7successv ; success()
0000000100003364 B800000000 mov eax, 0x0
0000000100003369 4883C430 add rsp, 0x30
000000010000336d 5D pop rbp
000000010000336e C3 ret
; endp
See more at: http://baldwisdom.com/bootloading/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment