	.file	"295580.c"
	.intel_syntax noprefix
	.text
	.globl	StringToHex
	.type	StringToHex, @function
StringToHex:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	BYTE PTR -18[rbp], 0
	mov	BYTE PTR -17[rbp], 0
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -12[rbp], eax
	mov	DWORD PTR -16[rbp], 0
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -12[rbp], eax
	jmp	.L2
.L9:
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 57
	jle	.L3
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 70
	jle	.L4
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 102
	jg	.L3
.L4:
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	sub	eax, 55
	jmp	.L5
.L3:
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	sub	eax, 48
.L5:
	mov	BYTE PTR -18[rbp], al
	add	QWORD PTR -8[rbp], 1
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 57
	jle	.L6
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 70
	jle	.L7
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 102
	jg	.L6
.L7:
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	sub	eax, 55
	jmp	.L8
.L6:
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	sub	eax, 48
.L8:
	mov	BYTE PTR -17[rbp], al
	movsx	eax, BYTE PTR -18[rbp]
	sal	eax, 4
	mov	edx, eax
	movzx	eax, BYTE PTR -17[rbp]
	and	eax, 15
	mov	ecx, edx
	or	ecx, eax
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	edx, ecx
	mov	BYTE PTR [rax], dl
	add	QWORD PTR -8[rbp], 1
	add	DWORD PTR -16[rbp], 1
.L2:
	mov	eax, DWORD PTR -12[rbp]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	cmp	DWORD PTR -16[rbp], eax
	jl	.L9
	mov	eax, DWORD PTR -12[rbp]
	and	eax, 1
	test	eax, eax
	je	.L14
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 57
	jle	.L11
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 70
	jle	.L12
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 102
	jg	.L11
.L12:
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	sub	eax, 55
	jmp	.L13
.L11:
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	sub	eax, 48
.L13:
	mov	edx, DWORD PTR -16[rbp]
	movsx	rcx, edx
	mov	rdx, QWORD PTR -48[rbp]
	add	rdx, rcx
	mov	BYTE PTR [rdx], al
.L14:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	StringToHex, .-StringToHex
	.section	.rodata
.LC0:
	.string	"r+"
.LC1:
	.string	"open input file:%s failed\n"
.LC2:
	.string	"w+"
.LC3:
	.string	"./out.bin"
.LC4:
	.string	"open output file failed"
.LC5:
	.string	"input file size:%ld\n"
.LC6:
	.string	"malloc failed"
.LC7:
	.string	"read input file failed"
.LC8:
	.string	",xX"
.LC9:
	.string	"write out file failed"
