	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atl1c_setup_ring_resources
_atl1c_setup_ring_resources:            ## @atl1c_setup_ring_resources
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	80(%rdi), %rbx
	movq	72(%rdi), %r13
	movl	40(%rdi), %eax
	movl	%eax, 16(%rdi)
	movq	_AT_MAX_TRANSMIT_QUEUE@GOTPCREL(%rip), %r14
	cmpl	$2, (%r14)
	movl	(%r13), %ecx
	jl	LBB0_3
## %bb.1:
	leaq	32(%r13), %rdx
	movl	$1, %esi
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, (%rdx)
	incq	%rsi
	movslq	(%r14), %rdi
	addq	$32, %rdx
	cmpq	%rdi, %rsi
	jl	LBB0_2
LBB0_3:
	leal	(%rax,%rcx,2), %edi
	shll	$2, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_kzalloc
	movq	%rax, 16(%r13)
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_15
## %bb.4:
	movl	(%r14), %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jle	LBB0_5
## %bb.6:
	movq	%rbx, %r8
	cmpl	$1, %ecx
	jne	LBB0_8
## %bb.7:
	xorl	%edx, %edx
	jmp	LBB0_10
LBB0_5:
	movq	%r12, %rcx
	jmp	LBB0_13
LBB0_8:
	movl	%ecx, %esi
	andl	$-2, %esi
	leaq	48(%r13), %rdi
	xorl	%edx, %edx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	cltq
	movq	16(%r13), %rbx
	addq	%rax, %rbx
	movq	%rbx, -32(%rdi)
	movslq	-48(%rdi), %rbx
	addq	%rax, %rbx
	movq	%rbx, %rax
	addq	16(%r13), %rax
	movq	%rax, (%rdi)
	movl	-16(%rdi), %eax
	addl	%ebx, %eax
	addq	$2, %rdx
	addq	$64, %rdi
	cmpq	%rdx, %rsi
	jne	LBB0_9
LBB0_10:
	testb	$1, %cl
	je	LBB0_12
## %bb.11:
	cltq
	movq	16(%r13), %rcx
	addq	%rax, %rcx
	shlq	$5, %rdx
	movq	%rcx, 16(%r13,%rdx)
	addl	(%r13,%rdx), %eax
LBB0_12:
	movq	%r12, %rcx
	cltq
	movq	%r8, %rbx
LBB0_13:
	addq	16(%r13), %rax
	movq	%rax, 64(%r15)
	movl	(%r13), %eax
	addl	40(%r15), %eax
	leal	32(,%rax,8), %esi
	movl	%esi, (%r15)
	leaq	4(%r15), %r12
	movl	(%rcx), %ecx
	movq	%rbx, %rdi
	movq	%r12, %rdx
	callq	_dma_alloc_coherent
	movq	%rax, 8(%r15)
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_err
LBB0_15:
	movq	16(%r13), %rdi
	callq	_kfree
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_20:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movl	(%r12), %edi
	movl	$8, %esi
	callq	_roundup
	movl	%eax, %ebx
	movl	%eax, 4(%r13)
	movl	(%r12), %eax
	subl	%eax, %ebx
	cmpl	$0, (%r14)
	jle	LBB0_19
## %bb.17:
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	addl	%ebx, %eax
	movl	%eax, 4(%r13)
	movslq	%ebx, %rbx
	leaq	(,%rbx,4), %rax
	addq	8(%r15), %rax
	movq	%rax, 24(%r13)
	movl	(%r13), %edi
	shll	$2, %edi
	movl	%edi, 8(%r13)
	movl	$8, %esi
	callq	_roundup
	addl	%eax, %ebx
	incq	%r12
	movslq	(%r14), %rcx
	movl	4(%r15), %eax
	addq	$32, %r13
	cmpq	%rcx, %r12
	jl	LBB0_18
