	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cnic_alloc_dma
_cnic_alloc_dma:                        ## @cnic_alloc_dma
	.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
	movl	%ecx, %r13d
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	8(%rdi), %r12
	leal	(,%r15,4), %eax
	leal	(%rax,%rax,2), %edi
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movslq	%r15d, %rcx
	leaq	(%rax,%rcx,8), %rdx
	movq	%rdx, 32(%rbx)
	movl	%r15d, (%rbx)
	testl	%r15d, %r15d
	jle	LBB0_8
## %bb.2:
	movq	(%r14), %rdi
	movq	_CNIC_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	movq	24(%rbx), %rcx
	movq	%rax, (%rcx)
	movq	24(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.3:
	movl	%r15d, %r12d
	shlq	$2, %r12
	movl	$4, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%r13, %r12
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r14), %rdi
	movq	_CNIC_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	32(%rbx), %rdx
	addq	%r13, %rdx
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	movq	24(%rbx), %rcx
	movq	%rax, (%rcx,%r13,2)
	movq	24(%rbx), %rax
	cmpq	$0, (%rax,%r13,2)
	leaq	4(%r13), %r13
	jne	LBB0_4
	jmp	LBB0_6
LBB0_8:
	xorl	%r13d, %r13d
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_11
## %bb.9:
	movq	_CNIC_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leal	(%rsi,%r15,8), %eax
	decl	%eax
	negl	%esi
	andl	%eax, %esi
	movl	%esi, 4(%rbx)
	movq	(%r14), %rdi
	leaq	16(%rbx), %rdx
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_dma_alloc_coherent
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_6
## %bb.10:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	callq	*(%rax)
	jmp	LBB0_11
LBB0_6:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_cnic_free_dma
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_11:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CNIC_PAGE_SIZE,4,2             ## @CNIC_PAGE_SIZE
	.no_dead_strip	_cnic_alloc_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cnic_alloc_dma
_cnic_alloc_dma:                        ; @cnic_alloc_dma
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x22, x3
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x23, [x0, #8]
	add	w8, w2, w2, lsl #1
	lsl	w0, w8, #2
Lloh0:
	adrp	x24, _GFP_ATOMIC@GOTPAGE
Lloh1:
	ldr	x24, [x24, _GFP_ATOMIC@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_kzalloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_11
; %bb.1:
	add	x2, x0, w21, sxtw #3
	str	x2, [x19, #32]
	str	w21, [x19]
	cmp	w21, #1
	b.lt	LBB0_6
; %bb.2:
	ldr	x0, [x20]
Lloh2:
	adrp	x25, _CNIC_PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x25, [x25, _CNIC_PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x25]
	ldr	w3, [x24]
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #24]
	str	x0, [x8]
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.3:
	mov	x26, #0
	mov	w27, w21
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x26, x26, #1
	cmp	x26, x27
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #32]
	ldr	x0, [x20]
	ldr	w1, [x25]
	add	x2, x8, x26, lsl #2
	ldr	w3, [x24]
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #24]
	lsl	x9, x26, #3
	str	x0, [x8, x9]
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x9]
	cbnz	x8, LBB0_4
	b	LBB0_10
LBB0_6:
	cbz	w22, LBB0_9
; %bb.7:
Lloh4:
	adrp	x8, _CNIC_PAGE_SIZE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CNIC_PAGE_SIZE@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	add	w9, w8, w21, lsl #3
	sub	w9, w9, #1
	neg	w8, w8
	and	w1, w9, w8
	str	w1, [x19, #4]
	ldr	x0, [x20]
	add	x2, x19, #16
	ldr	w3, [x24]
	bl	_dma_alloc_coherent
	str	x0, [x19, #8]
	cbz	x0, LBB0_10
; %bb.8:
	ldr	x8, [x23]
	mov	x0, x20
	mov	x1, x19
	blr	x8
LBB0_9:
	mov	w0, #0
	b	LBB0_12
LBB0_10:
	mov	x0, x20
	mov	x1, x19
	bl	_cnic_free_dma
LBB0_11:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CNIC_PAGE_SIZE,4,2             ; @CNIC_PAGE_SIZE
	.no_dead_strip	_cnic_alloc_dma
.subsections_via_symbols
