	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pt3_alloc_dmabuf               ## -- Begin function pt3_alloc_dmabuf
	.p2align	4, 0x90
_pt3_alloc_dmabuf:                      ## @pt3_alloc_dmabuf
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	32(%rdi), %r14
	movl	$0, (%rdi)
	movl	$0, 24(%rdi)
	cmpl	$0, (%r14)
	jle	LBB0_4
## %bb.1:
	movq	16(%r13), %rdx
	xorl	%ebx, %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rdi
	movq	_DATA_BUF_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addq	%rbx, %rdx
	movl	(%r15), %ecx
	callq	_dma_alloc_coherent
	testq	%rax, %rax
	je	LBB0_18
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%r13), %rdx
	movq	%rax, 8(%rdx,%rbx)
	incl	(%r13)
	incq	%r12
	movslq	(%r14), %rax
	addq	$16, %rbx
	cmpq	%rax, %r12
	jl	LBB0_2
LBB0_4:
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_pt3_init_dmabuf
	movq	_DATA_BUF_XFERS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	imull	(%r13), %edi
	movq	_DESCS_IN_PAGE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_DIV_ROUND_UP
	testl	%eax, %eax
	jle	LBB0_19
## %bb.5:
	movl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	xorl	%r14d, %r14d
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_8 Depth=1
	movl	-44(%rbp), %esi                 ## 4-byte Reload
LBB0_7:                                 ##   in Loop: Header=BB0_8 Depth=1
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	incq	%r12
	cmpq	-72(%rbp), %r12                 ## 8-byte Folded Reload
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_19
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-56(%rbp), %rdx
	callq	_dma_alloc_coherent
	testq	%rax, %rax
	je	LBB0_18
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	incl	24(%r13)
	movq	8(%r13), %rcx
	movq	%r12, %rdx
	shlq	$4, %rdx
	movq	%rax, 8(%rcx,%rdx)
	movq	-56(%rbp), %rax
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	movq	%rax, (%rcx,%rdx)
	testq	%r12, %r12
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	leal	-1(%r12), %eax
	shlq	$4, %rax
	movl	%r14d, %r13d
	movq	8(%rcx,%rax), %r14
	movslq	(%rbx), %rax
	leaq	(%rax,%rax,4), %r15
	movq	-56(%rbp), %rdi
	callq	_lower_32_bits
	movq	%rax, -32(%r14,%r15,8)
	movq	-56(%rbp), %rdi
	callq	_upper_32_bits
	movq	%rax, -40(%r14,%r15,8)
	movl	%r13d, %r14d
	movq	_DESCS_IN_PAGE@GOTPCREL(%rip), %rbx
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$0, (%rbx)
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	jle	LBB0_6
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_15 Depth=2
	movl	%r14d, %esi
	movl	-44(%rbp), %r14d                ## 4-byte Reload
LBB0_14:                                ##   in Loop: Header=BB0_15 Depth=2
	incq	%r12
	movq	_DESCS_IN_PAGE@GOTPCREL(%rip), %rbx
	movslq	(%rbx), %rax
	addq	$40, %r13
	cmpq	%rax, %r12
	jge	LBB0_7
LBB0_15:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rax
	movq	16(%rcx), %rcx
	movslq	%r14d, %rdx
	shlq	$4, %rdx
	movslq	%esi, %r14
	movq	(%rcx,%rdx), %rbx
	addq	%r14, %rbx
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rax,%rcx), %r15
	movq	%rbx, %rdi
	callq	_lower_32_bits
	movq	%rax, 32(%r15,%r13)
	movq	%rbx, %rdi
	callq	_upper_32_bits
	movq	%rax, 24(%r15,%r13)
	movq	_DATA_XFER_SZ@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	%rax, 16(%r15,%r13)
	movq	-56(%rbp), %rdi
	addq	$40, %rdi
	movq	%rdi, -56(%rbp)
	callq	_lower_32_bits
	movq	%rax, 8(%r15,%r13)
	movq	-56(%rbp), %rdi
	callq	_upper_32_bits
	movq	%rax, (%r15,%r13)
	addl	(%rbx), %r14d
	movl	%r14d, %esi
	movq	_DATA_BUF_SZ@GOTPCREL(%rip), %rax
	subl	(%rax), %esi
	jl	LBB0_13
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=2
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	cmpl	(%rcx), %eax
	movl	%eax, %r14d
	jl	LBB0_14
## %bb.17:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	(%rax), %rdi
	movq	%rdi, -56(%rbp)
	callq	_lower_32_bits
	movq	%rax, 8(%r15,%r13)
	movq	-56(%rbp), %rdi
	callq	_upper_32_bits
	movq	%rax, (%r15,%r13)
LBB0_19:
	xorl	%eax, %eax
	jmp	LBB0_20
LBB0_18:
	movq	%r13, %rdi
	callq	_pt3_free_dmabuf
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_20:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DATA_BUF_SZ,4,2                ## @DATA_BUF_SZ
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_DATA_BUF_XFERS,4,2             ## @DATA_BUF_XFERS
	.comm	_DESCS_IN_PAGE,4,2              ## @DESCS_IN_PAGE
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_DATA_XFER_SZ,8,3               ## @DATA_XFER_SZ
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pt3_alloc_dmabuf               ; -- Begin function pt3_alloc_dmabuf
	.p2align	2
