	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function allocate_cs
_allocate_cs:                           ## @allocate_cs
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$64, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%r15, 56(%rax)
	movq	$0, (%rax)
	leaq	52(%rax), %rdi
	callq	_INIT_LIST_HEAD
	leaq	48(%r14), %rdi
	movq	_cs_timedout@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_DELAYED_WORK
	leaq	44(%r14), %rdi
	callq	_kref_init
	movq	%r14, %rdi
	addq	$40, %rdi
	callq	_spin_lock_init
	movl	(%rbx), %esi
	movl	$64, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r13
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 32(%r13)
	leaq	20(%r13), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_init
	movq	%r13, %r12
	addq	$16, %r12
	movq	%r12, 24(%r14)
	leaq	4(%r15), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock
	movslq	(%r15), %r8
	movl	%r8d, 8(%r13)
	movq	8(%r15), %rax
	movq	_HL_MAX_PENDING_CS@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	decq	%rcx
	andq	%r8, %rcx
	movq	(%rax,%rcx,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.5:
	movq	%rbx, %rdi
	callq	_dma_fence_is_signaled
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	(%r15), %r8d
LBB0_7:
	movl	16(%r15), %ecx
	movq	_hl_fence_ops@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_dma_fence_init
	movslq	8(%r13), %rax
	movl	%eax, 12(%r14)
	movq	8(%r15), %rcx
	movq	_HL_MAX_PENDING_CS@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	decq	%rdx
	andq	%rax, %rdx
	movq	%r12, (%rcx,%rdx,8)
	incl	(%r15)
	movq	%r12, %rdi
	callq	_dma_fence_get
	movq	%rbx, %rdi
	callq	_dma_fence_put
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_9
LBB0_8:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r13, %rdi
	callq	_kfree
LBB0_9:
	negl	%ebx
	movq	%r14, %rdi
	callq	_kfree
LBB0_10:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_cs_timedout,4,2                ## @cs_timedout
	.comm	_HL_MAX_PENDING_CS,4,2          ## @HL_MAX_PENDING_CS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Rejecting CS because of too many in-flights CS\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_hl_fence_ops,4,2               ## @hl_fence_ops
	.no_dead_strip	_allocate_cs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function allocate_cs
_allocate_cs:                           ; @allocate_cs
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x23, _GFP_ATOMIC@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_ATOMIC@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #64
	bl	_kzalloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	str	x21, [x0, #56]
	add	x0, x0, #52
	str	xzr, [x19]
	bl	_INIT_LIST_HEAD
	add	x0, x19, #48
Lloh2:
	adrp	x8, _cs_timedout@GOTPAGE
Lloh3:
	ldr	x8, [x8, _cs_timedout@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_INIT_DELAYED_WORK
	add	x0, x19, #44
	bl	_kref_init
	add	x0, x19, #40
	bl	_spin_lock_init
	ldr	w1, [x23]
	mov	w0, #64
	bl	_kmalloc
	cbz	x0, LBB0_7
; %bb.2:
	mov	x23, x0
	str	x22, [x0, #32]
	add	x27, x0, #20
	mov	x0, x27
	bl	_spin_lock_init
	add	x25, x23, #16
	str	x25, [x19, #24]
	add	x24, x21, #4
	mov	x0, x24
	bl	_spin_lock
	ldr	w4, [x21]
	str	w4, [x23, #8]
Lloh5:
	adrp	x28, _HL_MAX_PENDING_CS@GOTPAGE
Lloh6:
	ldr	x28, [x28, _HL_MAX_PENDING_CS@GOTPAGEOFF]
	ldr	x8, [x21, #8]
	ldr	w9, [x28]
	sub	w9, w9, #1
	and	w9, w9, w4
	ldr	x26, [x8, w9, sxtw #3]
	cbz	x26, LBB0_5
; %bb.3:
	mov	x0, x26
	bl	_dma_fence_is_signaled
	cbz	w0, LBB0_8
; %bb.4:
	ldr	w4, [x21]
LBB0_5:
	ldr	w3, [x21, #16]
Lloh7:
	adrp	x1, _hl_fence_ops@GOTPAGE
Lloh8:
	ldr	x1, [x1, _hl_fence_ops@GOTPAGEOFF]
	mov	x0, x25
	mov	x2, x27
	bl	_dma_fence_init
	ldr	w8, [x23, #8]
	str	w8, [x19, #12]
	ldr	x9, [x21, #8]
	ldr	w10, [x28]
	sub	w10, w10, #1
	and	w8, w10, w8
	str	x25, [x9, w8, sxtw #3]
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
	mov	x0, x25
	bl	_dma_fence_get
	mov	x0, x26
	bl	_dma_fence_put
	mov	x0, x24
	bl	_spin_unlock
	mov	w21, #0
	str	x19, [x20]
	b	LBB0_10
LBB0_6:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_7:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w20, [x8]
	b	LBB0_9
LBB0_8:
	mov	x0, x24
	bl	_spin_unlock
	ldr	w0, [x22]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh17:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh19:
	ldr	w20, [x8]
	mov	x0, x23
	bl	_kfree
LBB0_9:
	neg	w21, w20
	mov	x0, x19
	bl	_kfree
LBB0_10:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_cs_timedout,4,2                ; @cs_timedout
	.comm	_HL_MAX_PENDING_CS,4,2          ; @HL_MAX_PENDING_CS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Rejecting CS because of too many in-flights CS\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_hl_fence_ops,4,2               ; @hl_fence_ops
	.no_dead_strip	_allocate_cs
.subsections_via_symbols
