	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_init                  ## -- Begin function i915_gem_init
	.p2align	4, 0x90
_i915_gem_init:                         ## @i915_gem_init
	.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	%rdi, %r13
	callq	_intel_vgpu_active
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%r13, %rdi
	callq	_intel_vgpu_has_huge_gtt
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movq	_I915_GTT_PAGE_SIZE_4K@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r13, %rdi
	callq	_mkwrite_device_info
	movl	%ebx, (%rax)
LBB0_3:
	movq	%r13, %rdi
	callq	_intel_timelines_init
	movq	%r13, %rdi
	callq	_i915_gem_init_userptr
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_36
## %bb.4:
	leaq	4(%r13), %r14
	movq	%r14, %rdi
	callq	_intel_uc_fetch_firmwares
	leaq	12(%r13), %rdi
	callq	_intel_wopcm_init
	movq	%r13, %rdi
	callq	_mutex_lock
	leaq	8(%r13), %r15
	movq	_FORCEWAKE_ALL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_intel_uncore_forcewake_get
	movq	%r13, %rdi
	callq	_i915_init_ggtt
	testl	%eax, %eax
	jne	LBB0_5
## %bb.6:
	movq	%r13, %rdi
	movl	$2, %esi
	callq	_IS_GEN
	testq	%rax, %rax
	jne	LBB0_7
## %bb.8:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_SZ_256K@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_i915_gem_init_scratch
	testl	%eax, %eax
	jne	LBB0_5
## %bb.10:
	movq	%r13, %rdi
	callq	_intel_engines_setup
	testl	%eax, %eax
	je	LBB0_11
LBB0_5:
	movl	%eax, %r12d
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	movl	(%rax), %eax
	addl	%r12d, %eax
	sete	%dil
	callq	_GEM_BUG_ON
LBB0_29:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_intel_uncore_forcewake_put
	movq	%r13, %rdi
	callq	_mutex_unlock
	movq	_EIO@GOTPCREL(%rip), %r15
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	subl	(%r15), %eax
	cmpl	%eax, %r12d
	je	LBB0_31
## %bb.30:
	movq	%r14, %rdi
	callq	_intel_uc_cleanup_firmwares
	movq	%r13, %rdi
	callq	_i915_gem_cleanup_userptr
	movq	%r13, %rdi
	callq	_intel_timelines_fini
	subl	(%r15), %ebx
	movl	%ebx, %eax
LBB0_31:
	cmpl	%eax, %r12d
	jne	LBB0_35
## %bb.32:
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	callq	_intel_gt_is_wedged
	testl	%eax, %eax
	jne	LBB0_34
## %bb.33:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_i915_probe_error
	movq	%r14, %rdi
	callq	_intel_gt_set_wedged
LBB0_34:
	movq	%r13, %rdi
	callq	_i915_ggtt_enable_hw
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_i915_gem_restore_gtt_mappings
	movq	%r13, %rdi
	callq	_i915_gem_restore_fences
	movq	%r13, %rdi
	callq	_intel_init_clock_gating
	movq	%r13, %rdi
	callq	_mutex_unlock
LBB0_35:
	movq	%r13, %rdi
	callq	_i915_gem_drain_freed_objects
LBB0_36:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r13, %rdi
	callq	_i915_gem_contexts_init
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %r12d
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	movl	(%rax), %eax
	addl	%r12d, %eax
	sete	%dil
	callq	_GEM_BUG_ON
	jmp	LBB0_28
LBB0_13:
	movq	%r13, %rdi
	callq	_intel_engines_init
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	movl	%eax, %r12d
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	movl	(%rax), %eax
	addl	%r12d, %eax
	sete	%dil
	callq	_GEM_BUG_ON
	jmp	LBB0_26
LBB0_15:
	movq	%r13, %rdi
	callq	_intel_init_gt_powersave
	movq	%r14, %rdi
	callq	_intel_uc_init
	movq	%r13, %rdi
	callq	_i915_gem_init_hw
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_24
## %bb.16:
	movq	%r14, %rdi
	callq	_intel_gt_resume
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_23
## %bb.17:
	movq	%r13, %rdi
	callq	_intel_init_clock_gating
	movq	%r13, %rdi
	callq	_intel_engines_verify_workarounds
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_22
## %bb.18:
	movq	%r13, %rdi
	callq	___intel_engines_record_defaults
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_22
## %bb.19:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	subl	(%rax), %esi
	movq	%r13, %rdi
	callq	_i915_inject_load_error
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_22
## %bb.20:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	subl	(%rax), %esi
	movq	%r13, %rdi
	callq	_i915_inject_load_error
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_21
LBB0_22:
	movq	%r13, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_intel_gt_set_wedged
	movq	%r13, %rdi
	callq	_i915_gem_suspend
	movq	%r13, %rdi
	callq	_i915_gem_suspend_late
	movq	%r13, %rdi
	callq	_i915_gem_drain_workqueue
	movq	%r13, %rdi
	callq	_mutex_lock
