	.file	"717967.c"
	.intel_syntax noprefix
	.text
	.local	stdin_settings
	.comm	stdin_settings,60,32
	.local	img
	.comm	img,8,8
	.type	restore, @function
restore:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdx, stdin_settings[rip]
	mov	esi, 0
	mov	edi, 0
	call	tcsetattr@PLT
	mov	rax, QWORD PTR img[rip]
	test	rax, rax
	je	.L3
	mov	rax, QWORD PTR img[rip]
	mov	rdi, rax
	call	fclose@PLT
.L3:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	restore, .-restore
	.section	.rodata
.LC0:
	.string	"w"
.LC1:
	.string	"fopen"
	.text
	.type	open_image, @function
open_image:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR img[rip]
	test	rax, rax
	je	.L5
	mov	rax, QWORD PTR img[rip]
	mov	rdi, rax
	call	fclose@PLT
.L5:
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR img[rip], rax
	mov	rax, QWORD PTR img[rip]
	test	rax, rax
	jne	.L6
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L7
.L6:
	mov	eax, 1
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	open_image, .-open_image
	.section	.rodata
.LC2:
	.string	"img.jpg"
.LC3:
	.string	"output file: %s\n"
.LC4:
	.string	"/dev/ttyUSB0"
.LC5:
	.string	"open"
.LC6:
	.string	"select"
.LC7:
	.string	"stdin"
.LC8:
	.string	"stdin closed?\n"
.LC9:
	.string	"enter file name: "
.LC10:
	.string	"write tty"
.LC11:
	.string	"read"
.LC12:
	.string	"G\n"
.LC13:
	.string	"can't save to image '%s'\n"
.LC14:
	.string	"write"
.LC15:
	.string	"odd pos %d?\n"
.LC16:
	.string	"dot failed?\n"
.LC17:
	.string	"done\n"
.LC18:
	.string	"%s(%d)"
.LC19:
	.string	"bad char '%c'\n"
.LC20:
	.string	"bad pos %d\n"
