	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tohex
_tohex:                                 ## @tohex
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	leaq	(%rsi,%rsi), %rdi
	incq	%rdi
	callq	_malloc
	movq	%rax, %r12
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_assert
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	cmpq	$1, %r15
	jne	LBB0_4
## %bb.3:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	testb	$1, %r15b
	jne	LBB0_8
	jmp	LBB0_9
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_4:
	movq	%r15, %r8
	andq	$-2, %r8
	negq	%r8
	xorl	%ecx, %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14,%rax,2), %edx
	movl	%edx, %edi
	shrl	$4, %edi
	andl	$15, %edi
	movzbl	(%rdi,%rsi), %ebx
	movb	%bl, (%r12,%rax)
	andl	$15, %edx
	movzbl	(%rdx,%rsi), %edx
	movb	%dl, 1(%r12,%rax)
	movl	4(%r14,%rax,2), %edx
	movl	%edx, %edi
	shrl	$4, %edi
	andl	$15, %edi
	movzbl	(%rdi,%rsi), %ebx
	movb	%bl, 2(%r12,%rax)
	andl	$15, %edx
	movzbl	(%rdx,%rsi), %edx
	movb	%dl, 3(%r12,%rax)
	addq	$4, %rax
	addq	$-2, %rcx
	cmpq	%rcx, %r8
	jne	LBB0_5
## %bb.6:
	negq	%rcx
	testb	$1, %r15b
	je	LBB0_9
LBB0_8:
	movl	(%r14,%rcx,4), %ecx
	movl	%ecx, %edx
	shrl	$4, %edx
	andl	$15, %edx
	leaq	L_.str(%rip), %rsi
	movb	(%rdx,%rsi), %dl
	movq	%rax, %rdi
	orq	$1, %rdi
	movb	%dl, (%r12,%rax)
	andl	$15, %ecx
	movb	(%rcx,%rsi), %cl
	addq	$2, %rax
	movb	%cl, (%r12,%rdi)
LBB0_9:
	movb	$0, (%r12,%rax)
	movq	%r12, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"0123456789abcdef"

	.no_dead_strip	_tohex
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tohex
_tohex:                                 ; @tohex
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x21, x0
	mov	w0, #1
	bfi	x0, x1, #1, #63
	bl	_malloc
	mov	x19, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	cbz	x20, LBB0_9
; %bb.1:
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
	mov	x10, #0
	subs	x9, x20, #1
	b.eq	LBB0_11
; %bb.2:
	adds	x9, x9, x9
	add	x11, x19, x9
	cset	w12, hs
	cmp	x11, x19
	b.lo	LBB0_10
; %bb.3:
	tbnz	w12, #0, LBB0_10
; %bb.4:
	add	x11, x19, #1
	add	x9, x11, x9
	cmp	x9, x11
	b.lo	LBB0_10
; %bb.5:
	mov	x9, x10
	tbnz	w12, #0, LBB0_11
; %bb.6:
	and	x10, x20, #0xfffffffffffffffe
	lsl	x9, x10, #1
	add	x12, x21, #4
	mov	x13, x10
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w14, w15, [x12, #-4]
	ubfx	x16, x14, #4, #4
	ubfx	x17, x15, #4, #4
	ldrb	w16, [x8, x16]
	ldrb	w17, [x8, x17]
	sturb	w16, [x11, #-1]
	and	x14, x14, #0xf
	and	x15, x15, #0xf
	ldrb	w14, [x8, x14]
	ldrb	w15, [x8, x15]
	strb	w17, [x11, #1]
	strb	w14, [x11]
	strb	w15, [x11, #2]
	add	x12, x12, #8
	add	x11, x11, #4
	subs	x13, x13, #2
	b.ne	LBB0_7
; %bb.8:
	cmp	x10, x20
	b.ne	LBB0_11
	b	LBB0_13
LBB0_9:
	mov	x9, x20
	b	LBB0_13
LBB0_10:
	mov	x9, x10
LBB0_11:
	sub	x11, x20, x10
	add	x10, x21, x10, lsl #2
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x10], #4
	ubfx	x13, x12, #4, #4
	ldrb	w13, [x8, x13]
	add	x14, x19, x9
	strb	w13, [x14]
	and	x12, x12, #0xf
	ldrb	w12, [x8, x12]
	add	x9, x9, #2
	strb	w12, [x14, #1]
	subs	x11, x11, #1
	b.ne	LBB0_12
LBB0_13:
	strb	wzr, [x19, x9]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"0123456789abcdef"

	.no_dead_strip	_tohex
.subsections_via_symbols
