	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_linux_set_thread_area          ## -- Begin function linux_set_thread_area
	.p2align	4, 0x90
_linux_set_thread_area:                 ## @linux_set_thread_area
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	(%rsi), %edi
	leaq	-40(%rbp), %rsi
	movl	$16, %edx
	callq	_copyin
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movl	-40(%rbp), %eax
	leal	-128(%rax), %ecx
	cmpl	$2, %ecx
	jb	LBB0_4
## %bb.2:
	cmpl	$6, %eax
	je	LBB0_4
## %bb.3:
	cmpl	$-1, %eax
	jne	LBB0_10
LBB0_4:
	movl	$128, -40(%rbp)
	movl	(%rbx), %esi
	leaq	-40(%rbp), %rdi
	movl	$16, %edx
	callq	_copyout
	testl	%eax, %eax
	jne	LBB0_9
## %bb.5:
	leaq	-40(%rbp), %rdi
	callq	_LINUX_LDT_empty
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	$0, -24(%rbp)
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_9
LBB0_7:
	leaq	-40(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_LINUX_LDT_entry_a
	movl	%eax, -24(%rbp)
	movq	%rbx, %rdi
	callq	_LINUX_LDT_entry_b
LBB0_8:
	movl	%eax, -20(%rbp)
	leaq	-48(%rbp), %rdi
	leaq	-24(%rbp), %rsi
	movl	$8, %edx
	callq	_memcpy
	movq	(%r14), %rdi
	movq	-32(%rbp), %rax
	movq	%rax, (%rdi)
	movq	_PCB_32BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_set_pcb_flags
	movq	-32(%rbp), %rsi
	movq	%r14, %rdi
	callq	_update_gdt_gsbase
	xorl	%eax, %eax
LBB0_9:
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PCB_32BIT,4,2                  ## @PCB_32BIT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_linux_set_thread_area          ; -- Begin function linux_set_thread_area
	.p2align	2
_linux_set_thread_area:                 ; @linux_set_thread_area
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x1]
	add	x1, sp, #16
	mov	w2, #16
	bl	_copyin
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	w8, [sp, #16]
	sub	w9, w8, #128
	cmp	w9, #2
	ccmp	w8, #6, #4, hs
	ccmn	w8, #1, #4, ne
	b.ne	LBB0_5
; %bb.2:
	mov	w8, #128
	str	w8, [sp, #16]
	ldr	w1, [x20]
	add	x0, sp, #16
	mov	w2, #16
	bl	_copyout
	cbnz	w0, LBB0_8
; %bb.3:
	add	x0, sp, #16
	bl	_LINUX_LDT_empty
	cbz	x0, LBB0_6
; %bb.4:
	mov	w0, #0
	str	wzr, [sp]
	b	LBB0_7
LBB0_5:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	b	LBB0_8
LBB0_6:
	add	x0, sp, #16
	bl	_LINUX_LDT_entry_a
	str	w0, [sp]
	add	x0, sp, #16
	bl	_LINUX_LDT_entry_b
LBB0_7:
	str	w0, [sp, #4]
	add	x0, sp, #8
	mov	x1, sp
	mov	w2, #8
	bl	_memcpy
	ldr	x0, [x19]
	ldr	x8, [sp, #24]
	str	x8, [x0]
Lloh3:
	adrp	x8, _PCB_32BIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCB_32BIT@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_set_pcb_flags
	ldr	x1, [sp, #24]
	mov	x0, x19
	bl	_update_gdt_gsbase
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PCB_32BIT,4,2                  ; @PCB_32BIT
.subsections_via_symbols
