	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_etnaviv_cmdbuf_suballoc_new    ## -- Begin function etnaviv_cmdbuf_suballoc_new
	.p2align	4, 0x90
_etnaviv_cmdbuf_suballoc_new:           ## @etnaviv_cmdbuf_suballoc_new
	.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	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%r14, 16(%rax)
	leaq	12(%rax), %rdi
	callq	_mutex_init
	leaq	8(%rbx), %rdi
	callq	_init_waitqueue_head
	movq	_ETNAVIV_SOFTPIN_START_ADDRESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_SUBALLOC_SIZE@GOTPCREL(%rip), %r12
	xorl	%edi, %edi
	cmpq	(%r12), %rax
	setl	%dil
	callq	_BUILD_BUG_ON
	movq	(%r12), %rsi
	movq	%rbx, %rdx
	addq	$4, %rdx
	movl	(%r15), %ecx
	movq	%r14, %rdi
	callq	_dma_alloc_wc
	movl	%eax, (%rbx)
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_4
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	callq	_kfree
LBB0_4:
	negl	%r14d
	movl	%r14d, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ETNAVIV_SOFTPIN_START_ADDRESS,8,3 ## @ETNAVIV_SOFTPIN_START_ADDRESS
	.comm	_SUBALLOC_SIZE,8,3              ## @SUBALLOC_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_etnaviv_cmdbuf_suballoc_new    ; -- Begin function etnaviv_cmdbuf_suballoc_new
	.p2align	2
_etnaviv_cmdbuf_suballoc_new:           ; @etnaviv_cmdbuf_suballoc_new
	.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
Lloh0:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	str	x20, [x0, #16]
	add	x0, x0, #12
	bl	_mutex_init
	add	x0, x19, #8
	bl	_init_waitqueue_head
Lloh2:
	adrp	x8, _ETNAVIV_SOFTPIN_START_ADDRESS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ETNAVIV_SOFTPIN_START_ADDRESS@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
Lloh5:
	adrp	x22, _SUBALLOC_SIZE@GOTPAGE
Lloh6:
	ldr	x22, [x22, _SUBALLOC_SIZE@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	x8, x9
	cset	w0, lt
	bl	_BUILD_BUG_ON
	ldr	x1, [x22]
	add	x2, x19, #4
	ldr	w3, [x21]
	mov	x0, x20
	bl	_dma_alloc_wc
	str	w0, [x19]
	cbz	w0, LBB0_4
; %bb.2:
	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
LBB0_3:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w20, [x8]
	b	LBB0_5
LBB0_4:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_kfree
LBB0_5:
	neg	w0, w20
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ETNAVIV_SOFTPIN_START_ADDRESS,8,3 ; @ETNAVIV_SOFTPIN_START_ADDRESS
	.comm	_SUBALLOC_SIZE,8,3              ; @SUBALLOC_SIZE
.subsections_via_symbols
