	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function callhook
_callhook:                              ## @callhook
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_LUA_HOOKCALL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	incl	(%rsi)
	movq	8(%rsi), %rdi
	callq	_isLua
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movl	-4(%rax), %edi
	callq	_GET_OPCODE
	movq	_OP_TAILCALL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	_CIST_TAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%rbx)
	movq	_LUA_HOOKTAILCALL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_3:
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	$-1, %edx
	callq	_luaD_hook
	decl	(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LUA_HOOKCALL,4,2               ## @LUA_HOOKCALL
	.comm	_OP_TAILCALL,8,3                ## @OP_TAILCALL
	.comm	_CIST_TAIL,4,2                  ## @CIST_TAIL
	.comm	_LUA_HOOKTAILCALL,4,2           ## @LUA_HOOKTAILCALL
	.no_dead_strip	_callhook
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function callhook
_callhook:                              ; @callhook
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _LUA_HOOKCALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LUA_HOOKCALL@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	ldr	w8, [x1]
	add	w8, w8, #1
	str	w8, [x1]
	ldr	x0, [x1, #8]
	bl	_isLua
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldur	w0, [x8, #-4]
	bl	_GET_OPCODE
Lloh3:
	adrp	x8, _OP_TAILCALL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OP_TAILCALL@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _CIST_TAIL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CIST_TAIL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
Lloh9:
	adrp	x8, _LUA_HOOKTAILCALL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LUA_HOOKTAILCALL@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
LBB0_3:
	mov	x0, x20
	mov	x1, x21
	mov	w2, #-1
	bl	_luaD_hook
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_LUA_HOOKCALL,4,2               ; @LUA_HOOKCALL
	.comm	_OP_TAILCALL,8,3                ; @OP_TAILCALL
	.comm	_CIST_TAIL,4,2                  ; @CIST_TAIL
	.comm	_LUA_HOOKTAILCALL,4,2           ; @LUA_HOOKTAILCALL
	.no_dead_strip	_callhook
.subsections_via_symbols
