	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chap_hex2bin
_chap_hex2bin:                          ## @chap_hex2bin
	.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	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %r12
	movq	%r12, %rdi
	callq	_strlen
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_strncasecmp
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	leaq	L_.str.1(%rip), %r12
	movq	%r12, %rdi
	callq	_strlen
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_strncasecmp
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	leaq	L_.str.2(%rip), %rdi
LBB0_3:
	xorl	%eax, %eax
	callq	_log_warnx
LBB0_4:
	movl	$-1, %eax
LBB0_5:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	addq	$2, %rbx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_chap_b642bin                   ## TAILCALL
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	callq	_strlen
	cltq
	addq	%rax, %rbx
	movq	%rbx, %rdi
	callq	_strlen
	testl	%eax, %eax
	jle	LBB0_16
## %bb.8:
	movl	%eax, %r13d
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	shrl	%eax
	movl	%r13d, %r15d
	andl	$1, %r15d
	addl	%eax, %r15d
	movl	$1, %ebx
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_calloc
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	callq	_log_err
LBB0_10:
	leaq	-1(%r15), %r12
	movl	%r13d, %r13d
	incq	%r13
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_13 Depth=1
	shlb	$4, %bl
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	orb	%bl, (%rax,%r12)
	decq	%r12
	movl	$1, %ebx
LBB0_12:                                ##   in Loop: Header=BB0_13 Depth=1
	decq	%r13
	cmpq	$1, %r13
	jbe	LBB0_17
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movq	%r15, %r14
	leal	-2(%r13), %r15d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movsbl	(%rax,%r15), %edi
	callq	_chap_hex2int
	testl	%eax, %eax
	js	LBB0_18
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%eax, %ebx
	xorl	%edi, %edi
	movq	%r14, %r15
	cmpq	%r14, %r12
	setb	%dil
	callq	_assert
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_11
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movb	%bl, (%rax,%r12)
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_16:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_3
LBB0_17:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rax)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%r15, (%rax)
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_18:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movsbl	(%rax,%r15), %esi
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_log_warnx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_free
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"0b"

L_.str.1:                               ## @.str.1
	.asciz	"0x"

L_.str.2:                               ## @.str.2
	.asciz	"malformed variable, should start with \"0x\" or \"0b\""

L_.str.3:                               ## @.str.3
	.asciz	"malformed variable; doesn't contain anything but \"0x\""

L_.str.4:                               ## @.str.4
	.asciz	"calloc"

L_.str.5:                               ## @.str.5
	.asciz	"malformed variable, invalid char \"%c\""

	.no_dead_strip	_chap_hex2bin
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chap_hex2bin
_chap_hex2bin:                          ; @chap_hex2bin
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x22, l_.str@PAGE
Lloh1:
	add	x22, x22, l_.str@PAGEOFF
	mov	x0, x22
	bl	_strlen
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_strncasecmp
	cbz	x0, LBB0_6
; %bb.1:
Lloh2:
	adrp	x22, l_.str.1@PAGE
Lloh3:
	add	x22, x22, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_strlen
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_strncasecmp
	cbz	x0, LBB0_7
; %bb.2:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_3:
	bl	_log_warnx
LBB0_4:
	mov	w0, #-1
LBB0_5:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_6:
	add	x0, x21, #2
	mov	x1, x20
	mov	x2, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_chap_b642bin
LBB0_7:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_strlen
	add	x21, x21, w0, sxtw
	mov	x0, x21
	bl	_strlen
	cmp	w0, #0
	b.le	LBB0_16
; %bb.8:
	mov	x24, x0
	and	w8, w0, #0x1
	add	w23, w8, w0, lsr #1
	mov	x0, x23
	mov	w1, #1
	bl	_calloc
	mov	x22, x0
	cbnz	x0, LBB0_10
; %bb.9:
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_log_err
LBB0_10:
	sub	x25, x23, #1
	mov	w8, w24
	add	x26, x8, #1
	mov	w27, #1
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=1
	ldrb	w8, [x22, x25]
	orr	w8, w8, w24, lsl #4
	strb	w8, [x22, x25]
	sub	x25, x25, #1
	mov	w27, #1
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	sub	x26, x26, #1
	cmp	x26, #1
	b.ls	LBB0_17
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	sub	w28, w26, #2
	ldrsb	w0, [x21, x28]
	bl	_chap_hex2int
	tbnz	w0, #31, LBB0_18
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x24, x0
	cmp	x25, x23
	cset	w0, lo
	bl	_assert
	cbz	w27, LBB0_11
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	w27, #0
	strb	w24, [x22, x25]
	b	LBB0_12
LBB0_16:
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_3
LBB0_17:
	mov	w0, #0
	str	x22, [x20]
	str	x23, [x19]
	b	LBB0_5
LBB0_18:
	ldrsb	x8, [x21, x28]
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.5@PAGE
Lloh13:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_log_warnx
	mov	x0, x22
	bl	_free
	b	LBB0_4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"0b"

l_.str.1:                               ; @.str.1
	.asciz	"0x"

l_.str.2:                               ; @.str.2
	.asciz	"malformed variable, should start with \"0x\" or \"0b\""

l_.str.3:                               ; @.str.3
	.asciz	"malformed variable; doesn't contain anything but \"0x\""

l_.str.4:                               ; @.str.4
	.asciz	"calloc"

l_.str.5:                               ; @.str.5
	.asciz	"malformed variable, invalid char \"%c\""

	.no_dead_strip	_chap_hex2bin
.subsections_via_symbols
