	.file	"261800.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"0123456789ABCDEF"
	.text
	.globl	tohex
	.type	tohex, @function
tohex:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, edi
	mov	QWORD PTR -48[rbp], rsi
	mov	BYTE PTR -36[rbp], al
	lea	rax, .LC0[rip]
	mov	QWORD PTR -24[rbp], rax
	lea	rax, -36[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR [rax], 48
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 1
	mov	BYTE PTR [rax], 120
	mov	rax, QWORD PTR -16[rbp]
	movzx	eax, BYTE PTR [rax]
	shr	al, 4
	movzx	eax, al
	and	eax, 15
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR -8[rbp]
	add	rdx, 2
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	mov	rax, QWORD PTR -16[rbp]
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	and	eax, 15
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR -8[rbp]
	add	rdx, 3
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 4
	mov	BYTE PTR [rax], 0
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, 1
	mov	BYTE PTR [rax], 0
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	tohex, .-tohex
	.section	.rodata
.LC1:
	.string	"rb"
.LC2:
	.string	"yuh.png"
	.align 8
.LC3:
	.string	"Error: failed to get handle to file."
.LC4:
	.string	"wb"
.LC5:
	.string	"encoded.bin"
	.align 8
.LC6:
	.string	"Error: failed to get handle to output file."
.LC7:
	.string	"w"
.LC8:
	.string	"encoded.c"
	.align 8
.LC9:
	.string	"unsigned char encodedBytes[%ld] = {\n\t"
.LC10:
	.string	"\n\t"
.LC11:
	.string	" "
.LC12:
	.string	""
.LC13:
	.string	","
.LC14:
	.string	"%s%s%s"
.LC15:
	.string	"\n};"
	.align 8
.LC16:
	.string	"finished writing encoded file."
	.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, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rsi, .LC1[rip]
	lea	rdi, .LC2[rip]
	call	fopen@PLT
	mov	QWORD PTR -56[rbp], rax
	cmp	QWORD PTR -56[rbp], 0
	jne	.L3
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	lea	rsi, .LC4[rip]
	lea	rdi, .LC5[rip]
	call	fopen@PLT
	mov	QWORD PTR -48[rbp], rax
	cmp	QWORD PTR -48[rbp], 0
	jne	.L4
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	lea	rsi, .LC7[rip]
	lea	rdi, .LC8[rip]
	call	fopen@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L5
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.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 -32[rbp], rax
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	rewind@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	rsi, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -40[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	DWORD PTR -60[rbp], 0
	jmp	.L6
.L11:
	mov	eax, DWORD PTR -60[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	lea	ecx, 69[rax]
	mov	eax, DWORD PTR -60[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	edx, ecx
	mov	BYTE PTR [rax], dl
	mov	eax, DWORD PTR -60[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	lea	rdx, -13[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	tohex
	mov	eax, DWORD PTR -60[rbp]
	lea	ecx, 1[rax]
	movsx	rax, ecx
	imul	rax, rax, 715827883
	shr	rax, 32
	sar	eax
	mov	esi, ecx
	sar	esi, 31
	sub	eax, esi
	mov	edx, eax
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	sal	eax, 2
	sub	ecx, eax
	mov	edx, ecx
	test	edx, edx
	jne	.L7
	lea	rdx, .LC10[rip]
	jmp	.L8
.L7:
	lea	rdx, .LC11[rip]
.L8:
	mov	eax, DWORD PTR -60[rbp]
	add	eax, 1
	cdqe
	cmp	QWORD PTR -32[rbp], rax
	jne	.L9
	lea	rax, .LC12[rip]
	jmp	.L10
.L9:
	lea	rax, .LC13[rip]
.L10:
	lea	rsi, -13[rbp]
	mov	rdi, QWORD PTR -40[rbp]
	mov	r8, rdx
	mov	rcx, rax
	mov	rdx, rsi
	lea	rsi, .LC14[rip]
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -60[rbp], 1
.L6:
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	cmp	QWORD PTR -32[rbp], rax
	jg	.L11
	mov	rax, QWORD PTR -40[rbp]
	mov	rcx, rax
	mov	edx, 3
	mov	esi, 1
	lea	rdi, .LC15[rip]
	call	fwrite@PLT
	mov	rsi, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	fclose@PLT
	lea	rdi, .LC16[rip]
	call	puts@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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	"261800.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"0123456789ABCDEF\000"
	.text
	.align	2
	.global	tohex
	.syntax unified
	.arm
	.fpu softvfp
	.type	tohex, %function
tohex:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	mov	r3, r0
	str	r1, [fp, #-28]
	strb	r3, [fp, #-21]
	ldr	r3, .L2
	str	r3, [fp, #-16]
	sub	r3, fp, #21
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-28]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r2, #48
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	mov	r2, #120
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsr	r3, r3, #4
	and	r3, r3, #255
	and	r3, r3, #15
	ldr	r2, [fp, #-16]
	add	r2, r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, #2
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	ldrb	r3, [r3]	@ zero_extendqisi2
	and	r3, r3, #15
	ldr	r2, [fp, #-16]
	add	r2, r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, #3
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	mov	r2, #0
	strb	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L3:
	.align	2
.L2:
	.word	.LC0
	.size	tohex, .-tohex
	.section	.rodata
	.align	2
.LC1:
	.ascii	"rb\000"
	.align	2
.LC2:
	.ascii	"yuh.png\000"
	.align	2
.LC3:
	.ascii	"Error: failed to get handle to file.\000"
	.align	2
.LC4:
	.ascii	"wb\000"
	.align	2
.LC5:
	.ascii	"encoded.bin\000"
	.align	2
.LC6:
	.ascii	"Error: failed to get handle to output file.\000"
	.align	2
.LC7:
	.ascii	"w\000"
	.align	2
.LC8:
	.ascii	"encoded.c\000"
	.align	2
.LC9:
	.ascii	"unsigned char encodedBytes[%ld] = {\012\011\000"
	.align	2
.LC10:
	.ascii	"\000"
	.align	2
.LC11:
	.ascii	",\000"
	.align	2
.LC12:
	.ascii	"\012\011\000"
	.align	2
.LC13:
	.ascii	" \000"
	.align	2
.LC14:
	.ascii	"%s%s%s\000"
	.align	2
.LC15:
	.ascii	"\012};\000"
	.align	2
.LC16:
	.ascii	"finished writing encoded file.\000"
	.align	2
.LC17:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L16+4
	ldr	r0, .L16+8
	bl	fopen
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bne	.L5
	ldr	r0, .L16+12
	bl	printf
	mov	r0, #1
	bl	exit
.L5:
	ldr	r1, .L16+16
	ldr	r0, .L16+20
	bl	fopen
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L6
	ldr	r0, .L16+24
	bl	printf
	mov	r0, #1
	bl	exit
.L6:
	ldr	r1, .L16+28
	ldr	r0, .L16+32
	bl	fopen
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L7
	ldr	r0, .L16+24
	bl	printf
	mov	r0, #1
	bl	exit
.L7:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-36]
	bl	fseek
	ldr	r0, [fp, #-36]
	bl	ftell
	str	r0, [fp, #-24]
	ldr	r0, [fp, #-36]
	bl	rewind
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r1, [fp, #-24]
	ldr	r3, [fp, #-36]
	mov	r2, #1
	ldr	r0, [fp, #-20]
	bl	fread
	ldr	r2, [fp, #-24]
	ldr	r1, .L16+36
	ldr	r0, [fp, #-28]
	bl	fprintf
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L8
.L13:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, [fp, #-40]
	ldr	r1, [fp, #-20]
	add	r3, r1, r3
	add	r2, r2, #69
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r2, fp, #16
	mov	r1, r2
	mov	r0, r3
	bl	tohex
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	bne	.L9
	ldr	r0, .L16+40
	b	.L10
.L9:
	ldr	r0, .L16+44
.L10:
	ldr	r3, [fp, #-40]
	add	r1, r3, #1
	ldr	r3, .L16+48
	smull	r2, r3, r1, r3
	asr	r2, r3, #1
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	sub	r2, r1, r3
	cmp	r2, #0
	bne	.L11
	ldr	r3, .L16+52
	b	.L12
.L11:
	ldr	r3, .L16+56
.L12:
	sub	r2, fp, #16
	str	r3, [sp]
	mov	r3, r0
	ldr	r1, .L16+60
	ldr	r0, [fp, #-28]
	bl	fprintf
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L8:
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L13
	ldr	r3, [fp, #-28]
	mov	r2, #3
	mov	r1, #1
	ldr	r0, .L16+64
	bl	fwrite
	ldr	r1, [fp, #-24]
	ldr	r3, [fp, #-32]
	mov	r2, #1
	ldr	r0, [fp, #-20]
	bl	fwrite
	ldr	r0, [fp, #-20]
	bl	free
	ldr	r0, [fp, #-36]
	bl	fclose
	ldr	r0, [fp, #-32]
	bl	fclose
	ldr	r0, [fp, #-28]
	bl	fclose
	ldr	r0, .L16+68
	bl	puts
	mov	r3, #0
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC17
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	715827883
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
