	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a5xx_gpu_init                  ## -- Begin function a5xx_gpu_init
	.p2align	4, 0x90
_a5xx_gpu_init:                         ## @a5xx_gpu_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.6:
	movq	%rax, %r15
	addq	$8, %r15
	movq	_a5xx_registers@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 20(%rax)
	movq	_a5xx_register_offsets@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rax)
	movl	$5111834, (%rax)                ## imm = 0x4E001A
	movq	%rbx, %rdi
	callq	_check_speed_bin
	movq	_funcs@GOTPCREL(%rip), %rcx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	movl	$4, %r8d
	callq	_adreno_gpu_init
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_a5xx_destroy
	movl	%ebx, %edi
	jmp	LBB0_5
LBB0_1:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_DRM_DEV_ERROR
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%edi, %edi
	subl	(%rax), %edi
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_8:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movl	(%rax), %edi
	movq	_a5xx_fault_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rsi
	callq	_msm_mmu_set_fault_handler
LBB0_10:
	movq	%r15, %rdi
	callq	_a5xx_preempt_init
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No A5XX device is defined\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_a5xx_registers,4,2             ## @a5xx_registers
	.comm	_a5xx_register_offsets,4,2      ## @a5xx_register_offsets
	.comm	_funcs,4,2                      ## @funcs
	.comm	_a5xx_fault_handler,4,2         ## @a5xx_fault_handler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a5xx_gpu_init                  ; -- Begin function a5xx_gpu_init
	.p2align	2
_a5xx_gpu_init:                         ; @a5xx_gpu_init
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	x21, [x8]
	cbz	x21, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.2:
	add	x19, x0, #8
Lloh3:
	adrp	x8, _a5xx_registers@GOTPAGE
Lloh4:
	ldr	x8, [x8, _a5xx_registers@GOTPAGEOFF]
Lloh5:
	adrp	x9, _a5xx_register_offsets@GOTPAGE
Lloh6:
	ldr	x9, [x9, _a5xx_register_offsets@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #16]
	mov	w8, #26
	movk	w8, #78, lsl #16
	str	w8, [x0]
	mov	x0, x21
	bl	_check_speed_bin
Lloh9:
	adrp	x3, _funcs@GOTPAGE
Lloh10:
	ldr	x3, [x3, _funcs@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	mov	w4, #4
	bl	_adreno_gpu_init
	cbz	w0, LBB0_8
; %bb.3:
	mov	x20, x0
	mov	x0, x19
	bl	_a5xx_destroy
	mov	x0, x20
	b	LBB0_7
LBB0_4:
	ldr	w0, [x20]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_ERROR
Lloh13:
	adrp	x8, _ENXIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_8:
	ldr	x8, [x19]
	cbz	x8, LBB0_10
; %bb.9:
	ldr	w0, [x8]
Lloh17:
	adrp	x8, _a5xx_fault_handler@GOTPAGE
Lloh18:
	ldr	x8, [x8, _a5xx_fault_handler@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x1, x19
	bl	_msm_mmu_set_fault_handler
LBB0_10:
	mov	x0, x19
	bl	_a5xx_preempt_init
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No A5XX device is defined\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_a5xx_registers,4,2             ; @a5xx_registers
	.comm	_a5xx_register_offsets,4,2      ; @a5xx_register_offsets
	.comm	_funcs,4,2                      ; @funcs
	.comm	_a5xx_fault_handler,4,2         ; @a5xx_fault_handler
.subsections_via_symbols
