	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stmmac_init_dma_engine
_stmmac_init_dma_engine:                ## @stmmac_init_dma_engine
	.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, %r14
	movq	16(%rdi), %rax
	movq	(%rax), %r15
	movq	8(%rax), %rsi
	movq	%r15, %rdi
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	callq	_max
	movq	%rax, %r12
	movq	16(%r14), %rax
	movq	16(%rax), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	cmpl	$0, (%rax)
	je	LBB0_2
## %bb.3:
	cmpq	$0, 48(%r14)
	je	LBB0_4
## %bb.5:
	movq	(%r14), %rax
	movq	_STMMAC_RING_MODE@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	sete	%bl
	jmp	LBB0_6
LBB0_2:
	movl	40(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_19
LBB0_4:
	xorl	%ebx, %ebx
LBB0_6:
	movl	8(%r14), %esi
	movq	%r14, %rdi
	callq	_stmmac_reset
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r13d
	movl	40(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_19
LBB0_8:
	movl	8(%r14), %esi
	movq	16(%r14), %rax
	movq	16(%rax), %rdx
	movq	%r14, %rdi
	movl	%ebx, %ecx
	callq	_stmmac_dma_init
	movq	16(%r14), %rax
	movq	24(%rax), %rdx
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.9:
	movl	8(%r14), %esi
	movq	%r14, %rdi
	callq	_stmmac_axi
LBB0_10:
	testq	%r12, %r12
	je	LBB0_13
## %bb.11:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	8(%r14), %esi
	movq	16(%r14), %rax
	movq	16(%rax), %rdx
	movq	%r14, %rdi
	movq	%rbx, %rcx
	callq	_stmmac_init_chan
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_12
LBB0_13:
	testq	%r15, %r15
	je	LBB0_16
## %bb.14:
	movl	$8, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r14), %r13
	movl	8(%r14), %esi
	movq	16(%r14), %rax
	movq	16(%rax), %rdx
	movq	(%r13,%r12), %rcx
	movq	%r14, %rdi
	movq	%rbx, %r8
	callq	_stmmac_init_rx_chan
	movq	_DMA_RX_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdx
	shlq	$2, %rdx
	addq	(%r13,%r12), %rdx
	movq	%rdx, -8(%r13,%r12)
	movl	8(%r14), %esi
	movq	%r14, %rdi
	movq	%rbx, %rcx
	callq	_stmmac_set_rx_tail_ptr
	incq	%rbx
	addq	$16, %r12
	cmpq	%rbx, %r15
	jne	LBB0_15
LBB0_16:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	xorl	%r13d, %r13d
	testq	%r12, %r12
	je	LBB0_19
## %bb.17:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r14), %r15
	movl	8(%r14), %esi
	movq	16(%r14), %rax
	movq	16(%rax), %rdx
	movl	4(%r15,%rbx,8), %ecx
	movq	%r14, %rdi
	movq	%rbx, %r8
	callq	_stmmac_init_tx_chan
	movl	4(%r15,%rbx,8), %edx
	movl	%edx, (%r15,%rbx,8)
	movl	8(%r14), %esi
	movq	%r14, %rdi
	movq	%rbx, %rcx
	callq	_stmmac_set_tx_tail_ptr
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_18
LBB0_19:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid DMA configuration\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_STMMAC_RING_MODE,8,3           ## @STMMAC_RING_MODE
L_.str.1:                               ## @.str.1
	.asciz	"Failed to reset the dma\n"

	.comm	_DMA_RX_SIZE,4,2                ## @DMA_RX_SIZE
	.no_dead_strip	_stmmac_init_dma_engine
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stmmac_init_dma_engine
_stmmac_init_dma_engine:                ; @stmmac_init_dma_engine
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldp	x21, x20, [x8]
	mov	x0, x21
	mov	x1, x20
	bl	_max
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	w8, [x8]
	cbz	w8, LBB0_4
; %bb.2:
	mov	x22, x0
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _STMMAC_RING_MODE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _STMMAC_RING_MODE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w23, eq
	b	LBB0_6
LBB0_4:
	ldr	w0, [x19, #40]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_20
LBB0_5:
	mov	w23, #0
LBB0_6:
	ldr	w1, [x19, #8]
	mov	x0, x19
	bl	_stmmac_reset
	cbz	w0, LBB0_8
; %bb.7:
	mov	x24, x0
	ldr	w0, [x19, #40]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_20
LBB0_8:
	ldr	w1, [x19, #8]
	ldr	x8, [x19, #16]
	ldr	x2, [x8, #16]
	mov	x0, x19
	mov	x3, x23
	bl	_stmmac_dma_init
	ldr	x8, [x19, #16]
	ldr	x2, [x8, #24]
	cbz	x2, LBB0_10
; %bb.9:
	ldr	w1, [x19, #8]
	mov	x0, x19
	bl	_stmmac_axi
LBB0_10:
	cbz	x22, LBB0_13
; %bb.11:
	mov	x23, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x19, #8]
	ldr	x8, [x19, #16]
	ldr	x2, [x8, #16]
	mov	x0, x19
	mov	x3, x23
	bl	_stmmac_init_chan
	add	x23, x23, #1
	cmp	x22, x23
	b.ne	LBB0_12
LBB0_13:
	cbz	x21, LBB0_16
; %bb.14:
	mov	x23, #0
	mov	x22, #0
Lloh10:
	adrp	x24, _DMA_RX_SIZE@GOTPAGE
Lloh11:
	ldr	x24, [x24, _DMA_RX_SIZE@GOTPAGEOFF]
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	ldr	w1, [x19, #8]
	ldr	x9, [x19, #16]
	ldr	x2, [x9, #16]
	add	x25, x8, x23
	ldr	x3, [x25, #8]
	mov	x0, x19
	mov	x4, x22
	bl	_stmmac_init_rx_chan
	ldr	x8, [x25, #8]
	ldrsw	x9, [x24]
	add	x2, x8, x9, lsl #2
	str	x2, [x25]
	ldr	w1, [x19, #8]
	mov	x0, x19
	mov	x3, x22
	bl	_stmmac_set_rx_tail_ptr
	add	x22, x22, #1
	add	x23, x23, #16
	cmp	x21, x22
	b.ne	LBB0_15
LBB0_16:
	cbz	x20, LBB0_19
; %bb.17:
	mov	x22, #0
	mov	x21, #0
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x19, #8]
	ldp	x9, x8, [x19, #16]
	ldr	x2, [x9, #16]
	add	x23, x8, x22
	ldr	w3, [x23, #4]
	mov	x0, x19
	mov	x4, x21
	bl	_stmmac_init_tx_chan
	ldr	w2, [x23, #4]
	str	w2, [x23]
	ldr	w1, [x19, #8]
	mov	x0, x19
	mov	x3, x21
	bl	_stmmac_set_tx_tail_ptr
	add	x21, x21, #1
	add	x22, x22, #8
	cmp	x20, x21
	b.ne	LBB0_18
LBB0_19:
	mov	w24, #0
LBB0_20:
	mov	x0, x24
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid DMA configuration\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_STMMAC_RING_MODE,8,3           ; @STMMAC_RING_MODE
l_.str.1:                               ; @.str.1
	.asciz	"Failed to reset the dma\n"

	.comm	_DMA_RX_SIZE,4,2                ; @DMA_RX_SIZE
	.no_dead_strip	_stmmac_init_dma_engine
.subsections_via_symbols
