	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amd64_get_ldt                  ## -- Begin function amd64_get_ldt
	.p2align	4, 0x90
_amd64_get_ldt:                         ## @amd64_get_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
	movq	%rdi, %r13
	movq	8(%rdi), %rax
	movq	(%rax), %rbx
	xorl	%r14d, %r14d
	testq	%rbx, %rbx
	je	LBB0_12
## %bb.1:
	movq	%rsi, %r15
	movq	_max_ldt_segment@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	subl	(%r15), %esi
	jle	LBB0_12
## %bb.2:
	movslq	4(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.3:
	callq	_min
	movl	%eax, %r14d
	movq	(%rbx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movslq	(%r15), %r12
	leal	(,%r14,4), %edi
	movq	_M_TEMP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	callq	_malloc
	movq	%rax, %rbx
	movq	_dt_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_lock
	testl	%r14d, %r14d
	jle	LBB0_11
## %bb.4:
	movl	%r14d, %ecx
	leaq	-1(%rcx), %rdx
	movl	%ecx, %eax
	andl	$3, %eax
	cmpq	$3, %rdx
	jae	LBB0_6
## %bb.5:
	xorl	%edx, %edx
	jmp	LBB0_8
LBB0_6:
	andl	$-4, %ecx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%r12,4), %rsi
	addq	$12, %rsi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	-12(%rsi,%rdx,4), %edi
	movl	%edi, (%rbx,%rdx,4)
	movl	-8(%rsi,%rdx,4), %edi
	movl	%edi, 4(%rbx,%rdx,4)
	movl	-4(%rsi,%rdx,4), %edi
	movl	%edi, 8(%rbx,%rdx,4)
	movl	(%rsi,%rdx,4), %edi
	movl	%edi, 12(%rbx,%rdx,4)
	addq	$4, %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_7
LBB0_8:
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	leaq	(%rbx,%rdx,4), %rcx
	addq	%rdx, %r12
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%r12,4), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdx,%rsi,4), %edi
	movl	%edi, (%rcx,%rsi,4)
	incq	%rsi
	cmpq	%rsi, %rax
	jne	LBB0_10
LBB0_11:
	movq	_dt_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock
	movq	8(%r15), %rsi
	movq	%rbx, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_copyout
	movl	%eax, %r15d
	movq	_M_TEMP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_free
	testl	%r15d, %r15d
	jne	LBB0_13
LBB0_12:
	movq	(%r13), %rax
	movl	%r14d, (%rax)
	xorl	%r15d, %r15d
LBB0_13:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_max_ldt_segment,4,2            ## @max_ldt_segment
	.comm	_M_TEMP,4,2                     ## @M_TEMP
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_dt_lock,4,2                    ## @dt_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amd64_get_ldt                  ; -- Begin function amd64_get_ldt
	.p2align	2
_amd64_get_ldt:                         ; @amd64_get_ldt
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x22, [x8]
	cbz	x22, LBB0_7
; %bb.1:
	mov	x21, x1
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _max_ldt_segment@GOTPAGE
Lloh1:
	ldr	x9, [x9, _max_ldt_segment@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	subs	w1, w9, w8
	b.le	LBB0_7
; %bb.2:
	ldrsw	x0, [x21, #4]
	cbz	w0, LBB0_7
; %bb.3:
	bl	_min
	mov	x20, x0
	ldr	x25, [x22]
	ldrsw	x26, [x21]
	lsl	w22, w0, #2
Lloh3:
	adrp	x24, _M_TEMP@GOTPAGE
Lloh4:
	ldr	x24, [x24, _M_TEMP@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh5:
	adrp	x8, _M_WAITOK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _M_WAITOK@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_malloc
	mov	x23, x0
Lloh8:
	adrp	x0, _dt_lock@GOTPAGE
Lloh9:
	ldr	x0, [x0, _dt_lock@GOTPAGEOFF]
	bl	_mtx_lock
	cmp	w20, #1
	b.lt	LBB0_6
; %bb.4:
	mov	w8, w20
	mov	x9, x23
	add	x10, x25, x26, lsl #2
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10], #4
	str	w11, [x9], #4
	subs	x8, x8, #1
	b.ne	LBB0_5
LBB0_6:
Lloh10:
	adrp	x0, _dt_lock@GOTPAGE
Lloh11:
	ldr	x0, [x0, _dt_lock@GOTPAGEOFF]
	bl	_mtx_unlock
	ldr	x1, [x21, #8]
	mov	x0, x23
	mov	x2, x22
	bl	_copyout
	mov	x21, x0
	ldr	w1, [x24]
	mov	x0, x23
	bl	_free
	cbnz	w21, LBB0_9
	b	LBB0_8
LBB0_7:
	mov	w20, #0
LBB0_8:
	mov	w21, #0
	ldr	x8, [x19]
	str	w20, [x8]
LBB0_9:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_max_ldt_segment,4,2            ; @max_ldt_segment
	.comm	_M_TEMP,4,2                     ; @M_TEMP
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_dt_lock,4,2                    ; @dt_lock
.subsections_via_symbols
