	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun4c_alloc_thread_info
_sun4c_alloc_thread_info:               ## @sun4c_alloc_thread_info
	.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
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_THREAD_INFO_ORDER@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	callq	___get_free_pages
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	_sun4c_lowbucket_avail@GOTPCREL(%rip), %r8
	movl	(%r8), %ecx
	movq	_NR_TASK_BUCKETS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movl	%ecx, %ebx
	cmpl	%eax, %ecx
	jge	LBB0_7
## %bb.3:
	movslq	%ecx, %rbx
	movq	_sun4c_bucket@GOTPCREL(%rip), %rdx
	movq	_BUCKET_EMPTY@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	leaq	(,%rbx,8), %rdi
	addq	(%rdx), %rdi
	movq	%rax, %rdx
	subq	%rbx, %rdx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rsi, (%rdi,%rbx,8)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	cmpq	%rbx, %rdx
	jne	LBB0_4
	jmp	LBB0_8
LBB0_1:
	xorl	%r15d, %r15d
	jmp	LBB0_14
LBB0_6:
	addl	%ecx, %ebx
LBB0_7:
	cmpl	%eax, %ebx
	jne	LBB0_9
LBB0_8:
	movq	(%r15), %rsi
	movq	%r14, %rdi
	callq	_free_pages
	xorl	%r15d, %r15d
	jmp	LBB0_14
LBB0_9:
	cmpl	%ecx, %ebx
	jl	LBB0_11
## %bb.10:
	leal	1(%rbx), %eax
	movl	%eax, (%r8)
LBB0_11:
	movl	%ebx, %edi
	callq	_BUCKET_ADDR
	movq	%rax, %r15
	movq	_sun4c_bucket@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ebx, %rcx
	movq	%r15, (%rax,%rcx,8)
	movq	%r15, %rdi
	callq	_sun4c_get_segmap
	movq	_invalid_segment@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.12:
	movq	%r15, %rdi
	callq	_get_locked_segment
LBB0_13:
	movq	%r14, %rdi
	callq	_sun4c_flush_page
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	%r14, %rdi
	callq	_sun4c_flush_page
	movq	%r14, %rdi
	callq	_BUCKET_PTE
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_sun4c_put_pte
	movq	(%rbx), %rax
	movq	%r15, %rbx
	addq	%rax, %rbx
	addq	%rax, %r14
	movq	%r14, %rdi
	callq	_BUCKET_PTE
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_sun4c_put_pte
LBB0_14:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_THREAD_INFO_ORDER,8,3          ## @THREAD_INFO_ORDER
	.comm	_sun4c_lowbucket_avail,4,2      ## @sun4c_lowbucket_avail
	.comm	_NR_TASK_BUCKETS,4,2            ## @NR_TASK_BUCKETS
	.comm	_sun4c_bucket,8,3               ## @sun4c_bucket
	.comm	_BUCKET_EMPTY,8,3               ## @BUCKET_EMPTY
	.comm	_invalid_segment,8,3            ## @invalid_segment
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.no_dead_strip	_sun4c_alloc_thread_info
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun4c_alloc_thread_info
_sun4c_alloc_thread_info:               ; @sun4c_alloc_thread_info
	.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
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x20, _THREAD_INFO_ORDER@GOTPAGE
Lloh4:
	ldr	x20, [x20, _THREAD_INFO_ORDER@GOTPAGEOFF]
	ldr	x1, [x20]
	bl	___get_free_pages
	cbz	x0, LBB0_8
; %bb.1:
	mov	x19, x0
Lloh5:
	adrp	x8, _sun4c_lowbucket_avail@GOTPAGE
Lloh6:
	ldr	x8, [x8, _sun4c_lowbucket_avail@GOTPAGEOFF]
	ldr	w9, [x8]
Lloh7:
	adrp	x10, _NR_TASK_BUCKETS@GOTPAGE
Lloh8:
	ldr	x10, [x10, _NR_TASK_BUCKETS@GOTPAGEOFF]
Lloh9:
	ldrsw	x10, [x10]
	cmp	w9, w10
	b.ge	LBB0_5
; %bb.2:
	sxtw	x13, w9
Lloh10:
	adrp	x11, _sun4c_bucket@GOTPAGE
Lloh11:
	ldr	x11, [x11, _sun4c_bucket@GOTPAGEOFF]
Lloh12:
	ldr	x12, [x11]
Lloh13:
	adrp	x11, _BUCKET_EMPTY@GOTPAGE
Lloh14:
	ldr	x11, [x11, _BUCKET_EMPTY@GOTPAGEOFF]
Lloh15:
	ldr	x11, [x11]
	add	x12, x12, x13, lsl #3
	sub	x13, x10, x13
	mov	x21, x9
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x14, [x12]
	cmp	x14, x11
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w21, w21, #1
	add	x12, x12, #8
	subs	x13, x13, #1
	b.ne	LBB0_3
	b	LBB0_7
LBB0_5:
	mov	x21, x9
LBB0_6:
	cmp	w21, w10
	b.ne	LBB0_9
LBB0_7:
	ldr	x1, [x20]
	mov	x0, x19
	bl	_free_pages
LBB0_8:
	mov	x20, #0
	b	LBB0_14
LBB0_9:
	cmp	w21, w9
	b.lt	LBB0_11
; %bb.10:
	add	w9, w21, #1
	str	w9, [x8]
LBB0_11:
	mov	x0, x21
	bl	_BUCKET_ADDR
	mov	x20, x0
Lloh16:
	adrp	x8, _sun4c_bucket@GOTPAGE
Lloh17:
	ldr	x8, [x8, _sun4c_bucket@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	str	x0, [x8, w21, sxtw #3]
	bl	_sun4c_get_segmap
Lloh19:
	adrp	x8, _invalid_segment@GOTPAGE
Lloh20:
	ldr	x8, [x8, _invalid_segment@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x20
	bl	_get_locked_segment
LBB0_13:
	mov	x0, x19
	bl	_sun4c_flush_page
Lloh22:
	adrp	x21, _PAGE_SIZE@GOTPAGE
Lloh23:
	ldr	x21, [x21, _PAGE_SIZE@GOTPAGEOFF]
	ldr	x8, [x21]
	add	x0, x8, x19
	bl	_sun4c_flush_page
	mov	x0, x19
	bl	_BUCKET_PTE
	mov	x1, x0
	mov	x0, x20
	bl	_sun4c_put_pte
	ldr	x8, [x21]
	add	x21, x8, x20
	add	x0, x8, x19
	bl	_BUCKET_PTE
	mov	x1, x0
	mov	x0, x21
	bl	_sun4c_put_pte
LBB0_14:
	mov	x0, x20
	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
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_THREAD_INFO_ORDER,8,3          ; @THREAD_INFO_ORDER
	.comm	_sun4c_lowbucket_avail,4,2      ; @sun4c_lowbucket_avail
	.comm	_NR_TASK_BUCKETS,4,2            ; @NR_TASK_BUCKETS
	.comm	_sun4c_bucket,8,3               ; @sun4c_bucket
	.comm	_BUCKET_EMPTY,8,3               ; @BUCKET_EMPTY
	.comm	_invalid_segment,8,3            ; @invalid_segment
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.no_dead_strip	_sun4c_alloc_thread_info
.subsections_via_symbols
