	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function host1x_pushbuffer_init
_host1x_pushbuffer_init:                ## @host1x_pushbuffer_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_pb_to_cdma
	movq	%rax, %rdi
	callq	_cdma_to_host1x
	movq	%rax, %r12
	movq	%rax, %r14
	movq	$0, 24(%rbx)
	leaq	16(%rbx), %r13
	movl	$0, 16(%rbx)
	movq	_HOST1X_PUSHBUFFER_SLOTS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	(,%rax,8), %rcx
	movl	%ecx, (%rbx)
	leaq	4(,%rax,8), %r15
	addl	$-8, %ecx
	movl	%ecx, 4(%rbx)
	movq	$0, 40(%rbx)
	cmpq	$0, 16(%r12)
	je	LBB0_7
## %bb.1:
	addq	$12, %r12
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_iova_align
	movq	%rax, %r15
	movl	8(%r14), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_dma_alloc_wc
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%r12, %rdi
	callq	_iova_shift
	movq	%rax, %rcx
	movq	%r15, %rsi
	shrq	%cl, %rsi
	movq	(%r14), %rdx
                                        ## kill: def $cl killed $cl killed $rcx
	shrq	%cl, %rdx
	movq	%r12, %rdi
	movl	$1, %ecx
	callq	_alloc_iova
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	%r12, %rdi
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, %rsi
	callq	_iova_dma_addr
	movl	%eax, 32(%rbx)
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	16(%r14), %rdi
	movl	16(%rbx), %edx
	movq	_IOMMU_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movl	%eax, %esi
	movq	%r15, %rcx
	callq	_iommu_map
	testl	%eax, %eax
	je	LBB0_5
## %bb.10:
	movl	%eax, %r13d
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	___free_iova
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_7:
	movl	8(%r14), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_dma_alloc_wc
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_2
## %bb.8:
	movl	16(%rbx), %eax
	movl	%eax, 32(%rbx)
	jmp	LBB0_9
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_12
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_11:
	movl	8(%r14), %edi
	movq	24(%rbx), %rdx
	movl	16(%rbx), %ecx
	movq	%r15, %rsi
	callq	_dma_free_wc
	jmp	LBB0_12
LBB0_5:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_9:
	movq	%r15, 8(%rbx)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_host1x_hw_pushbuffer_init
	xorl	%r13d, %r13d
LBB0_12:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HOST1X_PUSHBUFFER_SLOTS,4,2    ## @HOST1X_PUSHBUFFER_SLOTS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_IOMMU_READ,4,2                 ## @IOMMU_READ
	.no_dead_strip	_host1x_pushbuffer_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function host1x_pushbuffer_init
_host1x_pushbuffer_init:                ; @host1x_pushbuffer_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	bl	_pb_to_cdma
	bl	_cdma_to_host1x
	mov	x20, x0
	mov	x23, x19
	str	wzr, [x23, #16]!
	str	xzr, [x19, #24]
Lloh0:
	adrp	x8, _HOST1X_PUSHBUFFER_SLOTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HOST1X_PUSHBUFFER_SLOTS@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	lsl	x9, x8, #3
	mov	w21, #4
	bfi	x21, x8, #3, #61
	sub	w8, w9, #8
	stp	w9, w8, [x19]
	str	xzr, [x19, #40]
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_5
; %bb.1:
	add	x22, x20, #12
	mov	x0, x22
	mov	x1, x21
	bl	_iova_align
	mov	x21, x0
	ldr	w0, [x20, #8]
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x1, x21
	mov	x2, x23
	bl	_dma_alloc_wc
	str	x0, [x19, #24]
	cbz	x0, LBB0_8
; %bb.2:
	mov	x0, x22
	bl	_iova_shift
	lsr	x1, x21, x0
	ldr	x8, [x20]
	lsr	x2, x8, x0
	mov	x0, x22
	mov	w3, #1
	bl	_alloc_iova
	cbz	x0, LBB0_9
; %bb.3:
	mov	x24, x0
	mov	x0, x22
	mov	x1, x24
	bl	_iova_dma_addr
	mov	x1, x0
	str	w0, [x19, #32]
	ldr	x0, [x20, #16]
	ldr	w2, [x19, #16]
Lloh6:
	adrp	x8, _IOMMU_READ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IOMMU_READ@GOTPAGEOFF]
Lloh8:
	ldr	w4, [x8]
	mov	x3, x21
	bl	_iommu_map
	cbz	w0, LBB0_7
; %bb.4:
	mov	x23, x0
	mov	x0, x22
	mov	x1, x24
	bl	___free_iova
	b	LBB0_10
LBB0_5:
	ldr	w0, [x20, #8]
Lloh9:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	mov	x1, x21
	mov	x2, x23
	bl	_dma_alloc_wc
	str	x0, [x19, #24]
	cbz	x0, LBB0_8
; %bb.6:
	ldr	w8, [x19, #16]
	str	w8, [x19, #32]
LBB0_7:
	str	x21, [x19, #8]
	mov	x0, x20
	mov	x1, x19
	bl	_host1x_hw_pushbuffer_init
	mov	w23, #0
	b	LBB0_11
LBB0_8:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_11
LBB0_9:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_10:
	ldr	w0, [x20, #8]
	ldr	x2, [x19, #24]
	ldr	w3, [x19, #16]
	mov	x1, x21
	bl	_dma_free_wc
LBB0_11:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_HOST1X_PUSHBUFFER_SLOTS,4,2    ; @HOST1X_PUSHBUFFER_SLOTS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IOMMU_READ,4,2                 ; @IOMMU_READ
	.no_dead_strip	_host1x_pushbuffer_init
.subsections_via_symbols
