	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atl2_setup_ring_resources
_atl2_setup_ring_resources:             ## @atl2_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	64(%rdi), %rdi
	movl	8(%rbx), %eax
	movl	12(%rbx), %ecx
	shll	$2, %eax
	leal	(%rcx,%rcx,2), %ecx
	addl	4(%rbx), %eax
	shll	$9, %ecx
	leal	(%rcx,%rax), %esi
	addl	$141, %esi
	movl	%esi, (%rbx)
	leaq	16(%rbx), %rdx
	callq	_pci_alloc_consistent
	movl	%eax, 56(%rbx)
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	4(%rbx), %r8d
	movl	16(%rbx), %ecx
	movl	%ecx, %esi
	andl	$7, %esi
	movl	$8, %edi
	movl	$8, %edx
	subl	%esi, %edx
	testl	%esi, %esi
	cmovel	%esi, %edx
	addl	%edx, %ecx
	movl	%ecx, 20(%rbx)
	addl	%eax, %edx
	movslq	%edx, %rax
	addl	%r8d, %ecx
	movl	%ecx, %edx
	andl	$7, %edx
	subl	%edx, %edi
	testl	%edx, %edx
	cmovel	%edx, %edi
	movq	%rax, 48(%rbx)
	addl	%edi, %ecx
	movl	%ecx, 24(%rbx)
	addl	%r8d, %edi
	movslq	%edi, %rdx
	leaq	(%rax,%rdx,4), %rax
	movq	%rax, 32(%rbx)
	movslq	8(%rbx), %rdx
	leaq	(,%rdx,4), %rsi
	addl	%ecx, %esi
	movl	%esi, %ecx
	andl	$127, %ecx
	movl	$128, %edi
	subl	%ecx, %edi
	testl	%ecx, %ecx
	cmovel	%ecx, %edi
	xorl	%ecx, %ecx
	cmpl	$8, %edi
	setb	%cl
	shll	$7, %ecx
	addl	%edi, %ecx
	addl	$-8, %ecx
	addl	%ecx, %esi
	movl	%esi, 28(%rbx)
	movslq	%ecx, %rcx
	leaq	(%rcx,%rdx,4), %rcx
	leaq	(%rax,%rcx,4), %rax
	movq	%rax, 40(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_atl2_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 atl2_setup_ring_resources
_atl2_setup_ring_resources:             ; @atl2_setup_ring_resources
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x0, [x0, #64]
	ldp	w8, w9, [x19, #4]
	ldr	w10, [x19, #12]
	mov	w11, #1536
	add	w8, w8, w9, lsl #2
	madd	w8, w10, w11, w8
	add	w1, w8, #141
	str	w1, [x19]
	add	x2, x19, #16
	bl	_pci_alloc_consistent
	str	w0, [x19, #56]
	cbz	w0, LBB0_2
; %bb.1:
	mov	x8, x0
	mov	w0, #0
	ldr	w9, [x19, #16]
	ands	w10, w9, #0x7
	mov	w11, #8
	sub	w10, w11, w10
	tst	w9, #0x7
	csel	w10, wzr, w10, eq
	ldp	w12, w13, [x19, #4]
	add	w9, w10, w9
	add	w14, w9, w12
	ands	w15, w14, #0x7
	sub	w11, w11, w15
	tst	w14, #0x7
	csel	w11, wzr, w11, eq
	lsl	w13, w13, #2
	add	w14, w11, w14
	add	w15, w14, w13
	ands	w16, w15, #0x7f
	mov	w17, #128
	sub	w16, w17, w16
	tst	w15, #0x7f
	add	w8, w10, w8
	sxtw	x8, w8
	str	x8, [x19, #48]
	stp	w9, w14, [x19, #20]
	add	w9, w11, w12
	add	x8, x8, w9, sxtw #2
	csel	w9, wzr, w16, eq
	mov	w10, #120
	mov	w11, #-8
	cmp	w9, #7
	csel	w10, w11, w10, hi
	add	w9, w10, w9
	add	w10, w9, w15
	str	w10, [x19, #28]
	add	w9, w9, w13
	add	x9, x8, w9, sxtw #2
	stp	x8, x9, [x19, #32]
	b	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_atl2_setup_ring_resources
.subsections_via_symbols
