	.file	"366458.c"
	.intel_syntax noprefix
	.text
	.globl	buffer
	.bss
	.align 32
	.type	buffer, @object
	.size	buffer, 512
buffer:
	.zero	512
	.globl	title
	.data
	.type	title, @object
	.size	title, 7
title:
	.ascii	"000.jpg"
	.globl	imgno
	.align 4
	.type	imgno, @object
	.size	imgno, 4
imgno:
	.long	1
	.section	.rodata
.LC0:
	.string	"r"
.LC1:
	.string	"card.raw"
.LC2:
	.string	"Could not open %s.\n"
.LC3:
	.string	"w"
.LC4:
	.string	"%03d.jpg"
	.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
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	QWORD PTR -16[rbp], 0
	cmp	QWORD PTR -8[rbp], 0
	jne	.L4
	lea	rsi, .LC1[rip]
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 1
	jmp	.L3
.L7:
	movzx	eax, BYTE PTR buffer[rip]
	cmp	al, -1
	jne	.L5
	movzx	eax, BYTE PTR buffer[rip+1]
	cmp	al, -40
	jne	.L5
	movzx	eax, BYTE PTR buffer[rip+2]
	cmp	al, -1
	jne	.L5
	movzx	eax, BYTE PTR buffer[rip+3]
	cmp	al, -33
	jbe	.L5
	movzx	eax, BYTE PTR buffer[rip+3]
	cmp	al, -17
	ja	.L5
	cmp	QWORD PTR -16[rbp], 0
	je	.L6
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L6:
	lea	rsi, .LC3[rip]
	lea	rdi, title[rip]
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	eax, DWORD PTR imgno[rip]
	mov	edx, eax
	lea	rsi, .LC4[rip]
	lea	rdi, title[rip]
	mov	eax, 0
	call	sprintf@PLT
	mov	eax, DWORD PTR imgno[rip]
	add	eax, 1
	mov	DWORD PTR imgno[rip], eax
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 512
	lea	rdi, buffer[rip]
	call	fwrite@PLT
	jmp	.L4
.L5:
	cmp	QWORD PTR -16[rbp], 0
	je	.L4
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 512
	lea	rdi, buffer[rip]
	call	fwrite@PLT
.L4:
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 512
	lea	rdi, buffer[rip]
	call	fread@PLT
	test	rax, rax
	jne	.L7
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	cmp	QWORD PTR -16[rbp], 0
	je	.L8
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L8:
	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	"366458.c"
	.text
	.comm	buffer,512,4
	.global	title
	.data
	.align	2
	.type	title, %object
	.size	title, 7
title:
	.ascii	"000.jpg"
	.global	imgno
	.align	2
	.type	imgno, %object
	.size	imgno, 4
imgno:
	.word	1
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"card.raw\000"
	.align	2
.LC2:
	.ascii	"Could not open %s.\012\000"
	.align	2
.LC3:
	.ascii	"w\000"
	.align	2
.LC4:
	.ascii	"%03d.jpg\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	r1, .L9
	ldr	r0, .L9+4
	bl	fopen
	str	r0, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L4
	ldr	r1, .L9+4
	ldr	r0, .L9+8
	bl	printf
	ldr	r0, [fp, #-8]
	bl	fclose
	mov	r3, #1
	b	.L3
.L7:
	ldr	r3, .L9+12
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L5
	ldr	r3, .L9+12
	ldrb	r3, [r3, #1]	@ zero_extendqisi2
	cmp	r3, #216
	bne	.L5
	ldr	r3, .L9+12
	ldrb	r3, [r3, #2]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L5
	ldr	r3, .L9+12
	ldrb	r3, [r3, #3]	@ zero_extendqisi2
	cmp	r3, #223
	bls	.L5
	ldr	r3, .L9+12
	ldrb	r3, [r3, #3]	@ zero_extendqisi2
	cmp	r3, #239
	bhi	.L5
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L6
	ldr	r0, [fp, #-12]
	bl	fclose
.L6:
	ldr	r1, .L9+16
	ldr	r0, .L9+20
	bl	fopen
	str	r0, [fp, #-12]
	ldr	r3, .L9+24
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L9+28
	ldr	r0, .L9+20
	bl	sprintf
	ldr	r3, .L9+24
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L9+24
	str	r3, [r2]
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #512
	ldr	r0, .L9+12
	bl	fwrite
	b	.L4
.L5:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L4
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #512
	ldr	r0, .L9+12
	bl	fwrite
.L4:
	ldr	r3, [fp, #-8]
	mov	r2, #1
	mov	r1, #512
	ldr	r0, .L9+12
	bl	fread
	mov	r3, r0
	cmp	r3, #0
	bne	.L7
	ldr	r0, [fp, #-8]
	bl	fclose
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L8
	ldr	r0, [fp, #-12]
	bl	fclose
.L8:
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	buffer
	.word	.LC3
	.word	title
	.word	imgno
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
