	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function db_gethook
_db_gethook:                            ## @db_gethook
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	-28(%rbp), %rsi
	callq	_getthread
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_lua_gethookmask
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_lua_gethook
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_hookf@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_lua_pushliteral
	jmp	LBB0_5
LBB0_1:
	movq	%rbx, %rdi
	callq	_lua_pushnil
	jmp	LBB0_5
LBB0_4:
	movq	_LUA_REGISTRYINDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_HOOKKEY@GOTPCREL(%rip), %rdx
	movq	%rbx, %rdi
	callq	_lua_rawgetp
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	_checkstack
	movq	%r14, %rdi
	callq	_lua_pushthread
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_lua_xmove
	movq	%rbx, %rdi
	movl	$-2, %esi
	callq	_lua_rawget
	movq	%rbx, %rdi
	movl	$-2, %esi
	callq	_lua_remove
LBB0_5:
	leaq	-33(%rbp), %rsi
	movl	%r15d, %edi
	callq	_unmakemask
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_lua_pushstring
	movq	%r14, %rdi
	callq	_lua_gethookcount
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_lua_pushinteger
	movl	$3, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_hookf,8,3                      ## @hookf
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"external hook"

	.comm	_LUA_REGISTRYINDEX,4,2          ## @LUA_REGISTRYINDEX
	.comm	_HOOKKEY,4,2                    ## @HOOKKEY
	.no_dead_strip	_db_gethook
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function db_gethook
_db_gethook:                            ; @db_gethook
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	add	x1, sp, #12
	bl	_getthread
	mov	x20, x0
	bl	_lua_gethookmask
	mov	x21, x0
	mov	x0, x20
	bl	_lua_gethook
	cbz	x0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _hookf@GOTPAGE
Lloh1:
	ldr	x8, [x8, _hookf@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_4
; %bb.2:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_lua_pushliteral
	b	LBB0_5
LBB0_3:
	mov	x0, x19
	bl	_lua_pushnil
	b	LBB0_5
LBB0_4:
Lloh5:
	adrp	x8, _LUA_REGISTRYINDEX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LUA_REGISTRYINDEX@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x2, _HOOKKEY@GOTPAGE
Lloh9:
	ldr	x2, [x2, _HOOKKEY@GOTPAGEOFF]
	mov	x0, x19
	bl	_lua_rawgetp
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	bl	_checkstack
	mov	x0, x20
	bl	_lua_pushthread
	mov	x0, x20
	mov	x1, x19
	mov	w2, #1
	bl	_lua_xmove
	mov	x0, x19
	mov	w1, #-2
	bl	_lua_rawget
	mov	x0, x19
	mov	w1, #-2
	bl	_lua_remove
LBB0_5:
	add	x1, sp, #7
	mov	x0, x21
	bl	_unmakemask
	mov	x1, x0
	mov	x0, x19
	bl	_lua_pushstring
	mov	x0, x20
	bl	_lua_gethookcount
	mov	x1, x0
	mov	x0, x19
	bl	_lua_pushinteger
	mov	w0, #3
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_hookf,8,3                      ; @hookf
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"external hook"

	.comm	_LUA_REGISTRYINDEX,4,2          ; @LUA_REGISTRYINDEX
	.comm	_HOOKKEY,4,2                    ; @HOOKKEY
	.no_dead_strip	_db_gethook
.subsections_via_symbols
