	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function loadhex
_loadhex:                               ## @loadhex
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	callq	_getc
	movl	%eax, -48(%rbp)
	movq	_EOF@GOTPCREL(%rip), %r13
	xorl	%r15d, %r15d
	cmpl	(%r13), %eax
	jne	LBB0_1
LBB0_22:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	xorl	%r15d, %r15d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, -56(%rbp)
	je	LBB0_10
LBB0_21:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	callq	_getc
	movl	%eax, -48(%rbp)
	cmpl	(%r13), %eax
	je	LBB0_22
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	cmpl	$58, %eax
	jne	LBB0_21
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	leaq	L_.str(%rip), %rsi
	leaq	-52(%rbp), %rdx
	callq	_fscanf
	cmpl	$1, %eax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	callq	_ABANDON
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	-52(%rbp), %r14d
	movq	%r12, %rdi
	leaq	L_.str.2(%rip), %rsi
	leaq	-44(%rbp), %rdx
	callq	_fscanf
	cmpl	$1, %eax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	callq	_ABANDON
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %ebx
	movq	%r12, %rdi
	leaq	L_.str(%rip), %rsi
	leaq	-56(%rbp), %rdx
	callq	_fscanf
	cmpl	$1, %eax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	callq	_ABANDON
	jmp	LBB0_9
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	leal	255(%rbx), %eax
	testl	%ebx, %ebx
	cmovnsl	%ebx, %eax
	sarl	$8, %eax
	addl	%ebx, %r14d
	addl	%eax, %r14d
	cmpl	$0, -52(%rbp)
	jle	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r13d, %r13d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_12 Depth=2
	movl	-48(%rbp), %ecx
	leal	1(%rax), %edx
	movl	%edx, -44(%rbp)
	cltq
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movb	%cl, (%rsi,%rax)
	cmpl	%r15d, %eax
	cmovgel	%edx, %r15d
	movzbl	%r14b, %r14d
	addl	%ecx, %r14d
	incl	%r13d
	cmpl	-52(%rbp), %r13d
	jge	LBB0_17
LBB0_12:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r12, %rdi
	leaq	L_.str(%rip), %rsi
	leaq	-48(%rbp), %rdx
	callq	_fscanf
	cmpl	$1, %eax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=2
	leaq	L_.str.1(%rip), %rdi
	callq	_ABANDON
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=2
	movl	-44(%rbp), %eax
	movq	_MAX_SIZE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jl	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=2
	leaq	L_.str.3(%rip), %rdi
	callq	_ABANDON
	movl	-44(%rbp), %eax
	jmp	LBB0_16
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	leaq	L_.str(%rip), %rsi
	leaq	-60(%rbp), %rdx
	callq	_fscanf
	cmpl	$1, %eax
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	callq	_ABANDON
LBB0_19:                                ##   in Loop: Header=BB0_2 Depth=1
	negl	%r14d
	movzbl	%r14b, %eax
	cmpl	%eax, -60(%rbp)
	movq	_EOF@GOTPCREL(%rip), %r13
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.4(%rip), %rdi
	callq	_ABANDON
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_EOF,4,2                        ## @EOF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%02x"

L_.str.1:                               ## @.str.1
	.asciz	"File format error"

L_.str.2:                               ## @.str.2
	.asciz	"%04x"

	.comm	_MAX_SIZE,4,2                   ## @MAX_SIZE
L_.str.3:                               ## @.str.3
	.asciz	"File too large"

