	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sysarch_ldt                    ## -- Begin function sysarch_ldt
	.p2align	4, 0x90
_sysarch_ldt:                           ## @sysarch_ldt
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	(%rsi), %edi
	callq	_AUDIT_ARG_CMD
	movq	_UIO_USERSPACE@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	8(%rbx), %rdi
	leaq	-56(%rbp), %r15
	movq	%r15, %rsi
	movl	$16, %edx
	callq	_copyin
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_15
	jmp	LBB0_3
LBB0_2:
	movq	8(%rbx), %r15
LBB0_3:
	movl	(%rbx), %eax
	cmpl	$128, %eax
	je	LBB0_6
## %bb.4:
	xorl	%r12d, %r12d
	cmpl	$129, %eax
	jne	LBB0_15
## %bb.5:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_amd64_get_ldt
	jmp	LBB0_14
LBB0_6:
	cmpq	$0, 8(%r15)
	je	LBB0_9
## %bb.7:
	movl	(%r15), %eax
	movq	_max_ldt_segment@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_9
## %bb.8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_15
LBB0_9:
	movl	(%r14), %edi
	movq	_PCB_FULL_IRET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_set_pcb_flags
	cmpq	$0, 8(%r15)
	je	LBB0_13
## %bb.10:
	movl	(%r15), %edi
	shll	$4, %edi
	movq	_M_TEMP@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_malloc
	movq	%rax, %rbx
	movq	8(%r15), %rdi
	movl	(%r15), %edx
	shll	$4, %edx
	movq	%rax, %rsi
	callq	_copyin
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_amd64_set_ldt
	movl	%eax, %r12d
LBB0_12:
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_free
	jmp	LBB0_15
LBB0_13:
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_amd64_set_ldt
LBB0_14:
	movl	%eax, %r12d
LBB0_15:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UIO_USERSPACE,4,2              ## @UIO_USERSPACE
	.comm	_max_ldt_segment,4,2            ## @max_ldt_segment
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PCB_FULL_IRET,4,2              ## @PCB_FULL_IRET
	.comm	_M_TEMP,4,2                     ## @M_TEMP
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sysarch_ldt                    ; -- Begin function sysarch_ldt
	.p2align	2
_sysarch_ldt:                           ; @sysarch_ldt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	ldr	w0, [x1]
	bl	_AUDIT_ARG_CMD
Lloh0:
	adrp	x8, _UIO_USERSPACE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UIO_USERSPACE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_2
; %bb.1:
	ldr	x0, [x22, #8]
	mov	x20, sp
	mov	x1, sp
	mov	w2, #16
	bl	_copyin
	mov	x21, x0
	cbnz	w0, LBB0_16
	b	LBB0_3
LBB0_2:
	ldr	x20, [x22, #8]
LBB0_3:
	ldr	w8, [x22]
	cmp	w8, #128
	b.eq	LBB0_6
; %bb.4:
	cmp	w8, #129
	b.ne	LBB0_9
; %bb.5:
	mov	x0, x19
	mov	x1, x20
	bl	_amd64_get_ldt
	b	LBB0_15
LBB0_6:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_10
; %bb.7:
	ldr	w8, [x20]
Lloh3:
	adrp	x9, _max_ldt_segment@GOTPAGE
Lloh4:
	ldr	x9, [x9, _max_ldt_segment@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_10
; %bb.8:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x8]
	b	LBB0_16
LBB0_9:
	mov	w21, #0
	b	LBB0_16
LBB0_10:
	ldr	w0, [x19]
Lloh9:
	adrp	x8, _PCB_FULL_IRET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PCB_FULL_IRET@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_set_pcb_flags
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_14
; %bb.11:
	ldr	w8, [x20]
	lsl	w0, w8, #4
Lloh12:
	adrp	x23, _M_TEMP@GOTPAGE
Lloh13:
	ldr	x23, [x23, _M_TEMP@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh14:
	adrp	x8, _M_WAITOK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _M_WAITOK@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	bl	_malloc
	mov	x22, x0
	ldr	x0, [x20, #8]
	ldr	w8, [x20]
	lsl	w2, w8, #4
	mov	x1, x22
	bl	_copyin
	mov	x21, x0
	cbnz	w0, LBB0_13
; %bb.12:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_amd64_set_ldt
	mov	x21, x0
LBB0_13:
	ldr	w1, [x23]
	mov	x0, x22
	bl	_free
	b	LBB0_16
LBB0_14:
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	bl	_amd64_set_ldt
LBB0_15:
	mov	x21, x0
LBB0_16:
	mov	x0, x21
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_UIO_USERSPACE,4,2              ; @UIO_USERSPACE
	.comm	_max_ldt_segment,4,2            ; @max_ldt_segment
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PCB_FULL_IRET,4,2              ; @PCB_FULL_IRET
	.comm	_M_TEMP,4,2                     ; @M_TEMP
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
.subsections_via_symbols
