	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hxtool_hex                     ## -- Begin function hxtool_hex
	.p2align	4, 0x90
_hxtool_hex:                            ## @hxtool_hex
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$2056, %rsp                     ## imm = 0x808
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	cmpq	$0, (%rdi)
	je	LBB0_10
## %bb.1:
	movq	_stdin@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-1072(%rbp), %rdi
	movl	$1024, %esi                     ## imm = 0x400
	callq	_fgets
	testq	%rax, %rax
	je	LBB0_15
## %bb.2:
	leaq	-1072(%rbp), %r15
	leaq	-2096(%rbp), %r13
	movq	_stdout@GOTPCREL(%rip), %r14
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_stdin@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$1024, %esi                     ## imm = 0x400
	callq	_fgets
	testq	%rax, %rax
	je	LBB0_15
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movq	%r15, %rdi
	leaq	L_.str(%rip), %rsi
	callq	_strcspn
	movb	$0, -1072(%rbp,%rax)
	leaq	-1073(%rbp), %r12
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movzbl	1(%r12), %edi
	incq	%r12
	callq	_isspace
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	callq	_strlen
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_hex_decode
	movq	%rax, %rbx
	testq	%rax, %rax
	jns	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_errx
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r14), %ecx
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	callq	_fwrite
	cmpq	%rbx, %rax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_errx
	jmp	LBB0_9
LBB0_10:
	movq	_stdin@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	leaq	-1072(%rbp), %rdi
	movl	$1, %esi
	movl	$28, %edx
	callq	_fread
	testq	%rax, %rax
	je	LBB0_15
## %bb.11:
	leaq	-1072(%rbp), %rbx
	leaq	-2096(%rbp), %r14
	movq	_stdout@GOTPCREL(%rip), %r13
	leaq	L_.str.3(%rip), %r15
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	(%r12), %ecx
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$28, %edx
	callq	_fread
	testq	%rax, %rax
	je	LBB0_15
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movq	%r14, %rdx
	callq	_hex_encode
	testq	%rax, %rax
	js	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	(%r13), %edi
	movq	-2096(%rbp), %rdx
	movq	%r15, %rsi
	callq	_fprintf
	movq	-2096(%rbp), %rdi
	callq	_free
	jmp	LBB0_14
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	xorl	%eax, %eax
	addq	$2056, %rsp                     ## imm = 0x808
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_stdin,4,2                      ## @stdin
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\r\n"

L_.str.1:                               ## @.str.1
	.asciz	"hex_decode failed"

	.comm	_stdout,4,2                     ## @stdout
L_.str.2:                               ## @.str.2
	.asciz	"fwrite failed"

L_.str.3:                               ## @.str.3
	.asciz	"%s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hxtool_hex                     ; -- Begin function hxtool_hex
	.p2align	2
_hxtool_hex:                            ; @hxtool_hex
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #2064
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	ldr	x8, [x0]
	cbz	x8, LBB0_10
; %bb.1:
Lloh3:
	adrp	x23, _stdin@GOTPAGE
Lloh4:
	ldr	x23, [x23, _stdin@GOTPAGEOFF]
	ldr	w2, [x23]
	add	x24, sp, #1032
	add	x0, sp, #1032
	mov	w1, #1024
	bl	_fgets
	cbz	x0, LBB0_15
; %bb.2:
	sub	x25, x24, #1
Lloh5:
	adrp	x19, l_.str@PAGE
Lloh6:
	add	x19, x19, l_.str@PAGEOFF
Lloh7:
	adrp	x20, l_.str.1@PAGE
Lloh8:
	add	x20, x20, l_.str.1@PAGEOFF
Lloh9:
	adrp	x26, _stdout@GOTPAGE
Lloh10:
	ldr	x26, [x26, _stdout@GOTPAGEOFF]
Lloh11:
	adrp	x21, l_.str.2@PAGE
Lloh12:
	add	x21, x21, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w2, [x23]
	add	x0, sp, #1032
	mov	w1, #1024
	bl	_fgets
	cbz	x0, LBB0_15
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	add	x0, sp, #1032
	mov	x1, x19
	bl	_strcspn
	strb	wzr, [x24, x0]
	mov	x22, x25
LBB0_5:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldrb	w0, [x22, #1]!
	bl	_isspace
	cbnz	x0, LBB0_5
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x22
	bl	_strlen
	mov	x2, x0
	add	x1, sp, #8
	mov	x0, x22
	bl	_hex_decode
	mov	x22, x0
	tbz	x0, #63, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	mov	x1, x20
	bl	_errx
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w3, [x26]
	add	x0, sp, #8
	mov	w1, #1
	mov	x2, x22
	bl	_fwrite
	cmp	x0, x22
	b.eq	LBB0_3
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	mov	x1, x21
	bl	_errx
	b	LBB0_3
LBB0_10:
Lloh13:
	adrp	x20, _stdin@GOTPAGE
Lloh14:
	ldr	x20, [x20, _stdin@GOTPAGEOFF]
	ldr	w3, [x20]
	add	x0, sp, #1032
	mov	w1, #1
	mov	w2, #28
	bl	_fread
	cbz	x0, LBB0_15
; %bb.11:
	mov	x1, x0
Lloh15:
	adrp	x21, _stdout@GOTPAGE
Lloh16:
	ldr	x21, [x21, _stdout@GOTPAGEOFF]
Lloh17:
	adrp	x19, l_.str.3@PAGE
Lloh18:
	add	x19, x19, l_.str.3@PAGEOFF
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w3, [x20]
	add	x0, sp, #1032
	mov	w1, #1
	mov	w2, #28
	bl	_fread
	mov	x1, x0
	cbz	x0, LBB0_15
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #1032
	add	x2, sp, #8
	bl	_hex_encode
	tbnz	x0, #63, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w0, [x21]
	ldr	x2, [sp, #8]
	mov	x1, x19
	bl	_fprintf
	ldr	x0, [sp, #8]
	bl	_free
	b	LBB0_12
LBB0_15:
	ldur	x8, [x29, #-88]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	mov	w0, #0
	add	sp, sp, #2064
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_stdin,4,2                      ; @stdin
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\r\n"

l_.str.1:                               ; @.str.1
	.asciz	"hex_decode failed"

	.comm	_stdout,4,2                     ; @stdout
l_.str.2:                               ; @.str.2
	.asciz	"fwrite failed"

l_.str.3:                               ; @.str.3
	.asciz	"%s\n"

.subsections_via_symbols
