	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lua_setfenv
_lua_setfenv:                           ## @lua_setfenv
	.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
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	$1, %esi
	callq	_api_checknelems
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_index2adr
	movl	%eax, %r14d
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_api_checkvalidindex
	movq	(%rbx), %rdi
	decq	%rdi
	callq	_ttistable
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_luai_apicheck
	movl	%r14d, %edi
	callq	_ttype
	cmpl	$8, %eax
	je	LBB0_4
## %bb.1:
	cmpl	$7, %eax
	je	LBB0_5
## %bb.2:
	xorl	%ecx, %ecx
	cmpl	$6, %eax
	jne	LBB0_8
## %bb.3:
	movq	(%rbx), %rdi
	decq	%rdi
	callq	_hvalue
	movq	%rax, %r15
	movl	%r14d, %edi
	callq	_clvalue
	jmp	LBB0_6
LBB0_4:
	movl	%r14d, %edi
	callq	_thvalue
	movl	%eax, %edi
	callq	_gt
	movl	%eax, %r15d
	movq	(%rbx), %rdi
	decq	%rdi
	callq	_hvalue
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%rax, %rdx
	callq	_sethvalue
	jmp	LBB0_7
LBB0_5:
	movq	(%rbx), %rdi
	decq	%rdi
	callq	_hvalue
	movq	%rax, %r15
	movl	%r14d, %edi
	callq	_uvalue
LBB0_6:
	movq	%r15, (%rax)
LBB0_7:
	movl	%r14d, %edi
	callq	_gcvalue
	movl	%eax, %r14d
	movq	(%rbx), %rdi
	decq	%rdi
	callq	_hvalue
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movq	%rax, %rdx
	callq	_luaC_objbarrier
	movl	$1, %ecx
LBB0_8:
	decq	(%rbx)
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_lua_setfenv
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lua_setfenv
_lua_setfenv:                           ; @lua_setfenv
	.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, #1
	bl	_ttistable
	mov	x1, x0
	mov	x0, x19
	bl	_luai_apicheck
	mov	x0, x20
	bl	_ttype
	cmp	w0, #8
	b.eq	LBB0_4
; %bb.1:
	cmp	w0, #7
	b.eq	LBB0_5
; %bb.2:
	cmp	w0, #6
	b.ne	LBB0_8
; %bb.3:
	ldr	x8, [x19]
	sub	x0, x8, #1
	bl	_hvalue
	mov	x21, x0
	mov	x0, x20
	bl	_clvalue
	b	LBB0_6
LBB0_4:
	mov	x0, x20
	bl	_thvalue
	bl	_gt
	mov	x21, x0
	ldr	x8, [x19]
	sub	x0, x8, #1
	bl	_hvalue
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_sethvalue
	b	LBB0_7
LBB0_5:
	ldr	x8, [x19]
	sub	x0, x8, #1
	bl	_hvalue
	mov	x21, x0
	mov	x0, x20
	bl	_uvalue
LBB0_6:
	str	x21, [x0]
LBB0_7:
	mov	x0, x20
	bl	_gcvalue
	mov	x20, x0
	ldr	x8, [x19]
	sub	x0, x8, #1
	bl	_hvalue
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_luaC_objbarrier
	mov	w0, #1
	b	LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldr	x8, [x19]
	sub	x8, x8, #1
	str	x8, [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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_lua_setfenv
.subsections_via_symbols
