	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i915_initialize
_i915_initialize:                       ## @i915_initialize
	.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
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	(%rdi), %rax
	movq	8(%rdi), %r14
	movq	(%rax), %rax
	movq	(%rax), %r13
	callq	_drm_getsarea
	movq	%rax, 8(%r13)
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movslq	(%r15), %rcx
	shlq	$2, %rcx
	addq	(%rax), %rcx
	movq	%rcx, (%r13)
	cmpq	$0, 8(%r15)
	jne	LBB0_4
	jmp	LBB0_8
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_DRIVER
	cmpq	$0, 8(%r15)
	je	LBB0_8
LBB0_4:
	movq	%r14, %rdi
	callq	_LP_RING
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	callq	_i915_dma_cleanup
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_6:
	movl	28(%r15), %esi
	movq	8(%r15), %rdx
	movq	%r12, %rdi
	callq	_intel_render_ring_init_dri
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_i915_dma_cleanup
	jmp	LBB0_11
LBB0_8:
	movl	24(%r15), %eax
	movl	%eax, 24(%r14)
	movl	20(%r15), %eax
	movl	%eax, 20(%r14)
	movl	16(%r15), %eax
	movl	%eax, 16(%r14)
	movq	$0, 8(%r14)
	movq	(%r13), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	$0, (%rax)
LBB0_10:
	movl	$1, (%r14)
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sarea not found assuming DRI2 userspace\n"

L_.str.1:                               ## @.str.1
	.asciz	"Client tried to initialize ringbuffer in GEM mode\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_i915_initialize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i915_initialize
_i915_initialize:                       ; @i915_initialize
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x1
	mov	x20, x0
	ldp	x8, x19, [x0]
	ldr	x8, [x8]
	ldr	x23, [x8]
	bl	_drm_getsarea
	str	x0, [x23, #8]
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x0]
	ldrsw	x9, [x21]
	add	x8, x8, x9, lsl #2
	str	x8, [x23]
	ldr	x8, [x21, #8]
	cbnz	x8, LBB0_3
	b	LBB0_7
LBB0_2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_7
LBB0_3:
	mov	x0, x19
	bl	_LP_RING
	ldr	x8, [x0]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x20
	bl	_i915_dma_cleanup
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_10
LBB0_5:
	ldr	w1, [x21, #28]
	ldr	x2, [x21, #8]
	mov	x0, x20
	bl	_intel_render_ring_init_dri
	cbz	w0, LBB0_7
; %bb.6:
	mov	x22, x0
	mov	x0, x20
	bl	_i915_dma_cleanup
	b	LBB0_10
LBB0_7:
	ldr	w8, [x21, #24]
	str	w8, [x19, #24]
	ldr	d0, [x21, #16]
	str	d0, [x19, #16]
	str	xzr, [x19, #8]
	ldr	x8, [x23]
	cbz	x8, LBB0_9
; %bb.8:
	str	xzr, [x8]
LBB0_9:
	mov	w22, #0
	mov	w8, #1
	str	w8, [x19]
LBB0_10:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sarea not found assuming DRI2 userspace\n"

l_.str.1:                               ; @.str.1
	.asciz	"Client tried to initialize ringbuffer in GEM mode\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_i915_initialize
.subsections_via_symbols
