	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_sw_fence_await_reservation ## -- Begin function i915_sw_fence_await_reservation
	.p2align	4, 0x90
_i915_sw_fence_await_reservation:       ## @i915_sw_fence_await_reservation
	.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
	movl	%r9d, %r15d
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r14d
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	%rdi, %r12
	callq	_debug_fence_assert
	movl	%r15d, %edi
	callq	_gfpflags_allow_blocking
	movl	%eax, %edi
	callq	_might_sleep_if
	testl	%r14d, %r14d
	je	LBB0_15
## %bb.1:
	leaq	-64(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	leaq	-56(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_dma_resv_get_fences_rcu
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	movl	%eax, %r14d
	jmp	LBB0_21
LBB0_15:
	movq	%rbx, %rdi
	callq	_dma_resv_get_excl_rcu
	movq	%rax, -64(%rbp)
	xorl	%r14d, %r14d
	testl	%r14d, %r14d
	jns	LBB0_17
	jmp	LBB0_20
LBB0_2:
	movl	-44(%rbp), %ecx
	testl	%ecx, %ecx
	je	LBB0_3
## %bb.5:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%rbx
	movl	%ecx, %eax
	cmpq	%rax, %rbx
	jae	LBB0_11
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rax
	movq	(%rax,%rbx,8), %rsi
	cmpq	%r13, (%rsi)
	je	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r12, %rdi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%r15d, %ecx
	callq	_i915_sw_fence_await_dma_fence
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	orl	%eax, %r14d
	movl	-44(%rbp), %ecx
	jmp	LBB0_10
LBB0_3:
	xorl	%r14d, %r14d
	jmp	LBB0_14
LBB0_8:
	movl	-44(%rbp), %ecx
	movl	%eax, %r14d
LBB0_11:
	testl	%ecx, %ecx
	je	LBB0_14
## %bb.12:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_dma_fence_put
	incq	%rbx
	movl	-44(%rbp), %eax
	cmpq	%rax, %rbx
	jb	LBB0_13
LBB0_14:
	movq	-56(%rbp), %rdi
	callq	_kfree
	movq	-64(%rbp), %rax
	testl	%r14d, %r14d
	js	LBB0_20
LBB0_17:
	testq	%rax, %rax
	je	LBB0_20
## %bb.18:
	cmpq	%r13, (%rax)
	je	LBB0_20
## %bb.19:
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%r15d, %ecx
	callq	_i915_sw_fence_await_dma_fence
	xorl	%ecx, %ecx
	testl	%eax, %eax
	cmovsl	%ecx, %r14d
	orl	%eax, %r14d
	movq	-64(%rbp), %rax
LBB0_20:
	movq	%rax, %rdi
	callq	_dma_fence_put
LBB0_21:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_sw_fence_await_reservation ; -- Begin function i915_sw_fence_await_reservation
	.p2align	2
_i915_sw_fence_await_reservation:       ; @i915_sw_fence_await_reservation
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x5
	mov	x20, x4
	mov	x24, x3
	mov	x22, x2
	mov	x23, x1
	mov	x21, x0
	bl	_debug_fence_assert
	mov	x0, x19
	bl	_gfpflags_allow_blocking
	bl	_might_sleep_if
	cbz	w24, LBB0_3
; %bb.1:
	add	x1, sp, #24
	add	x2, sp, #12
	add	x3, sp, #16
	mov	x0, x23
	bl	_dma_resv_get_fences_rcu
	cbz	w0, LBB0_4
; %bb.2:
	mov	x23, x0
	b	LBB0_20
LBB0_3:
	mov	x0, x23
	bl	_dma_resv_get_excl_rcu
	mov	x1, x0
	mov	w23, #0
	str	x0, [sp, #24]
	tbz	w23, #31, LBB0_16
	b	LBB0_19
LBB0_4:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_10
; %bb.5:
	mov	x24, #0
	mov	w23, #0
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x24, x24, #1
	cmp	x24, w8, uxtw
	b.hs	LBB0_12
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [sp, #16]
	ldr	x1, [x9, x24, lsl #3]
	ldr	x9, [x1]
	cmp	x9, x22
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x21
	mov	x2, x20
	mov	x3, x19
	bl	_i915_sw_fence_await_dma_fence
	tbnz	w0, #31, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	orr	w23, w0, w23
	ldr	w8, [sp, #12]
	b	LBB0_6
LBB0_10:
	mov	w23, #0
	b	LBB0_15
LBB0_11:
	ldr	w8, [sp, #12]
	mov	x23, x0
LBB0_12:
	cbz	w8, LBB0_15
; %bb.13:
	mov	x24, #0
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #16]
	ldr	x0, [x8, x24, lsl #3]
	bl	_dma_fence_put
	add	x24, x24, #1
	ldr	w8, [sp, #12]
	cmp	x24, x8
	b.lo	LBB0_14
LBB0_15:
	ldr	x0, [sp, #16]
	bl	_kfree
	ldr	x1, [sp, #24]
	tbnz	w23, #31, LBB0_19
LBB0_16:
	cbz	x1, LBB0_19
; %bb.17:
	ldr	x8, [x1]
	cmp	x8, x22
	b.eq	LBB0_19
; %bb.18:
	mov	x0, x21
	mov	x2, x20
	mov	x3, x19
	bl	_i915_sw_fence_await_dma_fence
	cmp	w0, #0
	csel	w8, wzr, w23, lt
	orr	w23, w8, w0
	ldr	x1, [sp, #24]
LBB0_19:
	mov	x0, x1
	bl	_dma_fence_put
LBB0_20:
	mov	x0, x23
	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
	add	sp, sp, #96
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
