	.file	"508555.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: %s [filename]\n"
.LC1:
	.string	".mpo"
.LC2:
	.string	"rb"
.LC3:
	.string	"error opening file \"%s\"\n"
.LC4:
	.string	"failed to allocate memory\n"
	.align 8
.LC5:
	.string	"Allocated %ld chars of memory.\n"
.LC6:
	.string	"error loading file\n"
.LC7:
	.string	"View found at offset %d\n"
.LC8:
	.string	"%s.v%d.jpg"
.LC9:
	.string	"wb"
.LC10:
	.string	"Created %s\n"
.LC11:
	.string	"No views found.\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
	add	rsp, -128
	mov	DWORD PTR -116[rbp], edi
	mov	QWORD PTR -128[rbp], rsi
	mov	DWORD PTR -100[rbp], 0
	cmp	DWORD PTR -116[rbp], 2
	je	.L2
	mov	rax, QWORD PTR -128[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stdout[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 0
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -80[rbp], rax
	mov	rax, QWORD PTR -128[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	strdup@PLT
	mov	QWORD PTR -72[rbp], rax
	mov	rax, QWORD PTR -72[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	strstr@PLT
	mov	QWORD PTR -64[rbp], rax
	cmp	QWORD PTR -64[rbp], 0
	je	.L4
	mov	rax, QWORD PTR -64[rbp]
	mov	BYTE PTR [rax], 0
.L4:
	mov	rax, QWORD PTR -80[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -56[rbp], rax
	cmp	QWORD PTR -56[rbp], 0
	jne	.L5
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -80[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L3
.L5:
	mov	rax, QWORD PTR -56[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	QWORD PTR -48[rbp], rax
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	rewind@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	eax, 2
	jmp	.L3
.L6:
	mov	rax, QWORD PTR stdout[rip]
	mov	rdx, QWORD PTR -48[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rdx, QWORD PTR -48[rbp]
	mov	rcx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	cmp	QWORD PTR -32[rbp], rax
	je	.L7
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 19
	mov	esi, 1
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
	mov	eax, 3
	jmp	.L3
.L7:
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -96[rbp], rax
	mov	QWORD PTR -88[rbp], 0
	mov	edi, 256
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	jmp	.L8
.L14:
	mov	rax, QWORD PTR -96[rbp]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	movsx	rdx, eax
	imul	rdx, rdx, -2139062143
	shr	rdx, 32
	add	edx, eax
	sar	edx, 7
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	ecx, edx
	sal	ecx, 8
	sub	ecx, edx
	sub	eax, ecx
	mov	edx, eax
	cmp	edx, -1
	jne	.L9
	mov	rax, QWORD PTR -96[rbp]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	movsx	rdx, eax
	imul	rdx, rdx, -2139062143
	shr	rdx, 32
	add	edx, eax
	sar	edx, 7
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	ecx, edx
	sal	ecx, 8
	sub	ecx, edx
	sub	eax, ecx
	mov	edx, eax
	cmp	edx, -40
	jne	.L10
	mov	rax, QWORD PTR -96[rbp]
	add	rax, 2
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	movsx	rdx, eax
	imul	rdx, rdx, -2139062143
	shr	rdx, 32
	add	edx, eax
	sar	edx, 7
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	ecx, edx
	sal	ecx, 8
	sub	ecx, edx
	sub	eax, ecx
	mov	edx, eax
	cmp	edx, -1
	jne	.L11
	mov	rax, QWORD PTR -96[rbp]
	add	rax, 3
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	movsx	rdx, eax
	imul	rdx, rdx, -2139062143
	shr	rdx, 32
	add	edx, eax
	sar	edx, 7
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	ecx, edx
	sal	ecx, 8
	sub	ecx, edx
	sub	eax, ecx
	mov	edx, eax
	cmp	edx, -31
	jne	.L12
	mov	rax, QWORD PTR -96[rbp]
	sub	rax, QWORD PTR -40[rbp]
	mov	rdx, rax
	mov	rax, QWORD PTR stdout[rip]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -100[rbp], 1
	cmp	QWORD PTR -88[rbp], 0
	je	.L13
	mov	eax, DWORD PTR -100[rbp]
	lea	ecx, -1[rax]
	mov	rdx, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -96[rbp]
	sub	rax, QWORD PTR -88[rbp]
	mov	rsi, rax
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -88[rbp]
	mov	rcx, rdx
	mov	rdx, rsi
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdx, QWORD PTR -24[rbp]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L13:
	mov	rax, QWORD PTR -96[rbp]
	mov	QWORD PTR -88[rbp], rax
	add	QWORD PTR -96[rbp], 4
	jmp	.L8
.L12:
	add	QWORD PTR -96[rbp], 2
	jmp	.L8
.L11:
	add	QWORD PTR -96[rbp], 3
	jmp	.L8
.L10:
	add	QWORD PTR -96[rbp], 1
	jmp	.L8
.L9:
	add	QWORD PTR -96[rbp], 1
.L8:
	mov	rax, QWORD PTR -48[rbp]
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	cmp	QWORD PTR -96[rbp], rax
	jb	.L14
	cmp	DWORD PTR -100[rbp], 1
	jle	.L15
	mov	ecx, DWORD PTR -100[rbp]
	mov	rdx, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rdx, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	sub	rax, QWORD PTR -88[rbp]
	mov	rsi, rax
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -88[rbp]
	mov	rcx, rdx
	mov	rdx, rsi
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdx, QWORD PTR -24[rbp]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L16
.L15:
	cmp	DWORD PTR -100[rbp], 0
	jne	.L16
	mov	rax, QWORD PTR stdout[rip]
	mov	rcx, rax
	mov	edx, 16
	mov	esi, 1
	lea	rdi, .LC11[rip]
	call	fwrite@PLT
.L16:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"508555.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s [filename]\012\000"
	.align	2
.LC1:
	.ascii	".mpo\000"
	.align	2
.LC2:
	.ascii	"rb\000"
	.align	2
.LC3:
	.ascii	"error opening file \"%s\"\012\000"
	.align	2
.LC4:
	.ascii	"failed to allocate memory\012\000"
	.align	2
.LC5:
	.ascii	"Allocated %ld chars of memory.\012\000"
	.align	2
.LC6:
	.ascii	"error loading file\012\000"
	.align	2
.LC7:
	.ascii	"View found at offset %d\012\000"
	.align	2
.LC8:
	.ascii	"%s.v%d.jpg\000"
	.align	2
.LC9:
	.ascii	"wb\000"
	.align	2
.LC10:
	.ascii	"Created %s\012\000"
	.align	2
.LC11:
	.ascii	"No views found.\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #64
	str	r0, [fp, #-64]
	str	r1, [fp, #-68]
	mov	r3, #0
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-64]
	cmp	r3, #2
	beq	.L2
	ldr	r3, .L17
	ldr	r0, [r3]
	ldr	r3, [fp, #-68]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L17+4
	bl	fprintf
	mov	r3, #0
	b	.L3
.L2:
	ldr	r3, [fp, #-68]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-68]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	strdup
	mov	r3, r0
	str	r3, [fp, #-40]
	ldr	r1, .L17+8
	ldr	r0, [fp, #-40]
	bl	strstr
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	beq	.L4
	ldr	r3, [fp, #-36]
	mov	r2, #0
	strb	r2, [r3]
.L4:
	ldr	r1, .L17+12
	ldr	r0, [fp, #-44]
	bl	fopen
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L5
	ldr	r3, .L17+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-44]
	ldr	r1, .L17+20
	mov	r0, r3
	bl	fprintf
	mov	r3, #1
	b	.L3
.L5:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-32]
	bl	fseek
	ldr	r0, [fp, #-32]
	bl	ftell
	str	r0, [fp, #-28]
	ldr	r0, [fp, #-32]
	bl	rewind
	ldr	r3, [fp, #-28]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L6
	ldr	r3, .L17+16
	ldr	r3, [r3]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L17+24
	bl	fwrite
	mov	r3, #2
	b	.L3
.L6:
	ldr	r3, .L17
	ldr	r3, [r3]
	ldr	r2, [fp, #-28]
	ldr	r1, .L17+28
	mov	r0, r3
	bl	fprintf
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-32]
	mov	r1, #1
	ldr	r0, [fp, #-24]
	bl	fread
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	beq	.L7
	ldr	r3, .L17+16
	ldr	r3, [r3]
	mov	r2, #19
	mov	r1, #1
	ldr	r0, .L17+32
	bl	fwrite
	mov	r3, #3
	b	.L3
.L7:
	ldr	r0, [fp, #-32]
	bl	fclose
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-52]
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r0, #256
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	b	.L8
.L14:
	ldr	r3, [fp, #-52]
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, .L17+36
	umull	r1, r3, r2, r3
	lsr	r1, r3, #7
	mov	r3, r1
	lsl	r3, r3, #8
	sub	r3, r3, r1
	sub	r3, r2, r3
	and	r3, r3, #255
	cmp	r3, #255
	bne	.L9
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, .L17+36
	umull	r1, r3, r2, r3
	lsr	r1, r3, #7
	mov	r3, r1
	lsl	r3, r3, #8
	sub	r3, r3, r1
	sub	r3, r2, r3
	and	r3, r3, #255
	cmp	r3, #216
	bne	.L10
	ldr	r3, [fp, #-52]
	add	r3, r3, #2
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, .L17+36
	umull	r1, r3, r2, r3
	lsr	r1, r3, #7
	mov	r3, r1
	lsl	r3, r3, #8
	sub	r3, r3, r1
	sub	r3, r2, r3
	and	r3, r3, #255
	cmp	r3, #255
	bne	.L11
	ldr	r3, [fp, #-52]
	add	r3, r3, #3
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, .L17+36
	umull	r1, r3, r2, r3
	lsr	r1, r3, #7
	mov	r3, r1
	lsl	r3, r3, #8
	sub	r3, r3, r1
	sub	r3, r2, r3
	and	r3, r3, #255
	cmp	r3, #225
	bne	.L12
	ldr	r3, .L17
	ldr	r0, [r3]
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-24]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r1, .L17+40
	bl	fprintf
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-48]
	cmp	r3, #0
	beq	.L13
	ldr	r3, [fp, #-56]
	sub	r3, r3, #1
	ldr	r2, [fp, #-40]
	ldr	r1, .L17+44
	ldr	r0, [fp, #-16]
	bl	sprintf
	ldr	r1, .L17+48
	ldr	r0, [fp, #-16]
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-48]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-8]
	mov	r1, #1
	ldr	r0, [fp, #-48]
	bl	fwrite
	ldr	r0, [fp, #-8]
	bl	fclose
	ldr	r3, .L17
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	ldr	r1, .L17+52
	mov	r0, r3
	bl	fprintf
.L13:
	ldr	r3, [fp, #-52]
	str	r3, [fp, #-48]
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	str	r3, [fp, #-52]
	b	.L8
.L12:
	ldr	r3, [fp, #-52]
	add	r3, r3, #2
	str	r3, [fp, #-52]
	b	.L8
.L11:
	ldr	r3, [fp, #-52]
	add	r3, r3, #3
	str	r3, [fp, #-52]
	b	.L8
.L10:
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
	b	.L8
.L9:
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L8:
	ldr	r3, [fp, #-28]
	sub	r3, r3, #4
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [fp, #-52]
	cmp	r2, r3
	bcc	.L14
	ldr	r3, [fp, #-56]
	cmp	r3, #1
	ble	.L15
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #-40]
	ldr	r1, .L17+44
	ldr	r0, [fp, #-16]
	bl	sprintf
	ldr	r1, .L17+48
	ldr	r0, [fp, #-16]
	bl	fopen
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-24]
	add	r2, r2, r3
	ldr	r3, [fp, #-48]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-12]
	mov	r1, #1
	ldr	r0, [fp, #-48]
	bl	fwrite
	ldr	r0, [fp, #-12]
	bl	fclose
	ldr	r3, .L17
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	ldr	r1, .L17+52
	mov	r0, r3
	bl	fprintf
	b	.L16
.L15:
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L16
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r2, #16
	mov	r1, #1
	ldr	r0, .L17+56
	bl	fwrite
.L16:
	ldr	r0, [fp, #-16]
	bl	free
	ldr	r0, [fp, #-24]
	bl	free
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	stdout
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	stderr
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	-2139062143
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
