	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_ctx_get_fence               ## -- Begin function hl_ctx_get_fence
	.p2align	4, 0x90
_hl_ctx_get_fence:                      ## @hl_ctx_get_fence
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	16(%rdi), %r12
	leaq	4(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock
	movl	(%rbx), %ecx
	cmpl	%r15d, %ecx
	jle	LBB0_5
## %bb.1:
	movq	_HL_MAX_PENDING_CS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rax,%r15), %edx
	cmpl	%ecx, %edx
	jge	LBB0_4
## %bb.2:
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_dbg
	movq	%r14, %rdi
	callq	_spin_unlock
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_5:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_notice
	movq	%r14, %rdi
	callq	_spin_unlock
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_4:
	movq	8(%rbx), %rcx
	decl	%eax
	andl	%r15d, %eax
	cltq
	movl	(%rcx,%rax,4), %edi
	callq	_dma_fence_get
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_spin_unlock
	movq	%rbx, %rax
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't wait on seq %llu because current CS is at seq %llu\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_HL_MAX_PENDING_CS,4,2          ## @HL_MAX_PENDING_CS
L_.str.1:                               ## @.str.1
	.asciz	"Can't wait on seq %llu because current CS is at seq %llu (Fence is gone)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_ctx_get_fence               ; -- Begin function hl_ctx_get_fence
	.p2align	2
_hl_ctx_get_fence:                      ; @hl_ctx_get_fence
	.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
	mov	x20, x1
	mov	x21, x0
	ldr	x22, [x0, #16]
	add	x19, x0, #4
	mov	x0, x19
	bl	_spin_lock
	ldr	w3, [x21]
	cmp	w3, w20
	b.le	LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _HL_MAX_PENDING_CS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HL_MAX_PENDING_CS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	add	w9, w8, w20
	cmp	w9, w3
	b.ge	LBB0_4
; %bb.2:
	ldr	w0, [x22]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, #0
	b	LBB0_5
LBB0_3:
	ldr	w0, [x22]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_notice
	mov	x0, x19
	bl	_spin_unlock
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	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
	b	_ERR_PTR
LBB0_4:
	ldr	x9, [x21, #8]
	sub	w8, w8, #1
	and	w8, w8, w20
	ldr	w0, [x9, w8, sxtw #2]
	bl	_dma_fence_get
	mov	x20, x0
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x20
LBB0_5:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't wait on seq %llu because current CS is at seq %llu\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_HL_MAX_PENDING_CS,4,2          ; @HL_MAX_PENDING_CS
l_.str.1:                               ; @.str.1
	.asciz	"Can't wait on seq %llu because current CS is at seq %llu (Fence is gone)\n"

.subsections_via_symbols
