	.file	"177383.c"
	.intel_syntax noprefix
	.text
	.globl	buffer
	.bss
	.align 32
	.type	buffer, @object
	.size	buffer, 512
buffer:
	.zero	512
	.globl	count_sector
	.align 4
	.type	count_sector, @object
	.size	count_sector, 4
count_sector:
	.zero	4
	.globl	count_start_of_image
	.align 4
	.type	count_start_of_image, @object
	.size	count_start_of_image, 4
count_start_of_image:
	.zero	4
	.globl	count_app0
	.align 4
	.type	count_app0, @object
	.size	count_app0, 4
count_app0:
	.zero	4
	.globl	count_exif
	.align 4
	.type	count_exif, @object
	.size	count_exif, 4
count_exif:
	.zero	4
	.globl	count_ffed
	.align 4
	.type	count_ffed, @object
	.size	count_ffed, 4
count_ffed:
	.zero	4
	.globl	count_ffd8
	.align 4
	.type	count_ffd8, @object
	.size	count_ffd8, 4
count_ffd8:
	.zero	4
	.globl	count_ffdb
	.align 4
	.type	count_ffdb, @object
	.size	count_ffdb, 4
count_ffdb:
	.zero	4
	.globl	image_no
	.align 4
	.type	image_no, @object
	.size	image_no, 4
image_no:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%i GB inspected\n"
.LC1:
	.string	"%i sectors inspected\n"
.LC2:
	.string	"%i start_of_image count\n"
.LC3:
	.string	"%i APP0 count\n"
.LC4:
	.string	"%i EXIF count\n"
.LC5:
	.string	"%i FFED count\n"
.LC6:
	.string	"%i FFD8 count\n"
.LC7:
	.string	"%i FFDB count\n"
	.text
	.globl	report
	.type	report, @function
report:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	edi, 10
	call	putchar@PLT
	mov	eax, DWORD PTR count_sector[rip]
	mov	eax, eax
	imul	rax, rax, 1125899907
	shr	rax, 32
	shr	eax, 19
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR count_sector[rip]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR count_start_of_image[rip]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR count_app0[rip]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR count_exif[rip]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR count_ffed[rip]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR count_ffd8[rip]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR count_ffdb[rip]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	report, .-report
	.section	.rodata
.LC8:
	.string	"Out of mem\n"
.LC9:
	.string	"Unable to read data\n"
.LC10:
	.string	"out/%010d.jpg"
.LC11:
	.string	"wb"
.LC12:
	.string	"Extracted '%s'\n"
.LC13:
	.string	"Unable to open '%s'\n"
	.text
	.type	extract_image, @function
