	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function luaB_setmetatable
_luaB_setmetatable:                     ## @luaB_setmetatable
	.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	%rdi, %rbx
	movl	$2, %esi
	callq	_lua_type
	movl	%eax, %r14d
	movq	_LUA_TTABLE@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_luaL_checktype
	movq	_LUA_TNIL@GOTPCREL(%rip), %r12
	cmpl	(%r12), %r14d
	sete	%al
	cmpl	(%r15), %r14d
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %esi
	leaq	L_.str(%rip), %rcx
	movq	%rbx, %rdi
	movl	$2, %edx
	callq	_luaL_argcheck
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_luaL_getmetafield
	cmpl	(%r12), %eax
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_lua_settop
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_lua_setmetatable
	movl	$1, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_luaL_error                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_LUA_TTABLE,4,2                 ## @LUA_TTABLE
	.comm	_LUA_TNIL,4,2                   ## @LUA_TNIL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"nil or table expected"

L_.str.1:                               ## @.str.1
	.asciz	"__metatable"

L_.str.2:                               ## @.str.2
	.asciz	"cannot change a protected metatable"

	.no_dead_strip	_luaB_setmetatable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function luaB_setmetatable
_luaB_setmetatable:                     ; @luaB_setmetatable
	.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, x0
	mov	w1, #2
	bl	_lua_type
	mov	x20, x0
Lloh0:
	adrp	x21, _LUA_TTABLE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _LUA_TTABLE@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	x0, x19
	mov	w1, #1
	bl	_luaL_checktype
Lloh2:
	adrp	x22, _LUA_TNIL@GOTPAGE
Lloh3:
	ldr	x22, [x22, _LUA_TNIL@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w20, w8
	ldr	w8, [x21]
	ccmp	w20, w8, #4, ne
	cset	w1, eq
Lloh4:
	adrp	x3, l_.str@PAGE
Lloh5:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #2
	bl	_luaL_argcheck
Lloh6:
	adrp	x2, l_.str.1@PAGE
Lloh7:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w1, #1
	bl	_luaL_getmetafield
	ldr	w8, [x22]
	cmp	w0, w8
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #2
	bl	_lua_settop
	mov	x0, x19
	mov	w1, #1
	bl	_lua_setmetatable
	mov	w0, #1
	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
LBB0_2:
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	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
	b	_luaL_error
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_LUA_TTABLE,4,2                 ; @LUA_TTABLE
	.comm	_LUA_TNIL,4,2                   ; @LUA_TNIL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"nil or table expected"

l_.str.1:                               ; @.str.1
	.asciz	"__metatable"

l_.str.2:                               ; @.str.2
	.asciz	"cannot change a protected metatable"

	.no_dead_strip	_luaB_setmetatable
.subsections_via_symbols
