	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ring_wait_for_space
_ring_wait_for_space:                   ## @ring_wait_for_space
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	8(%rdi), %r15
	movq	8(%r15), %r12
	callq	_intel_ring_wait_request
	movq	_ENOSPC@GOTPCREL(%rip), %rcx
	movl	%eax, %edx
	addl	(%rcx), %edx
	jne	LBB0_10
## %bb.1:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_trace_i915_ring_wait_begin
	movq	_jiffies@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	_HZ@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	imulq	$60, %rcx, %r15
	addq	%rax, %r15
	movq	%r12, %r13
	addq	$4, %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_I915_READ_HEAD
	movl	%eax, 4(%rbx)
	movq	%rbx, %rdi
	callq	_ring_space
	movl	%eax, (%rbx)
	cmpl	%r14d, %eax
	jge	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rax), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_I915_BOX_WAIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, (%rax)
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %edi
	callq	_msleep
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_i915_gem_check_wedge
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_time_after
	testl	%eax, %eax
	je	LBB0_2
## %bb.9:
	movq	%rbx, %rdi
	callq	_trace_i915_ring_wait_end
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_3:
	movq	%rbx, %rdi
	callq	_trace_i915_ring_wait_end
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_jiffies,4,2                    ## @jiffies
	.comm	_HZ,4,2                         ## @HZ
	.comm	_I915_BOX_WAIT,4,2              ## @I915_BOX_WAIT
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_ring_wait_for_space
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ring_wait_for_space
_ring_wait_for_space:                   ; @ring_wait_for_space
	.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	x20, x1
	mov	x19, x0
	ldr	x23, [x0, #8]
	ldr	x24, [x23, #8]
	bl	_intel_ring_wait_request
Lloh0:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_10
; %bb.1:
	mov	x0, x19
	bl	_trace_i915_ring_wait_begin
Lloh3:
	adrp	x25, _jiffies@GOTPAGE
Lloh4:
	ldr	x25, [x25, _jiffies@GOTPAGEOFF]
	ldrsw	x8, [x25]
Lloh5:
	adrp	x9, _HZ@GOTPAGE
Lloh6:
	ldr	x9, [x9, _HZ@GOTPAGEOFF]
Lloh7:
	ldrsw	x9, [x9]
	mov	w10, #60
	madd	x21, x9, x10, x8
	add	x22, x24, #4
Lloh8:
	adrp	x26, _I915_BOX_WAIT@GOTPAGE
Lloh9:
	ldr	x26, [x26, _I915_BOX_WAIT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_I915_READ_HEAD
	str	w0, [x19, #4]
	mov	x0, x19
	bl	_ring_space
	str	w0, [x19]
	cmp	w0, w20
	b.ge	LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x23]
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x8]
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w9, [x26]
	ldr	w10, [x8]
	orr	w9, w10, w9
	str	w9, [x8]
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #1
	bl	_msleep
	ldr	w1, [x24]
	mov	x0, x22
	bl	_i915_gem_check_wedge
	cbnz	w0, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x25]
	mov	x1, x21
	bl	_time_after
	cbz	w0, LBB0_2
; %bb.8:
	mov	x0, x19
	bl	_trace_i915_ring_wait_end
Lloh10:
	adrp	x8, _EBUSY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	bl	_trace_i915_ring_wait_end
	mov	w0, #0
LBB0_10:
	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 AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_jiffies,4,2                    ; @jiffies
	.comm	_HZ,4,2                         ; @HZ
	.comm	_I915_BOX_WAIT,4,2              ; @I915_BOX_WAIT
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_ring_wait_for_space
.subsections_via_symbols
