	.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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movl	$1, %esi
	callq	_barg
	movl	%eax, %r14d
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_lua_isnone
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %r8
	movl	$8, %ecx
	jmp	LBB0_3
LBB0_2:
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_barg
	movl	%eax, %ecx
	negl	%ecx
	cmovsl	%eax, %ecx
	testl	%eax, %eax
	leaq	L_.str.1(%rip), %rdx
	leaq	L_.str(%rip), %r8
	cmovsq	%rdx, %r8
LBB0_3:
	cmpl	$8, %ecx
	movl	$8, %edi
	cmovll	%ecx, %edi
	testl	%edi, %edi
	je	LBB0_4
## %bb.5:
	movl	%edi, %edx
	leaq	-1(%rdx), %rsi
	movl	%r14d, %ecx
	andl	$15, %ecx
	movb	(%r8,%rcx), %cl
	movl	%esi, %eax
	movb	%cl, -32(%rbp,%rax)
	cmpl	$2, %edi
	jb	LBB0_13
## %bb.6:
	movl	%r14d, %eax
	shrl	$4, %eax
	leaq	-2(%rdx), %rcx
	andl	$15, %eax
	movb	(%r8,%rax), %al
	movl	%ecx, %edi
	movb	%al, -32(%rbp,%rdi)
	cmpl	$2, %esi
	jl	LBB0_13
## %bb.7:
	movl	%r14d, %eax
	shrl	$8, %eax
	leaq	-3(%rdx), %rsi
	andl	$15, %eax
	movb	(%r8,%rax), %al
	movl	%esi, %edi
	movb	%al, -32(%rbp,%rdi)
	cmpl	$2, %ecx
	jl	LBB0_13
## %bb.8:
	movl	%r14d, %eax
	shrl	$12, %eax
	leaq	-4(%rdx), %rcx
	andl	$15, %eax
	movb	(%r8,%rax), %al
	movl	%ecx, %edi
	movb	%al, -32(%rbp,%rdi)
	cmpl	$2, %esi
	jl	LBB0_13
## %bb.9:
	movl	%r14d, %eax
	shrl	$16, %eax
	leaq	-5(%rdx), %rsi
	andl	$15, %eax
	movb	(%r8,%rax), %al
	movl	%esi, %edi
	movb	%al, -32(%rbp,%rdi)
	cmpl	$2, %ecx
	jl	LBB0_13
## %bb.10:
	movl	%r14d, %eax
	shrl	$20, %eax
	leaq	-6(%rdx), %rcx
	andl	$15, %eax
	movb	(%r8,%rax), %al
	movl	%ecx, %edi
	movb	%al, -32(%rbp,%rdi)
	cmpl	$2, %esi
	jl	LBB0_13
## %bb.11:
	movl	%r14d, %eax
	shrl	$24, %eax
	leal	-7(%rdx), %esi
	andl	$15, %eax
	movb	(%r8,%rax), %al
	movb	%al, -32(%rbp,%rsi)
	cmpl	$2, %ecx
	jl	LBB0_13
## %bb.12:
	movl	$4294967288, %eax               ## imm = 0xFFFFFFF8
	movl	%r14d, %ecx
	shrq	$28, %rcx
	addl	%edx, %eax
	movb	(%r8,%rcx), %cl
	movb	%cl, -32(%rbp,%rax)
	jmp	LBB0_13
LBB0_4:
	xorl	%edx, %edx
LBB0_13:
	leaq	-32(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_lua_pushlstring
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-24(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	$1, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"0123456789abcdef"

L_.str.1:                               ## @.str.1
	.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:
	sub	sp, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	mov	w1, #1
	bl	_barg
	mov	x20, x0
	mov	x0, x19
	mov	w1, #2
	bl	_lua_isnone
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, l_.str@PAGE
Lloh4:
	add	x8, x8, l_.str@PAGEOFF
	mov	w9, #8
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	mov	w1, #2
	bl	_barg
	cmp	w0, #0
	cneg	w9, w0, mi
Lloh5:
	adrp	x8, l_.str@PAGE
Lloh6:
	add	x8, x8, l_.str@PAGEOFF
Lloh7:
	adrp	x10, l_.str.1@PAGE
Lloh8:
	add	x10, x10, l_.str.1@PAGEOFF
	csel	x8, x10, x8, lt
LBB0_3:
	mov	w10, #8
	cmp	w9, #8
	csel	w2, w9, w10, lt
	cbz	w2, LBB0_12
; %bb.4:
	sub	x9, x2, #1
	and	x10, x20, #0xf
	ldrb	w10, [x8, x10]
	mov	x11, sp
	strb	w10, [x11, w9, uxtw]
	cmp	w2, #2
	b.lo	LBB0_13
; %bb.5:
	mov	x12, x20
	sub	x10, x2, #2
	ubfx	x12, x12, #4, #4
	ldrb	w12, [x8, x12]
	strb	w12, [x11, w10, uxtw]
	cmp	w9, #2
	b.lt	LBB0_13
; %bb.6:
	mov	x11, x20
	sub	x9, x2, #3
	ubfx	x11, x11, #8, #4
	ldrb	w12, [x8, x11]
	mov	x11, sp
	strb	w12, [x11, w9, uxtw]
	cmp	w10, #2
	b.lt	LBB0_13
; %bb.7:
	mov	x12, x20
	sub	x10, x2, #4
	ubfx	x12, x12, #12, #4
	ldrb	w12, [x8, x12]
	strb	w12, [x11, w10, uxtw]
	cmp	w9, #2
	b.lt	LBB0_13
; %bb.8:
	mov	x11, x20
	sub	x9, x2, #5
	ubfx	x11, x11, #16, #4
	ldrb	w12, [x8, x11]
	mov	x11, sp
	strb	w12, [x11, w9, uxtw]
	cmp	w10, #2
	b.lt	LBB0_13
; %bb.9:
	mov	x12, x20
	sub	x10, x2, #6
	ubfx	x12, x12, #20, #4
	ldrb	w12, [x8, x12]
	strb	w12, [x11, w10, uxtw]
	cmp	w9, #2
	b.lt	LBB0_13
; %bb.10:
	mov	x9, x20
	sub	w11, w2, #7
	ubfx	x9, x9, #24, #4
	ldrb	w12, [x8, x9]
	mov	x9, sp
	strb	w12, [x9, w11, uxtw]
	cmp	w10, #2
	b.lt	LBB0_13
; %bb.11:
	mov	w10, w20
	lsr	x10, x10, #28
	sub	w11, w2, #8
	ldrb	w8, [x8, x10]
	strb	w8, [x9, w11, uxtw]
	b	LBB0_13
LBB0_12:
	mov	x2, #0
LBB0_13:
	mov	x1, sp
	mov	x0, x19
	bl	_lua_pushlstring
	ldr	x8, [sp, #8]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	mov	w0, #1
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"0123456789abcdef"

l_.str.1:                               ; @.str.1
	.asciz	"0123456789ABCDEF"

	.no_dead_strip	_tohex
.subsections_via_symbols