LBB0_23:
	movq	%r14, %rdi
	callq	_intel_uc_fini_hw
LBB0_24:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	je	LBB0_26
## %bb.25:
	movq	%r14, %rdi
	callq	_intel_uc_fini
	movq	%r13, %rdi
	callq	_intel_cleanup_gt_powersave
	movq	%r13, %rdi
	callq	_intel_engines_cleanup
LBB0_26:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	je	LBB0_28
## %bb.27:
	movq	%r13, %rdi
	callq	_i915_gem_contexts_fini
LBB0_28:
	movq	%r13, %rdi
	callq	_i915_gem_fini_scratch
	jmp	LBB0_29
LBB0_21:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_intel_uncore_forcewake_put
	movq	%r13, %rdi
	callq	_mutex_unlock
	xorl	%r12d, %r12d
	jmp	LBB0_36
	.cfi_endproc
                                        ## -- End function
	.comm	_I915_GTT_PAGE_SIZE_4K,4,2      ## @I915_GTT_PAGE_SIZE_4K
	.comm	_FORCEWAKE_ALL,4,2              ## @FORCEWAKE_ALL
	.comm	_EIO,4,2                        ## @EIO
	.comm	_SZ_256K,4,2                    ## @SZ_256K
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to initialize GPU, declaring it wedged!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_init                  ; -- Begin function i915_gem_init
	.p2align	2
_i915_gem_init:                         ; @i915_gem_init
	.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	x19, x0
	bl	_intel_vgpu_active
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_intel_vgpu_has_huge_gtt
	cbnz	w0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _I915_GTT_PAGE_SIZE_4K@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I915_GTT_PAGE_SIZE_4K@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_mkwrite_device_info
	str	w20, [x0]
LBB0_3:
	mov	x0, x19
	bl	_intel_timelines_init
	mov	x0, x19
	bl	_i915_gem_init_userptr
	mov	x22, x0
	cbnz	w0, LBB0_15
; %bb.4:
	add	x20, x19, #4
	mov	x0, x20
	bl	_intel_uc_fetch_firmwares
	add	x0, x19, #12
	bl	_intel_wopcm_init
	mov	x0, x19
	bl	_mutex_lock
	add	x21, x19, #8
Lloh3:
	adrp	x24, _FORCEWAKE_ALL@GOTPAGE
Lloh4:
	ldr	x24, [x24, _FORCEWAKE_ALL@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x21
	bl	_intel_uncore_forcewake_get
	mov	x0, x19
	bl	_i915_init_ggtt
Lloh5:
	adrp	x23, _EIO@GOTPAGE
Lloh6:
	ldr	x23, [x23, _EIO@GOTPAGEOFF]
	cbnz	w0, LBB0_7
; %bb.5:
	mov	x0, x19
	mov	w1, #2
	bl	_IS_GEN
Lloh7:
	adrp	x8, _SZ_256K@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SZ_256K@GOTPAGEOFF]
Lloh9:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x9, x8, eq
	ldr	w1, [x8]
	mov	x0, x19
	bl	_i915_gem_init_scratch
	cbnz	w0, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_intel_engines_setup
	cbz	w0, LBB0_16
LBB0_7:
	mov	x22, x0
	ldr	w8, [x23]
	cmn	w0, w8
	cset	w0, eq
	bl	_GEM_BUG_ON
LBB0_8:
	ldr	w1, [x24]
	mov	x0, x21
	bl	_intel_uncore_forcewake_put
	mov	x0, x19
	bl	_mutex_unlock
	ldr	w8, [x23]
	cmn	w22, w8
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x20
	bl	_intel_uc_cleanup_firmwares
	mov	x0, x19
	bl	_i915_gem_cleanup_userptr
	mov	x0, x19
	bl	_intel_timelines_fini
	ldr	w8, [x23]
