	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_ring_common
_init_ring_common:                      ## @init_ring_common
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %rdi
	movq	48(%rbx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r14
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_HAS_FORCE_WAKE
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_gen6_gt_force_wake_get
LBB0_2:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_I915_WRITE_CTL
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_I915_WRITE_HEAD
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	*40(%rbx)
	movq	%rbx, %rdi
	callq	_I915_READ_HEAD
	movq	_HEAD_ADDR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.3:
	movl	32(%rbx), %r13d
	movq	%rbx, %rdi
	callq	_I915_READ_CTL
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_I915_READ_HEAD
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_I915_READ_TAIL
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_I915_READ_START
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	movl	%r12d, %r8d
	movq	%rax, %r9
	callq	_DRM_DEBUG_KMS
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_I915_WRITE_HEAD
	movq	%rbx, %rdi
	callq	_I915_READ_HEAD
	movq	_HEAD_ADDR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:
	movl	32(%rbx), %r14d
	movq	%rbx, %rdi
	callq	_I915_READ_CTL
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_I915_READ_HEAD
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_I915_READ_TAIL
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_I915_READ_START
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	movl	%r13d, %r8d
	movq	%rax, %r9
	callq	_DRM_ERROR
LBB0_5:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	(%r15), %rsi
	movq	%rbx, %rdi
	callq	_I915_WRITE_START
	movl	(%rbx), %esi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	subl	(%rax), %esi
	movq	_RING_NR_PAGES@GOTPCREL(%rip), %rax
	andl	(%rax), %esi
	movq	_RING_VALID@GOTPCREL(%rip), %r14
	orl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_I915_WRITE_CTL
	movq	%rbx, %rdi
	callq	_I915_READ_CTL
	testl	%eax, (%r14)
	je	LBB0_6
## %bb.7:
	movq	%rbx, %rdi
	callq	_I915_READ_START
	cmpq	(%r15), %rax
	movl	$0, %edi
	jne	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	callq	_I915_READ_HEAD
	xorl	%edi, %edi
	movq	_HEAD_ADDR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	sete	%dil
	jmp	LBB0_9
LBB0_6:
	xorl	%edi, %edi
LBB0_9:
	movl	$50, %esi
	callq	_wait_for
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movl	32(%rbx), %r14d
	movq	%rbx, %rdi
	callq	_I915_READ_CTL
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_I915_READ_HEAD
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_I915_READ_TAIL
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_I915_READ_START
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	movl	%r13d, %r8d
	movq	%rax, %r9
	callq	_DRM_ERROR
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_11:
	movq	24(%rbx), %rdi
	movq	_DRIVER_MODESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_drm_core_check_feature
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movq	%rbx, %rdi
	callq	_I915_READ_HEAD
	movl	%eax, 4(%rbx)
	movq	%rbx, %rdi
	callq	_I915_READ_TAIL
	movq	_TAIL_ADDR@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, 8(%rbx)
	movq	%rbx, %rdi
	callq	_ring_space
	movl	%eax, 16(%rbx)
	movl	$-1, 12(%rbx)
	jmp	LBB0_14
LBB0_12:
	movq	24(%rbx), %rdi
	callq	_i915_kernel_lost_context
LBB0_14:
	xorl	%ebx, %ebx
LBB0_15:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_HAS_FORCE_WAKE
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movq	%r14, %rdi
	callq	_gen6_gt_force_wake_put
LBB0_17:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HEAD_ADDR,4,2                  ## @HEAD_ADDR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s head not reset to zero ctl %08x head %08x tail %08x start %08x\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to set %s head to zero ctl %08x head %08x tail %08x start %08x\n"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_RING_NR_PAGES,4,2              ## @RING_NR_PAGES
	.comm	_RING_VALID,4,2                 ## @RING_VALID
L_.str.2:                               ## @.str.2
	.asciz	"%s initialization failed ctl %08x head %08x tail %08x start %08x\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_DRIVER_MODESET,4,2             ## @DRIVER_MODESET
	.comm	_TAIL_ADDR,4,2                  ## @TAIL_ADDR
	.no_dead_strip	_init_ring_common
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_ring_common
_init_ring_common:                      ; @init_ring_common
	.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	x21, x0
	ldr	x20, [x0, #24]
	ldr	x19, [x20]
	ldr	x26, [x0, #48]
	mov	x0, x20
	bl	_HAS_FORCE_WAKE
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_gen6_gt_force_wake_get
LBB0_2:
	mov	x0, x21
	mov	w1, #0
	bl	_I915_WRITE_CTL
	mov	x0, x21
	mov	w1, #0
	bl	_I915_WRITE_HEAD
	ldr	x8, [x21, #40]
	mov	x0, x21
	mov	w1, #0
	blr	x8
	mov	x0, x21
	bl	_I915_READ_HEAD
Lloh0:
	adrp	x27, _HEAD_ADDR@GOTPAGE
Lloh1:
	ldr	x27, [x27, _HEAD_ADDR@GOTPAGEOFF]
	ldr	w8, [x27]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.3:
	ldr	w22, [x21, #32]
	mov	x0, x21
	bl	_I915_READ_CTL
	mov	x23, x0
	mov	x0, x21
	bl	_I915_READ_HEAD
	mov	x24, x0
	mov	x0, x21
	bl	_I915_READ_TAIL
	mov	x25, x0
	mov	x0, x21
	bl	_I915_READ_START
	mov	x5, x0
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	mov	x2, x23
	mov	x3, x24
	mov	x4, x25
	bl	_DRM_DEBUG_KMS
	mov	x0, x21
	mov	w1, #0
	bl	_I915_WRITE_HEAD
	mov	x0, x21
	bl	_I915_READ_HEAD
	ldr	w8, [x27]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.4:
	ldr	w22, [x21, #32]
	mov	x0, x21
	bl	_I915_READ_CTL
	mov	x23, x0
	mov	x0, x21
	bl	_I915_READ_HEAD
	mov	x24, x0
	mov	x0, x21
	bl	_I915_READ_TAIL
	mov	x25, x0
	mov	x0, x21
	bl	_I915_READ_START
	mov	x5, x0
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x22
	mov	x2, x23
	mov	x3, x24
	mov	x4, x25
	bl	_DRM_ERROR
LBB0_5:
	ldr	x1, [x26]
	mov	x0, x21
	bl	_I915_WRITE_START
	ldr	w8, [x21]
Lloh6:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _RING_NR_PAGES@GOTPAGE
Lloh10:
	ldr	x10, [x10, _RING_NR_PAGES@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	sub	w8, w8, w9
	and	w8, w8, w10
Lloh12:
	adrp	x22, _RING_VALID@GOTPAGE
Lloh13:
	ldr	x22, [x22, _RING_VALID@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w1, w8, w9
	mov	x0, x21
	bl	_I915_WRITE_CTL
	mov	x0, x21
	bl	_I915_READ_CTL
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.6:
	mov	x0, x21
	bl	_I915_READ_START
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x21
	bl	_I915_READ_HEAD
	ldr	w8, [x27]
	tst	w8, w0
	cset	w0, eq
	b	LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	mov	w1, #50
	bl	_wait_for
	cbz	x0, LBB0_11
; %bb.10:
	ldr	w22, [x21, #32]
	mov	x0, x21
	bl	_I915_READ_CTL
	mov	x23, x0
	mov	x0, x21
	bl	_I915_READ_HEAD
	mov	x24, x0
	mov	x0, x21
	bl	_I915_READ_TAIL
	mov	x25, x0
	mov	x0, x21
	bl	_I915_READ_START
	mov	x5, x0
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x22
	mov	x2, x23
	mov	x3, x24
	mov	x4, x25
	bl	_DRM_ERROR
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_14
LBB0_11:
	ldr	x0, [x21, #24]
Lloh19:
	adrp	x8, _DRIVER_MODESET@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DRIVER_MODESET@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	bl	_drm_core_check_feature
	cbz	w0, LBB0_13
; %bb.12:
	mov	x0, x21
	bl	_I915_READ_HEAD
	str	w0, [x21, #4]
	mov	x0, x21
	bl	_I915_READ_TAIL
Lloh22:
	adrp	x8, _TAIL_ADDR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _TAIL_ADDR@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	and	w8, w8, w0
	str	w8, [x21, #8]
	mov	x0, x21
	bl	_ring_space
	mov	w22, #0
	mov	w8, #-1
	stp	w8, w0, [x21, #12]
	b	LBB0_14
LBB0_13:
	ldr	x0, [x21, #24]
	bl	_i915_kernel_lost_context
	mov	w22, #0
LBB0_14:
	mov	x0, x20
	bl	_HAS_FORCE_WAKE
	cbz	x0, LBB0_16
; %bb.15:
	mov	x0, x19
	bl	_gen6_gt_force_wake_put
LBB0_16:
	mov	x0, x22
	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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_HEAD_ADDR,4,2                  ; @HEAD_ADDR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s head not reset to zero ctl %08x head %08x tail %08x start %08x\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to set %s head to zero ctl %08x head %08x tail %08x start %08x\n"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_RING_NR_PAGES,4,2              ; @RING_NR_PAGES
	.comm	_RING_VALID,4,2                 ; @RING_VALID
l_.str.2:                               ; @.str.2
	.asciz	"%s initialization failed ctl %08x head %08x tail %08x start %08x\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_DRIVER_MODESET,4,2             ; @DRIVER_MODESET
	.comm	_TAIL_ADDR,4,2                  ; @TAIL_ADDR
	.no_dead_strip	_init_ring_common
.subsections_via_symbols
