	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_linux_set_cloned_tls           ## -- Begin function linux_set_cloned_tls
	.p2align	4, 0x90
_linux_set_cloned_tls:                  ## @linux_set_cloned_tls
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$16, %edx
	callq	_copyin
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_linux_msg
	jmp	LBB0_5
LBB0_2:
	movq	_GUGS32_SEL@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	movl	%eax, -48(%rbp)
	leaq	-56(%rbp), %rdi
	movq	%rbx, %rsi
	movl	$16, %edx
	callq	_copyout
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_linux_msg
LBB0_4:
	leaq	-56(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_LINUX_LDT_entry_a
	movl	%eax, -40(%rbp)
	movq	%rbx, %rdi
	callq	_LINUX_LDT_entry_b
	movl	%eax, -36(%rbp)
	leaq	-64(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	movl	$8, %edx
	callq	_memcpy
	movq	8(%r14), %rbx
	movq	-56(%rbp), %rax
	movq	%rax, (%rbx)
	movl	(%r12), %edi
	movq	_SEL_UPL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_GSEL
	movq	(%r14), %rcx
	movl	%eax, (%rcx)
	movq	_PCB_32BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_set_pcb_flags
LBB0_5:
	movl	%r15d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set_cloned_tls copyin info failed!"

	.comm	_GUGS32_SEL,4,2                 ## @GUGS32_SEL
L_.str.1:                               ## @.str.1
	.asciz	"set_cloned_tls copyout info failed!"

	.comm	_SEL_UPL,4,2                    ## @SEL_UPL
	.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_cloned_tls           ; -- Begin function linux_set_cloned_tls
	.p2align	2
_linux_set_cloned_tls:                  ; @linux_set_cloned_tls
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x1
	mov	x19, x0
	add	x1, sp, #8
	mov	x0, x21
	mov	w2, #16
	bl	_copyin
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_linux_msg
	b	LBB0_5
LBB0_2:
Lloh2:
	adrp	x22, _GUGS32_SEL@GOTPAGE
Lloh3:
	ldr	x22, [x22, _GUGS32_SEL@GOTPAGEOFF]
	ldr	w8, [x22]
	str	w8, [sp, #16]
	add	x0, sp, #8
	mov	x1, x21
	mov	w2, #16
	bl	_copyout
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.3:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_linux_msg
LBB0_4:
	add	x0, sp, #8
	bl	_LINUX_LDT_entry_a
	str	w0, [sp]
	add	x0, sp, #8
	bl	_LINUX_LDT_entry_b
	str	w0, [sp, #4]
	add	x0, sp, #24
	mov	x1, sp
	mov	w2, #8
	bl	_memcpy
	ldr	x21, [x19, #8]
	ldr	x8, [sp, #8]
	str	x8, [x21]
	ldr	w0, [x22]
Lloh6:
	adrp	x8, _SEL_UPL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SEL_UPL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_GSEL
	ldr	x8, [x19]
	str	w0, [x8]
Lloh9:
	adrp	x8, _PCB_32BIT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PCB_32BIT@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_set_pcb_flags
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set_cloned_tls copyin info failed!"

	.comm	_GUGS32_SEL,4,2                 ; @GUGS32_SEL
l_.str.1:                               ; @.str.1
	.asciz	"set_cloned_tls copyout info failed!"

	.comm	_SEL_UPL,4,2                    ; @SEL_UPL
	.comm	_PCB_32BIT,4,2                  ; @PCB_32BIT
.subsections_via_symbols
