	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a3xx_gpu_init                  ## -- Begin function a3xx_gpu_init
	.p2align	4, 0x90
_a3xx_gpu_init:                         ## @a3xx_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	(%rax), %r15
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %r12
	movq	_perfcntrs@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, 12(%r12)
	callq	_ARRAY_SIZE
	movl	%eax, 8(%r12)
	movq	_a3xx_registers@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r12)
	movq	_a3xx_register_offsets@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r12)
	movq	_funcs@GOTPCREL(%rip), %rcx
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movl	$1, %r8d
	callq	_adreno_gpu_init
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_6
LBB0_8:
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_a3xx_destroy
	jmp	LBB0_9
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	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_6:
	movq	%r12, %rdi
	callq	_adreno_is_a330
	cmpl	$0, 4(%r12)
	je	LBB0_7
## %bb.10:
	addq	$4, %r12
	movq	%r12, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_DRM_DEV_ERROR
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no a3xx device\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_perfcntrs,4,2                  ## @perfcntrs
	.comm	_a3xx_registers,4,2             ## @a3xx_registers
	.comm	_a3xx_register_offsets,4,2      ## @a3xx_register_offsets
	.comm	_funcs,4,2                      ## @funcs
L_.str.1:                               ## @.str.1
	.asciz	"No memory protection without IOMMU\n"

	.comm	_OCMEM_GRAPHICS,4,2             ## @OCMEM_GRAPHICS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a3xx_gpu_init                  ; -- Begin function a3xx_gpu_init
	.p2align	2
_a3xx_gpu_init:                         ; @a3xx_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	x19, 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, #40
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.2:
	mov	x20, x0
Lloh3:
	adrp	x8, _perfcntrs@GOTPAGE
Lloh4:
	ldr	x8, [x8, _perfcntrs@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	str	w0, [x20, #12]
	bl	_ARRAY_SIZE
	str	w0, [x20, #8]
Lloh6:
	adrp	x8, _a3xx_registers@GOTPAGE
Lloh7:
	ldr	x8, [x8, _a3xx_registers@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _a3xx_register_offsets@GOTPAGE
Lloh10:
	ldr	x9, [x9, _a3xx_register_offsets@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #16]
Lloh12:
	adrp	x3, _funcs@GOTPAGE
Lloh13:
	ldr	x3, [x3, _funcs@GOTPAGEOFF]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	w4, #1
	bl	_adreno_gpu_init
	mov	x21, x0
	cbz	w0, LBB0_8
LBB0_3:
	add	x0, x20, #4
	bl	_a3xx_destroy
	b	LBB0_7
LBB0_4:
	ldr	w0, [x19]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_ERROR
Lloh16:
	adrp	x8, _ENXIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_7:
	mov	x0, x21
	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:
	mov	x0, x20
	bl	_adreno_is_a330
	mov	x0, x20
	ldr	w8, [x0, #4]!
	cbz	w8, LBB0_10
; %bb.9:
	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
LBB0_10:
	ldr	w0, [x19]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_DRM_DEV_ERROR
Lloh22:
	adrp	x8, _ENXIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no a3xx device\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_perfcntrs,4,2                  ; @perfcntrs
	.comm	_a3xx_registers,4,2             ; @a3xx_registers
	.comm	_a3xx_register_offsets,4,2      ; @a3xx_register_offsets
	.comm	_funcs,4,2                      ; @funcs
l_.str.1:                               ; @.str.1
	.asciz	"No memory protection without IOMMU\n"

	.comm	_OCMEM_GRAPHICS,4,2             ; @OCMEM_GRAPHICS
.subsections_via_symbols