_pt3_alloc_dmabuf:                      ; @pt3_alloc_dmabuf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	x21, [x0, #32]
	str	wzr, [x0]
	str	wzr, [x0, #24]
	ldr	w8, [x21]
Lloh0:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x20, #0
	mov	x22, #0
	ldr	x8, [x19, #16]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21, #8]
Lloh2:
	adrp	x9, _DATA_BUF_SZ@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DATA_BUF_SZ@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x9]
	add	x2, x8, x20
	ldr	w3, [x23]
	bl	_dma_alloc_coherent
	cbz	x0, LBB0_17
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x19, #16]
	add	x9, x8, x20
	str	x0, [x9, #8]
	ldr	w9, [x19]
	add	w9, w9, #1
	str	w9, [x19]
	add	x22, x22, #1
	ldrsw	x9, [x21]
	add	x20, x20, #16
	cmp	x22, x9
	b.lt	LBB0_2
LBB0_4:
	mov	x0, x19
	bl	_pt3_init_dmabuf
Lloh5:
	adrp	x8, _DATA_BUF_XFERS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DATA_BUF_XFERS@GOTPAGEOFF]
	ldr	w9, [x19]
Lloh7:
	ldr	w8, [x8]
	mul	w0, w8, w9
Lloh8:
	adrp	x22, _DESCS_IN_PAGE@GOTPAGE
Lloh9:
	ldr	x22, [x22, _DESCS_IN_PAGE@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_DIV_ROUND_UP
	cmp	w0, #1
	b.lt	LBB0_18
; %bb.5:
	mov	x25, #0
	mov	w27, #0
	mov	w26, #0
Lloh10:
	adrp	x28, _DATA_XFER_SZ@GOTPAGE
Lloh11:
	ldr	x28, [x28, _DATA_XFER_SZ@GOTPAGEOFF]
	mov	w8, w0
	stp	x8, x21, [sp, #8]               ; 16-byte Folded Spill
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x25, x25, #1
	ldp	x8, x21, [sp, #8]               ; 16-byte Folded Reload
	cmp	x25, x8
Lloh12:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	b.eq	LBB0_18
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_14 Depth 2
	ldr	x0, [x21, #8]
Lloh14:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	ldr	w3, [x23]
	add	x2, sp, #24
	bl	_dma_alloc_coherent
	cbz	x0, LBB0_17
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x19, #24]
	add	w8, w8, #1
	str	w8, [x19, #24]
	ldr	x8, [x19, #8]
	add	x9, x8, x25, lsl #4
	ldr	x10, [sp, #24]
	stp	x10, x0, [x9]
	cbz	x25, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	sub	w9, w25, #1
	add	x8, x8, w9, uxtw #4
	ldr	x20, [x8, #8]
Lloh17:
	adrp	x8, _DESCS_IN_PAGE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DESCS_IN_PAGE@GOTPAGEOFF]
Lloh19:
	ldrsw	x22, [x8]
	ldr	x0, [sp, #24]
	bl	_lower_32_bits
	mov	w8, #40
	madd	x20, x22, x8, x20
Lloh20:
	adrp	x22, _DESCS_IN_PAGE@GOTPAGE
Lloh21:
	ldr	x22, [x22, _DESCS_IN_PAGE@GOTPAGEOFF]
	stur	x0, [x20, #-32]
	ldr	x0, [sp, #24]
	bl	_upper_32_bits
	stur	x0, [x20, #-40]
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x23, #0
	mov	x24, #0
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_14 Depth=2
	mov	x27, x8
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=2
	add	x24, x24, #1
Lloh22:
	adrp	x22, _DESCS_IN_PAGE@GOTPAGE
Lloh23:
	ldr	x22, [x22, _DESCS_IN_PAGE@GOTPAGEOFF]
	ldrsw	x8, [x22]
	add	x23, x23, #40
	cmp	x24, x8
	b.ge	LBB0_6
LBB0_14:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sbfiz	x8, x26, #4, #32
	ldp	x10, x9, [x19, #8]
	ldr	x8, [x9, x8]
	add	x20, x8, w27, sxtw
	add	x8, x10, x25, lsl #4
	ldr	x22, [x8, #8]
	mov	x0, x20
	bl	_lower_32_bits
	add	x21, x22, x23
	str	x0, [x21, #32]
	mov	x0, x20
	bl	_upper_32_bits
	ldr	x8, [x28]
	stp	x8, x0, [x21, #16]
	ldr	x8, [sp, #24]
	add	x0, x8, #40
	str	x0, [sp, #24]
	bl	_lower_32_bits
	str	x0, [x21, #8]
	ldr	x0, [sp, #24]
	bl	_upper_32_bits
	str	x0, [x21]
	ldr	w8, [x28]
Lloh24:
	adrp	x9, _DATA_BUF_SZ@GOTPAGE
Lloh25:
	ldr	x9, [x9, _DATA_BUF_SZ@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	add	w27, w27, w8
	subs	w8, w27, w9
	b.lt	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=2
	add	w26, w26, #1
	ldr	w9, [x19]
	cmp	w26, w9
	b.lt	LBB0_12
; %bb.16:
	ldr	x8, [x19, #8]
	ldr	x0, [x8]
	str	x0, [sp, #24]
	bl	_lower_32_bits
	add	x19, x22, x23
	str	x0, [x19, #8]
	ldr	x0, [sp, #24]
	bl	_upper_32_bits
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19]
	b	LBB0_19
LBB0_17:
	mov	x0, x19
	bl	_pt3_free_dmabuf
Lloh27:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_19
LBB0_18:
	mov	w0, #0
LBB0_19:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_DATA_BUF_SZ,4,2                ; @DATA_BUF_SZ
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_DATA_BUF_XFERS,4,2             ; @DATA_BUF_XFERS
	.comm	_DESCS_IN_PAGE,4,2              ; @DESCS_IN_PAGE
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_DATA_XFER_SZ,8,3               ; @DATA_XFER_SZ
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
