	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function panfrost_open
_panfrost_open:                         ## @panfrost_open
	.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	%rsi, %r14
	movq	(%rdi), %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%r15, 8(%rax)
	movq	%rax, (%r14)
	movq	%rax, %rdi
	addq	$4, %rdi
	callq	_spin_lock_init
	movq	_SZ_32M@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movq	_SZ_4G@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	subl	%esi, %edx
	sarl	%cl, %esi
	sarl	%cl, %edx
	movq	%rbx, %rdi
	callq	_drm_mm_init
	movq	_panfrost_drm_mm_color_adjust@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	callq	_panfrost_mmu_pgtable_alloc
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movq	%rbx, %rdi
	callq	_panfrost_job_open
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_panfrost_mmu_pgtable_free
LBB0_6:
	movq	%rbx, %rdi
	callq	_drm_mm_takedown
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_7
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_7
LBB0_4:
	xorl	%r14d, %r14d
LBB0_7:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SZ_32M,4,2                     ## @SZ_32M
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_SZ_4G,4,2                      ## @SZ_4G
	.comm	_panfrost_drm_mm_color_adjust,4,2 ## @panfrost_drm_mm_color_adjust
	.no_dead_strip	_panfrost_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function panfrost_open
_panfrost_open:                         ; @panfrost_open
	.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, x1
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	str	x21, [x0, #8]
	str	x0, [x20]
	add	x0, x0, #4
	bl	_spin_lock_init
Lloh3:
	adrp	x8, _SZ_32M@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SZ_32M@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	asr	w1, w8, w9
Lloh9:
	adrp	x10, _SZ_4G@GOTPAGE
Lloh10:
	ldr	x10, [x10, _SZ_4G@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	sub	w8, w10, w8
	asr	w2, w8, w9
	mov	x0, x19
	bl	_drm_mm_init
Lloh12:
	adrp	x8, _panfrost_drm_mm_color_adjust@GOTPAGE
Lloh13:
	ldr	x8, [x8, _panfrost_drm_mm_color_adjust@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x19]
	mov	x0, x19
	bl	_panfrost_mmu_pgtable_alloc
	mov	x20, x0
	cbnz	w0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_panfrost_job_open
	mov	x20, x0
	cbz	w0, LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_panfrost_mmu_pgtable_free
LBB0_4:
	mov	x0, x19
	bl	_drm_mm_takedown
	mov	x0, x19
	bl	_kfree
	b	LBB0_6
LBB0_5:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_6:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SZ_32M,4,2                     ; @SZ_32M
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_SZ_4G,4,2                      ; @SZ_4G
	.comm	_panfrost_drm_mm_color_adjust,4,2 ; @panfrost_drm_mm_color_adjust
	.no_dead_strip	_panfrost_open
.subsections_via_symbols