.LC10:
	.string	"transform complete"
	.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, 112
	mov	DWORD PTR -100[rbp], edi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -84[rbp], 0
	mov	QWORD PTR -64[rbp], 0
	mov	QWORD PTR -56[rbp], 0
	mov	rax, QWORD PTR -112[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -48[rbp], rax
	mov	QWORD PTR -40[rbp], 0
	mov	BYTE PTR -85[rbp], 0
	mov	rax, QWORD PTR -48[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -32[rbp], 0
	jne	.L16
	mov	rax, QWORD PTR -48[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, -1
	jmp	.L30
.L16:
	lea	rsi, .LC2[rip]
	lea	rdi, .LC3[rip]
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L18
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, -1
	jmp	.L30
.L18:
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	QWORD PTR -64[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -64[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L19
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, -1
	jmp	.L30
.L19:
	mov	rsi, QWORD PTR -64[rbp]
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fread@PLT
	mov	QWORD PTR -56[rbp], rax
	cmp	QWORD PTR -56[rbp], 0
	jne	.L20
	lea	rdi, .LC7[rip]
	call	puts@PLT
.L20:
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -72[rbp], rax
	jmp	.L21
.L24:
	mov	rax, QWORD PTR -72[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 48
	jne	.L22
	mov	rax, QWORD PTR -72[rbp]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	cmp	al, 120
	je	.L23
	mov	rax, QWORD PTR -72[rbp]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	cmp	al, 88
	jne	.L22
.L23:
	mov	rax, QWORD PTR -72[rbp]
	mov	BYTE PTR [rax], 120
	add	QWORD PTR -72[rbp], 2
	jmp	.L21
.L22:
	add	QWORD PTR -72[rbp], 1
.L21:
	mov	rax, QWORD PTR -72[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L24
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -72[rbp], rax
.L29:
	lea	rdx, -80[rbp]
	mov	rax, QWORD PTR -72[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	call	strtok_r@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	je	.L32
	lea	rdx, -85[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	StringToHex
	mov	rdx, QWORD PTR -24[rbp]
	lea	rax, -85[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	QWORD PTR -56[rbp], rax
	cmp	QWORD PTR -56[rbp], 0
	jne	.L26
	lea	rdi, .LC9[rip]
	call	puts@PLT
	jmp	.L27
.L26:
	mov	QWORD PTR -72[rbp], 0
	jmp	.L29
.L32:
	nop
	lea	rdi, .LC10[rip]
	call	puts@PLT
.L27:
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
.L30:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	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	"295580.c"
	.text
	.align	2
	.global	StringToHex
	.syntax unified
	.arm
	.fpu softvfp
	.type	StringToHex, %function
StringToHex:
	@ 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]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-16]
	mov	r3, #0
	strb	r3, [fp, #-18]
	mov	r3, #0
	strb	r3, [fp, #-17]
	ldr	r0, [fp, #-16]
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r0, [fp, #-16]
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-8]
	b	.L2
.L9:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #57
	bls	.L3
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #70
	bls	.L4
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #102
	bhi	.L3
.L4:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #55
	and	r3, r3, #255
	b	.L5
.L3:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	and	r3, r3, #255
.L5:
	strb	r3, [fp, #-18]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #57
	bls	.L6
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #70
	bls	.L7
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #102
	bhi	.L6
.L7:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #55
	and	r3, r3, #255
	b	.L8
.L6:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	and	r3, r3, #255
.L8:
	strb	r3, [fp, #-17]
	ldrb	r3, [fp, #-18]	@ zero_extendqisi2
	lsl	r3, r3, #4
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldrsb	r3, [fp, #-17]
	and	r3, r3, #15
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldr	r3, [fp, #-12]
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L2:
	ldr	r3, [fp, #-8]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-12]
	cmp	r3, r2
	blt	.L9
	ldr	r3, [fp, #-8]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L14
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #57
	bls	.L11
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #70
	bls	.L12
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #102
	bhi	.L11
.L12:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #55
	and	r3, r3, #255
	b	.L13
.L11:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	and	r3, r3, #255
.L13:
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-28]
	add	r2, r1, r2
	strb	r3, [r2]
.L14:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	StringToHex, .-StringToHex
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r+\000"
	.align	2
.LC1:
	.ascii	"open input file:%s failed\012\000"
	.align	2
.LC2:
	.ascii	"w+\000"
	.align	2
.LC3:
	.ascii	"./out.bin\000"
	.align	2
.LC4:
	.ascii	"open output file failed\000"
	.align	2
.LC5:
	.ascii	"input file size:%ld\012\000"
	.align	2
.LC6:
	.ascii	"malloc failed\000"
	.align	2
.LC7:
	.ascii	"read input file failed\000"
	.align	2
.LC8:
	.ascii	",xX\000"
	.align	2
.LC9:
	.ascii	"write out file failed\000"
	.align	2
.LC10:
	.ascii	"transform complete\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	str	r0, [fp, #-56]
	str	r1, [fp, #-60]
	ldr	r3, .L33
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-60]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-24]
	mov	r3, #0
	strb	r3, [fp, #-49]
	ldr	r1, .L33+4
	ldr	r0, [fp, #-28]
	bl	fopen
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L16
	ldr	r1, [fp, #-28]
	ldr	r0, .L33+8
	bl	printf
	ldr	r0, [fp, #-20]
	bl	fclose
	mvn	r3, #0
	b	.L30
.L16:
	ldr	r1, .L33+12
	ldr	r0, .L33+16
	bl	fopen
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L18
	ldr	r0, .L33+20
	bl	puts
	ldr	r0, [fp, #-16]
	bl	fclose
	mvn	r3, #0
	b	.L30
.L18:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-20]
	bl	fseek
	ldr	r0, [fp, #-20]
	bl	ftell
	str	r0, [fp, #-36]
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-20]
	bl	fseek
	ldr	r1, [fp, #-36]
	ldr	r0, .L33+24
	bl	printf
	ldr	r3, [fp, #-36]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L19
	ldr	r0, .L33+28
	bl	puts
	ldr	r0, [fp, #-20]
	bl	fclose
	ldr	r0, [fp, #-16]
	bl	fclose
	mvn	r3, #0
	b	.L30
.L19:
	ldr	r1, [fp, #-36]
	ldr	r3, [fp, #-20]
	mov	r2, #1
	ldr	r0, [fp, #-24]
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L20
	ldr	r0, .L33+32
	bl	puts
.L20:
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-44]
	b	.L21
.L24:
	ldr	r3, [fp, #-44]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #48
	bne	.L22
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #120
	beq	.L23
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #88
	bne	.L22
.L23:
	ldr	r3, [fp, #-44]
	mov	r2, #120
	strb	r2, [r3]
	ldr	r3, [fp, #-44]
	add	r3, r3, #2
	str	r3, [fp, #-44]
	b	.L21
.L22:
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L21:
	ldr	r3, [fp, #-44]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L24
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-44]
.L29:
	sub	r3, fp, #48
	mov	r2, r3
	ldr	r1, .L33+36
	ldr	r0, [fp, #-44]
	bl	strtok_r
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L32
	sub	r3, fp, #49
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	StringToHex
	sub	r0, fp, #49
	ldr	r3, [fp, #-16]
	mov	r2, #1
	mov	r1, #1
	bl	fwrite
	mov	r3, r0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L26
	ldr	r0, .L33+40
	bl	puts
	b	.L27
.L26:
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L29
.L32:
	nop
	ldr	r0, .L33+44
	bl	puts
.L27:
	ldr	r0, [fp, #-24]
	bl	free
	ldr	r0, [fp, #-20]
	bl	fclose
	ldr	r0, [fp, #-16]
	bl	fclose
	mov	r3, #0
.L30:
	ldr	r2, .L33
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L31
	bl	__stack_chk_fail
.L31:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L34:
	.align	2
.L33:
	.word	.LC11
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