LBB0_19:
	addl	%ebx, %eax
	movl	%eax, 44(%r15)
	movslq	%ebx, %rbx
	leaq	(,%rbx,4), %rax
	addq	8(%r15), %rax
	movq	%rax, 56(%r15)
	movl	40(%r15), %edi
	shll	$2, %edi
	movl	%edi, 48(%r15)
	movl	$8, %esi
	callq	_roundup
	addl	%eax, %ebx
	movslq	%ebx, %rax
	addl	4(%r15), %ebx
	movl	%ebx, 20(%r15)
	shlq	$2, %rax
	addq	8(%r15), %rax
	movq	%rax, 32(%r15)
	movl	16(%r15), %edi
	shll	$2, %edi
	movl	%edi, 24(%r15)
	movl	$8, %esi
	callq	_roundup
	xorl	%eax, %eax
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_AT_MAX_TRANSMIT_QUEUE,4,2      ## @AT_MAX_TRANSMIT_QUEUE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not get memory for DMA buffer\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_atl1c_setup_ring_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atl1c_setup_ring_resources
_atl1c_setup_ring_resources:            ; @atl1c_setup_ring_resources
	.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
	ldp	x22, x20, [x0, #72]
	ldr	w8, [x0, #40]
	str	w8, [x0, #16]
Lloh0:
	adrp	x23, _AT_MAX_TRANSMIT_QUEUE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _AT_MAX_TRANSMIT_QUEUE@GOTPAGEOFF]
	ldr	w10, [x23]
	ldr	w9, [x22]
	cmp	w10, #2
	b.lt	LBB0_3
; %bb.1:
	add	x10, x22, #32
	mov	w11, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	str	w9, [x10], #32
	add	x11, x11, #1
	ldrsw	x12, [x23]
	cmp	x11, x12
	b.lt	LBB0_2
LBB0_3:
	add	w8, w8, w9, lsl #1
	lsl	w0, w8, #2
Lloh2:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_kzalloc
	str	x0, [x22, #16]
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_10
; %bb.4:
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.5:
	mov	w11, #0
	add	x9, x22, #16
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x22, #16]
	sxtw	x11, w11
	add	x10, x10, x11
	str	x10, [x9]
	ldursw	x10, [x9, #-16]
	add	x10, x10, x11
	add	x9, x9, #32
	mov	x11, x10
	subs	x8, x8, #1
	b.ne	LBB0_6
	b	LBB0_8
LBB0_7:
	mov	x10, #0
LBB0_8:
	ldr	x8, [x22, #16]
	add	x8, x8, x10
	str	x8, [x19, #64]
	ldr	w8, [x19, #40]
	ldr	w9, [x22]
	add	w8, w9, w8
	lsl	w8, w8, #3
	add	w1, w8, #32
	str	w1, [x19]
	add	x21, x19, #4
	ldr	w3, [x24]
	mov	x0, x20
	mov	x2, x21
	bl	_dma_alloc_coherent
	str	x0, [x19, #8]
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_12
; %bb.9:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_10:
	ldr	x0, [x22, #16]
	bl	_kfree
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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
LBB0_12:
	ldr	w0, [x21]
	mov	w1, #8
	bl	_roundup
	str	w0, [x22, #4]
	ldr	w8, [x21]
	sub	w20, w0, w8
	ldr	w9, [x23]
	cmp	w9, #1
	b.lt	LBB0_15
; %bb.13:
	mov	x21, #0
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	add	w8, w8, w20
	ldr	x9, [x19, #8]
	add	x9, x9, w20, sxtw #2
	str	x9, [x22, #24]
	ldr	w9, [x22]
	lsl	w0, w9, #2
	stp	w8, w0, [x22, #4]
	mov	w1, #8
	bl	_roundup
	add	w20, w0, w20
	add	x21, x21, #1
	ldrsw	x9, [x23]
	ldr	w8, [x19, #4]
	add	x22, x22, #32
	cmp	x21, x9
	b.lt	LBB0_14
LBB0_15:
	add	w8, w8, w20
	ldr	x9, [x19, #8]
	add	x9, x9, w20, sxtw #2
	str	x9, [x19, #56]
	ldr	w9, [x19, #40]
	lsl	w0, w9, #2
	stp	w8, w0, [x19, #44]
	mov	w1, #8
	bl	_roundup
	ldr	w8, [x19, #4]
	add	w9, w0, w20
	add	w8, w8, w9
	ldr	x10, [x19, #8]
	add	x9, x10, w9, sxtw #2
	str	x9, [x19, #32]
	ldr	w9, [x19, #16]
	lsl	w0, w9, #2
	stp	w8, w0, [x19, #20]
	mov	w1, #8
	bl	_roundup
	mov	w0, #0
	b	LBB0_11
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AT_MAX_TRANSMIT_QUEUE,4,2      ; @AT_MAX_TRANSMIT_QUEUE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not get memory for DMA buffer\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_atl1c_setup_ring_resources
.subsections_via_symbols
