ASM Long
Collection
Neural Long Context Assembly Transpilation
•
19 items
•
Updated
x86
stringlengths 321
9M
| arm
stringlengths 335
9.68M
|
---|---|
.file "803308.c"
.intel_syntax noprefix
.text
.section .rodata
.align 8
.LC0:
.string "Vnesi ime na datoteka za obrabotka: "
.LC1:
.string "%s"
.LC2:
.string "r+"
.align 8
.LC3:
.string "Ne mozham da ja otvaram datotekata \"%s\"\n"
.align 8
.LC4:
.string "Datotekata \"%s\" e uspeshno otvorena...\n"
.LC5:
.string "w+"
.LC6:
.string "Temp.txt"
.align 8
.LC7:
.string "Vnesi linija za otstranuvanje: "
.LC8:
.string "%d"
.LC9:
.string "w"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 336
mov rax, QWORD PTR fs:40
mov QWORD PTR -8[rbp], rax
xor eax, eax
mov DWORD PTR -324[rbp], 1
lea rdi, .LC0[rip]
mov eax, 0
call printf@PLT
lea rax, -304[rbp]
mov rsi, rax
lea rdi, .LC1[rip]
mov eax, 0
call __isoc99_scanf@PLT
lea rax, -304[rbp]
lea rsi, .LC2[rip]
mov rdi, rax
call fopen@PLT
mov QWORD PTR -320[rbp], rax
cmp QWORD PTR -320[rbp], 0
jne .L2
mov rax, QWORD PTR stderr[rip]
lea rdx, -304[rbp]
lea rsi, .LC3[rip]
mov rdi, rax
mov eax, 0
call fprintf@PLT
mov eax, -1
jmp .L9
.L2:
lea rax, -304[rbp]
mov rsi, rax
lea rdi, .LC4[rip]
mov eax, 0
call printf@PLT
lea rsi, .LC5[rip]
lea rdi, .LC6[rip]
call fopen@PLT
mov QWORD PTR -312[rbp], rax
lea rdi, .LC7[rip]
mov eax, 0
call printf@PLT
lea rax, -328[rbp]
mov rsi, rax
lea rdi, .LC8[rip]
mov eax, 0
call __isoc99_scanf@PLT
jmp .L4
.L6:
mov eax, DWORD PTR -328[rbp]
cmp DWORD PTR -324[rbp], eax
je .L5
mov rdx, QWORD PTR -312[rbp]
lea rax, -272[rbp]
mov rsi, rdx
mov rdi, rax
call fputs@PLT
.L5:
add DWORD PTR -324[rbp], 1
.L4:
mov rdx, QWORD PTR -320[rbp]
lea rax, -272[rbp]
mov esi, 256
mov rdi, rax
call fgets@PLT
test rax, rax
jne .L6
mov rax, QWORD PTR -320[rbp]
mov rdi, rax
call fclose@PLT
mov rax, QWORD PTR -312[rbp]
mov rdi, rax
call rewind@PLT
lea rax, -304[rbp]
lea rsi, .LC9[rip]
mov rdi, rax
call fopen@PLT
mov QWORD PTR -320[rbp], rax
jmp .L7
.L8:
mov rdx, QWORD PTR -320[rbp]
lea rax, -272[rbp]
mov rsi, rdx
mov rdi, rax
call fputs@PLT
.L7:
mov rdx, QWORD PTR -312[rbp]
lea rax, -272[rbp]
mov esi, 256
mov rdi, rax
call fgets@PLT
test rax, rax
jne .L8
mov rax, QWORD PTR -320[rbp]
mov rdi, rax
call fclose@PLT
mov rax, QWORD PTR -312[rbp]
mov rdi, rax
call fclose@PLT
lea rdi, .LC6[rip]
call remove@PLT
mov eax, 0
.L9:
mov rcx, QWORD PTR -8[rbp]
sub rcx, QWORD PTR fs:40
je .L10
call __stack_chk_fail@PLT
.L10:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:
| .arch armv5t
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 0
.eabi_attribute 18, 4
.file "803308.c"
.text
.section .rodata
.align 2
.LC0:
.ascii "Vnesi ime na datoteka za obrabotka: \000"
.align 2
.LC1:
.ascii "%s\000"
.align 2
.LC2:
.ascii "r+\000"
.align 2
.LC3:
.ascii "Ne mozham da ja otvaram datotekata \"%s\"\012\000"
.align 2
.LC4:
.ascii "Datotekata \"%s\" e uspeshno otvorena...\012\000"
.align 2
.LC5:
.ascii "w+\000"
.align 2
.LC6:
.ascii "Temp.txt\000"
.align 2
.LC7:
.ascii "Vnesi linija za otstranuvanje: \000"
.align 2
.LC8:
.ascii "%d\000"
.align 2
.LC9:
.ascii "w\000"
.align 2
.LC10:
.word __stack_chk_guard
.text
.align 2
.global main
.syntax unified
.arm
.fpu softvfp
.type main, %function
main:
@ args = 0, pretend = 0, frame = 296
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #296
ldr r3, .L11
ldr r3, [r3]
str r3, [fp, #-8]
mov r3,#0
mov r3, #1
str r3, [fp, #-296]
ldr r0, .L11+4
bl printf
sub r3, fp, #284
mov r1, r3
ldr r0, .L11+8
bl __isoc99_scanf
sub r3, fp, #284
ldr r1, .L11+12
mov r0, r3
bl fopen
str r0, [fp, #-292]
ldr r3, [fp, #-292]
cmp r3, #0
bne .L2
ldr r3, .L11+16
ldr r3, [r3]
sub r2, fp, #284
ldr r1, .L11+20
mov r0, r3
bl fprintf
mvn r3, #0
b .L9
.L2:
sub r3, fp, #284
mov r1, r3
ldr r0, .L11+24
bl printf
ldr r1, .L11+28
ldr r0, .L11+32
bl fopen
str r0, [fp, #-288]
ldr r0, .L11+36
bl printf
sub r3, fp, #300
mov r1, r3
ldr r0, .L11+40
bl __isoc99_scanf
b .L4
.L6:
ldr r3, [fp, #-300]
ldr r2, [fp, #-296]
cmp r2, r3
beq .L5
sub r3, fp, #264
ldr r1, [fp, #-288]
mov r0, r3
bl fputs
.L5:
ldr r3, [fp, #-296]
add r3, r3, #1
str r3, [fp, #-296]
.L4:
sub r3, fp, #264
ldr r2, [fp, #-292]
mov r1, #256
mov r0, r3
bl fgets
mov r3, r0
cmp r3, #0
bne .L6
ldr r0, [fp, #-292]
bl fclose
ldr r0, [fp, #-288]
bl rewind
sub r3, fp, #284
ldr r1, .L11+44
mov r0, r3
bl fopen
str r0, [fp, #-292]
b .L7
.L8:
sub r3, fp, #264
ldr r1, [fp, #-292]
mov r0, r3
bl fputs
.L7:
sub r3, fp, #264
ldr r2, [fp, #-288]
mov r1, #256
mov r0, r3
bl fgets
mov r3, r0
cmp r3, #0
bne .L8
ldr r0, [fp, #-292]
bl fclose
ldr r0, [fp, #-288]
bl fclose
ldr r0, .L11+32
bl remove
mov r3, #0
.L9:
ldr r2, .L11
ldr r1, [r2]
ldr r2, [fp, #-8]
eors r1, r2, r1
mov r2, #0
beq .L10
bl __stack_chk_fail
.L10:
mov r0, r3
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L12:
.align 2
.L11:
.word .LC10
.word .LC0
.word .LC1
.word .LC2
.word stderr
.word .LC3
.word .LC4
.word .LC5
.word .LC6
.word .LC7
.word .LC8
.word .LC9
.size main, .-main
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
.section .note.GNU-stack,"",%progbits
|
.file "266471.c"
.intel_syntax noprefix
.text
.globl g_bVerbose
.bss
.type g_bVerbose, @object
.size g_bVerbose, 1
g_bVerbose:
.zero 1
.globl g_bQuiet
.type g_bQuiet, @object
.size g_bQuiet, 1
g_bQuiet:
.zero 1
.globl g_bOverwrite
.type g_bOverwrite, @object
.size g_bOverwrite, 1
g_bOverwrite:
.zero 1
.globl g_bAdd
.data
.type g_bAdd, @object
.size g_bAdd, 1
g_bAdd:
.byte 1
.globl g_bCheck
.bss
.type g_bCheck, @object
.size g_bCheck, 1
g_bCheck:
.zero 1
.globl g_bForce
.type g_bForce, @object
.size g_bForce, 1
g_bForce:
.zero 1
.globl g_ulAddress
.align 8
.type g_ulAddress, @object
.size g_ulAddress, 8
g_ulAddress:
.zero 8
.globl g_usVendorID
.data
.align 2
.type g_usVendorID, @object
.size g_usVendorID, 2
g_usVendorID:
.value 7358
.globl g_usProductID
.align 2
.type g_usProductID, @object
.size g_usProductID, 2
g_usProductID:
.value 255
.globl g_usDeviceID
.bss
.align 2
.type g_usDeviceID, @object
.size g_usDeviceID, 2
g_usDeviceID:
.zero 2
.globl g_pszInput
.align 8
.type g_pszInput, @object
.size g_pszInput, 8
g_pszInput:
.zero 8
.globl g_pszOutput
.section .rodata
.LC0:
.string "image.dfu"
.section .data.rel.local,"aw"
.align 8
.type g_pszOutput, @object
.size g_pszOutput, 8
g_pszOutput:
.quad .LC0
.globl g_pulCRC32Table
.bss
.align 32
.type g_pulCRC32Table, @object
.size g_pulCRC32Table, 2048
g_pulCRC32Table:
.zero 2048
.globl g_pcDFUSuffix
.data
.align 16
.type g_pcDFUSuffix, @object
.size g_pcDFUSuffix, 16
g_pcDFUSuffix:
.string ""
.string ""
.string ""
.string ""
.string ""
.string ""
.string ""
.string "\001UFD\020"
.string ""
.string ""
.string ""
.globl g_pcDFUPrefix
.align 8
.type g_pcDFUPrefix, @object
.size g_pcDFUPrefix, 8
g_pcDFUPrefix:
.string "\001"
.string ""
.string " "
.string ""
.string ""
.string ""
.text
.globl Reflect
.type Reflect, @function
Reflect:
.LFB6:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -24[rbp], rdi
mov eax, esi
mov BYTE PTR -28[rbp], al
mov QWORD PTR -8[rbp], 0
mov DWORD PTR -12[rbp], 1
jmp .L2
.L4:
mov rax, QWORD PTR -24[rbp]
and eax, 1
test rax, rax
je .L3
movsx eax, BYTE PTR -28[rbp]
sub eax, DWORD PTR -12[rbp]
mov edx, 1
mov ecx, eax
sal edx, cl
mov eax, edx
cdqe
or QWORD PTR -8[rbp], rax
.L3:
shr QWORD PTR -24[rbp]
add DWORD PTR -12[rbp], 1
.L2:
movsx eax, BYTE PTR -28[rbp]
cmp DWORD PTR -12[rbp], eax
jle .L4
mov rax, QWORD PTR -8[rbp]
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE6:
.size Reflect, .-Reflect
.globl InitCRC32Table
.type InitCRC32Table, @function
InitCRC32Table:
.LFB7:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 16
mov QWORD PTR -8[rbp], 79764919
mov DWORD PTR -16[rbp], 0
jmp .L7
.L12:
mov eax, DWORD PTR -16[rbp]
cdqe
mov esi, 8
mov rdi, rax
call Reflect
sal rax, 24
mov rcx, rax
mov eax, DWORD PTR -16[rbp]
cdqe
lea rdx, 0[0+rax*8]
lea rax, g_pulCRC32Table[rip]
mov QWORD PTR [rdx+rax], rcx
mov DWORD PTR -12[rbp], 0
jmp .L8
.L11:
mov eax, DWORD PTR -16[rbp]
cdqe
lea rdx, 0[0+rax*8]
lea rax, g_pulCRC32Table[rip]
mov rax, QWORD PTR [rdx+rax]
lea rcx, [rax+rax]
mov eax, DWORD PTR -16[rbp]
cdqe
lea rdx, 0[0+rax*8]
lea rax, g_pulCRC32Table[rip]
mov rax, QWORD PTR [rdx+rax]
and rax, -2147483648
test rax, rax
je .L9
mov rax, QWORD PTR -8[rbp]
jmp .L10
.L9:
mov eax, 0
.L10:
xor rcx, rax
mov eax, DWORD PTR -16[rbp]
cdqe
lea rdx, 0[0+rax*8]
lea rax, g_pulCRC32Table[rip]
mov QWORD PTR [rdx+rax], rcx
add DWORD PTR -12[rbp], 1
.L8:
cmp DWORD PTR -12[rbp], 7
jle .L11
mov eax, DWORD PTR -16[rbp]
cdqe
lea rdx, 0[0+rax*8]
lea rax, g_pulCRC32Table[rip]
mov rax, QWORD PTR [rdx+rax]
mov esi, 32
mov rdi, rax
call Reflect
mov edx, DWORD PTR -16[rbp]
movsx rdx, edx
lea rcx, 0[0+rdx*8]
lea rdx, g_pulCRC32Table[rip]
mov QWORD PTR [rcx+rdx], rax
add DWORD PTR -16[rbp], 1
.L7:
cmp DWORD PTR -16[rbp], 255
jle .L12
nop
nop
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE7:
.size InitCRC32Table, .-InitCRC32Table
.globl CalculateCRC32
.type CalculateCRC32, @function
CalculateCRC32:
.LFB8:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -40[rbp], rdi
mov QWORD PTR -48[rbp], rsi
mov eax, 4294967295
mov QWORD PTR -24[rbp], rax
mov rax, QWORD PTR -40[rbp]
mov QWORD PTR -8[rbp], rax
mov rax, QWORD PTR -48[rbp]
mov QWORD PTR -16[rbp], rax
jmp .L14
.L15:
mov rax, QWORD PTR -8[rbp]
lea rdx, 1[rax]
mov QWORD PTR -8[rbp], rdx
movzx eax, BYTE PTR [rax]
mov BYTE PTR -25[rbp], al
mov rax, QWORD PTR -24[rbp]
shr rax, 8
mov rcx, rax
mov rax, QWORD PTR -24[rbp]
movzx edx, al
movzx eax, BYTE PTR -25[rbp]
xor rax, rdx
lea rdx, 0[0+rax*8]
lea rax, g_pulCRC32Table[rip]
mov rax, QWORD PTR [rdx+rax]
xor rax, rcx
mov QWORD PTR -24[rbp], rax
.L14:
mov rax, QWORD PTR -16[rbp]
lea rdx, -1[rax]
mov QWORD PTR -16[rbp], rdx
test rax, rax
jne .L15
mov rax, QWORD PTR -24[rbp]
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE8:
.size CalculateCRC32, .-CalculateCRC32
.section .rodata
.align 8
.LC1:
.string "\ndfuwrap - Wrap a binary file for use in USB DFU download."
.align 8
.LC2:
.string "Copyright (c) 2008-2014 Texas Instruments Incorporated. All rights reserved.\n"
.text
.globl PrintWelcome
.type PrintWelcome, @function
PrintWelcome:
.LFB9:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L18
lea rdi, .LC1[rip]
call puts@PLT
.L18:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L20
lea rdi, .LC2[rip]
call puts@PLT
.L20:
nop
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE9:
.size PrintWelcome, .-PrintWelcome
.section .rodata
.align 8
.LC3:
.string "This application may be used to wrap binary files which are"
.align 8
.LC4:
.string "to be flashed to a Tiva device using the USB boot loader."
.align 8
.LC5:
.string "Additionally, the application can check the validity of an"
.align 8
.LC6:
.string "existing Device Firmware Upgrade (DFU) wrapper or remove the"
.align 8
.LC7:
.string "wrapper to retrieve the original binary payload.\n"
.LC8:
.string "Supported parameters are:\n"
.align 8
.LC9:
.string "-i <file> - The name of the input file."
.align 8
.LC10:
.string "-o <file> - The name of the output file (default image.dfu)"
.align 8
.LC11:
.string "-r - Remove an existing DFU wrapper from the input file."
.align 8
.LC12:
.string "-c - Check validity of the input file's existing DFU wrapper."
.align 8
.LC13:
.string "-v <num> - Set the DFU wrapper's USB vendor ID (default 0x1CBE)."
.align 8
.LC14:
.string "-p <num> - Set the DFU wrapper's USB product ID (default 0x00FF)."
.align 8
.LC15:
.string "-d <num> - Set the DFU wrapper's USB device ID (default 0x0000)."
.align 8
.LC16:
.string "-a <num> - Set the address the binary will be flashed to."
.align 8
.LC17:
.string "-x - Overwrite existing output file without prompting."
.align 8
.LC18:
.string "-f - Force wrapper writing even if a wrapper already exists."
.LC19:
.string "-? or -h - Show this help."
.align 8
.LC20:
.string "-q - Quiet mode. Disable output to stdio."
.align 8
.LC21:
.string "-e - Enable verbose output\n"
.LC22:
.string "Example:\n"
.align 8
.LC23:
.string " dfuwrap -i program.bin -o program.dfu -a 0x1800\n"
.align 8
.LC24:
.string "wraps program.bin in a DFU wrapper which will cause the image to"
.LC25:
.string "address 0x1800 in flash.\n"
.text
.globl ShowHelp
.type ShowHelp, @function
ShowHelp:
.LFB10:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L24
lea rdi, .LC3[rip]
call puts@PLT
lea rdi, .LC4[rip]
call puts@PLT
lea rdi, .LC5[rip]
call puts@PLT
lea rdi, .LC6[rip]
call puts@PLT
lea rdi, .LC7[rip]
call puts@PLT
lea rdi, .LC8[rip]
call puts@PLT
lea rdi, .LC9[rip]
call puts@PLT
lea rdi, .LC10[rip]
call puts@PLT
lea rdi, .LC11[rip]
call puts@PLT
lea rdi, .LC12[rip]
call puts@PLT
lea rdi, .LC13[rip]
call puts@PLT
lea rdi, .LC14[rip]
call puts@PLT
lea rdi, .LC15[rip]
call puts@PLT
lea rdi, .LC16[rip]
call puts@PLT
lea rdi, .LC17[rip]
call puts@PLT
lea rdi, .LC18[rip]
call puts@PLT
lea rdi, .LC19[rip]
call puts@PLT
lea rdi, .LC20[rip]
call puts@PLT
lea rdi, .LC21[rip]
call puts@PLT
lea rdi, .LC22[rip]
call puts@PLT
lea rdi, .LC23[rip]
call puts@PLT
lea rdi, .LC24[rip]
call puts@PLT
lea rdi, .LC25[rip]
call puts@PLT
jmp .L21
.L24:
nop
.L21:
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE10:
.size ShowHelp, .-ShowHelp
.section .rodata
.LC26:
.string "a:i:o:v:d:p:eh?qcrfx"
.align 8
.LC27:
.string "ERROR: An input file must be specified using the -i parameter."
.align 8
.LC28:
.string "ERROR: The flash address of the image must be provided using the -a parameter."
.align 8
.LC29:
.string "ERROR: The supplied flash address must be a multiple of 1024."
.text
.globl ParseCommandLine
.type ParseCommandLine, @function
ParseCommandLine:
.LFB11:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 32
mov DWORD PTR -20[rbp], edi
mov QWORD PTR -32[rbp], rsi
mov BYTE PTR -5[rbp], 0
.L43:
mov rcx, QWORD PTR -32[rbp]
mov eax, DWORD PTR -20[rbp]
lea rdx, .LC26[rip]
mov rsi, rcx
mov edi, eax
call getopt@PLT
mov DWORD PTR -4[rbp], eax
cmp DWORD PTR -4[rbp], -1
je .L52
mov eax, DWORD PTR -4[rbp]
sub eax, 63
cmp eax, 57
ja .L43
mov eax, eax
lea rdx, 0[0+rax*4]
lea rax, .L30[rip]
mov eax, DWORD PTR [rdx+rax]
cdqe
lea rdx, .L30[rip]
add rax, rdx
notrack jmp rax
.section .rodata
.align 4
.align 4
.L30:
.long .L37-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L42-.L30
.long .L43-.L30
.long .L41-.L30
.long .L40-.L30
.long .L39-.L30
.long .L38-.L30
.long .L43-.L30
.long .L37-.L30
.long .L36-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L35-.L30
.long .L34-.L30
.long .L33-.L30
.long .L32-.L30
.long .L43-.L30
.long .L43-.L30
.long .L43-.L30
.long .L31-.L30
.long .L43-.L30
.long .L29-.L30
.text
.L36:
mov rax, QWORD PTR optarg[rip]
mov QWORD PTR g_pszInput[rip], rax
jmp .L28
.L35:
mov rax, QWORD PTR optarg[rip]
mov QWORD PTR g_pszOutput[rip], rax
jmp .L28
.L31:
mov rax, QWORD PTR optarg[rip]
mov edx, 0
mov esi, 0
mov rdi, rax
call strtol@PLT
mov WORD PTR g_usVendorID[rip], ax
jmp .L28
.L40:
mov rax, QWORD PTR optarg[rip]
mov edx, 0
mov esi, 0
mov rdi, rax
call strtol@PLT
mov WORD PTR g_usDeviceID[rip], ax
jmp .L28
.L34:
mov rax, QWORD PTR optarg[rip]
mov edx, 0
mov esi, 0
mov rdi, rax
call strtol@PLT
mov WORD PTR g_usProductID[rip], ax
jmp .L28
.L42:
mov rax, QWORD PTR optarg[rip]
mov edx, 0
mov esi, 0
mov rdi, rax
call strtol@PLT
mov QWORD PTR g_ulAddress[rip], rax
jmp .L28
.L39:
mov BYTE PTR g_bVerbose[rip], 1
jmp .L28
.L38:
mov BYTE PTR g_bForce[rip], 1
jmp .L28
.L33:
mov BYTE PTR g_bQuiet[rip], 1
jmp .L28
.L29:
mov BYTE PTR g_bOverwrite[rip], 1
jmp .L28
.L41:
mov BYTE PTR g_bCheck[rip], 1
jmp .L28
.L32:
mov BYTE PTR g_bAdd[rip], 0
jmp .L28
.L37:
mov BYTE PTR -5[rbp], 1
nop
.L28:
jmp .L43
.L52:
nop
call PrintWelcome
cmp BYTE PTR -5[rbp], 0
jne .L44
mov rax, QWORD PTR g_pszInput[rip]
test rax, rax
je .L44
mov rax, QWORD PTR g_ulAddress[rip]
test rax, rax
je .L45
mov rax, QWORD PTR g_ulAddress[rip]
and eax, 1023
test rax, rax
je .L46
.L45:
movzx eax, BYTE PTR g_bAdd[rip]
test al, al
je .L46
movzx eax, BYTE PTR g_bCheck[rip]
test al, al
jne .L46
.L44:
call ShowHelp
mov rax, QWORD PTR g_pszInput[rip]
test rax, rax
jne .L47
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L47
lea rdi, .LC27[rip]
call puts@PLT
.L47:
movzx eax, BYTE PTR g_bAdd[rip]
test al, al
je .L48
movzx eax, BYTE PTR g_bCheck[rip]
test al, al
jne .L48
mov rax, QWORD PTR g_ulAddress[rip]
test rax, rax
jne .L49
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L48
lea rdi, .LC28[rip]
call puts@PLT
jmp .L48
.L49:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L48
lea rdi, .LC29[rip]
call puts@PLT
.L48:
mov edi, 1
call exit@PLT
.L46:
mov eax, 1
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE11:
.size ParseCommandLine, .-ParseCommandLine
.section .rodata
.LC30:
.string "Input file: %s\n"
.LC31:
.string "Output file: %s\n"
.LC32:
.string "Add"
.LC33:
.string "Remove"
.LC34:
.string "Check"
.LC35:
.string "Operation: %s\n"
.LC36:
.string "Vendor ID: 0x%04x\n"
.LC37:
.string "Product ID: 0x%04x\n"
.LC38:
.string "Device ID: 0x%04x\n"
.LC39:
.string "Flash Address: 0x%08lx\n"
.LC40:
.string "Yes"
.LC41:
.string "No"
.LC42:
.string "Overwrite output?: %s\n"
.LC43:
.string "Force wrapper?: %s\n"
.text
.globl DumpCommandLineParameters
.type DumpCommandLineParameters, @function
DumpCommandLineParameters:
.LFB12:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L63
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L63
mov rax, QWORD PTR g_pszInput[rip]
mov rsi, rax
lea rdi, .LC30[rip]
mov eax, 0
call printf@PLT
mov rax, QWORD PTR g_pszOutput[rip]
mov rsi, rax
lea rdi, .LC31[rip]
mov eax, 0
call printf@PLT
movzx eax, BYTE PTR g_bCheck[rip]
test al, al
jne .L55
movzx eax, BYTE PTR g_bAdd[rip]
test al, al
je .L56
lea rax, .LC32[rip]
jmp .L58
.L56:
lea rax, .LC33[rip]
jmp .L58
.L55:
lea rax, .LC34[rip]
.L58:
mov rsi, rax
lea rdi, .LC35[rip]
mov eax, 0
call printf@PLT
movzx eax, WORD PTR g_usVendorID[rip]
movzx eax, ax
mov esi, eax
lea rdi, .LC36[rip]
mov eax, 0
call printf@PLT
movzx eax, WORD PTR g_usProductID[rip]
movzx eax, ax
mov esi, eax
lea rdi, .LC37[rip]
mov eax, 0
call printf@PLT
movzx eax, WORD PTR g_usDeviceID[rip]
movzx eax, ax
mov esi, eax
lea rdi, .LC38[rip]
mov eax, 0
call printf@PLT
mov rax, QWORD PTR g_ulAddress[rip]
mov rsi, rax
lea rdi, .LC39[rip]
mov eax, 0
call printf@PLT
movzx eax, BYTE PTR g_bOverwrite[rip]
test al, al
je .L59
lea rax, .LC40[rip]
jmp .L60
.L59:
lea rax, .LC41[rip]
.L60:
mov rsi, rax
lea rdi, .LC42[rip]
mov eax, 0
call printf@PLT
movzx eax, BYTE PTR g_bForce[rip]
test al, al
je .L61
lea rax, .LC40[rip]
jmp .L62
.L61:
lea rax, .LC41[rip]
.L62:
mov rsi, rax
lea rdi, .LC43[rip]
mov eax, 0
call printf@PLT
.L63:
nop
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE12:
.size DumpCommandLineParameters, .-DumpCommandLineParameters
.section .rodata
.LC44:
.string "Reading input file %s\n"
.LC45:
.string "rb"
.LC46:
.string "Can't open file!"
.align 8
.LC47:
.string "Can't allocate %d bytes of memory!\n"
.align 8
.LC48:
.string "Error reading file. Expected %d bytes, got %d!\n"
.text
.globl ReadInputFile
.type ReadInputFile, @function
ReadInputFile:
.LFB13:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 64
mov QWORD PTR -40[rbp], rdi
mov eax, esi
mov QWORD PTR -56[rbp], rdx
mov BYTE PTR -44[rbp], al
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L65
mov rax, QWORD PTR -40[rbp]
mov rsi, rax
lea rdi, .LC44[rip]
mov eax, 0
call printf@PLT
.L65:
mov rax, QWORD PTR -40[rbp]
lea rsi, .LC45[rip]
mov rdi, rax
call fopen@PLT
mov QWORD PTR -16[rbp], rax
cmp QWORD PTR -16[rbp], 0
jne .L66
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L67
lea rdi, .LC46[rip]
call puts@PLT
.L67:
mov eax, 0
jmp .L68
.L66:
mov rax, QWORD PTR -16[rbp]
mov edx, 2
mov esi, 0
mov rdi, rax
call fseek@PLT
mov rax, QWORD PTR -16[rbp]
mov rdi, rax
call ftell@PLT
mov DWORD PTR -28[rbp], eax
mov rax, QWORD PTR -16[rbp]
mov edx, 0
mov esi, 0
mov rdi, rax
call fseek@PLT
cmp BYTE PTR -44[rbp], 0
je .L69
mov edx, 24
jmp .L70
.L69:
mov edx, 0
.L70:
mov eax, DWORD PTR -28[rbp]
add eax, edx
mov DWORD PTR -24[rbp], eax
mov eax, DWORD PTR -24[rbp]
cdqe
mov rdi, rax
call malloc@PLT
mov QWORD PTR -8[rbp], rax
cmp QWORD PTR -8[rbp], 0
jne .L71
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L72
mov eax, DWORD PTR -24[rbp]
mov esi, eax
lea rdi, .LC47[rip]
mov eax, 0
call printf@PLT
.L72:
mov eax, 0
jmp .L68
.L71:
mov eax, DWORD PTR -28[rbp]
cdqe
cmp BYTE PTR -44[rbp], 0
je .L73
mov ecx, 8
jmp .L74
.L73:
mov ecx, 0
.L74:
mov rdx, QWORD PTR -8[rbp]
lea rdi, [rcx+rdx]
mov rdx, QWORD PTR -16[rbp]
mov rcx, rdx
mov rdx, rax
mov esi, 1
call fread@PLT
mov DWORD PTR -20[rbp], eax
mov rax, QWORD PTR -16[rbp]
mov rdi, rax
call fclose@PLT
mov eax, DWORD PTR -28[rbp]
cmp eax, DWORD PTR -20[rbp]
je .L75
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L76
mov edx, DWORD PTR -20[rbp]
mov eax, DWORD PTR -28[rbp]
mov esi, eax
lea rdi, .LC48[rip]
mov eax, 0
call printf@PLT
.L76:
mov rax, QWORD PTR -8[rbp]
mov rdi, rax
call free@PLT
mov eax, 0
jmp .L68
.L75:
cmp BYTE PTR -44[rbp], 0
je .L77
mov rdx, QWORD PTR g_pcDFUPrefix[rip]
mov rax, QWORD PTR -8[rbp]
mov QWORD PTR [rax], rdx
mov eax, DWORD PTR -24[rbp]
cdqe
lea rdx, -16[rax]
mov rax, QWORD PTR -8[rbp]
lea rcx, [rdx+rax]
mov rax, QWORD PTR g_pcDFUSuffix[rip]
mov rdx, QWORD PTR g_pcDFUSuffix[rip+8]
mov QWORD PTR [rcx], rax
mov QWORD PTR 8[rcx], rdx
.L77:
mov eax, DWORD PTR -24[rbp]
movsx rdx, eax
mov rax, QWORD PTR -56[rbp]
mov QWORD PTR [rax], rdx
mov rax, QWORD PTR -8[rbp]
.L68:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE13:
.size ReadInputFile, .-ReadInputFile
.section .rodata
.LC49:
.string "Looking for valid prefix..."
.align 8
.LC50:
.string "File is too short to contain a prefix."
.align 8
.LC51:
.string "Prefix fixed values are incorrect."
.align 8
.LC52:
.string "Length is not valid for supplied data.\n"
.LC53:
.string "Prefix appears valid."
.text
.globl IsPrefixValid
.type IsPrefixValid, @function
IsPrefixValid:
.LFB14:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 32
mov QWORD PTR -24[rbp], rdi
mov QWORD PTR -32[rbp], rsi
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L79
lea rdi, .LC49[rip]
call puts@PLT
.L79:
mov rax, QWORD PTR -32[rbp]
sub rax, QWORD PTR -24[rbp]
cmp rax, 7
ja .L80
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L81
lea rdi, .LC50[rip]
call puts@PLT
.L81:
mov eax, 0
jmp .L82
.L80:
mov rax, QWORD PTR -24[rbp]
movzx eax, BYTE PTR [rax]
cmp al, 1
jne .L83
mov rax, QWORD PTR -24[rbp]
add rax, 1
movzx eax, BYTE PTR [rax]
test al, al
je .L84
.L83:
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L85
lea rdi, .LC51[rip]
call puts@PLT
.L85:
mov eax, 0
jmp .L82
.L84:
mov rax, QWORD PTR -24[rbp]
add rax, 4
movzx eax, BYTE PTR [rax]
movzx edx, al
mov rax, QWORD PTR -24[rbp]
add rax, 5
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 8
or edx, eax
mov rax, QWORD PTR -24[rbp]
add rax, 6
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 16
or edx, eax
mov rax, QWORD PTR -24[rbp]
add rax, 7
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 24
or eax, edx
cdqe
mov QWORD PTR -8[rbp], rax
mov rax, QWORD PTR -24[rbp]
add rax, 2
movzx eax, BYTE PTR [rax]
movzx edx, al
mov rax, QWORD PTR -24[rbp]
add rax, 3
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 8
or eax, edx
mov WORD PTR -10[rbp], ax
mov rax, QWORD PTR -32[rbp]
sub rax, QWORD PTR -24[rbp]
sub rax, 8
cmp QWORD PTR -8[rbp], rax
je .L86
mov rax, QWORD PTR -32[rbp]
sub rax, QWORD PTR -24[rbp]
sub rax, 24
cmp QWORD PTR -8[rbp], rax
je .L86
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L87
mov rax, QWORD PTR -8[rbp]
mov rsi, rax
lea rdi, .LC52[rip]
mov eax, 0
call printf@PLT
.L87:
mov eax, 0
jmp .L82
.L86:
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L88
lea rdi, .LC53[rip]
call puts@PLT
.L88:
mov eax, 1
.L82:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE14:
.size IsPrefixValid, .-IsPrefixValid
.section .rodata
.LC54:
.string "Looking for valid suffix..."
.LC55:
.string "Length reported as %d bytes\n"
.LC56:
.string "Suffix length is not valid."
.align 8
.LC57:
.string "Suffix 'DFU' marker is not present."
.LC58:
.string "DFU suffix is valid."
.align 8
.LC59:
.string "Read CRC 0x%08lx, calculated 0x%08lx.\n"
.LC60:
.string "DFU suffix is invalid."
.text
.globl IsSuffixValid
.type IsSuffixValid, @function
IsSuffixValid:
.LFB15:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 48
mov QWORD PTR -40[rbp], rdi
mov QWORD PTR -48[rbp], rsi
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L90
lea rdi, .LC54[rip]
call puts@PLT
.L90:
mov rax, QWORD PTR -48[rbp]
movzx eax, BYTE PTR -5[rax]
mov BYTE PTR -17[rbp], al
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L91
movzx eax, BYTE PTR -17[rbp]
mov esi, eax
lea rdi, .LC55[rip]
mov eax, 0
call printf@PLT
.L91:
cmp BYTE PTR -17[rbp], 15
jbe .L92
mov rax, QWORD PTR -48[rbp]
sub rax, QWORD PTR -40[rbp]
mov rdx, rax
movzx eax, BYTE PTR -17[rbp]
cmp rdx, rax
jge .L93
.L92:
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L94
lea rdi, .LC56[rip]
call puts@PLT
.L94:
mov eax, 0
jmp .L95
.L93:
mov rax, QWORD PTR -48[rbp]
sub rax, 6
movzx eax, BYTE PTR [rax]
cmp al, 68
jne .L96
mov rax, QWORD PTR -48[rbp]
sub rax, 7
movzx eax, BYTE PTR [rax]
cmp al, 70
jne .L96
mov rax, QWORD PTR -48[rbp]
sub rax, 8
movzx eax, BYTE PTR [rax]
cmp al, 85
je .L97
.L96:
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L98
lea rdi, .LC57[rip]
call puts@PLT
.L98:
mov eax, 0
jmp .L95
.L97:
mov rax, QWORD PTR -48[rbp]
sub rax, 4
movzx eax, BYTE PTR [rax]
movzx edx, al
mov rax, QWORD PTR -48[rbp]
sub rax, 3
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 8
or edx, eax
mov rax, QWORD PTR -48[rbp]
sub rax, 2
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 16
or edx, eax
mov rax, QWORD PTR -48[rbp]
sub rax, 1
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 24
or eax, edx
cdqe
mov QWORD PTR -16[rbp], rax
mov rax, QWORD PTR -48[rbp]
sub rax, 4
sub rax, QWORD PTR -40[rbp]
mov rdx, rax
mov rax, QWORD PTR -40[rbp]
mov rsi, rdx
mov rdi, rax
call CalculateCRC32
mov QWORD PTR -8[rbp], rax
mov rax, QWORD PTR -16[rbp]
cmp rax, QWORD PTR -8[rbp]
jne .L99
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L100
lea rdi, .LC58[rip]
call puts@PLT
.L100:
mov eax, 1
jmp .L95
.L99:
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L101
mov rdx, QWORD PTR -8[rbp]
mov rax, QWORD PTR -16[rbp]
mov rsi, rax
lea rdi, .LC59[rip]
mov eax, 0
call printf@PLT
.L101:
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L102
lea rdi, .LC60[rip]
call puts@PLT
.L102:
mov eax, 0
.L95:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE15:
.size IsSuffixValid, .-IsSuffixValid
.section .rodata
.LC61:
.string "\nTiva DFU Prefix"
.LC62:
.string "---------------\n"
.LC63:
.string "Flash address: 0x%08x\n"
.align 8
.LC64:
.string "Payload length: %ld (0x%lx) bytes, %ldKB\n"
.text
.globl DumpPrefix
.type DumpPrefix, @function
DumpPrefix:
.LFB16:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 32
mov QWORD PTR -24[rbp], rdi
mov rax, QWORD PTR -24[rbp]
add rax, 4
movzx eax, BYTE PTR [rax]
movzx edx, al
mov rax, QWORD PTR -24[rbp]
add rax, 5
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 8
or edx, eax
mov rax, QWORD PTR -24[rbp]
add rax, 6
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 16
or edx, eax
mov rax, QWORD PTR -24[rbp]
add rax, 7
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 24
or eax, edx
cdqe
mov QWORD PTR -8[rbp], rax
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L104
lea rdi, .LC61[rip]
call puts@PLT
.L104:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L105
lea rdi, .LC62[rip]
call puts@PLT
.L105:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L106
mov rax, QWORD PTR -24[rbp]
add rax, 2
movzx eax, BYTE PTR [rax]
movzx edx, al
mov rax, QWORD PTR -24[rbp]
add rax, 3
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 8
or eax, edx
sal eax, 10
mov esi, eax
lea rdi, .LC63[rip]
mov eax, 0
call printf@PLT
.L106:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L108
mov rax, QWORD PTR -8[rbp]
shr rax, 10
mov rcx, rax
mov rdx, QWORD PTR -8[rbp]
mov rax, QWORD PTR -8[rbp]
mov rsi, rax
lea rdi, .LC64[rip]
mov eax, 0
call printf@PLT
.L108:
nop
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE16:
.size DumpPrefix, .-DumpPrefix
.section .rodata
.LC65:
.string "\nDFU File Suffix"
.LC66:
.string "Suffix Length: %d bytes\n"
.LC67:
.string "Suffix Version: 0x%4x\n"
.LC68:
.string "Device ID: 0x%04x\n"
.LC69:
.string "Product ID: 0x%04x\n"
.LC70:
.string "Vendor ID: 0x%04x\n"
.LC71:
.string "CRC: 0x%08x\n"
.text
.globl DumpSuffix
.type DumpSuffix, @function
DumpSuffix:
.LFB17:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 16
mov QWORD PTR -8[rbp], rdi
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L110
lea rdi, .LC65[rip]
call puts@PLT
.L110:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L111
lea rdi, .LC62[rip]
call puts@PLT
.L111:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L112
mov rax, QWORD PTR -8[rbp]
sub rax, 5
movzx eax, BYTE PTR [rax]
movzx eax, al
mov esi, eax
lea rdi, .LC66[rip]
mov eax, 0
call printf@PLT
.L112:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L113
mov rax, QWORD PTR -8[rbp]
sub rax, 10
movzx eax, BYTE PTR [rax]
movzx edx, al
mov rax, QWORD PTR -8[rbp]
sub rax, 9
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 8
or eax, edx
mov esi, eax
lea rdi, .LC67[rip]
mov eax, 0
call printf@PLT
.L113:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L114
mov rax, QWORD PTR -8[rbp]
sub rax, 16
movzx eax, BYTE PTR [rax]
movzx edx, al
mov rax, QWORD PTR -8[rbp]
sub rax, 15
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 8
or eax, edx
mov esi, eax
lea rdi, .LC68[rip]
mov eax, 0
call printf@PLT
.L114:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L115
mov rax, QWORD PTR -8[rbp]
sub rax, 14
movzx eax, BYTE PTR [rax]
movzx edx, al
mov rax, QWORD PTR -8[rbp]
sub rax, 13
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 8
or eax, edx
mov esi, eax
lea rdi, .LC69[rip]
mov eax, 0
call printf@PLT
.L115:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L116
mov rax, QWORD PTR -8[rbp]
sub rax, 12
movzx eax, BYTE PTR [rax]
movzx edx, al
mov rax, QWORD PTR -8[rbp]
sub rax, 11
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 8
or eax, edx
mov esi, eax
lea rdi, .LC70[rip]
mov eax, 0
call printf@PLT
.L116:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L118
mov rax, QWORD PTR -8[rbp]
sub rax, 4
movzx eax, BYTE PTR [rax]
movzx edx, al
mov rax, QWORD PTR -8[rbp]
sub rax, 3
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 8
or edx, eax
mov rax, QWORD PTR -8[rbp]
sub rax, 2
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 16
or edx, eax
mov rax, QWORD PTR -8[rbp]
sub rax, 1
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 24
or eax, edx
mov esi, eax
lea rdi, .LC71[rip]
mov eax, 0
call printf@PLT
.L118:
nop
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE17:
.size DumpSuffix, .-DumpSuffix
.section .rodata
.LC72:
.string "Output file already exists."
.LC73:
.string "File %s exists. Overwrite? "
.align 8
.LC74:
.string "User chose not to overwrite output."
.align 8
.LC75:
.string "Overwriting existing output file."
.LC76:
.string "wb"
.align 8
.LC77:
.string "Error opening output file for writing"
.align 8
.LC78:
.string "Writing %ld (0x%lx) bytes to output file.\n"
.align 8
.LC79:
.string "Error writing data to output file! Wrote %ld, requested %ld\n"
.align 8
.LC80:
.string "Output file written successfully."
.text
.globl WriteOutputFile
.type WriteOutputFile, @function
WriteOutputFile:
.LFB18:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 64
mov QWORD PTR -40[rbp], rdi
mov QWORD PTR -48[rbp], rsi
mov QWORD PTR -56[rbp], rdx
movzx eax, BYTE PTR g_bOverwrite[rip]
test al, al
jne .L120
mov rax, QWORD PTR -40[rbp]
lea rsi, .LC45[rip]
mov rdi, rax
call fopen@PLT
mov QWORD PTR -16[rbp], rax
cmp QWORD PTR -16[rbp], 0
je .L120
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L121
lea rdi, .LC72[rip]
call puts@PLT
.L121:
mov rax, QWORD PTR -16[rbp]
mov rdi, rax
call fclose@PLT
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L122
mov rax, QWORD PTR -40[rbp]
mov rsi, rax
lea rdi, .LC73[rip]
mov eax, 0
call printf@PLT
mov rax, QWORD PTR stdin[rip]
mov rdi, rax
call getc@PLT
mov DWORD PTR -20[rbp], eax
cmp DWORD PTR -20[rbp], 121
je .L123
cmp DWORD PTR -20[rbp], 89
je .L123
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L124
lea rdi, .LC74[rip]
call puts@PLT
.L124:
mov eax, 6
jmp .L125
.L123:
lea rdi, .LC75[rip]
call puts@PLT
jmp .L120
.L122:
mov eax, 7
jmp .L125
.L120:
mov rax, QWORD PTR -40[rbp]
lea rsi, .LC76[rip]
mov rdi, rax
call fopen@PLT
mov QWORD PTR -16[rbp], rax
cmp QWORD PTR -16[rbp], 0
jne .L126
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L127
lea rdi, .LC77[rip]
call puts@PLT
.L127:
mov eax, 8
jmp .L125
.L126:
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L128
mov rdx, QWORD PTR -56[rbp]
mov rax, QWORD PTR -56[rbp]
mov rsi, rax
lea rdi, .LC78[rip]
mov eax, 0
call printf@PLT
.L128:
mov rcx, QWORD PTR -16[rbp]
mov rdx, QWORD PTR -56[rbp]
mov rax, QWORD PTR -48[rbp]
mov esi, 1
mov rdi, rax
call fwrite@PLT
mov QWORD PTR -8[rbp], rax
mov rax, QWORD PTR -16[rbp]
mov rdi, rax
call fclose@PLT
mov rax, QWORD PTR -8[rbp]
cmp rax, QWORD PTR -56[rbp]
je .L129
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L130
mov rdx, QWORD PTR -56[rbp]
mov rax, QWORD PTR -8[rbp]
mov rsi, rax
lea rdi, .LC79[rip]
mov eax, 0
call printf@PLT
.L130:
mov eax, 9
jmp .L125
.L129:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L131
lea rdi, .LC80[rip]
call puts@PLT
.L131:
mov eax, 0
.L125:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE18:
.size WriteOutputFile, .-WriteOutputFile
.section .rodata
.LC81:
.string "Error reading input file."
.align 8
.LC82:
.string "File prefix appears to be invalid or absent."
.align 8
.LC83:
.string "DFU suffix appears to be invalid or absent."
.align 8
.LC84:
.string "This does not appear to be a valid DFU-formatted file."
.align 8
.LC85:
.string "This file already contains a valid DFU wrapper."
.align 8
.LC86:
.string "Use -f if you want to force the writing of another wrapper."
.text
.globl main
.type main, @function
main:
.LFB19:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 80
mov DWORD PTR -68[rbp], edi
mov QWORD PTR -80[rbp], rsi
mov rax, QWORD PTR fs:40
mov QWORD PTR -8[rbp], rax
xor eax, eax
mov eax, 0
call InitCRC32Table
mov rdx, QWORD PTR -80[rbp]
mov eax, DWORD PTR -68[rbp]
mov rsi, rdx
mov edi, eax
call ParseCommandLine
mov DWORD PTR -52[rbp], eax
cmp DWORD PTR -52[rbp], 0
jne .L133
mov eax, 1
mov rcx, QWORD PTR -8[rbp]
sub rcx, QWORD PTR fs:40
je .L156
jmp .L157
.L133:
call DumpCommandLineParameters
movzx eax, BYTE PTR g_bAdd[rip]
movzx ecx, al
mov rax, QWORD PTR g_pszInput[rip]
lea rdx, -48[rbp]
mov esi, ecx
mov rdi, rax
call ReadInputFile
mov QWORD PTR -40[rbp], rax
cmp QWORD PTR -40[rbp], 0
jne .L135
movzx eax, BYTE PTR g_bVerbose[rip]
test al, al
je .L136
lea rdi, .LC81[rip]
call puts@PLT
.L136:
mov edi, 1
call exit@PLT
.L135:
movzx eax, BYTE PTR g_bAdd[rip]
test al, al
je .L137
mov edx, 8
jmp .L138
.L137:
mov edx, 0
.L138:
mov rax, QWORD PTR -40[rbp]
add rax, rdx
mov QWORD PTR -32[rbp], rax
mov rdx, QWORD PTR -48[rbp]
movzx eax, BYTE PTR g_bAdd[rip]
test al, al
je .L139
mov eax, 16
jmp .L140
.L139:
mov eax, 0
.L140:
sub rdx, rax
mov rax, QWORD PTR -40[rbp]
add rax, rdx
mov QWORD PTR -24[rbp], rax
mov rdx, QWORD PTR -24[rbp]
mov rax, QWORD PTR -32[rbp]
mov rsi, rdx
mov rdi, rax
call IsPrefixValid
mov BYTE PTR -54[rbp], al
mov rdx, QWORD PTR -24[rbp]
mov rax, QWORD PTR -32[rbp]
mov rsi, rdx
mov rdi, rax
call IsSuffixValid
mov BYTE PTR -53[rbp], al
movzx eax, BYTE PTR g_bCheck[rip]
test al, al
je .L141
cmp BYTE PTR -54[rbp], 0
jne .L142
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L143
lea rdi, .LC82[rip]
call puts@PLT
jmp .L143
.L142:
mov rax, QWORD PTR -32[rbp]
mov rdi, rax
call DumpPrefix
.L143:
cmp BYTE PTR -53[rbp], 0
jne .L144
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L145
lea rdi, .LC83[rip]
call puts@PLT
jmp .L145
.L144:
mov rax, QWORD PTR -24[rbp]
mov rdi, rax
call DumpSuffix
.L145:
cmp BYTE PTR -54[rbp], 0
je .L146
cmp BYTE PTR -53[rbp], 0
jne .L147
.L146:
mov eax, 2
jmp .L148
.L147:
mov eax, 0
.L148:
mov DWORD PTR -52[rbp], eax
jmp .L149
.L141:
movzx eax, BYTE PTR g_bAdd[rip]
test al, al
jne .L150
cmp BYTE PTR -54[rbp], 0
jne .L151
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L152
lea rdi, .LC84[rip]
call puts@PLT
.L152:
mov DWORD PTR -52[rbp], 3
jmp .L149
.L151:
mov rax, QWORD PTR -32[rbp]
add rax, 4
movzx eax, BYTE PTR [rax]
movzx edx, al
mov rax, QWORD PTR -32[rbp]
add rax, 5
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 8
or edx, eax
mov rax, QWORD PTR -32[rbp]
add rax, 6
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 16
or edx, eax
mov rax, QWORD PTR -32[rbp]
add rax, 7
movzx eax, BYTE PTR [rax]
movzx eax, al
sal eax, 24
or eax, edx
movsx rdx, eax
mov rax, QWORD PTR -32[rbp]
lea rcx, 8[rax]
mov rax, QWORD PTR g_pszOutput[rip]
mov rsi, rcx
mov rdi, rax
call WriteOutputFile
mov DWORD PTR -52[rbp], eax
jmp .L149
.L150:
cmp BYTE PTR -54[rbp], 0
je .L153
cmp BYTE PTR -53[rbp], 0
je .L153
movzx eax, BYTE PTR g_bForce[rip]
test al, al
jne .L153
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L154
lea rdi, .LC85[rip]
call puts@PLT
.L154:
movzx eax, BYTE PTR g_bQuiet[rip]
test al, al
jne .L155
lea rdi, .LC86[rip]
call puts@PLT
.L155:
mov DWORD PTR -52[rbp], 5
jmp .L149
.L153:
mov rax, QWORD PTR g_ulAddress[rip]
shr rax, 10
mov rdx, rax
mov rax, QWORD PTR -40[rbp]
add rax, 2
mov BYTE PTR [rax], dl
mov rax, QWORD PTR g_ulAddress[rip]
shr rax, 10
shr rax, 8
mov rdx, rax
mov rax, QWORD PTR -40[rbp]
add rax, 3
mov BYTE PTR [rax], dl
mov rax, QWORD PTR -48[rbp]
mov edx, eax
mov rax, QWORD PTR -40[rbp]
add rax, 4
sub edx, 24
mov BYTE PTR [rax], dl
mov rax, QWORD PTR -48[rbp]
sub rax, 24
shr rax, 8
mov rdx, rax
mov rax, QWORD PTR -40[rbp]
add rax, 5
mov BYTE PTR [rax], dl
mov rax, QWORD PTR -48[rbp]
sub rax, 24
shr rax, 16
mov rdx, rax
mov rax, QWORD PTR -40[rbp]
add rax, 6
mov BYTE PTR [rax], dl
mov rax, QWORD PTR -48[rbp]
sub rax, 24
shr rax, 24
mov rdx, rax
mov rax, QWORD PTR -40[rbp]
add rax, 7
mov BYTE PTR [rax], dl
mov rdx, QWORD PTR -48[rbp]
mov rax, QWORD PTR -40[rbp]
add rax, rdx
mov QWORD PTR -24[rbp], rax
movzx edx, WORD PTR g_usDeviceID[rip]
mov rax, QWORD PTR -24[rbp]
sub rax, 16
mov BYTE PTR [rax], dl
movzx eax, WORD PTR g_usDeviceID[rip]
shr ax, 8
mov edx, eax
mov rax, QWORD PTR -24[rbp]
sub rax, 15
mov BYTE PTR [rax], dl
movzx edx, WORD PTR g_usProductID[rip]
mov rax, QWORD PTR -24[rbp]
sub rax, 14
mov BYTE PTR [rax], dl
movzx eax, WORD PTR g_usProductID[rip]
shr ax, 8
mov edx, eax
mov rax, QWORD PTR -24[rbp]
sub rax, 13
mov BYTE PTR [rax], dl
movzx edx, WORD PTR g_usVendorID[rip]
mov rax, QWORD PTR -24[rbp]
sub rax, 12
mov BYTE PTR [rax], dl
movzx eax, WORD PTR g_usVendorID[rip]
shr ax, 8
mov edx, eax
mov rax, QWORD PTR -24[rbp]
sub rax, 11
mov BYTE PTR [rax], dl
mov rax, QWORD PTR -48[rbp]
lea rdx, -4[rax]
mov rax, QWORD PTR -40[rbp]
mov rsi, rdx
mov rdi, rax
call CalculateCRC32
mov QWORD PTR -16[rbp], rax
mov rax, QWORD PTR -24[rbp]
sub rax, 4
mov rdx, QWORD PTR -16[rbp]
mov BYTE PTR [rax], dl
mov rax, QWORD PTR -16[rbp]
shr rax, 8
mov rdx, rax
mov rax, QWORD PTR -24[rbp]
sub rax, 3
mov BYTE PTR [rax], dl
mov rax, QWORD PTR -16[rbp]
shr rax, 16
mov rdx, rax
mov rax, QWORD PTR -24[rbp]
sub rax, 2
mov BYTE PTR [rax], dl
mov rax, QWORD PTR -16[rbp]
shr rax, 24
mov rdx, rax
mov rax, QWORD PTR -24[rbp]
sub rax, 1
mov BYTE PTR [rax], dl
mov rdx, QWORD PTR -48[rbp]
mov rax, QWORD PTR g_pszOutput[rip]
mov rcx, QWORD PTR -40[rbp]
mov rsi, rcx
mov rdi, rax
call WriteOutputFile
mov DWORD PTR -52[rbp], eax
.L149:
mov rax, QWORD PTR -40[rbp]
mov rdi, rax
call free@PLT
mov eax, DWORD PTR -52[rbp]
mov edi, eax
call exit@PLT
.L157:
call __stack_chk_fail@PLT
.L156:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE19:
.size main, .-main
.ident "GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:
| .arch armv5t
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 0
.eabi_attribute 18, 4
.file "266471.c"
.text
.global g_bVerbose
.bss
.type g_bVerbose, %object
.size g_bVerbose, 1
g_bVerbose:
.space 1
.global g_bQuiet
.type g_bQuiet, %object
.size g_bQuiet, 1
g_bQuiet:
.space 1
.global g_bOverwrite
.type g_bOverwrite, %object
.size g_bOverwrite, 1
g_bOverwrite:
.space 1
.global g_bAdd
.data
.type g_bAdd, %object
.size g_bAdd, 1
g_bAdd:
.byte 1
.global g_bCheck
.bss
.type g_bCheck, %object
.size g_bCheck, 1
g_bCheck:
.space 1
.global g_bForce
.type g_bForce, %object
.size g_bForce, 1
g_bForce:
.space 1
.global g_ulAddress
.align 2
.type g_ulAddress, %object
.size g_ulAddress, 4
g_ulAddress:
.space 4
.global g_usVendorID
.data
.align 1
.type g_usVendorID, %object
.size g_usVendorID, 2
g_usVendorID:
.short 7358
.global g_usProductID
.align 1
.type g_usProductID, %object
.size g_usProductID, 2
g_usProductID:
.short 255
.global g_usDeviceID
.bss
.align 1
.type g_usDeviceID, %object
.size g_usDeviceID, 2
g_usDeviceID:
.space 2
.global g_pszInput
.align 2
.type g_pszInput, %object
.size g_pszInput, 4
g_pszInput:
.space 4
.global g_pszOutput
.section .rodata
.align 2
.LC0:
.ascii "image.dfu\000"
.data
.align 2
.type g_pszOutput, %object
.size g_pszOutput, 4
g_pszOutput:
.word .LC0
.comm g_pulCRC32Table,1024,4
.global g_pcDFUSuffix
.align 2
.type g_pcDFUSuffix, %object
.size g_pcDFUSuffix, 16
g_pcDFUSuffix:
.ascii "\000\000\000\000\000\000\000\001UFD\020\000\000\000"
.ascii "\000"
.global g_pcDFUPrefix
.align 2
.type g_pcDFUPrefix, %object
.size g_pcDFUPrefix, 8
g_pcDFUPrefix:
.ascii "\001\000\000 \000\000\000\000"
.text
.align 2
.global Reflect
.syntax unified
.arm
.fpu softvfp
.type Reflect, %function
Reflect:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #20
str r0, [fp, #-16]
mov r3, r1
strb r3, [fp, #-17]
mov r3, #0
str r3, [fp, #-12]
mov r3, #1
str r3, [fp, #-8]
b .L2
.L4:
ldr r3, [fp, #-16]
and r3, r3, #1
cmp r3, #0
beq .L3
ldrb r2, [fp, #-17] @ zero_extendqisi2
ldr r3, [fp, #-8]
sub r3, r2, r3
mov r2, #1
lsl r3, r2, r3
mov r2, r3
ldr r3, [fp, #-12]
orr r3, r3, r2
str r3, [fp, #-12]
.L3:
ldr r3, [fp, #-16]
lsr r3, r3, #1
str r3, [fp, #-16]
ldr r3, [fp, #-8]
add r3, r3, #1
str r3, [fp, #-8]
.L2:
ldrb r3, [fp, #-17] @ zero_extendqisi2
ldr r2, [fp, #-8]
cmp r2, r3
ble .L4
ldr r3, [fp, #-12]
mov r0, r3
add sp, fp, #0
@ sp needed
ldr fp, [sp], #4
bx lr
.size Reflect, .-Reflect
.align 2
.global InitCRC32Table
.syntax unified
.arm
.fpu softvfp
.type InitCRC32Table, %function
InitCRC32Table:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #16
ldr r3, .L13
str r3, [fp, #-8]
mov r3, #0
str r3, [fp, #-16]
b .L7
.L12:
ldr r3, [fp, #-16]
mov r1, #8
mov r0, r3
bl Reflect
mov r3, r0
lsl r2, r3, #24
ldr r1, .L13+4
ldr r3, [fp, #-16]
str r2, [r1, r3, lsl #2]
mov r3, #0
str r3, [fp, #-12]
b .L8
.L11:
ldr r2, .L13+4
ldr r3, [fp, #-16]
ldr r3, [r2, r3, lsl #2]
lsl r2, r3, #1
ldr r1, .L13+4
ldr r3, [fp, #-16]
ldr r3, [r1, r3, lsl #2]
cmp r3, #0
bge .L9
ldr r3, [fp, #-8]
b .L10
.L9:
mov r3, #0
.L10:
eor r2, r2, r3
ldr r1, .L13+4
ldr r3, [fp, #-16]
str r2, [r1, r3, lsl #2]
ldr r3, [fp, #-12]
add r3, r3, #1
str r3, [fp, #-12]
.L8:
ldr r3, [fp, #-12]
cmp r3, #7
ble .L11
ldr r2, .L13+4
ldr r3, [fp, #-16]
ldr r3, [r2, r3, lsl #2]
mov r1, #32
mov r0, r3
bl Reflect
mov r2, r0
ldr r1, .L13+4
ldr r3, [fp, #-16]
str r2, [r1, r3, lsl #2]
ldr r3, [fp, #-16]
add r3, r3, #1
str r3, [fp, #-16]
.L7:
ldr r3, [fp, #-16]
cmp r3, #255
ble .L12
nop
nop
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L14:
.align 2
.L13:
.word 79764919
.word g_pulCRC32Table
.size InitCRC32Table, .-InitCRC32Table
.align 2
.global CalculateCRC32
.syntax unified
.arm
.fpu softvfp
.type CalculateCRC32, %function
CalculateCRC32:
@ args = 0, pretend = 0, frame = 24
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #28
str r0, [fp, #-24]
str r1, [fp, #-28]
mvn r3, #0
str r3, [fp, #-16]
ldr r3, [fp, #-24]
str r3, [fp, #-8]
ldr r3, [fp, #-28]
str r3, [fp, #-12]
b .L16
.L17:
ldr r3, [fp, #-8]
add r2, r3, #1
str r2, [fp, #-8]
ldrb r3, [r3]
strb r3, [fp, #-17]
ldr r3, [fp, #-16]
lsr r2, r3, #8
ldr r3, [fp, #-16]
and r1, r3, #255
ldrb r3, [fp, #-17] @ zero_extendqisi2
eor r3, r3, r1
ldr r1, .L19
ldr r3, [r1, r3, lsl #2]
eor r3, r3, r2
str r3, [fp, #-16]
.L16:
ldr r3, [fp, #-12]
sub r2, r3, #1
str r2, [fp, #-12]
cmp r3, #0
bne .L17
ldr r3, [fp, #-16]
mov r0, r3
add sp, fp, #0
@ sp needed
ldr fp, [sp], #4
bx lr
.L20:
.align 2
.L19:
.word g_pulCRC32Table
.size CalculateCRC32, .-CalculateCRC32
.section .rodata
.align 2
.LC1:
.ascii "\012dfuwrap - Wrap a binary file for use in USB DFU"
.ascii " download.\000"
.align 2
.LC2:
.ascii "Copyright (c) 2008-2014 Texas Instruments Incorpora"
.ascii "ted. All rights reserved.\012\000"
.text
.align 2
.global PrintWelcome
.syntax unified
.arm
.fpu softvfp
.type PrintWelcome, %function
PrintWelcome:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
ldr r3, .L25
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L22
ldr r0, .L25+4
bl puts
.L22:
ldr r3, .L25
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L24
ldr r0, .L25+8
bl puts
.L24:
nop
pop {fp, pc}
.L26:
.align 2
.L25:
.word g_bQuiet
.word .LC1
.word .LC2
.size PrintWelcome, .-PrintWelcome
.section .rodata
.align 2
.LC3:
.ascii "This application may be used to wrap binary files w"
.ascii "hich are\000"
.align 2
.LC4:
.ascii "to be flashed to a Tiva device using the USB boot l"
.ascii "oader.\000"
.align 2
.LC5:
.ascii "Additionally, the application can check the validit"
.ascii "y of an\000"
.align 2
.LC6:
.ascii "existing Device Firmware Upgrade (DFU) wrapper or r"
.ascii "emove the\000"
.align 2
.LC7:
.ascii "wrapper to retrieve the original binary payload.\012"
.ascii "\000"
.align 2
.LC8:
.ascii "Supported parameters are:\012\000"
.align 2
.LC9:
.ascii "-i <file> - The name of the input file.\000"
.align 2
.LC10:
.ascii "-o <file> - The name of the output file (default im"
.ascii "age.dfu)\000"
.align 2
.LC11:
.ascii "-r - Remove an existing DFU wrapper from the"
.ascii " input file.\000"
.align 2
.LC12:
.ascii "-c - Check validity of the input file's exis"
.ascii "ting DFU wrapper.\000"
.align 2
.LC13:
.ascii "-v <num> - Set the DFU wrapper's USB vendor ID (de"
.ascii "fault 0x1CBE).\000"
.align 2
.LC14:
.ascii "-p <num> - Set the DFU wrapper's USB product ID (d"
.ascii "efault 0x00FF).\000"
.align 2
.LC15:
.ascii "-d <num> - Set the DFU wrapper's USB device ID (de"
.ascii "fault 0x0000).\000"
.align 2
.LC16:
.ascii "-a <num> - Set the address the binary will be flas"
.ascii "hed to.\000"
.align 2
.LC17:
.ascii "-x - Overwrite existing output file without "
.ascii "prompting.\000"
.align 2
.LC18:
.ascii "-f - Force wrapper writing even if a wrapper"
.ascii " already exists.\000"
.align 2
.LC19:
.ascii "-? or -h - Show this help.\000"
.align 2
.LC20:
.ascii "-q - Quiet mode. Disable output to stdio.\000"
.align 2
.LC21:
.ascii "-e - Enable verbose output\012\000"
.align 2
.LC22:
.ascii "Example:\012\000"
.align 2
.LC23:
.ascii " dfuwrap -i program.bin -o program.dfu -a 0x1800\012"
.ascii "\000"
.align 2
.LC24:
.ascii "wraps program.bin in a DFU wrapper which will cause"
.ascii " the image to\000"
.align 2
.LC25:
.ascii "address 0x1800 in flash.\012\000"
.text
.align 2
.global ShowHelp
.syntax unified
.arm
.fpu softvfp
.type ShowHelp, %function
ShowHelp:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
ldr r3, .L31
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L30
ldr r0, .L31+4
bl puts
ldr r0, .L31+8
bl puts
ldr r0, .L31+12
bl puts
ldr r0, .L31+16
bl puts
ldr r0, .L31+20
bl puts
ldr r0, .L31+24
bl puts
ldr r0, .L31+28
bl puts
ldr r0, .L31+32
bl puts
ldr r0, .L31+36
bl puts
ldr r0, .L31+40
bl puts
ldr r0, .L31+44
bl puts
ldr r0, .L31+48
bl puts
ldr r0, .L31+52
bl puts
ldr r0, .L31+56
bl puts
ldr r0, .L31+60
bl puts
ldr r0, .L31+64
bl puts
ldr r0, .L31+68
bl puts
ldr r0, .L31+72
bl puts
ldr r0, .L31+76
bl puts
ldr r0, .L31+80
bl puts
ldr r0, .L31+84
bl puts
ldr r0, .L31+88
bl puts
ldr r0, .L31+92
bl puts
pop {fp, pc}
.L30:
nop
pop {fp, pc}
.L32:
.align 2
.L31:
.word g_bQuiet
.word .LC3
.word .LC4
.word .LC5
.word .LC6
.word .LC7
.word .LC8
.word .LC9
.word .LC10
.word .LC11
.word .LC12
.word .LC13
.word .LC14
.word .LC15
.word .LC16
.word .LC17
.word .LC18
.word .LC19
.word .LC20
.word .LC21
.word .LC22
.word .LC23
.word .LC24
.word .LC25
.size ShowHelp, .-ShowHelp
.section .rodata
.align 2
.LC26:
.ascii "a:i:o:v:d:p:eh?qcrfx\000"
.align 2
.LC27:
.ascii "ERROR: An input file must be specified using the -i"
.ascii " parameter.\000"
.align 2
.LC28:
.ascii "ERROR: The flash address of the image must be provi"
.ascii "ded using the -a parameter.\000"
.align 2
.LC29:
.ascii "ERROR: The supplied flash address must be a multipl"
.ascii "e of 1024.\000"
.text
.align 2
.global ParseCommandLine
.syntax unified
.arm
.fpu softvfp
.type ParseCommandLine, %function
ParseCommandLine:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #16
str r0, [fp, #-16]
str r1, [fp, #-20]
mov r3, #0
strb r3, [fp, #-9]
.L51:
ldr r2, .L61
ldr r1, [fp, #-20]
ldr r0, [fp, #-16]
bl getopt
str r0, [fp, #-8]
ldr r3, [fp, #-8]
cmn r3, #1
beq .L60
ldr r3, [fp, #-8]
sub r3, r3, #63
cmp r3, #57
ldrls pc, [pc, r3, asl #2]
b .L51
.L38:
.word .L45
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L50
.word .L51
.word .L49
.word .L48
.word .L47
.word .L46
.word .L51
.word .L45
.word .L44
.word .L51
.word .L51
.word .L51
.word .L51
.word .L51
.word .L43
.word .L42
.word .L41
.word .L40
.word .L51
.word .L51
.word .L51
.word .L39
.word .L51
.word .L37
.L44:
ldr r3, .L61+4
ldr r3, [r3]
ldr r2, .L61+8
str r3, [r2]
b .L36
.L43:
ldr r3, .L61+4
ldr r3, [r3]
ldr r2, .L61+12
str r3, [r2]
b .L36
.L39:
ldr r3, .L61+4
ldr r3, [r3]
mov r2, #0
mov r1, #0
mov r0, r3
bl strtol
mov r3, r0
lsl r3, r3, #16
lsr r3, r3, #16
ldr r2, .L61+16
strh r3, [r2] @ movhi
b .L36
.L48:
ldr r3, .L61+4
ldr r3, [r3]
mov r2, #0
mov r1, #0
mov r0, r3
bl strtol
mov r3, r0
lsl r3, r3, #16
lsr r3, r3, #16
ldr r2, .L61+20
strh r3, [r2] @ movhi
b .L36
.L42:
ldr r3, .L61+4
ldr r3, [r3]
mov r2, #0
mov r1, #0
mov r0, r3
bl strtol
mov r3, r0
lsl r3, r3, #16
lsr r3, r3, #16
ldr r2, .L61+24
strh r3, [r2] @ movhi
b .L36
.L50:
ldr r3, .L61+4
ldr r3, [r3]
mov r2, #0
mov r1, #0
mov r0, r3
bl strtol
mov r3, r0
mov r2, r3
ldr r3, .L61+28
str r2, [r3]
b .L36
.L47:
ldr r3, .L61+32
mov r2, #1
strb r2, [r3]
b .L36
.L46:
ldr r3, .L61+36
mov r2, #1
strb r2, [r3]
b .L36
.L41:
ldr r3, .L61+40
mov r2, #1
strb r2, [r3]
b .L36
.L37:
ldr r3, .L61+44
mov r2, #1
strb r2, [r3]
b .L36
.L49:
ldr r3, .L61+48
mov r2, #1
strb r2, [r3]
b .L36
.L40:
ldr r3, .L61+52
mov r2, #0
strb r2, [r3]
b .L36
.L45:
mov r3, #1
strb r3, [fp, #-9]
nop
.L36:
b .L51
.L60:
nop
bl PrintWelcome
ldrb r3, [fp, #-9] @ zero_extendqisi2
cmp r3, #0
bne .L52
ldr r3, .L61+8
ldr r3, [r3]
cmp r3, #0
beq .L52
ldr r3, .L61+28
ldr r3, [r3]
cmp r3, #0
beq .L53
ldr r3, .L61+28
ldr r3, [r3]
lsl r3, r3, #22
lsr r3, r3, #22
cmp r3, #0
beq .L54
.L53:
ldr r3, .L61+52
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L54
ldr r3, .L61+48
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L54
.L52:
bl ShowHelp
ldr r3, .L61+8
ldr r3, [r3]
cmp r3, #0
bne .L55
ldr r3, .L61+40
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L55
ldr r0, .L61+56
bl puts
.L55:
ldr r3, .L61+52
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L56
ldr r3, .L61+48
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L56
ldr r3, .L61+28
ldr r3, [r3]
cmp r3, #0
bne .L57
ldr r3, .L61+40
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L56
ldr r0, .L61+60
bl puts
b .L56
.L57:
ldr r3, .L61+40
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L56
ldr r0, .L61+64
bl puts
.L56:
mov r0, #1
bl exit
.L54:
mov r3, #1
mov r0, r3
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L62:
.align 2
.L61:
.word .LC26
.word optarg
.word g_pszInput
.word g_pszOutput
.word g_usVendorID
.word g_usDeviceID
.word g_usProductID
.word g_ulAddress
.word g_bVerbose
.word g_bForce
.word g_bQuiet
.word g_bOverwrite
.word g_bCheck
.word g_bAdd
.word .LC27
.word .LC28
.word .LC29
.size ParseCommandLine, .-ParseCommandLine
.section .rodata
.align 2
.LC30:
.ascii "Input file: %s\012\000"
.align 2
.LC31:
.ascii "Output file: %s\012\000"
.align 2
.LC32:
.ascii "Add\000"
.align 2
.LC33:
.ascii "Remove\000"
.align 2
.LC34:
.ascii "Check\000"
.align 2
.LC35:
.ascii "Operation: %s\012\000"
.align 2
.LC36:
.ascii "Vendor ID: 0x%04x\012\000"
.align 2
.LC37:
.ascii "Product ID: 0x%04x\012\000"
.align 2
.LC38:
.ascii "Device ID: 0x%04x\012\000"
.align 2
.LC39:
.ascii "Flash Address: 0x%08lx\012\000"
.align 2
.LC40:
.ascii "Yes\000"
.align 2
.LC41:
.ascii "No\000"
.align 2
.LC42:
.ascii "Overwrite output?: %s\012\000"
.align 2
.LC43:
.ascii "Force wrapper?: %s\012\000"
.text
.align 2
.global DumpCommandLineParameters
.syntax unified
.arm
.fpu softvfp
.type DumpCommandLineParameters, %function
DumpCommandLineParameters:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
ldr r3, .L74
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L73
ldr r3, .L74+4
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L73
ldr r3, .L74+8
ldr r3, [r3]
mov r1, r3
ldr r0, .L74+12
bl printf
ldr r3, .L74+16
ldr r3, [r3]
mov r1, r3
ldr r0, .L74+20
bl printf
ldr r3, .L74+24
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L65
ldr r3, .L74+28
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L66
ldr r3, .L74+32
b .L68
.L66:
ldr r3, .L74+36
b .L68
.L65:
ldr r3, .L74+40
.L68:
mov r1, r3
ldr r0, .L74+44
bl printf
ldr r3, .L74+48
ldrh r3, [r3]
mov r1, r3
ldr r0, .L74+52
bl printf
ldr r3, .L74+56
ldrh r3, [r3]
mov r1, r3
ldr r0, .L74+60
bl printf
ldr r3, .L74+64
ldrh r3, [r3]
mov r1, r3
ldr r0, .L74+68
bl printf
ldr r3, .L74+72
ldr r3, [r3]
mov r1, r3
ldr r0, .L74+76
bl printf
ldr r3, .L74+80
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L69
ldr r3, .L74+84
b .L70
.L69:
ldr r3, .L74+88
.L70:
mov r1, r3
ldr r0, .L74+92
bl printf
ldr r3, .L74+96
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L71
ldr r3, .L74+84
b .L72
.L71:
ldr r3, .L74+88
.L72:
mov r1, r3
ldr r0, .L74+100
bl printf
.L73:
nop
pop {fp, pc}
.L75:
.align 2
.L74:
.word g_bQuiet
.word g_bVerbose
.word g_pszInput
.word .LC30
.word g_pszOutput
.word .LC31
.word g_bCheck
.word g_bAdd
.word .LC32
.word .LC33
.word .LC34
.word .LC35
.word g_usVendorID
.word .LC36
.word g_usProductID
.word .LC37
.word g_usDeviceID
.word .LC38
.word g_ulAddress
.word .LC39
.word g_bOverwrite
.word .LC40
.word .LC41
.word .LC42
.word g_bForce
.word .LC43
.size DumpCommandLineParameters, .-DumpCommandLineParameters
.section .rodata
.align 2
.LC44:
.ascii "Reading input file %s\012\000"
.align 2
.LC45:
.ascii "rb\000"
.align 2
.LC46:
.ascii "Can't open file!\000"
.align 2
.LC47:
.ascii "Can't allocate %d bytes of memory!\012\000"
.align 2
.LC48:
.ascii "Error reading file. Expected %d bytes, got %d!\012\000"
.text
.align 2
.global ReadInputFile
.syntax unified
.arm
.fpu softvfp
.type ReadInputFile, %function
ReadInputFile:
@ args = 0, pretend = 0, frame = 40
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #40
str r0, [fp, #-32]
mov r3, r1
str r2, [fp, #-40]
strb r3, [fp, #-33]
ldr r3, .L90
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L77
ldr r1, [fp, #-32]
ldr r0, .L90+4
bl printf
.L77:
ldr r1, .L90+8
ldr r0, [fp, #-32]
bl fopen
str r0, [fp, #-24]
ldr r3, [fp, #-24]
cmp r3, #0
bne .L78
ldr r3, .L90
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L79
ldr r0, .L90+12
bl puts
.L79:
mov r3, #0
b .L80
.L78:
mov r2, #2
mov r1, #0
ldr r0, [fp, #-24]
bl fseek
ldr r0, [fp, #-24]
bl ftell
str r0, [fp, #-20]
mov r2, #0
mov r1, #0
ldr r0, [fp, #-24]
bl fseek
ldrb r3, [fp, #-33] @ zero_extendqisi2
cmp r3, #0
beq .L81
mov r2, #24
b .L82
.L81:
mov r2, #0
.L82:
ldr r3, [fp, #-20]
add r3, r2, r3
str r3, [fp, #-16]
ldr r3, [fp, #-16]
mov r0, r3
bl malloc
mov r3, r0
str r3, [fp, #-12]
ldr r3, [fp, #-12]
cmp r3, #0
bne .L83
ldr r3, .L90
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L84
ldr r1, [fp, #-16]
ldr r0, .L90+16
bl printf
.L84:
mov r3, #0
b .L80
.L83:
ldrb r3, [fp, #-33] @ zero_extendqisi2
cmp r3, #0
beq .L85
mov r3, #8
b .L86
.L85:
mov r3, #0
.L86:
ldr r2, [fp, #-12]
add r0, r2, r3
ldr r2, [fp, #-20]
ldr r3, [fp, #-24]
mov r1, #1
bl fread
mov r3, r0
str r3, [fp, #-8]
ldr r0, [fp, #-24]
bl fclose
ldr r2, [fp, #-20]
ldr r3, [fp, #-8]
cmp r2, r3
beq .L87
ldr r3, .L90
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L88
ldr r2, [fp, #-8]
ldr r1, [fp, #-20]
ldr r0, .L90+20
bl printf
.L88:
ldr r0, [fp, #-12]
bl free
mov r3, #0
b .L80
.L87:
ldrb r3, [fp, #-33] @ zero_extendqisi2
cmp r3, #0
beq .L89
ldr r3, [fp, #-12]
ldr r2, .L90+24
mov r0, r3
mov r1, r2
mov r3, #8
mov r2, r3
bl memcpy
ldr r3, [fp, #-16]
sub r3, r3, #16
ldr r2, [fp, #-12]
add r3, r2, r3
ldr r2, .L90+28
mov r0, r3
mov r1, r2
mov r3, #16
mov r2, r3
bl memcpy
.L89:
ldr r2, [fp, #-16]
ldr r3, [fp, #-40]
str r2, [r3]
ldr r3, [fp, #-12]
.L80:
mov r0, r3
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L91:
.align 2
.L90:
.word g_bQuiet
.word .LC44
.word .LC45
.word .LC46
.word .LC47
.word .LC48
.word g_pcDFUPrefix
.word g_pcDFUSuffix
.size ReadInputFile, .-ReadInputFile
.section .rodata
.align 2
.LC49:
.ascii "Looking for valid prefix...\000"
.align 2
.LC50:
.ascii "File is too short to contain a prefix.\000"
.align 2
.LC51:
.ascii "Prefix fixed values are incorrect.\000"
.align 2
.LC52:
.ascii "Length is not valid for supplied data.\012\000"
.align 2
.LC53:
.ascii "Prefix appears valid.\000"
.text
.align 2
.global IsPrefixValid
.syntax unified
.arm
.fpu softvfp
.type IsPrefixValid, %function
IsPrefixValid:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #16
str r0, [fp, #-16]
str r1, [fp, #-20]
ldr r3, .L103
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L93
ldr r0, .L103+4
bl puts
.L93:
ldr r2, [fp, #-20]
ldr r3, [fp, #-16]
sub r3, r2, r3
cmp r3, #7
bhi .L94
ldr r3, .L103
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L95
ldr r0, .L103+8
bl puts
.L95:
mov r3, #0
b .L96
.L94:
ldr r3, [fp, #-16]
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #1
bne .L97
ldr r3, [fp, #-16]
add r3, r3, #1
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L98
.L97:
ldr r3, .L103
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L99
ldr r0, .L103+12
bl puts
.L99:
mov r3, #0
b .L96
.L98:
ldr r3, [fp, #-16]
add r3, r3, #4
ldrb r3, [r3] @ zero_extendqisi2
mov r2, r3
ldr r3, [fp, #-16]
add r3, r3, #5
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #8
orr r2, r2, r3
ldr r3, [fp, #-16]
add r3, r3, #6
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #16
orr r2, r2, r3
ldr r3, [fp, #-16]
add r3, r3, #7
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #24
orr r3, r2, r3
str r3, [fp, #-8]
ldr r3, [fp, #-16]
add r3, r3, #2
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #16
asr r2, r3, #16
ldr r3, [fp, #-16]
add r3, r3, #3
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #8
lsl r3, r3, #16
asr r3, r3, #16
orr r3, r2, r3
lsl r3, r3, #16
asr r3, r3, #16
strh r3, [fp, #-10] @ movhi
ldr r2, [fp, #-20]
ldr r3, [fp, #-16]
sub r3, r2, r3
sub r3, r3, #8
ldr r2, [fp, #-8]
cmp r2, r3
beq .L100
ldr r2, [fp, #-20]
ldr r3, [fp, #-16]
sub r3, r2, r3
sub r3, r3, #24
ldr r2, [fp, #-8]
cmp r2, r3
beq .L100
ldr r3, .L103
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L101
ldr r1, [fp, #-8]
ldr r0, .L103+16
bl printf
.L101:
mov r3, #0
b .L96
.L100:
ldr r3, .L103
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L102
ldr r0, .L103+20
bl puts
.L102:
mov r3, #1
.L96:
mov r0, r3
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L104:
.align 2
.L103:
.word g_bVerbose
.word .LC49
.word .LC50
.word .LC51
.word .LC52
.word .LC53
.size IsPrefixValid, .-IsPrefixValid
.section .rodata
.align 2
.LC54:
.ascii "Looking for valid suffix...\000"
.align 2
.LC55:
.ascii "Length reported as %d bytes\012\000"
.align 2
.LC56:
.ascii "Suffix length is not valid.\000"
.align 2
.LC57:
.ascii "Suffix 'DFU' marker is not present.\000"
.align 2
.LC58:
.ascii "DFU suffix is valid.\000"
.align 2
.LC59:
.ascii "Read CRC 0x%08lx, calculated 0x%08lx.\012\000"
.align 2
.LC60:
.ascii "DFU suffix is invalid.\000"
.text
.align 2
.global IsSuffixValid
.syntax unified
.arm
.fpu softvfp
.type IsSuffixValid, %function
IsSuffixValid:
@ args = 0, pretend = 0, frame = 24
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #24
str r0, [fp, #-24]
str r1, [fp, #-28]
ldr r3, .L119
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L106
ldr r0, .L119+4
bl puts
.L106:
ldr r3, [fp, #-28]
ldrb r3, [r3, #-5]
strb r3, [fp, #-13]
ldr r3, .L119
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L107
ldrb r3, [fp, #-13] @ zero_extendqisi2
mov r1, r3
ldr r0, .L119+8
bl printf
.L107:
ldrb r3, [fp, #-13] @ zero_extendqisi2
cmp r3, #15
bls .L108
ldr r2, [fp, #-28]
ldr r3, [fp, #-24]
sub r2, r2, r3
ldrb r3, [fp, #-13] @ zero_extendqisi2
cmp r2, r3
bge .L109
.L108:
ldr r3, .L119
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L110
ldr r0, .L119+12
bl puts
.L110:
mov r3, #0
b .L111
.L109:
ldr r3, [fp, #-28]
sub r3, r3, #6
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #68
bne .L112
ldr r3, [fp, #-28]
sub r3, r3, #7
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #70
bne .L112
ldr r3, [fp, #-28]
sub r3, r3, #8
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #85
beq .L113
.L112:
ldr r3, .L119
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L114
ldr r0, .L119+16
bl puts
.L114:
mov r3, #0
b .L111
.L113:
ldr r3, [fp, #-28]
sub r3, r3, #4
ldrb r3, [r3] @ zero_extendqisi2
mov r2, r3
ldr r3, [fp, #-28]
sub r3, r3, #3
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #8
orr r2, r2, r3
ldr r3, [fp, #-28]
sub r3, r3, #2
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #16
orr r2, r2, r3
ldr r3, [fp, #-28]
sub r3, r3, #1
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #24
orr r3, r2, r3
str r3, [fp, #-12]
ldr r3, [fp, #-28]
sub r2, r3, #4
ldr r3, [fp, #-24]
sub r3, r2, r3
mov r1, r3
ldr r0, [fp, #-24]
bl CalculateCRC32
str r0, [fp, #-8]
ldr r2, [fp, #-12]
ldr r3, [fp, #-8]
cmp r2, r3
bne .L115
ldr r3, .L119
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L116
ldr r0, .L119+20
bl puts
.L116:
mov r3, #1
b .L111
.L115:
ldr r3, .L119
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L117
ldr r2, [fp, #-8]
ldr r1, [fp, #-12]
ldr r0, .L119+24
bl printf
.L117:
ldr r3, .L119
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L118
ldr r0, .L119+28
bl puts
.L118:
mov r3, #0
.L111:
mov r0, r3
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L120:
.align 2
.L119:
.word g_bVerbose
.word .LC54
.word .LC55
.word .LC56
.word .LC57
.word .LC58
.word .LC59
.word .LC60
.size IsSuffixValid, .-IsSuffixValid
.section .rodata
.align 2
.LC61:
.ascii "\012Tiva DFU Prefix\000"
.align 2
.LC62:
.ascii "---------------\012\000"
.align 2
.LC63:
.ascii "Flash address: 0x%08x\012\000"
.align 2
.LC64:
.ascii "Payload length: %ld (0x%lx) bytes, %ldKB\012\000"
.text
.align 2
.global DumpPrefix
.syntax unified
.arm
.fpu softvfp
.type DumpPrefix, %function
DumpPrefix:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #16
str r0, [fp, #-16]
ldr r3, [fp, #-16]
add r3, r3, #4
ldrb r3, [r3] @ zero_extendqisi2
mov r2, r3
ldr r3, [fp, #-16]
add r3, r3, #5
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #8
orr r2, r2, r3
ldr r3, [fp, #-16]
add r3, r3, #6
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #16
orr r2, r2, r3
ldr r3, [fp, #-16]
add r3, r3, #7
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #24
orr r3, r2, r3
str r3, [fp, #-8]
ldr r3, .L127
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L122
ldr r0, .L127+4
bl puts
.L122:
ldr r3, .L127
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L123
ldr r0, .L127+8
bl puts
.L123:
ldr r3, .L127
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L124
ldr r3, [fp, #-16]
add r3, r3, #2
ldrb r3, [r3] @ zero_extendqisi2
mov r2, r3
ldr r3, [fp, #-16]
add r3, r3, #3
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #8
orr r3, r2, r3
lsl r3, r3, #10
mov r1, r3
ldr r0, .L127+12
bl printf
.L124:
ldr r3, .L127
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L126
ldr r3, [fp, #-8]
lsr r3, r3, #10
ldr r2, [fp, #-8]
ldr r1, [fp, #-8]
ldr r0, .L127+16
bl printf
.L126:
nop
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L128:
.align 2
.L127:
.word g_bQuiet
.word .LC61
.word .LC62
.word .LC63
.word .LC64
.size DumpPrefix, .-DumpPrefix
.section .rodata
.align 2
.LC65:
.ascii "\012DFU File Suffix\000"
.align 2
.LC66:
.ascii "Suffix Length: %d bytes\012\000"
.align 2
.LC67:
.ascii "Suffix Version: 0x%4x\012\000"
.align 2
.LC68:
.ascii "Device ID: 0x%04x\012\000"
.align 2
.LC69:
.ascii "Product ID: 0x%04x\012\000"
.align 2
.LC70:
.ascii "Vendor ID: 0x%04x\012\000"
.align 2
.LC71:
.ascii "CRC: 0x%08x\012\000"
.text
.align 2
.global DumpSuffix
.syntax unified
.arm
.fpu softvfp
.type DumpSuffix, %function
DumpSuffix:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #8
str r0, [fp, #-8]
ldr r3, .L139
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L130
ldr r0, .L139+4
bl puts
.L130:
ldr r3, .L139
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L131
ldr r0, .L139+8
bl puts
.L131:
ldr r3, .L139
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L132
ldr r3, [fp, #-8]
sub r3, r3, #5
ldrb r3, [r3] @ zero_extendqisi2
mov r1, r3
ldr r0, .L139+12
bl printf
.L132:
ldr r3, .L139
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L133
ldr r3, [fp, #-8]
sub r3, r3, #10
ldrb r3, [r3] @ zero_extendqisi2
mov r2, r3
ldr r3, [fp, #-8]
sub r3, r3, #9
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #8
orr r3, r2, r3
mov r1, r3
ldr r0, .L139+16
bl printf
.L133:
ldr r3, .L139
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L134
ldr r3, [fp, #-8]
sub r3, r3, #16
ldrb r3, [r3] @ zero_extendqisi2
mov r2, r3
ldr r3, [fp, #-8]
sub r3, r3, #15
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #8
orr r3, r2, r3
mov r1, r3
ldr r0, .L139+20
bl printf
.L134:
ldr r3, .L139
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L135
ldr r3, [fp, #-8]
sub r3, r3, #14
ldrb r3, [r3] @ zero_extendqisi2
mov r2, r3
ldr r3, [fp, #-8]
sub r3, r3, #13
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #8
orr r3, r2, r3
mov r1, r3
ldr r0, .L139+24
bl printf
.L135:
ldr r3, .L139
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L136
ldr r3, [fp, #-8]
sub r3, r3, #12
ldrb r3, [r3] @ zero_extendqisi2
mov r2, r3
ldr r3, [fp, #-8]
sub r3, r3, #11
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #8
orr r3, r2, r3
mov r1, r3
ldr r0, .L139+28
bl printf
.L136:
ldr r3, .L139
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L138
ldr r3, [fp, #-8]
sub r3, r3, #4
ldrb r3, [r3] @ zero_extendqisi2
mov r2, r3
ldr r3, [fp, #-8]
sub r3, r3, #3
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #8
orr r2, r2, r3
ldr r3, [fp, #-8]
sub r3, r3, #2
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #16
orr r2, r2, r3
ldr r3, [fp, #-8]
sub r3, r3, #1
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #24
orr r3, r2, r3
mov r1, r3
ldr r0, .L139+32
bl printf
.L138:
nop
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L140:
.align 2
.L139:
.word g_bQuiet
.word .LC65
.word .LC62
.word .LC66
.word .LC67
.word .LC68
.word .LC69
.word .LC70
.word .LC71
.size DumpSuffix, .-DumpSuffix
.section .rodata
.align 2
.LC72:
.ascii "Output file already exists.\000"
.align 2
.LC73:
.ascii "File %s exists. Overwrite? \000"
.align 2
.LC74:
.ascii "User chose not to overwrite output.\000"
.align 2
.LC75:
.ascii "Overwriting existing output file.\000"
.align 2
.LC76:
.ascii "wb\000"
.align 2
.LC77:
.ascii "Error opening output file for writing\000"
.align 2
.LC78:
.ascii "Writing %ld (0x%lx) bytes to output file.\012\000"
.align 2
.LC79:
.ascii "Error writing data to output file! Wrote %ld, reque"
.ascii "sted %ld\012\000"
.align 2
.LC80:
.ascii "Output file written successfully.\000"
.text
.align 2
.global WriteOutputFile
.syntax unified
.arm
.fpu softvfp
.type WriteOutputFile, %function
WriteOutputFile:
@ args = 0, pretend = 0, frame = 32
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #32
str r0, [fp, #-24]
str r1, [fp, #-28]
str r2, [fp, #-32]
ldr r3, .L154
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L142
ldr r1, .L154+4
ldr r0, [fp, #-24]
bl fopen
str r0, [fp, #-16]
ldr r3, [fp, #-16]
cmp r3, #0
beq .L142
ldr r3, .L154+8
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L143
ldr r0, .L154+12
bl puts
.L143:
ldr r0, [fp, #-16]
bl fclose
ldr r3, .L154+16
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L144
ldr r1, [fp, #-24]
ldr r0, .L154+20
bl printf
ldr r3, .L154+24
ldr r3, [r3]
mov r0, r3
bl getc
str r0, [fp, #-12]
ldr r3, [fp, #-12]
cmp r3, #121
beq .L145
ldr r3, [fp, #-12]
cmp r3, #89
beq .L145
ldr r3, .L154+8
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L146
ldr r0, .L154+28
bl puts
.L146:
mov r3, #6
b .L147
.L145:
ldr r0, .L154+32
bl puts
b .L142
.L144:
mov r3, #7
b .L147
.L142:
ldr r1, .L154+36
ldr r0, [fp, #-24]
bl fopen
str r0, [fp, #-16]
ldr r3, [fp, #-16]
cmp r3, #0
bne .L148
ldr r3, .L154+16
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L149
ldr r0, .L154+40
bl puts
.L149:
mov r3, #8
b .L147
.L148:
ldr r3, .L154+8
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L150
ldr r2, [fp, #-32]
ldr r1, [fp, #-32]
ldr r0, .L154+44
bl printf
.L150:
ldr r3, [fp, #-16]
ldr r2, [fp, #-32]
mov r1, #1
ldr r0, [fp, #-28]
bl fwrite
str r0, [fp, #-8]
ldr r0, [fp, #-16]
bl fclose
ldr r2, [fp, #-8]
ldr r3, [fp, #-32]
cmp r2, r3
beq .L151
ldr r3, .L154+16
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L152
ldr r2, [fp, #-32]
ldr r1, [fp, #-8]
ldr r0, .L154+48
bl printf
.L152:
mov r3, #9
b .L147
.L151:
ldr r3, .L154+16
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L153
ldr r0, .L154+52
bl puts
.L153:
mov r3, #0
.L147:
mov r0, r3
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L155:
.align 2
.L154:
.word g_bOverwrite
.word .LC45
.word g_bVerbose
.word .LC72
.word g_bQuiet
.word .LC73
.word stdin
.word .LC74
.word .LC75
.word .LC76
.word .LC77
.word .LC78
.word .LC79
.word .LC80
.size WriteOutputFile, .-WriteOutputFile
.section .rodata
.align 2
.LC81:
.ascii "Error reading input file.\000"
.align 2
.LC82:
.ascii "File prefix appears to be invalid or absent.\000"
.align 2
.LC83:
.ascii "DFU suffix appears to be invalid or absent.\000"
.align 2
.LC84:
.ascii "This does not appear to be a valid DFU-formatted fi"
.ascii "le.\000"
.align 2
.LC85:
.ascii "This file already contains a valid DFU wrapper.\000"
.align 2
.LC86:
.ascii "Use -f if you want to force the writing of another "
.ascii "wrapper.\000"
.align 2
.LC87:
.word __stack_chk_guard
.text
.align 2
.global main
.syntax unified
.arm
.fpu softvfp
.type main, %function
main:
@ args = 0, pretend = 0, frame = 40
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #40
str r0, [fp, #-40]
str r1, [fp, #-44]
ldr r3, .L182
ldr r3, [r3]
str r3, [fp, #-8]
mov r3,#0
bl InitCRC32Table
ldr r1, [fp, #-44]
ldr r0, [fp, #-40]
bl ParseCommandLine
str r0, [fp, #-28]
ldr r3, [fp, #-28]
cmp r3, #0
bne .L157
mov r3, #1
ldr r2, .L182
ldr r1, [r2]
ldr r2, [fp, #-8]
eors r1, r2, r1
mov r2, #0
beq .L180
b .L181
.L157:
bl DumpCommandLineParameters
ldr r3, .L182+4
ldr r3, [r3]
ldr r2, .L182+8
ldrb r1, [r2] @ zero_extendqisi2
sub r2, fp, #32
mov r0, r3
bl ReadInputFile
str r0, [fp, #-24]
ldr r3, [fp, #-24]
cmp r3, #0
bne .L159
ldr r3, .L182+12
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L160
ldr r0, .L182+16
bl puts
.L160:
mov r0, #1
bl exit
.L159:
ldr r3, .L182+8
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L161
mov r3, #8
b .L162
.L161:
mov r3, #0
.L162:
ldr r2, [fp, #-24]
add r3, r2, r3
str r3, [fp, #-20]
ldr r2, [fp, #-32]
ldr r3, .L182+8
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L163
mov r3, #16
b .L164
.L163:
mov r3, #0
.L164:
sub r3, r2, r3
ldr r2, [fp, #-24]
add r3, r2, r3
str r3, [fp, #-16]
ldr r1, [fp, #-16]
ldr r0, [fp, #-20]
bl IsPrefixValid
mov r3, r0
strb r3, [fp, #-34]
ldr r1, [fp, #-16]
ldr r0, [fp, #-20]
bl IsSuffixValid
mov r3, r0
strb r3, [fp, #-33]
ldr r3, .L182+20
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
beq .L165
ldrb r3, [fp, #-34] @ zero_extendqisi2
cmp r3, #0
bne .L166
ldr r3, .L182+24
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L167
ldr r0, .L182+28
bl puts
b .L167
.L166:
ldr r0, [fp, #-20]
bl DumpPrefix
.L167:
ldrb r3, [fp, #-33] @ zero_extendqisi2
cmp r3, #0
bne .L168
ldr r3, .L182+24
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L169
ldr r0, .L182+32
bl puts
b .L169
.L168:
ldr r0, [fp, #-16]
bl DumpSuffix
.L169:
ldrb r3, [fp, #-34] @ zero_extendqisi2
cmp r3, #0
beq .L170
ldrb r3, [fp, #-33] @ zero_extendqisi2
cmp r3, #0
bne .L171
.L170:
mov r3, #2
b .L172
.L171:
mov r3, #0
.L172:
str r3, [fp, #-28]
b .L173
.L165:
ldr r3, .L182+8
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L174
ldrb r3, [fp, #-34] @ zero_extendqisi2
cmp r3, #0
bne .L175
ldr r3, .L182+24
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L176
ldr r0, .L182+36
bl puts
.L176:
mov r3, #3
str r3, [fp, #-28]
b .L173
.L175:
ldr r3, .L182+40
ldr r0, [r3]
ldr r3, [fp, #-20]
add r1, r3, #8
ldr r3, [fp, #-20]
add r3, r3, #4
ldrb r3, [r3] @ zero_extendqisi2
mov r2, r3
ldr r3, [fp, #-20]
add r3, r3, #5
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #8
orr r2, r2, r3
ldr r3, [fp, #-20]
add r3, r3, #6
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #16
orr r2, r2, r3
ldr r3, [fp, #-20]
add r3, r3, #7
ldrb r3, [r3] @ zero_extendqisi2
lsl r3, r3, #24
orr r3, r2, r3
mov r2, r3
bl WriteOutputFile
str r0, [fp, #-28]
b .L173
.L174:
ldrb r3, [fp, #-34] @ zero_extendqisi2
cmp r3, #0
beq .L177
ldrb r3, [fp, #-33] @ zero_extendqisi2
cmp r3, #0
beq .L177
ldr r3, .L182+44
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L177
ldr r3, .L182+24
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L178
ldr r0, .L182+48
bl puts
.L178:
ldr r3, .L182+24
ldrb r3, [r3] @ zero_extendqisi2
cmp r3, #0
bne .L179
ldr r0, .L182+52
bl puts
.L179:
mov r3, #5
str r3, [fp, #-28]
b .L173
.L177:
ldr r3, .L182+56
ldr r3, [r3]
lsr r2, r3, #10
ldr r3, [fp, #-24]
add r3, r3, #2
and r2, r2, #255
strb r2, [r3]
ldr r3, .L182+56
ldr r3, [r3]
lsr r3, r3, #10
lsr r2, r3, #8
ldr r3, [fp, #-24]
add r3, r3, #3
and r2, r2, #255
strb r2, [r3]
ldr r3, [fp, #-32]
and r2, r3, #255
ldr r3, [fp, #-24]
add r3, r3, #4
sub r2, r2, #24
and r2, r2, #255
strb r2, [r3]
ldr r3, [fp, #-32]
sub r3, r3, #24
lsr r2, r3, #8
ldr r3, [fp, #-24]
add r3, r3, #5
and r2, r2, #255
strb r2, [r3]
ldr r3, [fp, #-32]
sub r3, r3, #24
lsr r2, r3, #16
ldr r3, [fp, #-24]
add r3, r3, #6
and r2, r2, #255
strb r2, [r3]
ldr r3, [fp, #-32]
sub r3, r3, #24
lsr r2, r3, #24
ldr r3, [fp, #-24]
add r3, r3, #7
and r2, r2, #255
strb r2, [r3]
ldr r3, [fp, #-32]
ldr r2, [fp, #-24]
add r3, r2, r3
str r3, [fp, #-16]
ldr r3, .L182+60
ldrh r2, [r3]
ldr r3, [fp, #-16]
sub r3, r3, #16
and r2, r2, #255
strb r2, [r3]
ldr r3, .L182+60
ldrh r3, [r3]
lsr r3, r3, #8
lsl r3, r3, #16
lsr r2, r3, #16
ldr r3, [fp, #-16]
sub r3, r3, #15
and r2, r2, #255
strb r2, [r3]
ldr r3, .L182+64
ldrh r2, [r3]
ldr r3, [fp, #-16]
sub r3, r3, #14
and r2, r2, #255
strb r2, [r3]
ldr r3, .L182+64
ldrh r3, [r3]
lsr r3, r3, #8
lsl r3, r3, #16
lsr r2, r3, #16
ldr r3, [fp, #-16]
sub r3, r3, #13
and r2, r2, #255
strb r2, [r3]
ldr r3, .L182+68
ldrh r2, [r3]
ldr r3, [fp, #-16]
sub r3, r3, #12
and r2, r2, #255
strb r2, [r3]
ldr r3, .L182+68
ldrh r3, [r3]
lsr r3, r3, #8
lsl r3, r3, #16
lsr r2, r3, #16
ldr r3, [fp, #-16]
sub r3, r3, #11
and r2, r2, #255
strb r2, [r3]
ldr r3, [fp, #-32]
sub r3, r3, #4
mov r1, r3
ldr r0, [fp, #-24]
bl CalculateCRC32
str r0, [fp, #-12]
ldr r3, [fp, #-16]
sub r3, r3, #4
ldr r2, [fp, #-12]
and r2, r2, #255
strb r2, [r3]
ldr r3, [fp, #-12]
lsr r2, r3, #8
ldr r3, [fp, #-16]
sub r3, r3, #3
and r2, r2, #255
strb r2, [r3]
ldr r3, [fp, #-12]
lsr r2, r3, #16
ldr r3, [fp, #-16]
sub r3, r3, #2
and r2, r2, #255
strb r2, [r3]
ldr r3, [fp, #-12]
lsr r2, r3, #24
ldr r3, [fp, #-16]
sub r3, r3, #1
and r2, r2, #255
strb r2, [r3]
ldr r3, .L182+40
ldr r3, [r3]
ldr r2, [fp, #-32]
ldr r1, [fp, #-24]
mov r0, r3
bl WriteOutputFile
str r0, [fp, #-28]
.L173:
ldr r0, [fp, #-24]
bl free
ldr r0, [fp, #-28]
bl exit
.L181:
bl __stack_chk_fail
.L180:
mov r0, r3
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L183:
.align 2
.L182:
.word .LC87
.word g_pszInput
.word g_bAdd
.word g_bVerbose
.word .LC81
.word g_bCheck
.word g_bQuiet
.word .LC82
.word .LC83
.word .LC84
.word g_pszOutput
.word g_bForce
.word .LC85
.word .LC86
.word g_ulAddress
.word g_usDeviceID
.word g_usProductID
.word g_usVendorID
.size main, .-main
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
.section .note.GNU-stack,"",%progbits
|
.file "320900.c"
.intel_syntax noprefix
.text
.section .rodata
.LC0:
.string "Hello"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 16
mov DWORD PTR -4[rbp], edi
mov QWORD PTR -16[rbp], rsi
lea rdi, .LC0[rip]
call puts@PLT
mov eax, 5
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:
| .arch armv5t
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 0
.eabi_attribute 18, 4
.file "320900.c"
.text
.section .rodata
.align 2
.LC0:
.ascii "Hello\000"
.text
.align 2
.global main
.syntax unified
.arm
.fpu softvfp
.type main, %function
main:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #8
str r0, [fp, #-8]
str r1, [fp, #-12]
ldr r0, .L3
bl puts
mov r3, #5
mov r0, r3
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L4:
.align 2
.L3:
.word .LC0
.size main, .-main
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
.section .note.GNU-stack,"",%progbits
|
.file "264922.c"
.intel_syntax noprefix
.text
.data
.align 32
.type a, @object
.size a, 72
a:
.long 0
.long 1074266112
.long 0
.long -1072168960
.long 0
.long 1075576832
.long 0
.long 1075970048
.long 0
.long 0
.long 0
.long -1072431104
.long 0
.long 1075052544
.long 0
.long -1071644672
.long 0
.long 1075314688
.globl b
.bss
.align 32
.type b, @object
.size b, 72
b:
.zero 72
.globl c
.align 32
.type c, @object
.size c, 72
c:
.zero 72
.globl aa
.align 32
.type aa, @object
.size aa, 72
aa:
.zero 72
.globl a_i
.align 32
.type a_i, @object
.size a_i, 72
a_i:
.zero 72
.globl e
.align 32
.type e, @object
.size e, 72
e:
.zero 72
.globl det
.align 8
.type det, @object
.size det, 8
det:
.zero 8
.text
.globl minver_fabs
.type minver_fabs, @function
minver_fabs:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
movsd QWORD PTR -24[rbp], xmm0
movsd xmm0, QWORD PTR -24[rbp]
pxor xmm1, xmm1
comisd xmm0, xmm1
jb .L7
movsd xmm0, QWORD PTR -24[rbp]
movsd QWORD PTR -8[rbp], xmm0
jmp .L4
.L7:
movsd xmm0, QWORD PTR -24[rbp]
movq xmm1, QWORD PTR .LC1[rip]
xorpd xmm0, xmm1
movsd QWORD PTR -8[rbp], xmm0
.L4:
movsd xmm0, QWORD PTR -8[rbp]
movq rax, xmm0
movq xmm0, rax
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size minver_fabs, .-minver_fabs
.globl main
.type main, @function
main:
.LFB1:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 16
movsd xmm0, QWORD PTR .LC2[rip]
movsd QWORD PTR -8[rbp], xmm0
mov DWORD PTR -16[rbp], 0
jmp .L9
.L12:
mov DWORD PTR -12[rbp], 0
jmp .L10
.L11:
mov eax, DWORD PTR -12[rbp]
movsx rcx, eax
mov eax, DWORD PTR -16[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd xmm0, QWORD PTR [rdx+rax]
mov eax, DWORD PTR -12[rbp]
movsx rcx, eax
mov eax, DWORD PTR -16[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, aa[rip]
movsd QWORD PTR [rdx+rax], xmm0
add DWORD PTR -12[rbp], 1
.L10:
cmp DWORD PTR -12[rbp], 2
jle .L11
add DWORD PTR -16[rbp], 1
.L9:
cmp DWORD PTR -16[rbp], 2
jle .L12
mov rax, QWORD PTR -8[rbp]
movq xmm0, rax
mov esi, 3
mov edi, 3
call minver
mov DWORD PTR -16[rbp], 0
jmp .L13
.L16:
mov DWORD PTR -12[rbp], 0
jmp .L14
.L15:
mov eax, DWORD PTR -12[rbp]
movsx rcx, eax
mov eax, DWORD PTR -16[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd xmm0, QWORD PTR [rdx+rax]
mov eax, DWORD PTR -12[rbp]
movsx rcx, eax
mov eax, DWORD PTR -16[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a_i[rip]
movsd QWORD PTR [rdx+rax], xmm0
add DWORD PTR -12[rbp], 1
.L14:
cmp DWORD PTR -12[rbp], 2
jle .L15
add DWORD PTR -16[rbp], 1
.L13:
cmp DWORD PTR -16[rbp], 2
jle .L16
mov ecx, 3
mov edx, 3
mov esi, 3
mov edi, 3
call mmul
mov eax, 0
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size main, .-main
.globl mmul
.type mmul, @function
mmul:
.LFB2:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov DWORD PTR -36[rbp], edi
mov DWORD PTR -40[rbp], esi
mov DWORD PTR -44[rbp], edx
mov DWORD PTR -48[rbp], ecx
mov eax, DWORD PTR -36[rbp]
mov DWORD PTR -16[rbp], eax
mov eax, DWORD PTR -48[rbp]
mov DWORD PTR -12[rbp], eax
cmp DWORD PTR -16[rbp], 0
jle .L19
cmp DWORD PTR -44[rbp], 0
jle .L19
cmp DWORD PTR -12[rbp], 0
jle .L19
mov eax, DWORD PTR -40[rbp]
cmp eax, DWORD PTR -44[rbp]
je .L20
.L19:
mov eax, 999
jmp .L21
.L20:
mov DWORD PTR -28[rbp], 0
jmp .L22
.L27:
mov DWORD PTR -24[rbp], 0
jmp .L23
.L26:
pxor xmm0, xmm0
movsd QWORD PTR -8[rbp], xmm0
mov DWORD PTR -20[rbp], 0
jmp .L24
.L25:
mov eax, DWORD PTR -20[rbp]
movsx rcx, eax
mov eax, DWORD PTR -28[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd xmm1, QWORD PTR [rdx+rax]
mov eax, DWORD PTR -24[rbp]
movsx rcx, eax
mov eax, DWORD PTR -20[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, b[rip]
movsd xmm0, QWORD PTR [rdx+rax]
mulsd xmm0, xmm1
movsd xmm1, QWORD PTR -8[rbp]
addsd xmm0, xmm1
movsd QWORD PTR -8[rbp], xmm0
add DWORD PTR -20[rbp], 1
.L24:
mov eax, DWORD PTR -20[rbp]
cmp eax, DWORD PTR -44[rbp]
jl .L25
mov eax, DWORD PTR -24[rbp]
movsx rcx, eax
mov eax, DWORD PTR -28[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, c[rip]
movsd xmm0, QWORD PTR -8[rbp]
movsd QWORD PTR [rdx+rax], xmm0
add DWORD PTR -24[rbp], 1
.L23:
mov eax, DWORD PTR -24[rbp]
cmp eax, DWORD PTR -12[rbp]
jl .L26
add DWORD PTR -28[rbp], 1
.L22:
mov eax, DWORD PTR -28[rbp]
cmp eax, DWORD PTR -16[rbp]
jl .L27
mov eax, 0
.L21:
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE2:
.size mmul, .-mmul
.globl minver
.type minver, @function
minver:
.LFB3:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 2112
mov DWORD PTR -2100[rbp], edi
mov DWORD PTR -2104[rbp], esi
movsd QWORD PTR -2112[rbp], xmm0
mov rax, QWORD PTR fs:40
mov QWORD PTR -8[rbp], rax
xor eax, eax
cmp DWORD PTR -2100[rbp], 1
jle .L29
cmp DWORD PTR -2100[rbp], 500
jg .L29
pxor xmm0, xmm0
comisd xmm0, QWORD PTR -2112[rbp]
jb .L66
.L29:
mov eax, 999
jmp .L61
.L66:
movsd xmm0, QWORD PTR .LC3[rip]
movsd QWORD PTR -2040[rbp], xmm0
mov DWORD PTR -2092[rbp], 0
jmp .L33
.L34:
mov eax, DWORD PTR -2092[rbp]
cdqe
mov edx, DWORD PTR -2092[rbp]
mov DWORD PTR -2016[rbp+rax*4], edx
add DWORD PTR -2092[rbp], 1
.L33:
mov eax, DWORD PTR -2092[rbp]
cmp eax, DWORD PTR -2100[rbp]
jl .L34
mov DWORD PTR -2084[rbp], 0
jmp .L35
.L54:
pxor xmm0, xmm0
movsd QWORD PTR -2048[rbp], xmm0
mov eax, DWORD PTR -2084[rbp]
mov DWORD PTR -2092[rbp], eax
jmp .L36
.L39:
mov eax, DWORD PTR -2084[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2092[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
mov rax, QWORD PTR [rdx+rax]
movq xmm0, rax
call minver_fabs
movq rax, xmm0
mov QWORD PTR -2056[rbp], rax
movsd xmm0, QWORD PTR -2056[rbp]
comisd xmm0, QWORD PTR -2048[rbp]
jbe .L37
movsd xmm0, QWORD PTR -2056[rbp]
movsd QWORD PTR -2048[rbp], xmm0
mov eax, DWORD PTR -2092[rbp]
mov DWORD PTR -2080[rbp], eax
.L37:
add DWORD PTR -2092[rbp], 1
.L36:
mov eax, DWORD PTR -2092[rbp]
cmp eax, DWORD PTR -2100[rbp]
jl .L39
mov eax, DWORD PTR -2084[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2080[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd xmm0, QWORD PTR [rdx+rax]
movsd QWORD PTR -2032[rbp], xmm0
mov rax, QWORD PTR -2032[rbp]
movq xmm0, rax
call minver_fabs
movq rax, xmm0
mov QWORD PTR -2024[rbp], rax
movsd xmm0, QWORD PTR -2112[rbp]
comisd xmm0, QWORD PTR -2024[rbp]
jb .L67
movsd xmm0, QWORD PTR -2040[rbp]
movsd QWORD PTR det[rip], xmm0
mov eax, 1
jmp .L61
.L67:
movsd xmm0, QWORD PTR -2040[rbp]
mulsd xmm0, QWORD PTR -2032[rbp]
movsd QWORD PTR -2040[rbp], xmm0
mov eax, DWORD PTR -2084[rbp]
imul eax, DWORD PTR -2104[rbp]
mov DWORD PTR -2072[rbp], eax
mov eax, DWORD PTR -2080[rbp]
imul eax, DWORD PTR -2104[rbp]
mov DWORD PTR -2060[rbp], eax
mov eax, DWORD PTR -2080[rbp]
cmp eax, DWORD PTR -2084[rbp]
je .L42
movsd xmm0, QWORD PTR -2056[rbp]
movq xmm1, QWORD PTR .LC1[rip]
xorpd xmm0, xmm1
movsd QWORD PTR -2040[rbp], xmm0
mov eax, DWORD PTR -2084[rbp]
cdqe
mov eax, DWORD PTR -2016[rbp+rax*4]
mov DWORD PTR -2076[rbp], eax
mov eax, DWORD PTR -2080[rbp]
cdqe
mov edx, DWORD PTR -2016[rbp+rax*4]
mov eax, DWORD PTR -2084[rbp]
cdqe
mov DWORD PTR -2016[rbp+rax*4], edx
mov eax, DWORD PTR -2080[rbp]
cdqe
mov edx, DWORD PTR -2076[rbp]
mov DWORD PTR -2016[rbp+rax*4], edx
mov DWORD PTR -2088[rbp], 0
jmp .L43
.L44:
mov edx, DWORD PTR -2072[rbp]
mov eax, DWORD PTR -2088[rbp]
add eax, edx
mov DWORD PTR -2068[rbp], eax
mov edx, DWORD PTR -2060[rbp]
mov eax, DWORD PTR -2088[rbp]
add eax, edx
mov DWORD PTR -2064[rbp], eax
mov eax, DWORD PTR -2088[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2084[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd xmm0, QWORD PTR [rdx+rax]
movsd QWORD PTR -2056[rbp], xmm0
mov eax, DWORD PTR -2088[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2080[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd xmm0, QWORD PTR [rdx+rax]
mov eax, DWORD PTR -2088[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2084[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd QWORD PTR [rdx+rax], xmm0
mov eax, DWORD PTR -2088[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2080[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd xmm0, QWORD PTR -2056[rbp]
movsd QWORD PTR [rdx+rax], xmm0
add DWORD PTR -2088[rbp], 1
.L43:
mov eax, DWORD PTR -2088[rbp]
cmp eax, DWORD PTR -2100[rbp]
jl .L44
.L42:
mov DWORD PTR -2092[rbp], 0
jmp .L45
.L46:
mov eax, DWORD PTR -2092[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2084[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd xmm0, QWORD PTR [rdx+rax]
divsd xmm0, QWORD PTR -2032[rbp]
mov eax, DWORD PTR -2092[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2084[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd QWORD PTR [rdx+rax], xmm0
add DWORD PTR -2092[rbp], 1
.L45:
mov eax, DWORD PTR -2092[rbp]
cmp eax, DWORD PTR -2100[rbp]
jl .L46
mov DWORD PTR -2092[rbp], 0
jmp .L47
.L53:
mov eax, DWORD PTR -2092[rbp]
cmp eax, DWORD PTR -2084[rbp]
je .L48
mov eax, DWORD PTR -2092[rbp]
imul eax, DWORD PTR -2104[rbp]
mov DWORD PTR -2060[rbp], eax
mov edx, DWORD PTR -2060[rbp]
mov eax, DWORD PTR -2084[rbp]
add eax, edx
mov DWORD PTR -2068[rbp], eax
mov eax, DWORD PTR -2084[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2092[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd xmm0, QWORD PTR [rdx+rax]
movsd QWORD PTR -2056[rbp], xmm0
pxor xmm0, xmm0
ucomisd xmm0, QWORD PTR -2056[rbp]
jp .L65
pxor xmm0, xmm0
comisd xmm0, QWORD PTR -2056[rbp]
je .L48
.L65:
mov DWORD PTR -2088[rbp], 0
jmp .L50
.L52:
mov eax, DWORD PTR -2088[rbp]
cmp eax, DWORD PTR -2084[rbp]
je .L51
mov eax, DWORD PTR -2088[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2092[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd xmm0, QWORD PTR [rdx+rax]
mov eax, DWORD PTR -2088[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2084[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd xmm1, QWORD PTR [rdx+rax]
mulsd xmm1, QWORD PTR -2056[rbp]
subsd xmm0, xmm1
mov eax, DWORD PTR -2088[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2092[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd QWORD PTR [rdx+rax], xmm0
.L51:
add DWORD PTR -2088[rbp], 1
.L50:
mov eax, DWORD PTR -2088[rbp]
cmp eax, DWORD PTR -2100[rbp]
jl .L52
movsd xmm0, QWORD PTR -2056[rbp]
movq xmm1, QWORD PTR .LC1[rip]
xorpd xmm0, xmm1
divsd xmm0, QWORD PTR -2032[rbp]
mov eax, DWORD PTR -2084[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2092[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd QWORD PTR [rdx+rax], xmm0
.L48:
add DWORD PTR -2092[rbp], 1
.L47:
mov eax, DWORD PTR -2092[rbp]
cmp eax, DWORD PTR -2100[rbp]
jl .L53
movsd xmm0, QWORD PTR .LC3[rip]
divsd xmm0, QWORD PTR -2032[rbp]
mov eax, DWORD PTR -2084[rbp]
cdqe
sal rax, 5
mov rdx, rax
lea rax, a[rip]
movsd QWORD PTR [rdx+rax], xmm0
add DWORD PTR -2084[rbp], 1
.L35:
mov eax, DWORD PTR -2084[rbp]
cmp eax, DWORD PTR -2100[rbp]
jl .L54
mov DWORD PTR -2092[rbp], 0
jmp .L55
.L60:
mov eax, DWORD PTR -2092[rbp]
cdqe
mov eax, DWORD PTR -2016[rbp+rax*4]
mov DWORD PTR -2084[rbp], eax
mov eax, DWORD PTR -2084[rbp]
cmp eax, DWORD PTR -2092[rbp]
je .L69
mov eax, DWORD PTR -2084[rbp]
cdqe
mov eax, DWORD PTR -2016[rbp+rax*4]
mov DWORD PTR -2076[rbp], eax
mov eax, DWORD PTR -2092[rbp]
cdqe
mov edx, DWORD PTR -2016[rbp+rax*4]
mov eax, DWORD PTR -2084[rbp]
cdqe
mov DWORD PTR -2016[rbp+rax*4], edx
mov eax, DWORD PTR -2092[rbp]
cdqe
mov edx, DWORD PTR -2076[rbp]
mov DWORD PTR -2016[rbp+rax*4], edx
mov DWORD PTR -2088[rbp], 0
jmp .L58
.L59:
mov eax, DWORD PTR -2088[rbp]
imul eax, DWORD PTR -2104[rbp]
mov DWORD PTR -2072[rbp], eax
mov edx, DWORD PTR -2072[rbp]
mov eax, DWORD PTR -2092[rbp]
add eax, edx
mov DWORD PTR -2068[rbp], eax
mov edx, DWORD PTR -2072[rbp]
mov eax, DWORD PTR -2084[rbp]
add eax, edx
mov DWORD PTR -2064[rbp], eax
mov eax, DWORD PTR -2092[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2084[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd xmm0, QWORD PTR [rdx+rax]
movsd QWORD PTR -2056[rbp], xmm0
mov eax, DWORD PTR -2084[rbp]
cdqe
sal rax, 5
mov rdx, rax
lea rax, a[rip]
movsd xmm0, QWORD PTR [rdx+rax]
mov eax, DWORD PTR -2092[rbp]
movsx rcx, eax
mov eax, DWORD PTR -2084[rbp]
movsx rdx, eax
mov rax, rdx
add rax, rax
add rax, rdx
add rax, rcx
lea rdx, 0[0+rax*8]
lea rax, a[rip]
movsd QWORD PTR [rdx+rax], xmm0
mov eax, DWORD PTR -2084[rbp]
cdqe
sal rax, 5
mov rdx, rax
lea rax, a[rip]
movsd xmm0, QWORD PTR -2056[rbp]
movsd QWORD PTR [rdx+rax], xmm0
add DWORD PTR -2088[rbp], 1
.L58:
mov eax, DWORD PTR -2088[rbp]
cmp eax, DWORD PTR -2100[rbp]
jl .L59
jmp .L60
.L69:
nop
add DWORD PTR -2092[rbp], 1
.L55:
mov eax, DWORD PTR -2092[rbp]
cmp eax, DWORD PTR -2100[rbp]
jl .L60
movsd xmm0, QWORD PTR -2040[rbp]
movsd QWORD PTR det[rip], xmm0
mov eax, 0
.L61:
mov rsi, QWORD PTR -8[rbp]
sub rsi, QWORD PTR fs:40
je .L62
call __stack_chk_fail@PLT
.L62:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE3:
.size minver, .-minver
.section .rodata
.align 16
.LC1:
.long 0
.long -2147483648
.long 0
.long 0
.align 8
.LC2:
.long -1598689907
.long 1051772663
.align 8
.LC3:
.long 0
.long 1072693248
.ident "GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:
| .arch armv5t
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 0
.eabi_attribute 18, 4
.file "264922.c"
.text
.data
.align 3
.type a, %object
.size a, 72
a:
.word 0
.word 1074266112
.word 0
.word -1072168960
.word 0
.word 1075576832
.word 0
.word 1075970048
.word 0
.word 0
.word 0
.word -1072431104
.word 0
.word 1075052544
.word 0
.word -1071644672
.word 0
.word 1075314688
.comm b,72,8
.comm c,72,8
.comm aa,72,8
.comm a_i,72,8
.comm e,72,8
.comm det,8,8
.global __aeabi_dcmpge
.text
.align 2
.global minver_fabs
.syntax unified
.arm
.fpu softvfp
.type minver_fabs, %function
minver_fabs:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
push {r4, r5, fp, lr}
add fp, sp, #12
sub sp, sp, #16
str r0, [fp, #-28]
str r1, [fp, #-24]
mov r2, #0
mov r3, #0
sub r1, fp, #28
ldmia r1, {r0-r1}
bl __aeabi_dcmpge
mov r3, r0
cmp r3, #0
beq .L7
sub r3, fp, #28
ldmia r3, {r2-r3}
str r2, [fp, #-20]
str r3, [fp, #-16]
b .L4
.L7:
ldr r4, [fp, #-28]
ldr r3, [fp, #-24]
eor r5, r3, #-2147483648
str r4, [fp, #-20]
str r5, [fp, #-16]
.L4:
sub r3, fp, #20
ldmia r3, {r2-r3}
mov r0, r2
mov r1, r3
sub sp, fp, #12
@ sp needed
pop {r4, r5, fp, pc}
.size minver_fabs, .-minver_fabs
.align 2
.global main
.syntax unified
.arm
.fpu softvfp
.type main, %function
main:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #16
ldr r2, .L18
ldr r3, .L18+4
str r2, [fp, #-12]
str r3, [fp, #-8]
mov r3, #0
str r3, [fp, #-20]
b .L9
.L12:
mov r3, #0
str r3, [fp, #-16]
b .L10
.L11:
ldr r1, .L18+8
ldr r2, [fp, #-20]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-16]
add r3, r3, r2
lsl r3, r3, #3
add r3, r1, r3
ldmia r3, {r0-r1}
ldr ip, .L18+12
ldr r2, [fp, #-20]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-16]
add r3, r3, r2
lsl r3, r3, #3
add r3, ip, r3
stm r3, {r0-r1}
ldr r3, [fp, #-16]
add r3, r3, #1
str r3, [fp, #-16]
.L10:
ldr r3, [fp, #-16]
cmp r3, #2
ble .L11
ldr r3, [fp, #-20]
add r3, r3, #1
str r3, [fp, #-20]
.L9:
ldr r3, [fp, #-20]
cmp r3, #2
ble .L12
sub r3, fp, #12
ldmia r3, {r2-r3}
mov r1, #3
mov r0, #3
bl minver
mov r3, #0
str r3, [fp, #-20]
b .L13
.L16:
mov r3, #0
str r3, [fp, #-16]
b .L14
.L15:
ldr r1, .L18+8
ldr r2, [fp, #-20]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-16]
add r3, r3, r2
lsl r3, r3, #3
add r3, r1, r3
ldmia r3, {r0-r1}
ldr ip, .L18+16
ldr r2, [fp, #-20]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-16]
add r3, r3, r2
lsl r3, r3, #3
add r3, ip, r3
stm r3, {r0-r1}
ldr r3, [fp, #-16]
add r3, r3, #1
str r3, [fp, #-16]
.L14:
ldr r3, [fp, #-16]
cmp r3, #2
ble .L15
ldr r3, [fp, #-20]
add r3, r3, #1
str r3, [fp, #-20]
.L13:
ldr r3, [fp, #-20]
cmp r3, #2
ble .L16
mov r3, #3
mov r2, #3
mov r1, #3
mov r0, #3
bl mmul
mov r3, #0
mov r0, r3
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L19:
.align 2
.L18:
.word -1598689907
.word 1051772663
.word a
.word aa
.word a_i
.size main, .-main
.global __aeabi_dmul
.global __aeabi_dadd
.align 2
.global mmul
.syntax unified
.arm
.fpu softvfp
.type mmul, %function
mmul:
@ args = 0, pretend = 0, frame = 48
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #48
str r0, [fp, #-40]
str r1, [fp, #-44]
str r2, [fp, #-48]
str r3, [fp, #-52]
ldr r3, [fp, #-40]
str r3, [fp, #-20]
ldr r3, [fp, #-52]
str r3, [fp, #-16]
ldr r3, [fp, #-20]
cmp r3, #0
ble .L21
ldr r3, [fp, #-48]
cmp r3, #0
ble .L21
ldr r3, [fp, #-16]
cmp r3, #0
ble .L21
ldr r2, [fp, #-44]
ldr r3, [fp, #-48]
cmp r2, r3
beq .L22
.L21:
ldr r3, .L30
b .L23
.L22:
mov r3, #0
str r3, [fp, #-32]
b .L24
.L29:
mov r3, #0
str r3, [fp, #-28]
b .L25
.L28:
mov r2, #0
mov r3, #0
str r2, [fp, #-12]
str r3, [fp, #-8]
mov r3, #0
str r3, [fp, #-24]
b .L26
.L27:
ldr r1, .L30+4
ldr r2, [fp, #-32]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-24]
add r3, r3, r2
lsl r3, r3, #3
add r3, r1, r3
ldmia r3, {r0-r1}
ldr ip, .L30+8
ldr r2, [fp, #-24]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-28]
add r3, r3, r2
lsl r3, r3, #3
add r3, ip, r3
ldmia r3, {r2-r3}
bl __aeabi_dmul
mov r2, r0
mov r3, r1
sub r1, fp, #12
ldmia r1, {r0-r1}
bl __aeabi_dadd
mov r2, r0
mov r3, r1
str r2, [fp, #-12]
str r3, [fp, #-8]
ldr r3, [fp, #-24]
add r3, r3, #1
str r3, [fp, #-24]
.L26:
ldr r2, [fp, #-24]
ldr r3, [fp, #-48]
cmp r2, r3
blt .L27
ldr r1, .L30+12
ldr r2, [fp, #-32]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-28]
add r3, r3, r2
lsl r3, r3, #3
add r1, r1, r3
sub r3, fp, #12
ldmia r3, {r2-r3}
stm r1, {r2-r3}
ldr r3, [fp, #-28]
add r3, r3, #1
str r3, [fp, #-28]
.L25:
ldr r2, [fp, #-28]
ldr r3, [fp, #-16]
cmp r2, r3
blt .L28
ldr r3, [fp, #-32]
add r3, r3, #1
str r3, [fp, #-32]
.L24:
ldr r2, [fp, #-32]
ldr r3, [fp, #-20]
cmp r2, r3
blt .L29
mov r3, #0
.L23:
mov r0, r3
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L31:
.align 2
.L30:
.word 999
.word a
.word b
.word c
.size mmul, .-mmul
.global __aeabi_dcmple
.global __aeabi_dcmpgt
.global __aeabi_ddiv
.global __aeabi_dcmpeq
.global __aeabi_dsub
.section .rodata
.align 2
.LC0:
.word __stack_chk_guard
.text
.align 2
.global minver
.syntax unified
.arm
.fpu softvfp
.type minver, %function
minver:
@ args = 0, pretend = 0, frame = 2104
@ frame_needed = 1, uses_anonymous_args = 0
push {r4, r5, r6, r7, r8, r9, fp, lr}
add fp, sp, #28
sub sp, sp, #2096
sub sp, sp, #8
str r0, [fp, #-2120]
str r1, [fp, #-2124]
str r2, [fp, #-2132]
str r3, [fp, #-2128]
ldr r3, .L74
ldr r3, [r3]
str r3, [fp, #-32]
mov r3,#0
ldr r3, [fp, #-2120]
cmp r3, #1
ble .L33
ldr r3, [fp, #-2120]
cmp r3, #500
bgt .L33
mov r2, #0
mov r3, #0
ldr r0, [fp, #-2132]
ldr r1, [fp, #-2128]
bl __aeabi_dcmple
mov r3, r0
cmp r3, #0
beq .L70
.L33:
ldr r3, .L74+4
b .L65
.L70:
mov r2, #0
ldr r3, .L74+8
str r2, [fp, #-2060]
str r3, [fp, #-2056]
mov r3, #0
str r3, [fp, #-2112]
b .L37
.L38:
ldr r3, [fp, #-2112]
lsl r3, r3, #2
sub r2, fp, #28
add r3, r2, r3
ldr r2, [fp, #-2112]
str r2, [r3, #-2004]
ldr r3, [fp, #-2112]
add r3, r3, #1
str r3, [fp, #-2112]
.L37:
ldr r2, [fp, #-2112]
ldr r3, [fp, #-2120]
cmp r2, r3
blt .L38
mov r3, #0
str r3, [fp, #-2104]
b .L39
.L58:
mov r2, #0
mov r3, #0
str r2, [fp, #-2068]
str r3, [fp, #-2064]
ldr r3, [fp, #-2104]
str r3, [fp, #-2112]
b .L40
.L43:
ldr r1, .L74+12
ldr r2, [fp, #-2112]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2104]
add r3, r3, r2
lsl r3, r3, #3
add r3, r1, r3
ldmia r3, {r2-r3}
mov r0, r2
mov r1, r3
bl minver_fabs
str r0, [fp, #-2076]
str r1, [fp, #-2072]
ldr r2, [fp, #-2068]
ldr r3, [fp, #-2064]
ldr r0, [fp, #-2076]
ldr r1, [fp, #-2072]
bl __aeabi_dcmpgt
mov r3, r0
cmp r3, #0
beq .L41
ldr r2, [fp, #-2076]
ldr r3, [fp, #-2072]
str r2, [fp, #-2068]
str r3, [fp, #-2064]
ldr r3, [fp, #-2112]
str r3, [fp, #-2100]
.L41:
ldr r3, [fp, #-2112]
add r3, r3, #1
str r3, [fp, #-2112]
.L40:
ldr r2, [fp, #-2112]
ldr r3, [fp, #-2120]
cmp r2, r3
blt .L43
ldr r1, .L74+12
ldr r2, [fp, #-2100]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2104]
add r3, r3, r2
lsl r3, r3, #3
add r3, r1, r3
ldmia r3, {r2-r3}
str r2, [fp, #-2052]
str r3, [fp, #-2048]
ldr r0, [fp, #-2052]
ldr r1, [fp, #-2048]
bl minver_fabs
str r0, [fp, #-2044]
str r1, [fp, #-2040]
ldr r2, [fp, #-2132]
ldr r3, [fp, #-2128]
ldr r0, [fp, #-2044]
ldr r1, [fp, #-2040]
bl __aeabi_dcmple
mov r3, r0
cmp r3, #0
beq .L71
ldr r1, .L74+16
ldr r2, [fp, #-2060]
ldr r3, [fp, #-2056]
stm r1, {r2-r3}
mov r3, #1
b .L65
.L71:
ldr r2, [fp, #-2052]
ldr r3, [fp, #-2048]
ldr r0, [fp, #-2060]
ldr r1, [fp, #-2056]
bl __aeabi_dmul
mov r2, r0
mov r3, r1
str r2, [fp, #-2060]
str r3, [fp, #-2056]
ldr r3, [fp, #-2104]
ldr r2, [fp, #-2124]
mul r3, r2, r3
str r3, [fp, #-2092]
ldr r3, [fp, #-2100]
ldr r2, [fp, #-2124]
mul r3, r2, r3
str r3, [fp, #-2080]
ldr r2, [fp, #-2100]
ldr r3, [fp, #-2104]
cmp r2, r3
beq .L46
ldr r4, [fp, #-2076]
ldr r3, [fp, #-2072]
eor r5, r3, #-2147483648
str r4, [fp, #-2060]
str r5, [fp, #-2056]
ldr r3, [fp, #-2104]
lsl r3, r3, #2
sub r2, fp, #28
add r3, r2, r3
ldr r3, [r3, #-2004]
str r3, [fp, #-2096]
ldr r3, [fp, #-2100]
lsl r3, r3, #2
sub r2, fp, #28
add r3, r2, r3
ldr r2, [r3, #-2004]
ldr r3, [fp, #-2104]
lsl r3, r3, #2
sub r1, fp, #28
add r3, r1, r3
str r2, [r3, #-2004]
ldr r3, [fp, #-2100]
lsl r3, r3, #2
sub r2, fp, #28
add r3, r2, r3
ldr r2, [fp, #-2096]
str r2, [r3, #-2004]
mov r3, #0
str r3, [fp, #-2108]
b .L47
.L48:
ldr r2, [fp, #-2092]
ldr r3, [fp, #-2108]
add r3, r2, r3
str r3, [fp, #-2088]
ldr r2, [fp, #-2080]
ldr r3, [fp, #-2108]
add r3, r2, r3
str r3, [fp, #-2084]
ldr r1, .L74+12
ldr r2, [fp, #-2104]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2108]
add r3, r3, r2
lsl r3, r3, #3
add r3, r1, r3
ldmia r3, {r2-r3}
str r2, [fp, #-2076]
str r3, [fp, #-2072]
ldr r1, .L74+12
ldr r2, [fp, #-2100]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2108]
add r3, r3, r2
lsl r3, r3, #3
add r3, r1, r3
ldmia r3, {r0-r1}
ldr ip, .L74+12
ldr r2, [fp, #-2104]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2108]
add r3, r3, r2
lsl r3, r3, #3
add r3, ip, r3
stm r3, {r0-r1}
ldr r1, .L74+12
ldr r2, [fp, #-2100]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2108]
add r3, r3, r2
lsl r3, r3, #3
add r1, r1, r3
ldr r2, [fp, #-2076]
ldr r3, [fp, #-2072]
stm r1, {r2-r3}
ldr r3, [fp, #-2108]
add r3, r3, #1
str r3, [fp, #-2108]
.L47:
ldr r2, [fp, #-2108]
ldr r3, [fp, #-2120]
cmp r2, r3
blt .L48
.L46:
mov r3, #0
str r3, [fp, #-2112]
b .L49
.L50:
ldr r1, .L74+12
ldr r2, [fp, #-2104]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2112]
add r3, r3, r2
lsl r3, r3, #3
add r3, r1, r3
ldmia r3, {r0-r1}
ldr r2, [fp, #-2052]
ldr r3, [fp, #-2048]
bl __aeabi_ddiv
mov r2, r0
mov r3, r1
mov r0, r2
mov r1, r3
ldr ip, .L74+12
ldr r2, [fp, #-2104]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2112]
add r3, r3, r2
lsl r3, r3, #3
add r3, ip, r3
stm r3, {r0-r1}
ldr r3, [fp, #-2112]
add r3, r3, #1
str r3, [fp, #-2112]
.L49:
ldr r2, [fp, #-2112]
ldr r3, [fp, #-2120]
cmp r2, r3
blt .L50
mov r3, #0
str r3, [fp, #-2112]
b .L51
.L57:
ldr r2, [fp, #-2112]
ldr r3, [fp, #-2104]
cmp r2, r3
beq .L52
ldr r3, [fp, #-2112]
ldr r2, [fp, #-2124]
mul r3, r2, r3
str r3, [fp, #-2080]
ldr r2, [fp, #-2080]
ldr r3, [fp, #-2104]
add r3, r2, r3
str r3, [fp, #-2088]
ldr r1, .L74+12
ldr r2, [fp, #-2112]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2104]
add r3, r3, r2
lsl r3, r3, #3
add r3, r1, r3
ldmia r3, {r2-r3}
str r2, [fp, #-2076]
str r3, [fp, #-2072]
mov r2, #0
mov r3, #0
ldr r0, [fp, #-2076]
ldr r1, [fp, #-2072]
bl __aeabi_dcmpeq
mov r3, r0
cmp r3, #0
bne .L52
mov r3, #0
str r3, [fp, #-2108]
b .L54
.L56:
ldr r2, [fp, #-2108]
ldr r3, [fp, #-2104]
cmp r2, r3
beq .L55
ldr r1, .L74+12
ldr r2, [fp, #-2112]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2108]
add r3, r3, r2
lsl r3, r3, #3
add r3, r1, r3
ldmia r3, {r8-r9}
ldr r1, .L74+12
ldr r2, [fp, #-2104]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2108]
add r3, r3, r2
lsl r3, r3, #3
add r3, r1, r3
ldmia r3, {r0-r1}
ldr r2, [fp, #-2076]
ldr r3, [fp, #-2072]
bl __aeabi_dmul
mov r2, r0
mov r3, r1
mov r0, r8
mov r1, r9
bl __aeabi_dsub
mov r2, r0
mov r3, r1
mov r0, r2
mov r1, r3
ldr ip, .L74+12
ldr r2, [fp, #-2112]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2108]
add r3, r3, r2
lsl r3, r3, #3
add r3, ip, r3
stm r3, {r0-r1}
.L55:
ldr r3, [fp, #-2108]
add r3, r3, #1
str r3, [fp, #-2108]
.L54:
ldr r2, [fp, #-2108]
ldr r3, [fp, #-2120]
cmp r2, r3
blt .L56
ldr r6, [fp, #-2076]
ldr r3, [fp, #-2072]
eor r7, r3, #-2147483648
ldr r2, [fp, #-2052]
ldr r3, [fp, #-2048]
mov r0, r6
mov r1, r7
bl __aeabi_ddiv
mov r2, r0
mov r3, r1
mov r0, r2
mov r1, r3
ldr ip, .L74+12
ldr r2, [fp, #-2112]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2104]
add r3, r3, r2
lsl r3, r3, #3
add r3, ip, r3
stm r3, {r0-r1}
.L52:
ldr r3, [fp, #-2112]
add r3, r3, #1
str r3, [fp, #-2112]
.L51:
ldr r2, [fp, #-2112]
ldr r3, [fp, #-2120]
cmp r2, r3
blt .L57
ldr r2, [fp, #-2052]
ldr r3, [fp, #-2048]
mov r0, #0
ldr r1, .L74+8
bl __aeabi_ddiv
mov r2, r0
mov r3, r1
ldr r0, .L74+12
ldr r1, [fp, #-2104]
lsl r1, r1, #5
add r1, r0, r1
stm r1, {r2-r3}
ldr r3, [fp, #-2104]
add r3, r3, #1
str r3, [fp, #-2104]
.L39:
ldr r2, [fp, #-2104]
ldr r3, [fp, #-2120]
cmp r2, r3
blt .L58
mov r3, #0
str r3, [fp, #-2112]
b .L59
.L64:
ldr r3, [fp, #-2112]
lsl r3, r3, #2
sub r2, fp, #28
add r3, r2, r3
ldr r3, [r3, #-2004]
str r3, [fp, #-2104]
ldr r2, [fp, #-2104]
ldr r3, [fp, #-2112]
cmp r2, r3
beq .L73
ldr r3, [fp, #-2104]
lsl r3, r3, #2
sub r2, fp, #28
add r3, r2, r3
ldr r3, [r3, #-2004]
str r3, [fp, #-2096]
ldr r3, [fp, #-2112]
lsl r3, r3, #2
sub r2, fp, #28
add r3, r2, r3
ldr r2, [r3, #-2004]
ldr r3, [fp, #-2104]
lsl r3, r3, #2
sub r1, fp, #28
add r3, r1, r3
str r2, [r3, #-2004]
ldr r3, [fp, #-2112]
lsl r3, r3, #2
sub r2, fp, #28
add r3, r2, r3
ldr r2, [fp, #-2096]
str r2, [r3, #-2004]
mov r3, #0
str r3, [fp, #-2108]
b .L62
.L63:
ldr r3, [fp, #-2108]
ldr r2, [fp, #-2124]
mul r3, r2, r3
str r3, [fp, #-2092]
ldr r2, [fp, #-2092]
ldr r3, [fp, #-2112]
add r3, r2, r3
str r3, [fp, #-2088]
ldr r2, [fp, #-2092]
ldr r3, [fp, #-2104]
add r3, r2, r3
str r3, [fp, #-2084]
ldr r1, .L74+12
ldr r2, [fp, #-2104]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2112]
add r3, r3, r2
lsl r3, r3, #3
add r3, r1, r3
ldmia r3, {r2-r3}
str r2, [fp, #-2076]
str r3, [fp, #-2072]
ldr r2, .L74+12
ldr r3, [fp, #-2104]
lsl r3, r3, #5
add r3, r2, r3
ldmia r3, {r0-r1}
ldr ip, .L74+12
ldr r2, [fp, #-2104]
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
ldr r2, [fp, #-2112]
add r3, r3, r2
lsl r3, r3, #3
add r3, ip, r3
stm r3, {r0-r1}
ldr r2, .L74+12
ldr r3, [fp, #-2104]
lsl r3, r3, #5
add r1, r2, r3
ldr r2, [fp, #-2076]
ldr r3, [fp, #-2072]
stm r1, {r2-r3}
ldr r3, [fp, #-2108]
add r3, r3, #1
str r3, [fp, #-2108]
.L62:
ldr r2, [fp, #-2108]
ldr r3, [fp, #-2120]
cmp r2, r3
blt .L63
b .L64
.L73:
nop
ldr r3, [fp, #-2112]
add r3, r3, #1
str r3, [fp, #-2112]
.L59:
ldr r2, [fp, #-2112]
ldr r3, [fp, #-2120]
cmp r2, r3
blt .L64
ldr r1, .L74+16
ldr r2, [fp, #-2060]
ldr r3, [fp, #-2056]
stm r1, {r2-r3}
mov r3, #0
.L65:
ldr r2, .L74
ldr r1, [r2]
ldr r2, [fp, #-32]
eors r1, r2, r1
mov r2, #0
beq .L66
bl __stack_chk_fail
.L66:
mov r0, r3
sub sp, fp, #28
@ sp needed
pop {r4, r5, r6, r7, r8, r9, fp, pc}
.L75:
.align 2
.L74:
.word .LC0
.word 999
.word 1072693248
.word a
.word det
.size minver, .-minver
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
.section .note.GNU-stack,"",%progbits
|
.file "692500.c"
.intel_syntax noprefix
.text
.section .rodata
.LC0:
.string "%d"
.text
.globl scilab_rt_plot3d_i2i2i2i0_
.type scilab_rt_plot3d_i2i2i2i0_, @function
scilab_rt_plot3d_i2i2i2i0_:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
push r15
push r14
push r13
push r12
push rbx
sub rsp, 88
.cfi_offset 15, -24
.cfi_offset 14, -32
.cfi_offset 13, -40
.cfi_offset 12, -48
.cfi_offset 3, -56
mov DWORD PTR -100[rbp], edi
mov DWORD PTR -104[rbp], esi
mov QWORD PTR -112[rbp], rdx
mov DWORD PTR -116[rbp], ecx
mov DWORD PTR -120[rbp], r8d
mov QWORD PTR -128[rbp], r9
mov eax, DWORD PTR -104[rbp]
movsx rdx, eax
sub rdx, 1
mov QWORD PTR -72[rbp], rdx
movsx rdx, eax
mov r12, rdx
mov r13d, 0
mov r12d, DWORD PTR -120[rbp]
movsx rdx, r12d
sub rdx, 1
mov QWORD PTR -64[rbp], rdx
movsx rdx, r12d
mov r14, rdx
mov r15d, 0
mov ebx, DWORD PTR 24[rbp]
movsx rdx, ebx
sub rdx, 1
mov QWORD PTR -56[rbp], rdx
movsx rdx, ebx
mov r10, rdx
mov r11d, 0
mov DWORD PTR -88[rbp], 0
mov DWORD PTR -92[rbp], 0
mov DWORD PTR -76[rbp], 0
mov DWORD PTR -80[rbp], 0
jmp .L2
.L5:
mov DWORD PTR -84[rbp], 0
jmp .L3
.L4:
mov edx, DWORD PTR -80[rbp]
movsx rcx, edx
movsx rdx, eax
imul rdx, rcx
lea rcx, 0[0+rdx*4]
mov rdx, QWORD PTR -112[rbp]
add rcx, rdx
mov edx, DWORD PTR -84[rbp]
movsx rdx, edx
mov edx, DWORD PTR [rcx+rdx*4]
add DWORD PTR -88[rbp], edx
add DWORD PTR -84[rbp], 1
.L3:
mov edx, DWORD PTR -84[rbp]
cmp edx, DWORD PTR -104[rbp]
jl .L4
add DWORD PTR -80[rbp], 1
.L2:
mov edx, DWORD PTR -80[rbp]
cmp edx, DWORD PTR -100[rbp]
jl .L5
mov eax, DWORD PTR -88[rbp]
mov esi, eax
lea rdi, .LC0[rip]
mov eax, 0
call printf@PLT
mov DWORD PTR -80[rbp], 0
jmp .L6
.L9:
mov DWORD PTR -84[rbp], 0
jmp .L7
.L8:
mov eax, DWORD PTR -80[rbp]
movsx rdx, eax
movsx rax, r12d
imul rax, rdx
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -128[rbp]
add rdx, rax
mov eax, DWORD PTR -84[rbp]
cdqe
mov eax, DWORD PTR [rdx+rax*4]
add DWORD PTR -92[rbp], eax
add DWORD PTR -84[rbp], 1
.L7:
mov eax, DWORD PTR -84[rbp]
cmp eax, DWORD PTR -120[rbp]
jl .L8
add DWORD PTR -80[rbp], 1
.L6:
mov eax, DWORD PTR -80[rbp]
cmp eax, DWORD PTR -116[rbp]
jl .L9
mov eax, DWORD PTR -92[rbp]
mov esi, eax
lea rdi, .LC0[rip]
mov eax, 0
call printf@PLT
mov DWORD PTR -80[rbp], 0
jmp .L10
.L13:
mov DWORD PTR -84[rbp], 0
jmp .L11
.L12:
mov eax, DWORD PTR -80[rbp]
movsx rdx, eax
movsx rax, ebx
imul rax, rdx
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR 32[rbp]
add rdx, rax
mov eax, DWORD PTR -84[rbp]
cdqe
mov eax, DWORD PTR [rdx+rax*4]
add DWORD PTR -76[rbp], eax
add DWORD PTR -84[rbp], 1
.L11:
mov eax, DWORD PTR -84[rbp]
cmp eax, DWORD PTR 24[rbp]
jl .L12
add DWORD PTR -80[rbp], 1
.L10:
mov eax, DWORD PTR -80[rbp]
cmp eax, DWORD PTR 16[rbp]
jl .L13
mov eax, DWORD PTR -76[rbp]
mov esi, eax
lea rdi, .LC0[rip]
mov eax, 0
call printf@PLT
mov eax, DWORD PTR 40[rbp]
mov esi, eax
lea rdi, .LC0[rip]
mov eax, 0
call printf@PLT
nop
add rsp, 88
pop rbx
pop r12
pop r13
pop r14
pop r15
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size scilab_rt_plot3d_i2i2i2i0_, .-scilab_rt_plot3d_i2i2i2i0_
.ident "GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:
| .arch armv5t
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 0
.eabi_attribute 18, 4
.file "692500.c"
.text
.section .rodata
.align 2
.LC0:
.ascii "%d\000"
.text
.align 2
.global scilab_rt_plot3d_i2i2i2i0_
.syntax unified
.arm
.fpu softvfp
.type scilab_rt_plot3d_i2i2i2i0_, %function
scilab_rt_plot3d_i2i2i2i0_:
@ args = 24, pretend = 0, frame = 48
@ frame_needed = 1, uses_anonymous_args = 0
push {r4, r5, fp, lr}
add fp, sp, #12
sub sp, sp, #48
str r0, [fp, #-48]
str r1, [fp, #-52]
str r2, [fp, #-56]
str r3, [fp, #-60]
ldr ip, [fp, #-52]
sub r3, ip, #1
str r3, [fp, #-24]
mov r3, ip
mov r0, r3
mov r1, #0
mov r2, #0
mov r3, #0
lsl r3, r1, #5
orr r3, r3, r0, lsr #27
lsl r2, r0, #5
ldr r5, [fp, #4]
sub r3, r5, #1
str r3, [fp, #-20]
mov r3, r5
mov r0, r3
mov r1, #0
mov r2, #0
mov r3, #0
lsl r3, r1, #5
orr r3, r3, r0, lsr #27
lsl r2, r0, #5
ldr r4, [fp, #16]
sub r3, r4, #1
str r3, [fp, #-16]
mov r3, r4
mov r0, r3
mov r1, #0
mov r2, #0
mov r3, #0
lsl r3, r1, #5
orr r3, r3, r0, lsr #27
lsl r2, r0, #5
mov r3, #0
str r3, [fp, #-40]
mov r3, #0
str r3, [fp, #-44]
mov r3, #0
str r3, [fp, #-28]
mov r3, #0
str r3, [fp, #-32]
b .L2
.L5:
mov r3, #0
str r3, [fp, #-36]
b .L3
.L4:
mov r2, ip
ldr r3, [fp, #-32]
mul r3, r2, r3
lsl r3, r3, #2
ldr r2, [fp, #-56]
add r3, r2, r3
ldr r2, [fp, #-36]
ldr r3, [r3, r2, lsl #2]
ldr r2, [fp, #-40]
add r3, r2, r3
str r3, [fp, #-40]
ldr r3, [fp, #-36]
add r3, r3, #1
str r3, [fp, #-36]
.L3:
ldr r2, [fp, #-36]
ldr r3, [fp, #-52]
cmp r2, r3
blt .L4
ldr r3, [fp, #-32]
add r3, r3, #1
str r3, [fp, #-32]
.L2:
ldr r2, [fp, #-32]
ldr r3, [fp, #-48]
cmp r2, r3
blt .L5
ldr r1, [fp, #-40]
ldr r0, .L14
bl printf
mov r3, #0
str r3, [fp, #-32]
b .L6
.L9:
mov r3, #0
str r3, [fp, #-36]
b .L7
.L8:
mov r2, r5
ldr r3, [fp, #-32]
mul r3, r2, r3
lsl r3, r3, #2
ldr r2, [fp, #8]
add r3, r2, r3
ldr r2, [fp, #-36]
ldr r3, [r3, r2, lsl #2]
ldr r2, [fp, #-44]
add r3, r2, r3
str r3, [fp, #-44]
ldr r3, [fp, #-36]
add r3, r3, #1
str r3, [fp, #-36]
.L7:
ldr r2, [fp, #-36]
ldr r3, [fp, #4]
cmp r2, r3
blt .L8
ldr r3, [fp, #-32]
add r3, r3, #1
str r3, [fp, #-32]
.L6:
ldr r2, [fp, #-32]
ldr r3, [fp, #-60]
cmp r2, r3
blt .L9
ldr r1, [fp, #-44]
ldr r0, .L14
bl printf
mov r3, #0
str r3, [fp, #-32]
b .L10
.L13:
mov r3, #0
str r3, [fp, #-36]
b .L11
.L12:
mov r2, r4
ldr r3, [fp, #-32]
mul r3, r2, r3
lsl r3, r3, #2
ldr r2, [fp, #20]
add r3, r2, r3
ldr r2, [fp, #-36]
ldr r3, [r3, r2, lsl #2]
ldr r2, [fp, #-28]
add r3, r2, r3
str r3, [fp, #-28]
ldr r3, [fp, #-36]
add r3, r3, #1
str r3, [fp, #-36]
.L11:
ldr r2, [fp, #-36]
ldr r3, [fp, #16]
cmp r2, r3
blt .L12
ldr r3, [fp, #-32]
add r3, r3, #1
str r3, [fp, #-32]
.L10:
ldr r2, [fp, #-32]
ldr r3, [fp, #12]
cmp r2, r3
blt .L13
ldr r1, [fp, #-28]
ldr r0, .L14
bl printf
ldr r1, [fp, #24]
ldr r0, .L14
bl printf
nop
sub sp, fp, #12
@ sp needed
pop {r4, r5, fp, pc}
.L15:
.align 2
.L14:
.word .LC0
.size scilab_rt_plot3d_i2i2i2i0_, .-scilab_rt_plot3d_i2i2i2i0_
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
.section .note.GNU-stack,"",%progbits
|
.file "841349.c"
.intel_syntax noprefix
.text
.globl search
.type search, @function
search:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov QWORD PTR -24[rbp], rdi
mov DWORD PTR -28[rbp], esi
mov DWORD PTR -32[rbp], edx
mov DWORD PTR -8[rbp], 0
mov DWORD PTR -4[rbp], 0
jmp .L2
.L5:
mov eax, DWORD PTR -4[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -24[rbp]
add rax, rdx
mov eax, DWORD PTR [rax]
cmp DWORD PTR -28[rbp], eax
jne .L3
mov DWORD PTR -8[rbp], 1
jmp .L4
.L3:
add DWORD PTR -4[rbp], 1
.L2:
mov eax, DWORD PTR -4[rbp]
cmp eax, DWORD PTR -32[rbp]
jl .L5
.L4:
mov eax, DWORD PTR -8[rbp]
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size search, .-search
.section .rodata
.LC0:
.string "Enter the number of elements:"
.LC1:
.string "%d"
.LC2:
.string "Enter the key to be found"
.LC3:
.string "Found"
.LC4:
.string "Not Found"
.text
.globl main
.type main, @function
main:
.LFB1:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 32
mov rax, QWORD PTR fs:40
mov QWORD PTR -8[rbp], rax
xor eax, eax
lea rdi, .LC0[rip]
mov eax, 0
call printf@PLT
lea rax, -28[rbp]
mov rsi, rax
lea rdi, .LC1[rip]
mov eax, 0
call __isoc99_scanf@PLT
mov eax, DWORD PTR -28[rbp]
cdqe
sal rax, 2
mov rdi, rax
call malloc@PLT
mov QWORD PTR -16[rbp], rax
mov DWORD PTR -20[rbp], 0
jmp .L8
.L9:
mov eax, DWORD PTR -20[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -16[rbp]
add rax, rdx
mov rsi, rax
lea rdi, .LC1[rip]
mov eax, 0
call __isoc99_scanf@PLT
add DWORD PTR -20[rbp], 1
.L8:
mov eax, DWORD PTR -28[rbp]
cmp DWORD PTR -20[rbp], eax
jl .L9
lea rdi, .LC2[rip]
call puts@PLT
lea rax, -24[rbp]
mov rsi, rax
lea rdi, .LC1[rip]
mov eax, 0
call __isoc99_scanf@PLT
mov ecx, DWORD PTR -24[rbp]
mov rax, QWORD PTR -16[rbp]
mov edx, 2
mov esi, ecx
mov rdi, rax
call search
cmp eax, 1
jne .L10
lea rdi, .LC3[rip]
call puts@PLT
jmp .L11
.L10:
lea rdi, .LC4[rip]
call puts@PLT
.L11:
mov eax, 0
mov rcx, QWORD PTR -8[rbp]
sub rcx, QWORD PTR fs:40
je .L13
call __stack_chk_fail@PLT
.L13:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size main, .-main
.ident "GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:
| .arch armv5t
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 0
.eabi_attribute 18, 4
.file "841349.c"
.text
.align 2
.global search
.syntax unified
.arm
.fpu softvfp
.type search, %function
search:
@ args = 0, pretend = 0, frame = 24
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #28
str r0, [fp, #-16]
str r1, [fp, #-20]
str r2, [fp, #-24]
mov r3, #0
str r3, [fp, #-12]
mov r3, #0
str r3, [fp, #-8]
b .L2
.L5:
ldr r3, [fp, #-8]
lsl r3, r3, #2
ldr r2, [fp, #-16]
add r3, r2, r3
ldr r3, [r3]
ldr r2, [fp, #-20]
cmp r2, r3
bne .L3
mov r3, #1
str r3, [fp, #-12]
b .L4
.L3:
ldr r3, [fp, #-8]
add r3, r3, #1
str r3, [fp, #-8]
.L2:
ldr r2, [fp, #-8]
ldr r3, [fp, #-24]
cmp r2, r3
blt .L5
.L4:
ldr r3, [fp, #-12]
mov r0, r3
add sp, fp, #0
@ sp needed
ldr fp, [sp], #4
bx lr
.size search, .-search
.section .rodata
.align 2
.LC0:
.ascii "Enter the number of elements:\000"
.align 2
.LC1:
.ascii "%d\000"
.align 2
.LC2:
.ascii "Enter the key to be found\000"
.align 2
.LC3:
.ascii "Found\000"
.align 2
.LC4:
.ascii "Not Found\000"
.align 2
.LC5:
.word __stack_chk_guard
.text
.align 2
.global main
.syntax unified
.arm
.fpu softvfp
.type main, %function
main:
@ args = 0, pretend = 0, frame = 24
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #24
ldr r3, .L14
ldr r3, [r3]
str r3, [fp, #-8]
mov r3,#0
ldr r0, .L14+4
bl printf
sub r3, fp, #24
mov r1, r3
ldr r0, .L14+8
bl __isoc99_scanf
ldr r3, [fp, #-24]
lsl r3, r3, #2
mov r0, r3
bl malloc
mov r3, r0
str r3, [fp, #-12]
mov r3, #0
str r3, [fp, #-16]
b .L8
.L9:
ldr r3, [fp, #-16]
lsl r3, r3, #2
ldr r2, [fp, #-12]
add r3, r2, r3
mov r1, r3
ldr r0, .L14+8
bl __isoc99_scanf
ldr r3, [fp, #-16]
add r3, r3, #1
str r3, [fp, #-16]
.L8:
ldr r3, [fp, #-24]
ldr r2, [fp, #-16]
cmp r2, r3
blt .L9
ldr r0, .L14+12
bl puts
sub r3, fp, #20
mov r1, r3
ldr r0, .L14+8
bl __isoc99_scanf
ldr r3, [fp, #-20]
mov r2, #1
mov r1, r3
ldr r0, [fp, #-12]
bl search
mov r3, r0
cmp r3, #1
bne .L10
ldr r0, .L14+16
bl puts
b .L11
.L10:
ldr r0, .L14+20
bl puts
.L11:
mov r3, #0
ldr r2, .L14
ldr r1, [r2]
ldr r2, [fp, #-8]
eors r1, r2, r1
mov r2, #0
beq .L13
bl __stack_chk_fail
.L13:
mov r0, r3
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L15:
.align 2
.L14:
.word .LC5
.word .LC0
.word .LC1
.word .LC2
.word .LC3
.word .LC4
.size main, .-main
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
.section .note.GNU-stack,"",%progbits
|
.file "84007.c"
.intel_syntax noprefix
.text
.section .rodata
.LC0:
.string "value of array[index]"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 80
mov rax, QWORD PTR fs:40
mov QWORD PTR -8[rbp], rax
xor eax, eax
lea rax, -48[rbp]
mov QWORD PTR -64[rbp], rax
mov eax, 0
call nondet_pointer@PLT
mov QWORD PTR -56[rbp], rax
cmp DWORD PTR -68[rbp], 0
js .L2
cmp DWORD PTR -68[rbp], 9
jg .L2
mov eax, 1
jmp .L3
.L2:
mov eax, 0
.L3:
mov edi, eax
mov eax, 0
call __CPROVER_assume@PLT
mov eax, DWORD PTR -68[rbp]
cdqe
lea rdx, 0[0+rax*4]
mov rax, QWORD PTR -64[rbp]
add rax, rdx
cmp QWORD PTR -56[rbp], rax
sete al
movzx eax, al
mov edi, eax
mov eax, 0
call __CPROVER_assume@PLT
mov rax, QWORD PTR -56[rbp]
mov DWORD PTR [rax], 123
mov eax, DWORD PTR -68[rbp]
cdqe
mov eax, DWORD PTR -48[rbp+rax*4]
cmp eax, 123
sete al
movzx eax, al
lea rsi, .LC0[rip]
mov edi, eax
mov eax, 0
call __CPROVER_assert@PLT
mov eax, 0
mov rcx, QWORD PTR -8[rbp]
sub rcx, QWORD PTR fs:40
je .L5
call __stack_chk_fail@PLT
.L5:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:
| .arch armv5t
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 0
.eabi_attribute 18, 4
.file "84007.c"
.text
.section .rodata
.align 2
.LC0:
.ascii "value of array[index]\000"
.align 2
.LC1:
.word __stack_chk_guard
.text
.align 2
.global main
.syntax unified
.arm
.fpu softvfp
.type main, %function
main:
@ args = 0, pretend = 0, frame = 56
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #56
ldr r3, .L6
ldr r3, [r3]
str r3, [fp, #-8]
mov r3,#0
sub r3, fp, #48
str r3, [fp, #-60]
bl nondet_pointer
str r0, [fp, #-56]
ldr r3, [fp, #-52]
cmp r3, #0
blt .L2
ldr r3, [fp, #-52]
cmp r3, #9
bgt .L2
mov r3, #1
b .L3
.L2:
mov r3, #0
.L3:
mov r0, r3
bl __CPROVER_assume
ldr r3, [fp, #-52]
lsl r3, r3, #2
ldr r2, [fp, #-60]
add r3, r2, r3
ldr r2, [fp, #-56]
cmp r2, r3
moveq r3, #1
movne r3, #0
and r3, r3, #255
mov r0, r3
bl __CPROVER_assume
ldr r3, [fp, #-56]
mov r2, #123
str r2, [r3]
ldr r3, [fp, #-52]
lsl r3, r3, #2
sub r2, fp, #4
add r3, r2, r3
ldr r3, [r3, #-44]
cmp r3, #123
moveq r3, #1
movne r3, #0
and r3, r3, #255
ldr r1, .L6+4
mov r0, r3
bl __CPROVER_assert
mov r3, #0
ldr r2, .L6
ldr r1, [r2]
ldr r2, [fp, #-8]
eors r1, r2, r1
mov r2, #0
beq .L5
bl __stack_chk_fail
.L5:
mov r0, r3
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L7:
.align 2
.L6:
.word .LC1
.word .LC0
.size main, .-main
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
.section .note.GNU-stack,"",%progbits
|
.file "794563.c"
.intel_syntax noprefix
.text
.ident "GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:
| .arch armv5t
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 0
.eabi_attribute 18, 4
.file "794563.c"
.text
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
.section .note.GNU-stack,"",%progbits
|
.file "957270.c"
.intel_syntax noprefix
.text
.section .rodata
.LC0:
.string "%lli\n"
.LC1:
.string "%lli"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
push rbx
sub rsp, 24
.cfi_offset 3, -24
mov rax, QWORD PTR fs:40
mov QWORD PTR -24[rbp], rax
xor eax, eax
jmp .L2
.L3:
mov rax, QWORD PTR -32[rbp]
lea rbx, -1[rax]
mov rax, QWORD PTR -32[rbp]
sub rax, 1
pxor xmm1, xmm1
cvtsi2sd xmm1, rax
movq rax, xmm1
movq xmm0, rax
call log2@PLT
cvttsd2si eax, xmm0
cdqe
add rax, rbx
mov rsi, rax
lea rdi, .LC0[rip]
mov eax, 0
call printf@PLT
.L2:
lea rax, -32[rbp]
mov rsi, rax
lea rdi, .LC1[rip]
mov eax, 0
call __isoc99_scanf@PLT
cmp eax, 1
je .L3
mov eax, 0
mov rdx, QWORD PTR -24[rbp]
sub rdx, QWORD PTR fs:40
je .L5
call __stack_chk_fail@PLT
.L5:
mov rbx, QWORD PTR -8[rbp]
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:
| .arch armv5t
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 0
.eabi_attribute 18, 4
.file "957270.c"
.text
.global __aeabi_l2d
.global __aeabi_d2iz
.section .rodata
.align 2
.LC0:
.ascii "%lli\012\000"
.align 2
.LC1:
.ascii "%lli\000"
.align 2
.LC2:
.word __stack_chk_guard
.text
.align 2
.global main
.syntax unified
.arm
.fpu softvfp
.type main, %function
main:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
push {r4, r5, r6, r7, r8, r9, fp, lr}
add fp, sp, #28
sub sp, sp, #16
ldr r3, .L6
ldr r3, [r3]
str r3, [fp, #-32]
mov r3,#0
b .L2
.L3:
sub r3, fp, #44
ldmia r3, {r2-r3}
subs r4, r2, #1
sbc r5, r3, #0
sub r3, fp, #44
ldmia r3, {r2-r3}
subs r6, r2, #1
sbc r7, r3, #0
mov r0, r6
mov r1, r7
bl __aeabi_l2d
mov r2, r0
mov r3, r1
mov r0, r2
mov r1, r3
bl log2
mov r2, r0
mov r3, r1
mov r0, r2
mov r1, r3
bl __aeabi_d2iz
mov r3, r0
mov r2, r3
asr r3, r2, #31
adds r8, r4, r2
adc r9, r5, r3
mov r2, r8
mov r3, r9
ldr r0, .L6+4
bl printf
.L2:
sub r3, fp, #44
mov r1, r3
ldr r0, .L6+8
bl __isoc99_scanf
mov r3, r0
cmp r3, #1
beq .L3
mov r3, #0
ldr r2, .L6
ldr r1, [r2]
ldr r2, [fp, #-32]
eors r1, r2, r1
mov r2, #0
beq .L5
bl __stack_chk_fail
.L5:
mov r0, r3
sub sp, fp, #28
@ sp needed
pop {r4, r5, r6, r7, r8, r9, fp, pc}
.L7:
.align 2
.L6:
.word .LC2
.word .LC0
.word .LC1
.size main, .-main
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
.section .note.GNU-stack,"",%progbits
|
.file "10094.c"
.intel_syntax noprefix
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov eax, 0
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:
| .arch armv5t
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 0
.eabi_attribute 18, 4
.file "10094.c"
.text
.align 2
.global main
.syntax unified
.arm
.fpu softvfp
.type main, %function
main:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
mov r3, #0
mov r0, r3
add sp, fp, #0
@ sp needed
ldr fp, [sp], #4
bx lr
.size main, .-main
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
.section .note.GNU-stack,"",%progbits
|
.file "93391.c"
.intel_syntax noprefix
.text
.globl add
.type add, @function
add:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
mov DWORD PTR -20[rbp], edi
mov eax, DWORD PTR -20[rbp]
mov DWORD PTR -8[rbp], eax
mov DWORD PTR -4[rbp], 0
jmp .L2
.L3:
mov eax, DWORD PTR -4[rbp]
add DWORD PTR -8[rbp], eax
add DWORD PTR -4[rbp], 1
.L2:
cmp DWORD PTR -4[rbp], 1000
jle .L3
mov eax, DWORD PTR -8[rbp]
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size add, .-add
.ident "GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:
| .arch armv5t
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 0
.eabi_attribute 18, 4
.file "93391.c"
.text
.align 2
.global add
.syntax unified
.arm
.fpu softvfp
.type add, %function
add:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #20
str r0, [fp, #-16]
ldr r3, [fp, #-16]
str r3, [fp, #-12]
mov r3, #0
str r3, [fp, #-8]
b .L2
.L3:
ldr r2, [fp, #-12]
ldr r3, [fp, #-8]
add r3, r2, r3
str r3, [fp, #-12]
ldr r3, [fp, #-8]
add r3, r3, #1
str r3, [fp, #-8]
.L2:
ldr r3, [fp, #-8]
cmp r3, #1000
ble .L3
ldr r3, [fp, #-12]
mov r0, r3
add sp, fp, #0
@ sp needed
ldr fp, [sp], #4
bx lr
.size add, .-add
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
.section .note.GNU-stack,"",%progbits
|
.file "871799.c"
.intel_syntax noprefix
.text
.section .rodata
.LC0:
.string "Enter the encrypted code"
.LC1:
.string "%s"
.LC2:
.string "alpha = %d\n"
.LC3:
.string "k = %d\n"
.LC4:
.string "for i = %d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
endbr64
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
push rbx
sub rsp, 56
.cfi_offset 3, -24
mov rax, QWORD PTR fs:40
mov QWORD PTR -24[rbp], rax
xor eax, eax
lea rdi, .LC0[rip]
call puts@PLT
lea rax, -44[rbp]
mov rsi, rax
lea rdi, .LC1[rip]
mov eax, 0
call __isoc99_scanf@PLT
mov DWORD PTR -64[rbp], 0
jmp .L2
.L10:
mov eax, DWORD PTR -64[rbp]
cdqe
movzx eax, BYTE PTR -44[rbp+rax]
movsx eax, al
sub eax, 97
mov DWORD PTR -48[rbp], eax
mov eax, DWORD PTR -48[rbp]
mov esi, eax
lea rdi, .LC2[rip]
mov eax, 0
call printf@PLT
mov eax, DWORD PTR -48[rbp]
sub eax, 4
mov DWORD PTR -60[rbp], eax
cmp DWORD PTR -60[rbp], 0
jns .L3
add DWORD PTR -60[rbp], 26
.L3:
mov eax, DWORD PTR -60[rbp]
mov esi, eax
lea rdi, .LC3[rip]
mov eax, 0
call printf@PLT
mov DWORD PTR -56[rbp], 0
jmp .L4
.L7:
mov eax, DWORD PTR -56[rbp]
cdqe
movzx eax, BYTE PTR -44[rbp+rax]
movsx eax, al
sub eax, 97
sub eax, DWORD PTR -60[rbp]
movsx rdx, eax
imul rdx, rdx, 1321528399
shr rdx, 32
sar edx, 3
mov ecx, eax
sar ecx, 31
sub edx, ecx
imul ecx, edx, 26
sub eax, ecx
mov edx, eax
mov eax, DWORD PTR -56[rbp]
cdqe
mov BYTE PTR -34[rbp+rax], dl
mov eax, DWORD PTR -56[rbp]
cdqe
movzx eax, BYTE PTR -34[rbp+rax]
test al, al
jns .L5
mov eax, DWORD PTR -56[rbp]
cdqe
movzx eax, BYTE PTR -34[rbp+rax]
add eax, 123
mov edx, eax
mov eax, DWORD PTR -56[rbp]
cdqe
mov BYTE PTR -34[rbp+rax], dl
jmp .L6
.L5:
mov eax, DWORD PTR -56[rbp]
cdqe
movzx eax, BYTE PTR -34[rbp+rax]
add eax, 97
mov edx, eax
mov eax, DWORD PTR -56[rbp]
cdqe
mov BYTE PTR -34[rbp+rax], dl
.L6:
add DWORD PTR -56[rbp], 1
.L4:
mov eax, DWORD PTR -56[rbp]
movsx rbx, eax
lea rax, -44[rbp]
mov rdi, rax
call strlen@PLT
cmp rbx, rax
jb .L7
mov eax, DWORD PTR -64[rbp]
mov esi, eax
lea rdi, .LC4[rip]
mov eax, 0
call printf@PLT
mov DWORD PTR -52[rbp], 0
jmp .L8
.L9:
mov eax, DWORD PTR -52[rbp]
cdqe
movzx eax, BYTE PTR -34[rbp+rax]
movsx eax, al
mov edi, eax
call putchar@PLT
add DWORD PTR -52[rbp], 1
.L8:
mov eax, DWORD PTR -52[rbp]
movsx rbx, eax
lea rax, -44[rbp]
mov rdi, rax
call strlen@PLT
cmp rbx, rax
jb .L9
mov edi, 10
call putchar@PLT
add DWORD PTR -64[rbp], 1
.L2:
mov eax, DWORD PTR -64[rbp]
movsx rbx, eax
lea rax, -44[rbp]
mov rdi, rax
call strlen@PLT
cmp rbx, rax
jb .L10
mov eax, 0
mov rsi, QWORD PTR -24[rbp]
sub rsi, QWORD PTR fs:40
je .L12
call __stack_chk_fail@PLT
.L12:
mov rbx, QWORD PTR -8[rbp]
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:
| .arch armv5t
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 0
.eabi_attribute 18, 4
.file "871799.c"
.text
.section .rodata
.align 2
.LC0:
.ascii "Enter the encrypted code\000"
.align 2
.LC1:
.ascii "%s\000"
.align 2
.LC2:
.ascii "alpha = %d\012\000"
.align 2
.LC3:
.ascii "k = %d\012\000"
.align 2
.LC4:
.ascii "for i = %d\012\000"
.align 2
.LC5:
.word __stack_chk_guard
.text
.align 2
.global main
.syntax unified
.arm
.fpu softvfp
.type main, %function
main:
@ args = 0, pretend = 0, frame = 48
@ frame_needed = 1, uses_anonymous_args = 0
push {fp, lr}
add fp, sp, #4
sub sp, sp, #48
ldr r3, .L11
ldr r3, [r3]
str r3, [fp, #-8]
mov r3,#0
ldr r0, .L11+4
bl puts
sub r3, fp, #32
mov r1, r3
ldr r0, .L11+8
bl __isoc99_scanf
mov r3, #0
str r3, [fp, #-52]
b .L2
.L8:
sub r2, fp, #32
ldr r3, [fp, #-52]
add r3, r2, r3
ldrb r3, [r3] @ zero_extendqisi2
sub r3, r3, #97
str r3, [fp, #-36]
ldr r1, [fp, #-36]
ldr r0, .L11+12
bl printf
ldr r3, [fp, #-36]
sub r3, r3, #4
str r3, [fp, #-48]
ldr r3, [fp, #-48]
cmp r3, #0
bge .L3
ldr r3, [fp, #-48]
add r3, r3, #26
str r3, [fp, #-48]
.L3:
ldr r1, [fp, #-48]
ldr r0, .L11+16
bl printf
mov r3, #0
str r3, [fp, #-44]
b .L4
.L5:
sub r2, fp, #32
ldr r3, [fp, #-44]
add r3, r2, r3
ldrb r3, [r3] @ zero_extendqisi2
sub r2, r3, #97
ldr r3, [fp, #-48]
sub r1, r2, r3
ldr r3, .L11+20
smull r2, r3, r1, r3
asr r2, r3, #3
asr r3, r1, #31
sub r2, r2, r3
mov r3, r2
lsl r3, r3, #1
add r3, r3, r2
lsl r3, r3, #2
add r3, r3, r2
lsl r3, r3, #1
sub r2, r1, r3
and r1, r2, #255
sub r2, fp, #20
ldr r3, [fp, #-44]
add r3, r2, r3
mov r2, r1
strb r2, [r3]
sub r2, fp, #20
ldr r3, [fp, #-44]
add r3, r2, r3
ldrb r3, [r3] @ zero_extendqisi2
add r3, r3, #97
and r1, r3, #255
sub r2, fp, #20
ldr r3, [fp, #-44]
add r3, r2, r3
mov r2, r1
strb r2, [r3]
ldr r3, [fp, #-44]
add r3, r3, #1
str r3, [fp, #-44]
.L4:
sub r3, fp, #32
mov r0, r3
bl strlen
mov r2, r0
ldr r3, [fp, #-44]
cmp r2, r3
bhi .L5
ldr r1, [fp, #-52]
ldr r0, .L11+24
bl printf
mov r3, #0
str r3, [fp, #-40]
b .L6
.L7:
sub r2, fp, #20
ldr r3, [fp, #-40]
add r3, r2, r3
ldrb r3, [r3] @ zero_extendqisi2
mov r0, r3
bl putchar
ldr r3, [fp, #-40]
add r3, r3, #1
str r3, [fp, #-40]
.L6:
sub r3, fp, #32
mov r0, r3
bl strlen
mov r2, r0
ldr r3, [fp, #-40]
cmp r2, r3
bhi .L7
mov r0, #10
bl putchar
ldr r3, [fp, #-52]
add r3, r3, #1
str r3, [fp, #-52]
.L2:
sub r3, fp, #32
mov r0, r3
bl strlen
mov r2, r0
ldr r3, [fp, #-52]
cmp r2, r3
bhi .L8
mov r3, #0
ldr r2, .L11
ldr r1, [r2]
ldr r2, [fp, #-8]
eors r1, r2, r1
mov r2, #0
beq .L10
bl __stack_chk_fail
.L10:
mov r0, r3
sub sp, fp, #4
@ sp needed
pop {fp, pc}
.L12:
.align 2
.L11:
.word .LC5
.word .LC0
.word .LC1
.word .LC2
.word .LC3
.word 1321528399
.word .LC4
.size main, .-main
.ident "GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
.section .note.GNU-stack,"",%progbits
|