	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lua_setmetatable
_lua_setmetatable:                      ## @lua_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
	movl	%esi, %ebx
	movq	%rdi, %r12
	movl	$1, %esi
	callq	_api_checknelems
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_index2adr
	movq	%rax, %r14
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_api_checkvalidindex
	movq	(%r12), %rdi
	addq	$-4, %rdi
	callq	_ttisnil
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	xorl	%r15d, %r15d
	jmp	LBB0_3
LBB0_2:
	movq	(%r12), %rdi
	addq	$-4, %rdi
	callq	_ttistable
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_luai_apicheck
	movq	(%r12), %rdi
	addq	$-4, %rdi
	callq	_hvalue
	movq	%rax, %r15
LBB0_3:
	movq	%r14, %rdi
	callq	_ttype
	cmpq	$7, %rax
	je	LBB0_7
## %bb.4:
	cmpq	$5, %rax
	jne	LBB0_9
## %bb.5:
	movq	%r14, %rdi
	callq	_hvalue
	movq	%r15, (%rax)
	testq	%r15, %r15
	je	LBB0_10
## %bb.6:
	movq	%r14, %rdi
	callq	_hvalue
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	%r15, %rdx
	callq	_luaC_objbarriert
	jmp	LBB0_10
LBB0_7:
	movq	%r14, %rdi
	callq	_uvalue
	movq	%r15, (%rax)
	testq	%r15, %r15
	je	LBB0_10
## %bb.8:
	movq	%r14, %rdi
	callq	_rawuvalue
	movq	%r12, %rdi
	movl	%eax, %esi
	movq	%r15, %rdx
	callq	_luaC_objbarrier
	jmp	LBB0_10
LBB0_9:
	movq	%r12, %rdi
	callq	_G
	movq	(%rax), %rbx
	movq	%r14, %rdi
	callq	_ttype
	movq	%r15, (%rbx,%rax,8)
LBB0_10:
	addq	$-4, (%r12)
	movl	$1, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_lua_setmetatable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lua_setmetatable
_lua_setmetatable:                      ; @lua_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	x20, x1
	mov	x19, x0
	mov	w1, #1
	bl	_api_checknelems
	mov	x0, x19
	mov	x1, x20
	bl	_index2adr
	mov	x20, x0
	mov	x0, x19
	mov	x1, x20
	bl	_api_checkvalidindex
	ldr	x8, [x19]
	sub	x0, x8, #4
	bl	_ttisnil
	cbz	x0, LBB0_2
; %bb.1:
	mov	x21, #0
	b	LBB0_3
LBB0_2:
	ldr	x8, [x19]
	sub	x0, x8, #4
	bl	_ttistable
	mov	x1, x0
	mov	x0, x19
	bl	_luai_apicheck
	ldr	x8, [x19]
	sub	x0, x8, #4
	bl	_hvalue
	mov	x21, x0
LBB0_3:
	mov	x0, x20
	bl	_ttype
	cmp	x0, #7
	b.eq	LBB0_7
; %bb.4:
	cmp	x0, #5
	b.ne	LBB0_9
; %bb.5:
	mov	x0, x20
	bl	_hvalue
	str	x21, [x0]
	cbz	x21, LBB0_10
; %bb.6:
	mov	x0, x20
	bl	_hvalue
	mov	x1, x0
	mov	x0, x19
	mov	x2, x21
	bl	_luaC_objbarriert
	b	LBB0_10
LBB0_7:
	mov	x0, x20
	bl	_uvalue
	str	x21, [x0]
	cbz	x21, LBB0_10
; %bb.8:
	mov	x0, x20
	bl	_rawuvalue
	mov	x1, x0
	mov	x0, x19
	mov	x2, x21
	bl	_luaC_objbarrier
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	bl	_G
	ldr	x22, [x0]
	mov	x0, x20
	bl	_ttype
	str	x21, [x22, x0, lsl #3]
LBB0_10:
	ldr	x8, [x19]
	sub	x8, x8, #4
	str	x8, [x19]
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_lua_setmetatable
.subsections_via_symbols
