	.file	"937001.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"parse header\n"
.LC1:
	.string	"*** %s"
.LC2:
	.string	"Content-Length: "
.LC3:
	.string	"Content-Length: %d\r"
.LC4:
	.string	"Unable to parse size!\n"
.LC5:
	.string	"*** SIZE %d\n"
	.text
	.globl	parse_header
	.type	parse_header, @function
parse_header:
.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, 112
	mov	QWORD PTR -104[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -80[rbp], 0
	mov	QWORD PTR -72[rbp], 0
	mov	QWORD PTR -64[rbp], 0
	mov	QWORD PTR -56[rbp], 0
	mov	QWORD PTR -48[rbp], 0
	mov	QWORD PTR -40[rbp], 0
	mov	QWORD PTR -32[rbp], 0
	mov	QWORD PTR -24[rbp], 0
	mov	DWORD PTR -84[rbp], 1
	mov	DWORD PTR -88[rbp], 0
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 13
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	jmp	.L2
.L5:
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -80[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	movzx	eax, BYTE PTR -80[rbp]
	cmp	al, 13
	jne	.L3
	cmp	DWORD PTR -84[rbp], 0
	je	.L9
.L3:
	mov	DWORD PTR -84[rbp], 0
	lea	rax, -80[rbp]
	mov	edx, 16
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L2
	lea	rdx, -88[rbp]
	lea	rax, -80[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
.L2:
	mov	rdx, QWORD PTR -104[rbp]
	lea	rax, -80[rbp]
	mov	esi, 64
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	jne	.L5
	jmp	.L4
.L9:
	nop
.L4:
	mov	eax, DWORD PTR -88[rbp]
	test	eax, eax
	jne	.L6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 22
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	edx, DWORD PTR -88[rbp]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR -88[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	parse_header, .-parse_header
	.section	.rodata
.LC6:
	.string	"rb"
.LC7:
	.string	"\r"
.LC8:
	.string	"--myboundary\r"
.LC9:
	.string	"Content-Type: image/jpeg\r"
.LC10:
	.string	"Content-Length: %d\r\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -20[rbp], 0
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
.L14:
	cmp	DWORD PTR -20[rbp], 0
	jle	.L11
	lea	rdi, .LC7[rip]
	call	puts@PLT
.L11:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	parse_header
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	edx, DWORD PTR -20[rbp]
	movsx	rdx, edx
	cmp	rax, rdx
	jne	.L12
	lea	rdi, .LC8[rip]
	call	puts@PLT
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	rcx, QWORD PTR stdout[rip]
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	jmp	.L13
.L12:
	mov	DWORD PTR -20[rbp], 0
.L13:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	cmp	DWORD PTR -20[rbp], 0
	jne	.L14
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"937001.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"parse header\012\000"
	.align	2
.LC1:
	.ascii	"*** %s\000"
	.align	2
.LC2:
	.ascii	"Content-Length: \000"
	.align	2
.LC3:
	.ascii	"Content-Length: %d\015\000"
	.align	2
.LC4:
	.ascii	"Unable to parse size!\012\000"
	.align	2
.LC5:
	.ascii	"*** SIZE %d\012\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	parse_header
	.syntax unified
	.arm
	.fpu softvfp
	.type	parse_header, %function
parse_header:
	@ args = 0, pretend = 0, frame = 88
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #88
	str	r0, [fp, #-88]
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-72]
	sub	r3, fp, #68
	mov	r2, #60
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #1
	str	r3, [fp, #-76]
	mov	r3, #0
	str	r3, [fp, #-80]
	ldr	r3, .L10+4
	ldr	r3, [r3]
	mov	r2, #13
	mov	r1, #1
	ldr	r0, .L10+8
	bl	fwrite
	b	.L2
.L5:
	ldr	r3, .L10+4
	ldr	r3, [r3]
	sub	r2, fp, #72
	ldr	r1, .L10+12
	mov	r0, r3
	bl	fprintf
	ldrb	r3, [fp, #-72]	@ zero_extendqisi2
	cmp	r3, #13
	bne	.L3
	ldr	r3, [fp, #-76]
	cmp	r3, #0
	beq	.L9
.L3:
	mov	r3, #0
	str	r3, [fp, #-76]
	sub	r3, fp, #72
	mov	r2, #16
	ldr	r1, .L10+16
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L2
	sub	r2, fp, #80
	sub	r3, fp, #72
	ldr	r1, .L10+20
	mov	r0, r3
	bl	__isoc99_sscanf
.L2:
	sub	r3, fp, #72
	ldr	r2, [fp, #-88]
	mov	r1, #64
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L5
	b	.L4
.L9:
	nop
.L4:
	ldr	r3, [fp, #-80]
	cmp	r3, #0
	bne	.L6
	ldr	r3, .L10+4
	ldr	r3, [r3]
	mov	r2, #22
	mov	r1, #1
	ldr	r0, .L10+24
	bl	fwrite
	mov	r0, #1
	bl	exit
.L6:
	ldr	r3, .L10+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-80]
	ldr	r1, .L10+28
	mov	r0, r3
	bl	fprintf
	ldr	r3, [fp, #-80]
	ldr	r2, .L10
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC6
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	parse_header, .-parse_header
	.section	.rodata
	.align	2
.LC7:
	.ascii	"rb\000"
	.align	2
.LC8:
	.ascii	"\015\000"
	.align	2
.LC9:
	.ascii	"--myboundary\015\000"
	.align	2
.LC10:
	.ascii	"Content-Type: image/jpeg\015\000"
	.align	2
.LC11:
	.ascii	"Content-Length: %d\015\012\000"
	.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
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L18
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-12]
.L16:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	ble	.L13
	ldr	r0, .L18+4
	bl	puts
.L13:
	ldr	r0, [fp, #-12]
	bl	parse_header
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	mov	r1, #1
	ldr	r0, [fp, #-8]
	bl	fread
	mov	r2, r0
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	bne	.L14
	ldr	r0, .L18+8
	bl	puts
	ldr	r0, .L18+12
	bl	puts
	ldr	r1, [fp, #-16]
	ldr	r0, .L18+16
	bl	printf
	ldr	r0, .L18+4
	bl	puts
	ldr	r3, .L18+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	ldr	r2, [fp, #-16]
	ldr	r3, .L18+20
	ldr	r3, [r3]
	mov	r1, #1
	ldr	r0, [fp, #-8]
	bl	fwrite
	ldr	r3, .L18+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	b	.L15
.L14:
	mov	r3, #0
	str	r3, [fp, #-16]
.L15:
	ldr	r0, [fp, #-8]
	bl	free
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L16
	ldr	r0, [fp, #-12]
	bl	fclose
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	stdout
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
