	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_panfrost_gpu_init              ## -- Begin function panfrost_gpu_init
	.p2align	4, 0x90
_panfrost_gpu_init:                     ## @panfrost_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	callq	_panfrost_gpu_soft_reset
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_1
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movq	%r14, %rdi
	callq	_panfrost_gpu_init_features
	movl	(%r14), %ebx
	movl	4(%r14), %esi
	movl	$65280, %edi                    ## imm = 0xFF00
	callq	_FIELD_GET
	movl	%eax, %edi
	callq	_DMA_BIT_MASK
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_dma_set_mask_and_coherent
	movl	(%r14), %edi
	callq	_to_platform_device
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_platform_get_irq_byname
	testl	%eax, %eax
	jle	LBB0_2
## %bb.3:
	movl	(%r14), %edi
	movq	_panfrost_gpu_irq_handler@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_IRQF_SHARED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leaq	L_.str(%rip), %r8
	movl	%eax, %esi
	movq	%r14, %r9
	callq	_devm_request_irq
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_6
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_5:
	movq	%r14, %rdi
	callq	_panfrost_gpu_init_quirks
	movq	%r14, %rdi
	callq	_panfrost_gpu_power_on
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gpu"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_panfrost_gpu_irq_handler,4,2   ## @panfrost_gpu_irq_handler
	.comm	_IRQF_SHARED,4,2                ## @IRQF_SHARED
L_.str.1:                               ## @.str.1
	.asciz	"failed to request gpu irq"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_panfrost_gpu_init              ; -- Begin function panfrost_gpu_init
	.p2align	2
_panfrost_gpu_init:                     ; @panfrost_gpu_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_panfrost_gpu_soft_reset
	mov	x20, x0
	cbz	w0, LBB0_2
LBB0_1:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x0, x19
	bl	_panfrost_gpu_init_features
	ldp	w20, w1, [x19]
	mov	w0, #65280
	bl	_FIELD_GET
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x20
	bl	_dma_set_mask_and_coherent
	ldr	w0, [x19]
	bl	_to_platform_device
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_platform_get_irq_byname
	cmp	w0, #0
	b.le	LBB0_5
; %bb.3:
	mov	x1, x0
	ldr	w0, [x19]
Lloh2:
	adrp	x8, _panfrost_gpu_irq_handler@GOTPAGE
Lloh3:
	ldr	x8, [x8, _panfrost_gpu_irq_handler@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
Lloh5:
	adrp	x8, _IRQF_SHARED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IRQF_SHARED@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
Lloh8:
	adrp	x4, l_.str@PAGE
Lloh9:
	add	x4, x4, l_.str@PAGEOFF
	mov	x5, x19
	bl	_devm_request_irq
	mov	x20, x0
	cbz	w0, LBB0_6
; %bb.4:
	ldr	w0, [x19]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_1
LBB0_5:
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_1
LBB0_6:
	mov	x0, x19
	bl	_panfrost_gpu_init_quirks
	mov	x0, x19
	bl	_panfrost_gpu_power_on
	b	LBB0_1
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gpu"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_panfrost_gpu_irq_handler,4,2   ; @panfrost_gpu_irq_handler
	.comm	_IRQF_SHARED,4,2                ; @IRQF_SHARED
l_.str.1:                               ; @.str.1
	.asciz	"failed to request gpu irq"

.subsections_via_symbols