.LC21:
	.string	"echo"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 384
	mov	DWORD PTR -372[rbp], edi
	mov	QWORD PTR -384[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -336[rbp], 1
	lea	rax, -80[rbp]
	mov	edx, 64
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	strncpy@PLT
	mov	DWORD PTR -364[rbp], 0
	jmp	.L9
.L11:
	mov	eax, DWORD PTR -364[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -384[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	jne	.L10
	mov	eax, DWORD PTR -364[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -384[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	cmp	al, 111
	jne	.L10
	add	DWORD PTR -364[rbp], 1
	mov	eax, DWORD PTR -364[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -384[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	lea	rax, -80[rbp]
	mov	edx, 64
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
.L10:
	add	DWORD PTR -364[rbp], 1
.L9:
	mov	eax, DWORD PTR -364[rbp]
	cmp	eax, DWORD PTR -372[rbp]
	jl	.L11
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -80[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	esi, 2050
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -332[rbp], eax
	cmp	DWORD PTR -332[rbp], -1
	jne	.L12
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L60
.L12:
	lea	rdx, -288[rbp]
	mov	eax, DWORD PTR -332[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	tcgetattr@PLT
	lea	rax, -288[rbp]
	mov	esi, 4098
	mov	rdi, rax
	call	cfsetspeed@PLT
	lea	rax, -288[rbp]
	mov	rdi, rax
	call	cfmakeraw@PLT
	lea	rdx, -288[rbp]
	mov	eax, DWORD PTR -332[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcsetattr@PLT
	lea	rsi, stdin_settings[rip]
	mov	edi, 0
	call	tcgetattr@PLT
	mov	rax, QWORD PTR stdin_settings[rip]
	mov	rdx, QWORD PTR stdin_settings[rip+8]
	mov	QWORD PTR -288[rbp], rax
	mov	QWORD PTR -280[rbp], rdx
	mov	rax, QWORD PTR stdin_settings[rip+16]
	mov	rdx, QWORD PTR stdin_settings[rip+24]
	mov	QWORD PTR -272[rbp], rax
	mov	QWORD PTR -264[rbp], rdx
	mov	rax, QWORD PTR stdin_settings[rip+32]
	mov	rdx, QWORD PTR stdin_settings[rip+40]
	mov	QWORD PTR -256[rbp], rax
	mov	QWORD PTR -248[rbp], rdx
	mov	rax, QWORD PTR stdin_settings[rip+48]
	mov	QWORD PTR -240[rbp], rax
	mov	eax, DWORD PTR stdin_settings[rip+56]
	mov	DWORD PTR -232[rbp], eax
	mov	eax, DWORD PTR -276[rbp]
	and	eax, -11
	mov	DWORD PTR -276[rbp], eax
	lea	rax, -288[rbp]
	mov	rdx, rax
	mov	esi, 0
	mov	edi, 0
	call	tcsetattr@PLT
	lea	rdi, restore[rip]
	call	atexit@PLT
	mov	DWORD PTR -360[rbp], 0
	mov	DWORD PTR -352[rbp], 0
	mov	DWORD PTR -348[rbp], 0
.L59:
	mov	QWORD PTR -304[rbp], 0
	mov	QWORD PTR -296[rbp], 0
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -224[rbp]
	mov	rdi, rdx
#APP
# 75 "the_stack_data/717967.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -328[rbp], edx
	mov	DWORD PTR -324[rbp], eax
	mov	rax, QWORD PTR -224[rbp]
	or	rax, 1
	mov	QWORD PTR -224[rbp], rax
	mov	eax, DWORD PTR -332[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	esi, eax
	movsx	rax, esi
	mov	rdi, QWORD PTR -224[rbp+rax*8]
	mov	eax, DWORD PTR -332[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	or	rdi, rax
	mov	rdx, rdi
	movsx	rax, esi
	mov	QWORD PTR -224[rbp+rax*8], rdx
	mov	eax, DWORD PTR -332[rbp]
	lea	edi, 1[rax]
	lea	rdx, -304[rbp]
	lea	rax, -224[rbp]
	mov	r8, rdx
	mov	ecx, 0
	mov	edx, 0
	mov	rsi, rax
	call	select@PLT
	mov	DWORD PTR -344[rbp], eax
	cmp	DWORD PTR -344[rbp], -1
	jne	.L14
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	eax, 4
	jmp	.L60
.L14:
	cmp	DWORD PTR -344[rbp], 0
	jle	.L16
	mov	rax, QWORD PTR -224[rbp]
	and	eax, 1
	test	rax, rax
	je	.L16
	lea	rax, -88[rbp]
	mov	edx, 8
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	QWORD PTR -320[rbp], rax
	cmp	QWORD PTR -320[rbp], -1
	jne	.L17
	lea	rdi, .LC7[rip]
	call	perror@PLT
	jmp	.L29
.L17:
	cmp	QWORD PTR -320[rbp], 0
	jne	.L19
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 14
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	jmp	.L29
.L19:
	movzx	eax, BYTE PTR -88[rbp]
	movsx	eax, al
	cmp	eax, 4
	je	.L20
	cmp	eax, 6
	je	.L21
	jmp	.L62
.L20:
	mov	edi, 0
	call	exit@PLT
.L21:
	cmp	DWORD PTR -360[rbp], 3
	je	.L63
	mov	DWORD PTR -360[rbp], 4
	mov	DWORD PTR -352[rbp], 0
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 17
	mov	esi, 1
	lea	rdi, .LC9[rip]
	call	fwrite@PLT
	jmp	.L63
.L62:
	cmp	DWORD PTR -360[rbp], 4
	jne	.L25
	movzx	eax, BYTE PTR -88[rbp]
	cmp	al, 10
	je	.L26
	mov	eax, DWORD PTR -352[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -320[rbp]
	add	rax, rdx
	cmp	rax, 62
	jle	.L27
.L26:
	mov	eax, DWORD PTR -352[rbp]
	cdqe
	mov	BYTE PTR -80[rbp+rax], 0
	mov	DWORD PTR -360[rbp], 0
	jmp	.L25
.L27:
	mov	rdx, QWORD PTR -320[rbp]
	mov	eax, DWORD PTR -352[rbp]
	cdqe
	lea	rcx, -80[rbp]
	add	rcx, rax
	lea	rax, -88[rbp]
	mov	rsi, rax
	mov	rdi, rcx
	call	memcpy@PLT
	mov	rax, QWORD PTR -320[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -352[rbp]
	add	eax, edx
	mov	DWORD PTR -352[rbp], eax
.L25:
	mov	rdx, QWORD PTR -320[rbp]
	lea	rcx, -88[rbp]
	mov	eax, DWORD PTR -332[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	cmp	QWORD PTR -320[rbp], rax
	je	.L64
	lea	rdi, .LC10[rip]
	call	perror@PLT
	jmp	.L64
.L63:
	nop
	jmp	.L24
.L64:
	nop
.L24:
	sub	DWORD PTR -344[rbp], 1
.L16:
	cmp	DWORD PTR -344[rbp], 0
	je	.L65
	mov	eax, DWORD PTR -332[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	cdqe
	mov	rsi, QWORD PTR -224[rbp+rax*8]
	mov	eax, DWORD PTR -332[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	and	rax, rsi
	test	rax, rax
	je	.L65
	lea	rcx, -366[rbp]
	mov	eax, DWORD PTR -332[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -312[rbp], rax
	cmp	QWORD PTR -312[rbp], -1
	jne	.L33
	lea	rdi, .LC11[rip]
	call	perror@PLT
	mov	eax, 2
	jmp	.L60
.L33:
	cmp	DWORD PTR -360[rbp], 2
	je	.L34
	cmp	DWORD PTR -360[rbp], 2
	ja	.L66
	cmp	DWORD PTR -360[rbp], 0
	je	.L36
	cmp	DWORD PTR -360[rbp], 1
	je	.L37
	jmp	.L66
.L36:
	movzx	eax, BYTE PTR -366[rbp]
	cmp	al, 74
	jne	.L67
	mov	DWORD PTR -360[rbp], 1
	jmp	.L67
.L37:
	movzx	eax, BYTE PTR -366[rbp]
	cmp	al, 80
	jne	.L40
	mov	eax, 2
	jmp	.L41
.L40:
	mov	eax, 0
.L41:
	mov	DWORD PTR -360[rbp], eax
	jmp	.L39
.L34:
	movzx	eax, BYTE PTR -366[rbp]
	cmp	al, 71
	jne	.L42
	mov	DWORD PTR -360[rbp], 3
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 2
	mov	esi, 1
	lea	rdi, .LC12[rip]
	call	fwrite@PLT
	lea	rax, -80[rbp]
	mov	rdi, rax
	call	open_image
	xor	eax, 1
	test	al, al
	je	.L68
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -80[rbp]
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	DWORD PTR -360[rbp], 0
	jmp	.L68
.L42:
	mov	DWORD PTR -360[rbp], 0
	jmp	.L39
.L66:
	nop
	jmp	.L39
.L67:
	nop
.L39:
	cmp	DWORD PTR -360[rbp], 3
	jne	.L44
	movzx	eax, BYTE PTR -366[rbp]
	cmp	al, 32
	jne	.L45
	mov	eax, DWORD PTR -356[rbp]
	mov	BYTE PTR -366[rbp], al
	mov	rdx, QWORD PTR img[rip]
	lea	rax, -366[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	QWORD PTR -312[rbp], rax
	cmp	QWORD PTR -312[rbp], -1
	jne	.L46
	lea	rdi, .LC14[rip]
	call	perror@PLT
	jmp	.L29
.L46:
	cmp	DWORD PTR -352[rbp], 2
	je	.L47
	mov	eax, DWORD PTR -352[rbp]
	mov	esi, eax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
.L47:
	mov	DWORD PTR -352[rbp], 0
	mov	DWORD PTR -356[rbp], 0
	add	DWORD PTR -348[rbp], 1
	mov	eax, DWORD PTR -348[rbp]
	and	eax, 1023
	test	eax, eax
	jne	.L59
	mov	BYTE PTR -365[rbp], 46
	lea	rax, -365[rbp]
	mov	edx, 1
	mov	rsi, rax
	mov	edi, 2
	call	write@PLT
	cmp	rax, 1
	je	.L59
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 12
	mov	esi, 1
	lea	rdi, .LC16[rip]
	call	fwrite@PLT
	jmp	.L59
.L45:
	movzx	eax, BYTE PTR -366[rbp]
	cmp	al, 4
	jne	.L50
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 5
	mov	esi, 1
	lea	rdi, .LC17[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR img[rip]
	mov	rdi, rax
	call	fclose@PLT
	mov	QWORD PTR img[rip], 0
	mov	ecx, DWORD PTR -336[rbp]
	lea	rdx, -80[rbp]
	lea	rax, -80[rbp]
	lea	rsi, .LC18[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	DWORD PTR -360[rbp], 0
	jmp	.L56
.L50:
	movzx	eax, BYTE PTR -366[rbp]
	cmp	al, 47
	jle	.L51
	movzx	eax, BYTE PTR -366[rbp]
	cmp	al, 57
	jg	.L51
	movzx	eax, BYTE PTR -366[rbp]
	movsx	eax, al
	sub	eax, 48
	mov	DWORD PTR -340[rbp], eax
	jmp	.L52
.L51:
	movzx	eax, BYTE PTR -366[rbp]
	cmp	al, 96
	jle	.L53
	movzx	eax, BYTE PTR -366[rbp]
	cmp	al, 102
	jg	.L53
	movzx	eax, BYTE PTR -366[rbp]
	movsx	eax, al
	sub	eax, 87
	mov	DWORD PTR -340[rbp], eax
	jmp	.L52
.L53:
	movzx	eax, BYTE PTR -366[rbp]
	movsx	edx, al
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC19[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L29
.L52:
	cmp	DWORD PTR -352[rbp], 0
	jne	.L54
	mov	eax, DWORD PTR -340[rbp]
	sal	eax, 4
	mov	DWORD PTR -356[rbp], eax
	mov	DWORD PTR -352[rbp], 1
	jmp	.L59
.L54:
	cmp	DWORD PTR -352[rbp], 1
	jne	.L55
	mov	eax, DWORD PTR -340[rbp]
	or	DWORD PTR -356[rbp], eax
	mov	DWORD PTR -352[rbp], 2
	jmp	.L59
.L55:
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -352[rbp]
	lea	rsi, .LC20[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L29
.L44:
	lea	rax, -366[rbp]
	mov	edx, 1
	mov	rsi, rax
	mov	edi, 1
	call	write@PLT
	cmp	rax, -1
	jne	.L59
	lea	rdi, .LC21[rip]
	call	perror@PLT
	jmp	.L59
.L29:
	mov	eax, DWORD PTR -332[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR img[rip]
	test	rax, rax
	jne	.L57
	jmp	.L58
.L65:
	nop
	jmp	.L59
.L68:
	nop
.L56:
	jmp	.L59
.L57:
	mov	rax, QWORD PTR img[rip]
	mov	rdi, rax
	call	fclose@PLT
.L58:
	mov	eax, 0
.L60:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L61
	call	__stack_chk_fail@PLT
.L61:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"717967.c"
	.text
	.local	stdin_settings
	.comm	stdin_settings,60,4
	.local	img
	.comm	img,4,4
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	restore, %function
restore:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r2, .L4
	mov	r1, #0
	mov	r0, #0
	bl	tcsetattr
	ldr	r3, .L4+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L3
	ldr	r3, .L4+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
.L3:
	nop
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	stdin_settings
	.word	img
	.size	restore, .-restore
	.section	.rodata
	.align	2
.LC0:
	.ascii	"w\000"
	.align	2
.LC1:
	.ascii	"fopen\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	open_image, %function
open_image:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, .L10
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L7
	ldr	r3, .L10
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
.L7:
	ldr	r1, .L10+4
	ldr	r0, [fp, #-8]
	bl	fopen
	mov	r3, r0
	ldr	r2, .L10
	str	r3, [r2]
	ldr	r3, .L10
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L8
	ldr	r0, .L10+8
	bl	perror
	mov	r3, #0
	b	.L9
.L8:
	mov	r3, #1
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	img
	.word	.LC0
	.word	.LC1
	.size	open_image, .-open_image
	.section	.rodata
	.align	2
.LC2:
	.ascii	"img.jpg\000"
	.align	2
.LC3:
	.ascii	"output file: %s\012\000"
	.align	2
.LC4:
	.ascii	"/dev/ttyUSB0\000"
	.align	2
.LC5:
	.ascii	"open\000"
	.align	2
.LC6:
	.ascii	"select\000"
	.align	2
.LC7:
	.ascii	"stdin\000"
	.align	2
.LC8:
	.ascii	"stdin closed?\012\000"
	.align	2
.LC9:
	.ascii	"enter file name: \000"
	.align	2
.LC10:
	.ascii	"write tty\000"
	.align	2
.LC11:
	.ascii	"read\000"
	.align	2
.LC12:
	.ascii	"G\012\000"
	.align	2
.LC13:
	.ascii	"can't save to image '%s'\012\000"
	.align	2
.LC14:
	.ascii	"write\000"
	.align	2
.LC15:
	.ascii	"odd pos %d?\012\000"
	.align	2
.LC16:
	.ascii	"dot failed?\012\000"
	.align	2
.LC17:
	.ascii	"done\012\000"
	.align	2
.LC18:
	.ascii	"%s(%d)\000"
	.align	2
.LC19:
	.ascii	"bad char '%c'\012\000"
	.align	2
.LC20:
	.ascii	"bad pos %d\012\000"
	.align	2
.LC21:
	.ascii	"echo\000"
	.align	2
.LC22:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 336
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #344
	str	r0, [fp, #-336]
	str	r1, [fp, #-340]
	ldr	r3, .L75
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-296]
	sub	r3, fp, #72
	mov	r2, #64
	ldr	r1, .L75+4
	mov	r0, r3
	bl	strncpy
	mov	r3, #0
	str	r3, [fp, #-328]
	b	.L13
.L15:
	ldr	r3, [fp, #-328]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-340]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	bne	.L14
	ldr	r3, [fp, #-328]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-340]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #111
	bne	.L14
	ldr	r3, [fp, #-328]
	add	r3, r3, #1
	str	r3, [fp, #-328]
	ldr	r3, [fp, #-328]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-340]
	add	r3, r2, r3
	ldr	r1, [r3]
	sub	r3, fp, #72
	mov	r2, #64
	mov	r0, r3
	bl	strncpy
.L14:
	ldr	r3, [fp, #-328]
	add	r3, r3, #1
	str	r3, [fp, #-328]
.L13:
	ldr	r2, [fp, #-328]
	ldr	r3, [fp, #-336]
	cmp	r2, r3
	blt	.L15
	ldr	r3, .L75+8
	ldr	r3, [r3]
	sub	r2, fp, #72
	ldr	r1, .L75+12
	mov	r0, r3
	bl	fprintf
	ldr	r1, .L75+16
	ldr	r0, .L75+20
	bl	open
	str	r0, [fp, #-292]
	ldr	r3, [fp, #-292]
	cmn	r3, #1
	bne	.L16
	ldr	r0, .L75+24
	bl	perror
	mov	r3, #1
	b	.L66
.L16:
	sub	r3, fp, #268
	mov	r1, r3
	ldr	r0, [fp, #-292]
	bl	tcgetattr
	sub	r3, fp, #268
	ldr	r1, .L75+28
	mov	r0, r3
	bl	cfsetspeed
	sub	r3, fp, #268
	mov	r0, r3
	bl	cfmakeraw
	sub	r3, fp, #268
	mov	r2, r3
	mov	r1, #0
	ldr	r0, [fp, #-292]
	bl	tcsetattr
	ldr	r1, .L75+32
	mov	r0, #0
	bl	tcgetattr
	ldr	r3, .L75+32
	sub	ip, fp, #268
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1, r2}
	stm	ip, {r0, r1, r2}
	ldr	r3, [fp, #-256]
	bic	r3, r3, #10
	str	r3, [fp, #-256]
	sub	r3, fp, #268
	mov	r2, r3
	mov	r1, #0
	mov	r0, #0
	bl	tcsetattr
	ldr	r0, .L75+36
	bl	atexit
	mov	r3, #0
	str	r3, [fp, #-324]
	mov	r3, #0
	str	r3, [fp, #-316]
	mov	r3, #0
	str	r3, [fp, #-312]
.L65:
	sub	r3, fp, #276
	mov	r2, #0
	str	r2, [r3]
	str	r2, [r3, #4]
	sub	r3, fp, #208
	str	r3, [fp, #-288]
	mov	r3, #0
	str	r3, [fp, #-308]
	b	.L18
.L19:
	ldr	r3, [fp, #-288]
	ldr	r2, [fp, #-308]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-308]
	add	r3, r3, #1
	str	r3, [fp, #-308]
.L18:
	ldr	r3, [fp, #-308]
	cmp	r3, #31
	bls	.L19
	ldr	r3, [fp, #-208]
	orr	r3, r3, #1
	str	r3, [fp, #-208]
	ldr	r3, [fp, #-292]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	lsl	r3, r2, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r1, [r3, #-204]
	ldr	r3, [fp, #-292]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r1, r1, r3
	lsl	r3, r2, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	str	r1, [r3, #-204]
	ldr	r3, [fp, #-292]
	add	r0, r3, #1
	sub	r1, fp, #208
	sub	r3, fp, #276
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	bl	select
	str	r0, [fp, #-304]
	ldr	r3, [fp, #-304]
	cmn	r3, #1
	bne	.L20
	ldr	r0, .L75+40
	bl	perror
	mov	r3, #4
	b	.L66
.L20:
	ldr	r3, [fp, #-304]
	cmp	r3, #0
	ble	.L22
	ldr	r3, [fp, #-208]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L22
	sub	r3, fp, #80
	mov	r2, #8
	mov	r1, r3
	mov	r0, #0
	bl	read
	str	r0, [fp, #-284]
	ldr	r3, [fp, #-284]
	cmn	r3, #1
	bne	.L23
	ldr	r0, .L75+44
	bl	perror
	b	.L35
.L23:
	ldr	r3, [fp, #-284]
	cmp	r3, #0
	bne	.L25
	ldr	r3, .L75+8
	ldr	r3, [r3]
	mov	r2, #14
	mov	r1, #1
	ldr	r0, .L75+48
	bl	fwrite
	b	.L35
.L25:
	ldrb	r3, [fp, #-80]	@ zero_extendqisi2
	cmp	r3, #4
	beq	.L26
	cmp	r3, #6
	beq	.L27
	b	.L68
.L26:
	mov	r0, #0
	bl	exit
.L27:
	ldr	r3, [fp, #-324]
	cmp	r3, #3
	beq	.L69
	mov	r3, #4
	str	r3, [fp, #-324]
	mov	r3, #0
	str	r3, [fp, #-316]
	ldr	r3, .L75+8
	ldr	r3, [r3]
	mov	r2, #17
	mov	r1, #1
	ldr	r0, .L75+52
	bl	fwrite
	b	.L69
.L68:
	ldr	r3, [fp, #-324]
	cmp	r3, #4
	bne	.L31
	ldrb	r3, [fp, #-80]	@ zero_extendqisi2
	cmp	r3, #10
	beq	.L32
	ldr	r2, [fp, #-316]
	ldr	r3, [fp, #-284]
	add	r3, r2, r3
	cmp	r3, #62
	ble	.L33
.L32:
	sub	r2, fp, #72
	ldr	r3, [fp, #-316]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-324]
	b	.L31
.L33:
	ldr	r3, [fp, #-316]
	sub	r2, fp, #72
	add	r3, r2, r3
	ldr	r2, [fp, #-284]
	sub	r1, fp, #80
	mov	r0, r3
	bl	memcpy
	ldr	r2, [fp, #-316]
	ldr	r3, [fp, #-284]
	add	r3, r2, r3
	str	r3, [fp, #-316]
.L31:
	ldr	r2, [fp, #-284]
	sub	r3, fp, #80
	mov	r1, r3
	ldr	r0, [fp, #-292]
	bl	write
	mov	r2, r0
	ldr	r3, [fp, #-284]
	cmp	r3, r2
	beq	.L70
	ldr	r0, .L75+56
	bl	perror
	b	.L70
.L69:
	nop
	b	.L30
.L70:
	nop
.L30:
	ldr	r3, [fp, #-304]
	sub	r3, r3, #1
	str	r3, [fp, #-304]
.L22:
	ldr	r3, [fp, #-304]
	cmp	r3, #0
	beq	.L71
	ldr	r3, [fp, #-292]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [r3, #-204]
	ldr	r3, [fp, #-292]
	rsbs	r1, r3, #0
	and	r3, r3, #31
	and	r1, r1, #31
	rsbpl	r3, r1, #0
	mov	r1, #1
	lsl	r3, r1, r3
	and	r3, r3, r2
	cmp	r3, #0
	beq	.L71
	sub	r3, fp, #328
	sub	r3, r3, #2
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-292]
	bl	read
	str	r0, [fp, #-280]
	ldr	r3, [fp, #-280]
	cmn	r3, #1
	bne	.L39
	ldr	r0, .L75+60
	bl	perror
	mov	r3, #2
	b	.L66
.L39:
	ldr	r3, [fp, #-324]
	cmp	r3, #2
	beq	.L40
	ldr	r3, [fp, #-324]
	cmp	r3, #2
	bhi	.L72
	ldr	r3, [fp, #-324]
	cmp	r3, #0
	beq	.L42
	ldr	r3, [fp, #-324]
	cmp	r3, #1
	beq	.L43
	b	.L72
.L42:
	ldrb	r3, [fp, #-330]	@ zero_extendqisi2
	cmp	r3, #74
	bne	.L73
	mov	r3, #1
	str	r3, [fp, #-324]
	b	.L73
.L43:
	ldrb	r3, [fp, #-330]	@ zero_extendqisi2
	cmp	r3, #80
	bne	.L46
	mov	r3, #2
	b	.L47
.L46:
	mov	r3, #0
.L47:
	str	r3, [fp, #-324]
	b	.L45
.L40:
	ldrb	r3, [fp, #-330]	@ zero_extendqisi2
	cmp	r3, #71
	bne	.L48
	mov	r3, #3
	str	r3, [fp, #-324]
	ldr	r3, .L75+8
	ldr	r3, [r3]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, .L75+64
	bl	fwrite
	sub	r3, fp, #72
	mov	r0, r3
	bl	open_image
	mov	r3, r0
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	beq	.L74
	ldr	r3, .L75+8
	ldr	r3, [r3]
	sub	r2, fp, #72
	ldr	r1, .L75+68
	mov	r0, r3
	bl	fprintf
	mov	r3, #0
	str	r3, [fp, #-324]
	b	.L74
.L48:
	mov	r3, #0
	str	r3, [fp, #-324]
	b	.L45
.L72:
	nop
	b	.L45
.L73:
	nop
.L45:
	ldr	r3, [fp, #-324]
	cmp	r3, #3
	bne	.L50
	ldrb	r3, [fp, #-330]	@ zero_extendqisi2
	cmp	r3, #32
	bne	.L51
	ldr	r3, [fp, #-320]
	and	r3, r3, #255
	strb	r3, [fp, #-330]
	ldr	r3, .L75+72
	ldr	r3, [r3]
	sub	r0, fp, #328
	sub	r0, r0, #2
	mov	r2, #1
	mov	r1, #1
	bl	fwrite
	mov	r3, r0
	str	r3, [fp, #-280]
	ldr	r3, [fp, #-280]
	cmn	r3, #1
	bne	.L52
	ldr	r0, .L75+76
	bl	perror
	b	.L35
.L52:
	ldr	r3, [fp, #-316]
	cmp	r3, #2
	beq	.L53
	ldr	r1, [fp, #-316]
	ldr	r0, .L75+80
	bl	printf
.L53:
	mov	r3, #0
	str	r3, [fp, #-316]
	mov	r3, #0
	str	r3, [fp, #-320]
	ldr	r3, [fp, #-312]
	add	r3, r3, #1
	str	r3, [fp, #-312]
	ldr	r3, [fp, #-312]
	lsl	r3, r3, #22
	lsr	r3, r3, #22
	cmp	r3, #0
	bne	.L65
	mov	r3, #46
	strb	r3, [fp, #-329]
	sub	r3, fp, #328
	sub	r3, r3, #1
	mov	r2, #1
	mov	r1, r3
	mov	r0, #2
	bl	write
	mov	r3, r0
	cmp	r3, #1
	beq	.L65
	ldr	r3, .L75+8
	ldr	r3, [r3]
	mov	r2, #12
	mov	r1, #1
	ldr	r0, .L75+84
	bl	fwrite
	b	.L65
.L51:
	ldrb	r3, [fp, #-330]	@ zero_extendqisi2
	cmp	r3, #4
	bne	.L56
	ldr	r3, .L75+8
	ldr	r3, [r3]
	mov	r2, #5
	mov	r1, #1
	ldr	r0, .L75+88
	bl	fwrite
	ldr	r3, .L75+72
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	ldr	r3, .L75+72
	mov	r2, #0
	str	r2, [r3]
	sub	r2, fp, #72
	sub	r0, fp, #72
	ldr	r3, [fp, #-296]
	ldr	r1, .L75+92
	bl	sprintf
	mov	r3, #0
	str	r3, [fp, #-324]
	b	.L62
.L56:
	ldrb	r3, [fp, #-330]	@ zero_extendqisi2
	cmp	r3, #47
	bls	.L57
	ldrb	r3, [fp, #-330]	@ zero_extendqisi2
	cmp	r3, #57
	bhi	.L57
	ldrb	r3, [fp, #-330]	@ zero_extendqisi2
	sub	r3, r3, #48
	str	r3, [fp, #-300]
	b	.L58
.L57:
	ldrb	r3, [fp, #-330]	@ zero_extendqisi2
	cmp	r3, #96
	bls	.L59
	ldrb	r3, [fp, #-330]	@ zero_extendqisi2
	cmp	r3, #102
	bhi	.L59
	ldrb	r3, [fp, #-330]	@ zero_extendqisi2
	sub	r3, r3, #87
	str	r3, [fp, #-300]
	b	.L58
.L59:
	ldr	r3, .L75+8
	ldr	r3, [r3]
	ldrb	r2, [fp, #-330]	@ zero_extendqisi2
	ldr	r1, .L75+96
	mov	r0, r3
	bl	fprintf
	b	.L35
.L58:
	ldr	r3, [fp, #-316]
	cmp	r3, #0
	bne	.L60
	ldr	r3, [fp, #-300]
	lsl	r3, r3, #4
	str	r3, [fp, #-320]
	mov	r3, #1
	str	r3, [fp, #-316]
	b	.L65
.L60:
	ldr	r3, [fp, #-316]
	cmp	r3, #1
	bne	.L61
	ldr	r2, [fp, #-320]
	ldr	r3, [fp, #-300]
	orr	r3, r2, r3
	str	r3, [fp, #-320]
	mov	r3, #2
	str	r3, [fp, #-316]
	b	.L65
.L61:
	ldr	r3, .L75+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-316]
	ldr	r1, .L75+100
	mov	r0, r3
	bl	fprintf
	b	.L35
.L50:
	sub	r3, fp, #328
	sub	r3, r3, #2
	mov	r2, #1
	mov	r1, r3
	mov	r0, #1
	bl	write
	mov	r3, r0
	cmn	r3, #1
	bne	.L65
	ldr	r0, .L75+104
	bl	perror
	b	.L65
.L35:
	ldr	r0, [fp, #-292]
	bl	close
	ldr	r3, .L75+72
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L63
	b	.L64
.L71:
	nop
	b	.L65
.L74:
	nop
.L62:
	b	.L65
.L63:
	ldr	r3, .L75+72
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
.L64:
	mov	r3, #0
.L66:
	ldr	r2, .L75
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L67
	bl	__stack_chk_fail
.L67:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L76:
	.align	2
.L75:
	.word	.LC22
	.word	.LC2
	.word	stderr
	.word	.LC3
	.word	2050
	.word	.LC4
	.word	.LC5
	.word	4098
	.word	stdin_settings
	.word	restore
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	img
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