LBB0_10:
	neg	w8, w8
	cmp	w22, w8
	b.ne	LBB0_14
; %bb.11:
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	bl	_intel_gt_is_wedged
	cbnz	w0, LBB0_13
; %bb.12:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_i915_probe_error
	mov	x0, x20
	bl	_intel_gt_set_wedged
LBB0_13:
	mov	x0, x19
	bl	_i915_ggtt_enable_hw
	mov	x22, x0
	mov	x0, x19
	bl	_i915_gem_restore_gtt_mappings
	mov	x0, x19
	bl	_i915_gem_restore_fences
	mov	x0, x19
	bl	_intel_init_clock_gating
	mov	x0, x19
	bl	_mutex_unlock
LBB0_14:
	mov	x0, x19
	bl	_i915_gem_drain_freed_objects
LBB0_15:
	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
LBB0_16:
	mov	x0, x19
	bl	_i915_gem_contexts_init
	cbz	w0, LBB0_18
; %bb.17:
	mov	x22, x0
	ldr	w8, [x23]
	cmn	w0, w8
	cset	w0, eq
	bl	_GEM_BUG_ON
	b	LBB0_32
LBB0_18:
	mov	x0, x19
	bl	_intel_engines_init
	cbz	w0, LBB0_20
; %bb.19:
	mov	x22, x0
	ldr	w8, [x23]
	cmn	w0, w8
	cset	w0, eq
	bl	_GEM_BUG_ON
	b	LBB0_30
LBB0_20:
	mov	x0, x19
	bl	_intel_init_gt_powersave
	mov	x0, x20
	bl	_intel_uc_init
	mov	x0, x19
	bl	_i915_gem_init_hw
	mov	x22, x0
	cbnz	w0, LBB0_28
; %bb.21:
	mov	x0, x20
	bl	_intel_gt_resume
	mov	x22, x0
	cbnz	w0, LBB0_27
; %bb.22:
	mov	x0, x19
	bl	_intel_init_clock_gating
	mov	x0, x19
	bl	_intel_engines_verify_workarounds
	mov	x22, x0
	cbnz	w0, LBB0_26
; %bb.23:
	mov	x0, x19
	bl	___intel_engines_record_defaults
	mov	x22, x0
	cbnz	w0, LBB0_26
; %bb.24:
Lloh13:
	adrp	x8, _ENODEV@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w1, w8
	mov	x0, x19
	bl	_i915_inject_load_error
	mov	x22, x0
	cbnz	w0, LBB0_26
; %bb.25:
	ldr	w8, [x23]
	neg	w1, w8
	mov	x0, x19
	bl	_i915_inject_load_error
	mov	x22, x0
	cbz	w0, LBB0_33
LBB0_26:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	bl	_intel_gt_set_wedged
	mov	x0, x19
	bl	_i915_gem_suspend
	mov	x0, x19
	bl	_i915_gem_suspend_late
	mov	x0, x19
	bl	_i915_gem_drain_workqueue
	mov	x0, x19
	bl	_mutex_lock
LBB0_27:
	mov	x0, x20
	bl	_intel_uc_fini_hw
LBB0_28:
	ldr	w8, [x23]
	cmn	w22, w8
	b.eq	LBB0_30
; %bb.29:
	mov	x0, x20
	bl	_intel_uc_fini
	mov	x0, x19
	bl	_intel_cleanup_gt_powersave
	mov	x0, x19
	bl	_intel_engines_cleanup
LBB0_30:
	ldr	w8, [x23]
	cmn	w22, w8
	b.eq	LBB0_32
; %bb.31:
	mov	x0, x19
	bl	_i915_gem_contexts_fini
LBB0_32:
	mov	x0, x19
	bl	_i915_gem_fini_scratch
	b	LBB0_8
LBB0_33:
	ldr	w1, [x24]
	mov	x0, x21
	bl	_intel_uncore_forcewake_put
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_I915_GTT_PAGE_SIZE_4K,4,2      ; @I915_GTT_PAGE_SIZE_4K
	.comm	_FORCEWAKE_ALL,4,2              ; @FORCEWAKE_ALL
	.comm	_EIO,4,2                        ; @EIO
	.comm	_SZ_256K,4,2                    ; @SZ_256K
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to initialize GPU, declaring it wedged!\n"

.subsections_via_symbols
