	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ep93xx_alloc_buffers
_ep93xx_alloc_buffers:                  ## @ep93xx_alloc_buffers
	.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
	movq	32(%rdi), %rax
	movq	(%rax), %rdi
	leaq	24(%rbx), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	$4, %esi
	callq	_dma_alloc_coherent
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, (%rbx)
	movl	$1, %ecx
	testq	%rax, %rax
	je	LBB0_15
## %bb.1:
	movq	_RX_QUEUE_ENTRIES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_6
## %bb.2:
	xorl	%ebx, %ebx
	movl	$8, %r15d
	movq	_PKT_BUF_SIZE@GOTPCREL(%rip), %r14
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %r13
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	(%r14), %edx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_dma_map_single
	movq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	16(%rcx), %rax
	movq	%r13, (%rax,%r12,8)
	movq	(%rcx), %rax
	movq	8(%rax), %rax
	movq	%rbx, (%rax,%r15)
	movq	_PKT_BUF_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	orl	%ebx, %ecx
	movl	%ecx, -8(%rax,%r15)
	incq	%r12
	movq	_RX_QUEUE_ENTRIES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addl	$65536, %ebx                    ## imm = 0x10000
	addq	$16, %r15
	cmpq	%rax, %r12
	jl	LBB0_3
LBB0_6:
	movq	_TX_QUEUE_ENTRIES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_14
## %bb.7:
	xorl	%r15d, %r15d
	movq	_PKT_BUF_SIZE@GOTPCREL(%rip), %r12
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%rax, %r13
	movl	(%r12), %edx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_dma_map_single
	movq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rax
	movq	%r13, (%rax,%r15,8)
	movq	(%rcx), %rax
	movq	(%rax), %rax
	movq	%rbx, (%rax,%r15,8)
	incq	%r15
	movq	_TX_QUEUE_ENTRIES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r15
	jl	LBB0_8
LBB0_14:
	xorl	%ecx, %ecx
	jmp	LBB0_15
LBB0_12:
	movq	%r13, %rdi
	callq	_kfree
LBB0_13:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ep93xx_free_buffers
	movl	$1, %ecx
LBB0_15:
	movl	%ecx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_RX_QUEUE_ENTRIES,4,2           ## @RX_QUEUE_ENTRIES
	.comm	_PKT_BUF_SIZE,4,2               ## @PKT_BUF_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_TX_QUEUE_ENTRIES,4,2           ## @TX_QUEUE_ENTRIES
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.no_dead_strip	_ep93xx_alloc_buffers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ep93xx_alloc_buffers
_ep93xx_alloc_buffers:                  ; @ep93xx_alloc_buffers
	.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	x19, x0
	ldr	x8, [x0, #32]
	ldr	x20, [x8]
	add	x2, x0, #24
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x20
	mov	w1, #4
	bl	_dma_alloc_coherent
	str	x0, [x19]
	cbz	x0, LBB0_14
; %bb.1:
Lloh3:
	adrp	x24, _RX_QUEUE_ENTRIES@GOTPAGE
Lloh4:
	ldr	x24, [x24, _RX_QUEUE_ENTRIES@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.2:
	mov	x25, #0
	mov	w26, #0
	mov	x27, #0
Lloh5:
	adrp	x28, _PKT_BUF_SIZE@GOTPAGE
Lloh6:
	ldr	x28, [x28, _PKT_BUF_SIZE@GOTPAGEOFF]
Lloh7:
	adrp	x23, _DMA_FROM_DEVICE@GOTPAGE
Lloh8:
	ldr	x23, [x23, _DMA_FROM_DEVICE@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x28]
Lloh9:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_13
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x21, x0
	ldr	w2, [x28]
	ldr	w3, [x23]
	mov	x0, x20
	mov	x1, x21
	bl	_dma_map_single
	mov	x22, x0
	mov	x0, x20
	mov	x1, x22
	bl	_dma_mapping_error
	cbnz	x0, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #16]
	str	x21, [x8, x27, lsl #3]
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	add	x8, x8, x25
	str	x22, [x8, #8]
	ldr	w9, [x28]
	orr	w9, w9, w26
	str	w9, [x8]
	add	x27, x27, #1
	ldrsw	x8, [x24]
	add	w26, w26, #16, lsl #12          ; =65536
	add	x25, x25, #16
	cmp	x27, x8
	b.lt	LBB0_3
LBB0_6:
Lloh12:
	adrp	x23, _TX_QUEUE_ENTRIES@GOTPAGE
Lloh13:
	ldr	x23, [x23, _TX_QUEUE_ENTRIES@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.7:
	mov	x24, #0
Lloh14:
	adrp	x25, _PKT_BUF_SIZE@GOTPAGE
Lloh15:
	ldr	x25, [x25, _PKT_BUF_SIZE@GOTPAGEOFF]
Lloh16:
	adrp	x26, _DMA_TO_DEVICE@GOTPAGE
Lloh17:
	ldr	x26, [x26, _DMA_TO_DEVICE@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x25]
Lloh18:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x21, x0
	ldr	w2, [x25]
	ldr	w3, [x26]
	mov	x0, x20
	mov	x1, x21
	bl	_dma_map_single
	mov	x22, x0
	mov	x0, x20
	mov	x1, x22
	bl	_dma_mapping_error
	cbnz	x0, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x19, #8]
	lsl	x9, x24, #3
	str	x21, [x8, x9]
	ldr	x8, [x19]
	ldr	x8, [x8]
	str	x22, [x8, x9]
	add	x24, x24, #1
	ldrsw	x8, [x23]
	cmp	x24, x8
	b.lt	LBB0_8
LBB0_11:
	mov	w0, #0
	b	LBB0_15
LBB0_12:
	mov	x0, x21
	bl	_kfree
LBB0_13:
	mov	x0, x19
	bl	_ep93xx_free_buffers
LBB0_14:
	mov	w0, #1
LBB0_15:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_RX_QUEUE_ENTRIES,4,2           ; @RX_QUEUE_ENTRIES
	.comm	_PKT_BUF_SIZE,4,2               ; @PKT_BUF_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_TX_QUEUE_ENTRIES,4,2           ; @TX_QUEUE_ENTRIES
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.no_dead_strip	_ep93xx_alloc_buffers
.subsections_via_symbols