extract_image:
.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, 96
	mov	QWORD PTR -72[rbp], rdi
	mov	QWORD PTR -80[rbp], rsi
	mov	QWORD PTR -88[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -88[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -64[rbp], rax
	cmp	QWORD PTR -64[rbp], 0
	jne	.L3
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 11
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	jmp	.L2
.L3:
	mov	rcx, QWORD PTR -80[rbp]
	mov	rax, QWORD PTR -72[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	rsi, QWORD PTR -88[rbp]
	mov	rdx, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR -64[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fread@PLT
	cmp	rax, 1
	je	.L5
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 20
	mov	esi, 1
	lea	rdi, .LC9[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L2
.L5:
	mov	eax, DWORD PTR image_no[rip]
	lea	edx, 1[rax]
	lea	rax, -48[rbp]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -48[rbp]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -56[rbp], rax
	cmp	QWORD PTR -56[rbp], 0
	je	.L6
	mov	rsi, QWORD PTR -88[rbp]
	mov	rdx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -64[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, DWORD PTR image_no[rip]
	add	eax, 1
	mov	DWORD PTR image_no[rip], eax
	lea	rax, -48[rbp]
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L7
.L6:
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -48[rbp]
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L7:
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	free@PLT
.L2:
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	extract_image, .-extract_image
	.globl	read_blocks
	.type	read_blocks, @function
read_blocks:
.LFB2:
	.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
	mov	DWORD PTR -24[rbp], 0
	mov	rax, QWORD PTR -48[rbp]
	lea	rcx, 2[rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
.L25:
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	getc@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 255
	jne	.L29
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	getc@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], -1
	je	.L30
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	getc@PLT
	mov	DWORD PTR -16[rbp], eax
	cmp	DWORD PTR -16[rbp], -1
	je	.L31
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	getc@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], -1
	je	.L32
	mov	eax, DWORD PTR -16[rbp]
	sal	eax, 8
	mov	edx, eax
	mov	eax, DWORD PTR -12[rbp]
	add	eax, edx
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	sub	eax, 216
	cmp	eax, 21
	ja	.L33
	mov	eax, eax
	lea	rdx, 0[0+rax*4]
	lea	rax, .L19[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cdqe
	lea	rdx, .L19[rip]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L19:
	.long	.L23-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L22-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L21-.L19
	.long	.L20-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L33-.L19
	.long	.L18-.L19
	.text
.L21:
	mov	DWORD PTR -24[rbp], 1
	mov	eax, DWORD PTR count_app0[rip]
	add	eax, 1
	mov	DWORD PTR count_app0[rip], eax
	jmp	.L24
.L20:
	mov	DWORD PTR -24[rbp], 1
	mov	eax, DWORD PTR count_exif[rip]
	add	eax, 1
	mov	DWORD PTR count_exif[rip], eax
	jmp	.L24
.L18:
	mov	eax, DWORD PTR count_ffed[rip]
	add	eax, 1
	mov	DWORD PTR count_ffed[rip], eax
	jmp	.L24
.L23:
	mov	eax, DWORD PTR count_ffd8[rip]
	add	eax, 1
	mov	DWORD PTR count_ffd8[rip], eax
	jmp	.L24
.L22:
	mov	eax, DWORD PTR count_ffd8[rip]
	add	eax, 1
	mov	DWORD PTR count_ffd8[rip], eax
	jmp	.L24
.L33:
	nop
.L24:
	mov	eax, DWORD PTR -8[rbp]
	sub	eax, 2
	movsx	rcx, eax
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	jmp	.L25
.L29:
	nop
	cmp	DWORD PTR -24[rbp], 0
	je	.L10
.L27:
	mov	eax, DWORD PTR -28[rbp]
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	getc@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], -1
	je	.L26
	cmp	DWORD PTR -4[rbp], 255
	jne	.L27
	cmp	DWORD PTR -28[rbp], 217
	jne	.L27
.L26:
	cmp	DWORD PTR -28[rbp], -1
	je	.L10
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	edx, eax
	mov	rax, QWORD PTR -48[rbp]
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], 15728639
	jg	.L10
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	extract_image
	jmp	.L10
.L30:
	nop
	jmp	.L10
.L31:
	nop
	jmp	.L10
.L32:
	nop
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	read_blocks, .-read_blocks
	.section	.rodata
.LC14:
	.string	"Must supply file name\n"
.LC15:
	.string	"rb"
	.text
	.globl	main
	.type	main, @function
main:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	cmp	DWORD PTR -20[rbp], 2
	je	.L35
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 22
	mov	esi, 1
	lea	rdi, .LC14[rip]
	call	fwrite@PLT
	mov	eax, 0
	jmp	.L36
.L35:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L37
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 0
	jmp	.L36
.L37:
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 512
	lea	rdi, buffer[rip]
	call	fread@PLT
	cmp	rax, 1
	jne	.L46
	mov	eax, DWORD PTR count_sector[rip]
	add	eax, 1
	mov	DWORD PTR count_sector[rip], eax
	mov	edx, DWORD PTR count_sector[rip]
	mov	eax, edx
	imul	rax, rax, 1125899907
	shr	rax, 32
	shr	eax, 19
	imul	ecx, eax, 2000000
	mov	eax, edx
	sub	eax, ecx
	test	eax, eax
	jne	.L40
	call	report
.L40:
	movzx	eax, BYTE PTR buffer[rip]
	cmp	al, -1
	jne	.L47
	movzx	eax, BYTE PTR buffer[rip+1]
	cmp	al, -40
	jne	.L47
	mov	eax, DWORD PTR count_start_of_image[rip]
	add	eax, 1
	mov	DWORD PTR count_start_of_image[rip], eax
	movzx	eax, BYTE PTR buffer[rip+2]
	cmp	al, -1
	jne	.L48
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, -512[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	read_blocks
	mov	rcx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	jmp	.L37
.L47:
	nop
	jmp	.L37
.L48:
	nop
	jmp	.L37
.L46:
	nop
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	call	report
	mov	eax, 0
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	"177383.c"
	.text
	.comm	buffer,512,4
	.comm	count_sector,4,4
	.comm	count_start_of_image,4,4
	.comm	count_app0,4,4
	.comm	count_exif,4,4
	.comm	count_ffed,4,4
	.comm	count_ffd8,4,4
	.comm	count_ffdb,4,4
	.comm	image_no,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%i GB inspected\012\000"
	.align	2
.LC1:
	.ascii	"%i sectors inspected\012\000"
	.align	2
.LC2:
	.ascii	"%i start_of_image count\012\000"
	.align	2
.LC3:
	.ascii	"%i APP0 count\012\000"
	.align	2
.LC4:
	.ascii	"%i EXIF count\012\000"
	.align	2
.LC5:
	.ascii	"%i FFED count\012\000"
	.align	2
.LC6:
	.ascii	"%i FFD8 count\012\000"
	.align	2
.LC7:
	.ascii	"%i FFDB count\012\000"
	.text
	.align	2
	.global	report
	.syntax unified
	.arm
	.fpu softvfp
	.type	report, %function
report:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	mov	r0, #10
	bl	putchar
	ldr	r3, .L2
	ldr	r3, [r3]
	ldr	r2, .L2+4
	umull	r1, r3, r2, r3
	lsr	r3, r3, #19
	mov	r1, r3
	ldr	r0, .L2+8
	bl	printf
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L2+12
	bl	printf
	ldr	r3, .L2+16
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L2+20
	bl	printf
	ldr	r3, .L2+24
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L2+28
	bl	printf
	ldr	r3, .L2+32
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L2+36
	bl	printf
	ldr	r3, .L2+40
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L2+44
	bl	printf
	ldr	r3, .L2+48
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L2+52
	bl	printf
	ldr	r3, .L2+56
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L2+60
	bl	printf
	nop
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	count_sector
	.word	1125899907
	.word	.LC0
	.word	.LC1
	.word	count_start_of_image
	.word	.LC2
	.word	count_app0
	.word	.LC3
	.word	count_exif
	.word	.LC4
	.word	count_ffed
	.word	.LC5
	.word	count_ffd8
	.word	.LC6
	.word	count_ffdb
	.word	.LC7
	.size	report, .-report
	.section	.rodata
	.align	2
.LC8:
	.ascii	"Out of mem\012\000"
	.align	2
.LC9:
	.ascii	"Unable to read data\012\000"
	.align	2
.LC10:
	.ascii	"out/%010d.jpg\000"
	.align	2
.LC11:
	.ascii	"wb\000"
	.align	2
.LC12:
	.ascii	"Extracted '%s'\012\000"
	.align	2
.LC13:
	.ascii	"Unable to open '%s'\012\000"
	.align	2
.LC14:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	extract_image, %function
extract_image:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	str	r0, [fp, #-64]
	str	r1, [fp, #-68]
	str	r2, [fp, #-72]
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-72]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L5
	ldr	r3, .L12+4
	ldr	r3, [r3]
	mov	r2, #11
	mov	r1, #1
	ldr	r0, .L12+8
	bl	fwrite
	b	.L4
.L5:
	mov	r2, #0
	ldr	r1, [fp, #-68]
	ldr	r0, [fp, #-64]
	bl	fseek
	ldr	r1, [fp, #-72]
	ldr	r3, [fp, #-64]
	mov	r2, #1
	ldr	r0, [fp, #-56]
	bl	fread
	mov	r3, r0
	cmp	r3, #1
	beq	.L7
	ldr	r3, .L12+4
	ldr	r3, [r3]
	mov	r2, #20
	mov	r1, #1
	ldr	r0, .L12+12
	bl	fwrite
	ldr	r0, [fp, #-56]
	bl	free
	b	.L4
.L7:
	ldr	r3, .L12+16
	ldr	r3, [r3]
	add	r2, r3, #1
	sub	r3, fp, #48
	ldr	r1, .L12+20
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #48
	ldr	r1, .L12+24
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmp	r3, #0
	beq	.L8
	ldr	r1, [fp, #-72]
	ldr	r3, [fp, #-52]
	mov	r2, #1
	ldr	r0, [fp, #-56]
	bl	fwrite
	ldr	r0, [fp, #-52]
	bl	fclose
	ldr	r3, .L12+16
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L12+16
	str	r3, [r2]
	sub	r3, fp, #48
	mov	r1, r3
	ldr	r0, .L12+28
	bl	printf
	b	.L9
.L8:
	ldr	r3, .L12+4
	ldr	r3, [r3]
	sub	r2, fp, #48
	ldr	r1, .L12+32
	mov	r0, r3
	bl	fprintf
.L9:
	ldr	r0, [fp, #-56]
	bl	free
.L4:
	ldr	r3, .L12
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC14
	.word	stderr
	.word	.LC8
	.word	.LC9
	.word	image_no
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.size	extract_image, .-extract_image
	.align	2
	.global	read_blocks
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_blocks, %function
read_blocks:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-44]
	add	r3, r3, #2
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-40]
	bl	fseek
.L29:
	ldr	r0, [fp, #-40]
	bl	getc
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #255
	bne	.L33
	ldr	r0, [fp, #-40]
	bl	getc
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmn	r3, #1
	beq	.L34
	ldr	r0, [fp, #-40]
	bl	getc
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	beq	.L35
	ldr	r0, [fp, #-40]
	bl	getc
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	beq	.L36
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #8
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-24]
	sub	r3, r3, #216
	cmp	r3, #21
	ldrls	pc, [pc, r3, asl #2]
	b	.L37
.L23:
	.word	.L27
	.word	.L37
	.word	.L37
	.word	.L26
	.word	.L37
	.word	.L37
	.word	.L37
	.word	.L37
	.word	.L25
	.word	.L24
	.word	.L37
	.word	.L37
	.word	.L37
	.word	.L37
	.word	.L37
	.word	.L37
	.word	.L37
	.word	.L37
	.word	.L37
	.word	.L37
	.word	.L37
	.word	.L22
.L25:
	mov	r3, #1
	str	r3, [fp, #-28]
	ldr	r3, .L38
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L38
	str	r3, [r2]
	b	.L28
.L24:
	mov	r3, #1
	str	r3, [fp, #-28]
	ldr	r3, .L38+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L38+4
	str	r3, [r2]
	b	.L28
.L22:
	ldr	r3, .L38+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L38+8
	str	r3, [r2]
	b	.L28
.L27:
	ldr	r3, .L38+12
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L38+12
	str	r3, [r2]
	b	.L28
.L26:
	ldr	r3, .L38+12
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L38+12
	str	r3, [r2]
	b	.L28
.L37:
	nop
.L28:
	ldr	r3, [fp, #-12]
	sub	r3, r3, #2
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-40]
	bl	fseek
	b	.L29
.L33:
	nop
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L14
.L31:
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-40]
	bl	getc
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmn	r3, #1
	beq	.L30
	ldr	r3, [fp, #-8]
	cmp	r3, #255
	bne	.L31
	ldr	r3, [fp, #-32]
	cmp	r3, #217
	bne	.L31
.L30:
	ldr	r3, [fp, #-32]
	cmn	r3, #1
	beq	.L14
	ldr	r0, [fp, #-40]
	bl	ftell
	mov	r2, r0
	ldr	r3, [fp, #-44]
	sub	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #15728640
	bge	.L14
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-44]
	ldr	r0, [fp, #-40]
	bl	extract_image
	b	.L14
.L34:
	nop
	b	.L14
.L35:
	nop
	b	.L14
.L36:
	nop
.L14:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L39:
	.align	2
.L38:
	.word	count_app0
	.word	count_exif
	.word	count_ffed
	.word	count_ffd8
	.size	read_blocks, .-read_blocks
	.section	.rodata
	.align	2
.LC15:
	.ascii	"Must supply file name\012\000"
	.align	2
.LC16:
	.ascii	"rb\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	.L41
	ldr	r3, .L55
	ldr	r3, [r3]
	mov	r2, #22
	mov	r1, #1
	ldr	r0, .L55+4
	bl	fwrite
	mov	r3, #0
	b	.L42
.L41:
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L55+8
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L43
	ldr	r3, .L55
	ldr	r0, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L55+12
	bl	fprintf
	mov	r3, #0
	b	.L42
.L43:
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #512
	ldr	r0, .L55+16
	bl	fread
	mov	r3, r0
	cmp	r3, #1
	bne	.L52
	ldr	r3, .L55+20
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L55+20
	str	r3, [r2]
	ldr	r3, .L55+20
	ldr	r0, [r3]
	ldr	r3, .L55+24
	umull	r2, r3, r0, r3
	lsr	r1, r3, #19
	mov	r2, r1
	lsl	r2, r2, #5
	sub	r2, r2, r1
	lsl	r3, r2, #6
	sub	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r1
	lsl	r3, r3, #7
	sub	r1, r0, r3
	cmp	r1, #0
	bne	.L46
	bl	report
.L46:
	ldr	r3, .L55+16
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L53
	ldr	r3, .L55+16
	ldrb	r3, [r3, #1]	@ zero_extendqisi2
	cmp	r3, #216
	bne	.L53
	ldr	r3, .L55+28
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L55+28
	str	r3, [r2]
	ldr	r3, .L55+16
	ldrb	r3, [r3, #2]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L54
	ldr	r0, [fp, #-12]
	bl	ftell
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	sub	r3, r3, #512
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	read_blocks
	mov	r2, #0
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-12]
	bl	fseek
	b	.L43
.L53:
	nop
	b	.L43
.L54:
	nop
	b	.L43
.L52:
	nop
	ldr	r0, [fp, #-12]
	bl	fclose
	bl	report
	mov	r3, #0
.L42:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L56:
	.align	2
.L55:
	.word	stderr
	.word	.LC15
	.word	.LC16
	.word	.LC13
	.word	buffer
	.word	count_sector
	.word	1125899907
	.word	count_start_of_image
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
