	.file	"674545.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: ./recover image"
.LC1:
	.string	"rb"
.LC2:
	.string	"Couldn't open %s\n"
	.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	cmp	DWORD PTR -20[rbp], 2
	je	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L4
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L3
.L4:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	recover_jpeg
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC3:
	.string	"Memory resource error, try again"
.LC4:
	.string	"%03d.jpg"
.LC5:
	.string	"wb"
	.align 8
.LC6:
	.string	"Memory resource error, try again!"
.LC7:
	.string	"got_FF && buf[0] == 0xd9"
	.text
	.globl	recover_jpeg
	.type	recover_jpeg, @function
recover_jpeg:
.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, 576
	mov	QWORD PTR -568[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -544[rbp], 0
	mov	DWORD PTR -560[rbp], 0
	mov	edi, 128
	call	malloc@PLT
	mov	QWORD PTR -536[rbp], rax
	cmp	QWORD PTR -536[rbp], 0
	jne	.L6
	lea	rdi, .LC3[rip]
	call	puts@PLT
	jmp	.L5
.L6:
	mov	DWORD PTR -556[rbp], 0
	jmp	.L8
.L17:
	cmp	QWORD PTR -544[rbp], 0
	jne	.L9
	movzx	eax, BYTE PTR -528[rbp]
	cmp	al, -1
	jne	.L9
	movzx	eax, BYTE PTR -527[rbp]
	cmp	al, -40
	jne	.L9
	movzx	eax, BYTE PTR -526[rbp]
	cmp	al, -1
	jne	.L9
	movzx	eax, BYTE PTR -525[rbp]
	cmp	al, -33
	jbe	.L9
	movzx	eax, BYTE PTR -525[rbp]
	cmp	al, -17
	ja	.L9
	mov	DWORD PTR -556[rbp], 0
	add	DWORD PTR -560[rbp], 1
	mov	edx, DWORD PTR -560[rbp]
	mov	rax, QWORD PTR -536[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	rax, QWORD PTR -536[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -544[rbp], rax
	cmp	QWORD PTR -544[rbp], 0
	jne	.L9
	mov	rax, QWORD PTR -536[rbp]
	mov	rdi, rax
	call	free@PLT
	lea	rdi, .LC6[rip]
	call	puts@PLT
	jmp	.L5
.L9:
	cmp	QWORD PTR -544[rbp], 0
	je	.L8
	mov	DWORD PTR -552[rbp], 1
	cmp	DWORD PTR -556[rbp], 0
	je	.L10
	movzx	eax, BYTE PTR -528[rbp]
	cmp	al, -39
	jne	.L10
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -552[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -544[rbp]
	lea	rax, -528[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -544[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	QWORD PTR -544[rbp], 0
	jmp	.L11
.L10:
	mov	DWORD PTR -552[rbp], 2
	jmp	.L12
.L14:
	mov	eax, DWORD PTR -552[rbp]
	sub	eax, 2
	cdqe
	movzx	eax, BYTE PTR -528[rbp+rax]
	cmp	al, -1
	jne	.L13
	mov	eax, DWORD PTR -552[rbp]
	sub	eax, 1
	cdqe
	movzx	eax, BYTE PTR -528[rbp+rax]
	cmp	al, -39
	jne	.L13
	mov	eax, DWORD PTR -552[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -544[rbp]
	lea	rax, -528[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -544[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	QWORD PTR -544[rbp], 0
	jmp	.L11
.L13:
	add	DWORD PTR -552[rbp], 1
.L12:
	mov	eax, DWORD PTR -552[rbp]
	cmp	eax, DWORD PTR -548[rbp]
	jle	.L14
.L11:
	cmp	QWORD PTR -544[rbp], 0
	je	.L15
	mov	eax, DWORD PTR -548[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -544[rbp]
	lea	rax, -528[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
.L15:
	cmp	QWORD PTR -544[rbp], 0
	je	.L16
	mov	eax, DWORD PTR -548[rbp]
	sub	eax, 1
	cdqe
	movzx	eax, BYTE PTR -528[rbp+rax]
	cmp	al, -1
	jne	.L16
	mov	DWORD PTR -556[rbp], 1
	jmp	.L8
.L16:
	mov	DWORD PTR -556[rbp], 0
.L8:
	mov	rdx, QWORD PTR -568[rbp]
	lea	rax, -528[rbp]
	mov	rcx, rdx
	mov	edx, 512
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -548[rbp], eax
	cmp	DWORD PTR -548[rbp], 0
	jne	.L17
	cmp	QWORD PTR -544[rbp], 0
	je	.L18
	mov	rax, QWORD PTR -544[rbp]
	mov	rdi, rax
	call	free@PLT
.L18:
	mov	rax, QWORD PTR -536[rbp]
	mov	rdi, rax
	call	free@PLT
.L5:
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	recover_jpeg, .-recover_jpeg
	.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	"674545.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: ./recover image\000"
	.align	2
.LC1:
	.ascii	"rb\000"
	.align	2
.LC2:
	.ascii	"Couldn't open %s\012\000"
	.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	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	cmp	r3, #2
	beq	.L2
	ldr	r0, .L5
	bl	puts
	mov	r3, #1
	b	.L3
.L2:
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L5+4
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L4
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L5+8
	bl	printf
	mov	r3, #1
	b	.L3
.L4:
	ldr	r0, [fp, #-8]
	bl	recover_jpeg
	ldr	r0, [fp, #-8]
	bl	fclose
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	main, .-main
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Memory resource error, try again\000"
	.align	2
.LC4:
	.ascii	"%03d.jpg\000"
	.align	2
.LC5:
	.ascii	"wb\000"
	.align	2
.LC6:
	.ascii	"Memory resource error, try again!\000"
	.align	2
.LC7:
	.ascii	"got_FF && buf[0] == 0xd9\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	recover_jpeg
	.syntax unified
	.arm
	.fpu softvfp
	.type	recover_jpeg, %function
recover_jpeg:
	@ args = 0, pretend = 0, frame = 552
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #552
	str	r0, [fp, #-552]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-544]
	mov	r3, #0
	str	r3, [fp, #-540]
	mov	r0, #128
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-528]
	ldr	r3, [fp, #-528]
	cmp	r3, #0
	bne	.L8
	ldr	r0, .L23+4
	bl	puts
	b	.L7
.L8:
	mov	r3, #0
	str	r3, [fp, #-536]
	b	.L10
.L19:
	ldr	r3, [fp, #-544]
	cmp	r3, #0
	bne	.L11
	ldrb	r3, [fp, #-520]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L11
	ldrb	r3, [fp, #-519]	@ zero_extendqisi2
	cmp	r3, #216
	bne	.L11
	ldrb	r3, [fp, #-518]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L11
	ldrb	r3, [fp, #-517]	@ zero_extendqisi2
	cmp	r3, #223
	bls	.L11
	ldrb	r3, [fp, #-517]	@ zero_extendqisi2
	cmp	r3, #239
	bhi	.L11
	mov	r3, #0
	str	r3, [fp, #-536]
	ldr	r3, [fp, #-540]
	add	r3, r3, #1
	str	r3, [fp, #-540]
	ldr	r2, [fp, #-540]
	ldr	r1, .L23+8
	ldr	r0, [fp, #-528]
	bl	sprintf
	ldr	r1, .L23+12
	ldr	r0, [fp, #-528]
	bl	fopen
	str	r0, [fp, #-544]
	ldr	r3, [fp, #-544]
	cmp	r3, #0
	bne	.L11
	ldr	r0, [fp, #-528]
	bl	free
	ldr	r0, .L23+16
	bl	puts
	b	.L7
.L11:
	ldr	r3, [fp, #-544]
	cmp	r3, #0
	beq	.L10
	mov	r3, #1
	str	r3, [fp, #-532]
	ldr	r3, [fp, #-536]
	cmp	r3, #0
	beq	.L12
	ldrb	r3, [fp, #-520]	@ zero_extendqisi2
	cmp	r3, #217
	bne	.L12
	ldr	r0, .L23+20
	bl	puts
	ldr	r2, [fp, #-532]
	sub	r0, fp, #520
	ldr	r3, [fp, #-544]
	mov	r1, #1
	bl	fwrite
	ldr	r0, [fp, #-544]
	bl	fclose
	mov	r3, #0
	str	r3, [fp, #-544]
	b	.L13
.L12:
	mov	r3, #2
	str	r3, [fp, #-532]
	b	.L14
.L16:
	ldr	r3, [fp, #-532]
	sub	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-516]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L15
	ldr	r3, [fp, #-532]
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-516]	@ zero_extendqisi2
	cmp	r3, #217
	bne	.L15
	ldr	r2, [fp, #-532]
	sub	r0, fp, #520
	ldr	r3, [fp, #-544]
	mov	r1, #1
	bl	fwrite
	ldr	r0, [fp, #-544]
	bl	fclose
	mov	r3, #0
	str	r3, [fp, #-544]
	b	.L13
.L15:
	ldr	r3, [fp, #-532]
	add	r3, r3, #1
	str	r3, [fp, #-532]
.L14:
	ldr	r2, [fp, #-532]
	ldr	r3, [fp, #-524]
	cmp	r2, r3
	ble	.L16
.L13:
	ldr	r3, [fp, #-544]
	cmp	r3, #0
	beq	.L17
	ldr	r2, [fp, #-524]
	sub	r0, fp, #520
	ldr	r3, [fp, #-544]
	mov	r1, #1
	bl	fwrite
.L17:
	ldr	r3, [fp, #-544]
	cmp	r3, #0
	beq	.L18
	ldr	r3, [fp, #-524]
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-516]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L18
	mov	r3, #1
	str	r3, [fp, #-536]
	b	.L10
.L18:
	mov	r3, #0
	str	r3, [fp, #-536]
.L10:
	sub	r0, fp, #520
	ldr	r3, [fp, #-552]
	mov	r2, #512
	mov	r1, #1
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-524]
	ldr	r3, [fp, #-524]
	cmp	r3, #0
	bne	.L19
	ldr	r3, [fp, #-544]
	cmp	r3, #0
	beq	.L20
	ldr	r0, [fp, #-544]
	bl	free
.L20:
	ldr	r0, [fp, #-528]
	bl	free
.L7:
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L22
	bl	__stack_chk_fail
.L22:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC8
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	recover_jpeg, .-recover_jpeg
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