L_.str.4:                               ## @.str.4
	.asciz	"Line checksum error"

	.no_dead_strip	_loadhex
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function loadhex
_loadhex:                               ; @loadhex
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x19, x1
	mov	x20, x0
	bl	_getc
	str	w0, [sp, #28]
Lloh0:
	adrp	x27, _EOF@GOTPAGE
Lloh1:
	ldr	x27, [x27, _EOF@GOTPAGEOFF]
	ldr	w8, [x27]
	cmp	w0, w8
	b.ne	LBB0_3
; %bb.1:
	mov	w21, #0
LBB0_2:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_3:
	mov	w21, #0
Lloh2:
	adrp	x22, l_.str@PAGE
Lloh3:
	add	x22, x22, l_.str@PAGEOFF
Lloh4:
	adrp	x23, l_.str.2@PAGE
Lloh5:
	add	x23, x23, l_.str.2@PAGEOFF
Lloh6:
	adrp	x28, _MAX_SIZE@GOTPAGE
Lloh7:
	ldr	x28, [x28, _MAX_SIZE@GOTPAGEOFF]
Lloh8:
	adrp	x25, l_.str.1@PAGE
Lloh9:
	add	x25, x25, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_13
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	bl	_getc
	str	w0, [sp, #28]
	ldr	w8, [x27]
	cmp	w0, w8
	b.eq	LBB0_2
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_16 Depth 2
	cmp	w0, #58
	b.ne	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x2, sp, #24
	mov	x0, x20
	mov	x1, x22
	bl	_fscanf
	cmp	w0, #1
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x25
	bl	_ABANDON
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w24, [sp, #24]
	add	x2, sp, #16
	mov	x0, x20
	mov	x1, x23
	bl	_fscanf
	cmp	w0, #1
	b.eq	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x25
	bl	_ABANDON
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w26, [sp, #16]
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x22
	bl	_fscanf
	cmp	w0, #1
	b.eq	LBB0_4
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x25
	bl	_ABANDON
	b	LBB0_4
LBB0_13:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w8, w26, #255
	cmp	w26, #0
	csel	w8, w8, w26, lt
	add	w9, w26, w24
	add	w26, w9, w8, asr #8
	ldr	w8, [sp, #24]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.14:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w24, #0
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=2
	ldr	w9, [sp, #28]
	add	w10, w8, #1
	str	w10, [sp, #16]
	strb	w9, [x19, w8, sxtw]
	cmp	w8, w21
	csinc	w21, w21, w8, lt
	add	w26, w9, w26, uxtb
	add	w24, w24, #1
	ldr	w8, [sp, #24]
	cmp	w24, w8
	b.ge	LBB0_20
LBB0_16:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x2, sp, #28
	mov	x0, x20
	mov	x1, x22
	bl	_fscanf
	cmp	w0, #1
	b.eq	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=2
	mov	x0, x25
	bl	_ABANDON
LBB0_18:                                ;   in Loop: Header=BB0_16 Depth=2
	ldr	w8, [sp, #16]
	ldr	w9, [x28]
	cmp	w8, w9
	b.lt	LBB0_15
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=2
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_ABANDON
	ldr	w8, [sp, #16]
	b	LBB0_15
LBB0_20:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x2, sp, #20
	mov	x0, x20
	mov	x1, x22
	bl	_fscanf
	cmp	w0, #1
	b.eq	LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x25
	bl	_ABANDON
LBB0_22:                                ;   in Loop: Header=BB0_6 Depth=1
	neg	w8, w26
	ldr	w9, [sp, #20]
	cmp	w9, w8, uxtb
	b.eq	LBB0_5
; %bb.23:                               ;   in Loop: Header=BB0_6 Depth=1
Lloh12:
	adrp	x0, l_.str.4@PAGE
Lloh13:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_ABANDON
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EOF,4,2                        ; @EOF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%02x"

l_.str.1:                               ; @.str.1
	.asciz	"File format error"

l_.str.2:                               ; @.str.2
	.asciz	"%04x"

	.comm	_MAX_SIZE,4,2                   ; @MAX_SIZE
l_.str.3:                               ; @.str.3
	.asciz	"File too large"

l_.str.4:                               ; @.str.4
	.asciz	"Line checksum error"

	.no_dead_strip	_loadhex
.subsections_via_symbols
