	.file	"129237.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: ./recover"
.LC1:
	.string	"r"
.LC2:
	.string	"card.raw"
.LC3:
	.string	"Could not open card."
.LC4:
	.string	"w"
	.align 8
.LC5:
	.string	"Could not open new file for write."
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	cmp	DWORD PTR -68[rbp], 1
	je	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L13
.L2:
	lea	rsi, .LC1[rip]
	lea	rdi, .LC2[rip]
	call	fopen@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L4
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, 2
	jmp	.L13
.L4:
	mov	DWORD PTR -16[rbp], -520103681
	mov	DWORD PTR -12[rbp], -503326465
	mov	edi, 8
	call	malloc@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	BYTE PTR -49[rbp], 0
	mov	edi, 512
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
.L6:
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 512
	mov	rdi, rax
	call	fread@PLT
	mov	rcx, QWORD PTR -24[rbp]
	lea	rax, -16[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	je	.L12
	mov	rcx, QWORD PTR -24[rbp]
	lea	rax, -12[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	jne	.L6
.L12:
	mov	rcx, QWORD PTR -24[rbp]
	lea	rax, -16[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	je	.L7
	mov	rcx, QWORD PTR -24[rbp]
	lea	rax, -12[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	jne	.L8
.L7:
	cmp	BYTE PTR -49[rbp], 0
	je	.L9
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L9:
	movzx	eax, BYTE PTR -49[rbp]
	lea	edx, 1[rax]
	mov	BYTE PTR -49[rbp], dl
	movzx	edx, al
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	defFileName
	mov	rax, QWORD PTR -32[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -48[rbp], rax
	cmp	QWORD PTR -48[rbp], 0
	jne	.L10
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, 3
	jmp	.L13
.L10:
	mov	rdx, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 512
	mov	rdi, rax
	call	fwrite@PLT
	jmp	.L11
.L8:
	mov	rdx, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 512
	mov	rdi, rax
	call	fwrite@PLT
.L11:
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 512
	mov	rdi, rax
	call	fread@PLT
	test	rax, rax
	jne	.L12
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
.L13:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC6:
	.string	"%i%i%i.jpg"
.LC7:
	.string	"%i%i.jpg"
	.text
	.globl	defFileName
	.type	defFileName, @function
defFileName:
.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], rdi
	mov	eax, esi
	mov	BYTE PTR -12[rbp], al
	cmp	BYTE PTR -12[rbp], 9
	ja	.L16
	movzx	edx, BYTE PTR -12[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	r8d, edx
	mov	ecx, 0
	mov	edx, 0
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	jmp	.L15
.L16:
	movzx	edx, BYTE PTR -12[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	ecx, edx
	mov	edx, 0
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	nop
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	defFileName, .-defFileName
	.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	"129237.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: ./recover\000"
	.align	2
.LC1:
	.ascii	"r\000"
	.align	2
.LC2:
	.ascii	"card.raw\000"
	.align	2
.LC3:
	.ascii	"Could not open card.\000"
	.align	2
.LC4:
	.ascii	"w\000"
	.align	2
.LC5:
	.ascii	"Could not open new file for write.\000"
	.align	2
.LC6:
	.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, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	beq	.L2
	ldr	r0, .L15+4
	bl	puts
	mov	r3, #1
	b	.L13
.L2:
	ldr	r1, .L15+8
	ldr	r0, .L15+12
	bl	fopen
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L4
	ldr	r0, .L15+16
	bl	puts
	mov	r3, #2
	b	.L13
.L4:
	ldr	r3, .L15+20
	str	r3, [fp, #-16]
	ldr	r3, .L15+24
	str	r3, [fp, #-12]
	mov	r0, #8
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-24]
	mov	r3, #0
	strb	r3, [fp, #-33]
	mov	r0, #512
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
.L6:
	ldr	r3, [fp, #-28]
	mov	r2, #1
	mov	r1, #512
	ldr	r0, [fp, #-20]
	bl	fread
	sub	r3, fp, #16
	mov	r2, #4
	ldr	r1, [fp, #-20]
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L12
	sub	r3, fp, #12
	mov	r2, #4
	ldr	r1, [fp, #-20]
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L6
.L12:
	sub	r3, fp, #16
	mov	r2, #4
	ldr	r1, [fp, #-20]
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	sub	r3, fp, #12
	mov	r2, #4
	ldr	r1, [fp, #-20]
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L8
.L7:
	ldrb	r3, [fp, #-33]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L9
	ldr	r0, [fp, #-32]
	bl	fclose
.L9:
	ldrb	r3, [fp, #-33]	@ zero_extendqisi2
	add	r2, r3, #1
	strb	r2, [fp, #-33]
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	defFileName
	ldr	r1, .L15+28
	ldr	r0, [fp, #-24]
	bl	fopen
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L10
	ldr	r0, .L15+32
	bl	puts
	mov	r3, #3
	b	.L13
.L10:
	ldr	r3, [fp, #-32]
	mov	r2, #1
	mov	r1, #512
	ldr	r0, [fp, #-20]
	bl	fwrite
	b	.L11
.L8:
	ldr	r3, [fp, #-32]
	mov	r2, #1
	mov	r1, #512
	ldr	r0, [fp, #-20]
	bl	fwrite
.L11:
	ldr	r3, [fp, #-28]
	mov	r2, #1
	mov	r1, #512
	ldr	r0, [fp, #-20]
	bl	fread
	mov	r3, r0
	cmp	r3, #0
	bne	.L12
	ldr	r0, [fp, #-24]
	bl	free
	ldr	r0, [fp, #-20]
	bl	free
	ldr	r0, [fp, #-28]
	bl	fclose
	ldr	r0, [fp, #-32]
	bl	fclose
	mov	r3, #0
.L13:
	ldr	r2, .L15
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	-520103681
	.word	-503326465
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.section	.rodata
	.align	2
.LC7:
	.ascii	"%i%i%i.jpg\000"
	.align	2
.LC8:
	.ascii	"%i%i.jpg\000"
	.text
	.align	2
	.global	defFileName
	.syntax unified
	.arm
	.fpu softvfp
	.type	defFileName, %function
defFileName:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-8]
	mov	r3, r1
	strb	r3, [fp, #-9]
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
	cmp	r3, #9
	bhi	.L18
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	ldr	r1, .L21
	ldr	r0, [fp, #-8]
	bl	sprintf
	b	.L17
.L18:
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
	mov	r2, #0
	ldr	r1, .L21+4
	ldr	r0, [fp, #-8]
	bl	sprintf
	nop
.L17:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC7
	.word	.LC8
	.size	defFileName, .-defFileName
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
