	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ltq_etop_hw_init
_ltq_etop_hw_init:                      ## @ltq_etop_hw_init
	.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
	callq	_netdev_priv
	movq	%rax, %r14
	movq	_PMU_PPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ltq_pmu_enable
	movq	16(%r14), %rax
	movl	(%rax), %edx
	cmpl	$128, %edx
	je	LBB0_1
## %bb.2:
	cmpl	$129, %edx
	jne	LBB0_20
## %bb.3:
	movq	_ETOP_MII_NORMAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_1:
	movq	_ETOP_MII_REVERSE@GOTPCREL(%rip), %rax
LBB0_4:
	movq	_ETOP_MII_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	(%rax), %esi
	movq	_LTQ_ETOP_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_ltq_etop_w32_mask
	movq	_PPE32_CGEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_LQ_PPE32_ENET_MAC_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ltq_etop_w32
	movq	_DMA_PORT_ETOP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ltq_dma_init_port
	movq	_MAX_DMA_CHAN@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_10
## %bb.5:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_14 Depth 2
	movq	_LTQ_DMA_CH0_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	addl	%ebx, %r13d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	8(%r15), %r12
	leaq	(%rbx,%rbx,4), %r14
	leaq	(%r12,%r14,8), %rax
	addq	$8, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	%ebx, 8(%r12,%r14,8)
	movl	%ebx, (%r12,%r14,8)
	movq	(%r15), %rax
	movq	%rax, 32(%r12,%r14,8)
	movl	%ebx, %edi
	callq	_IS_TX
	testq	%rax, %rax
	je	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_ltq_dma_alloc_tx
	movq	_ltq_etop_dma_irq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	xorl	%edx, %edx
	leaq	L_.str.1(%rip), %rcx
	movq	%r15, %r8
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	%ebx, %edi
	callq	_IS_RX
	testq	%rax, %rax
	je	LBB0_9
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	%r15, %rdi
	callq	_ltq_dma_alloc_rx
	leaq	(%r12,%r14,8), %r13
	addq	$16, %r13
	movq	$0, 16(%r12,%r14,8)
	movq	_LTQ_DESC_NUM@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jle	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_6 Depth=1
	leaq	(%r12,%r14,8), %r15
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	callq	_ltq_etop_alloc_skb
	testq	%rax, %rax
	jne	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=2
	movq	(%r13), %rax
	incq	%rax
	movq	%rax, (%r13)
	movq	_LTQ_DESC_NUM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_14
LBB0_16:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	$0, (%r13)
	movq	_ltq_etop_dma_irq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %edi
	xorl	%edx, %edx
	leaq	L_.str.2(%rip), %rcx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	callq	_request_irq
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	%r13d, 24(%r12,%r14,8)
	incq	%rbx
	movq	_MAX_DMA_CHAN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jl	LBB0_6
LBB0_10:
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_20:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_netdev_err
	movq	_ENOTSUPP@GOTPCREL(%rip), %rcx
	jmp	LBB0_18
LBB0_17:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_18:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PMU_PPE,4,2                    ## @PMU_PPE
	.comm	_ETOP_MII_MASK,4,2              ## @ETOP_MII_MASK
	.comm	_ETOP_MII_REVERSE,4,2           ## @ETOP_MII_REVERSE
	.comm	_LTQ_ETOP_CFG,4,2               ## @LTQ_ETOP_CFG
	.comm	_ETOP_MII_NORMAL,4,2            ## @ETOP_MII_NORMAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown mii mode %d\n"

	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.comm	_PPE32_CGEN,4,2                 ## @PPE32_CGEN
	.comm	_LQ_PPE32_ENET_MAC_CFG,4,2      ## @LQ_PPE32_ENET_MAC_CFG
	.comm	_DMA_PORT_ETOP,4,2              ## @DMA_PORT_ETOP
	.comm	_MAX_DMA_CHAN,4,2               ## @MAX_DMA_CHAN
	.comm	_LTQ_DMA_CH0_INT,4,2            ## @LTQ_DMA_CH0_INT
	.comm	_ltq_etop_dma_irq,4,2           ## @ltq_etop_dma_irq
L_.str.1:                               ## @.str.1
	.asciz	"etop_tx"

	.comm	_LTQ_DESC_NUM,8,3               ## @LTQ_DESC_NUM
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"etop_rx"

	.no_dead_strip	_ltq_etop_hw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ltq_etop_hw_init
_ltq_etop_hw_init:                      ; @ltq_etop_hw_init
	.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	x20, x0
	bl	_netdev_priv
	mov	x19, x0
Lloh0:
	adrp	x8, _PMU_PPE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PMU_PPE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_ltq_pmu_enable
	ldr	x8, [x19, #16]
	ldr	w2, [x8]
	cmp	w2, #128
	b.eq	LBB0_3
; %bb.1:
	cmp	w2, #129
	b.ne	LBB0_16
; %bb.2:
Lloh3:
	adrp	x8, _ETOP_MII_NORMAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ETOP_MII_NORMAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _ETOP_MII_REVERSE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ETOP_MII_REVERSE@GOTPAGEOFF]
LBB0_4:
Lloh7:
	adrp	x9, _ETOP_MII_MASK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ETOP_MII_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x9]
	ldr	w1, [x8]
Lloh10:
	adrp	x8, _LTQ_ETOP_CFG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _LTQ_ETOP_CFG@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	bl	_ltq_etop_w32_mask
Lloh13:
	adrp	x8, _PPE32_CGEN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PPE32_CGEN@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x8, _LQ_PPE32_ENET_MAC_CFG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _LQ_PPE32_ENET_MAC_CFG@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	bl	_ltq_etop_w32
Lloh19:
	adrp	x8, _DMA_PORT_ETOP@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DMA_PORT_ETOP@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_ltq_dma_init_port
Lloh22:
	adrp	x26, _MAX_DMA_CHAN@GOTPAGE
Lloh23:
	ldr	x26, [x26, _MAX_DMA_CHAN@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.5:
	mov	x20, #0
Lloh24:
	adrp	x27, _LTQ_DMA_CH0_INT@GOTPAGE
Lloh25:
	ldr	x27, [x27, _LTQ_DMA_CH0_INT@GOTPAGEOFF]
	mov	w28, #40
Lloh26:
	adrp	x21, _LTQ_DESC_NUM@GOTPAGE
Lloh27:
	ldr	x21, [x21, _LTQ_DESC_NUM@GOTPAGEOFF]
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldr	w8, [x27]
	add	w23, w8, w20
	ldp	x8, x22, [x19]
	madd	x24, x20, x28, x22
	mov	x25, x24
	str	w20, [x25, #8]!
	str	w20, [x24]
	str	x8, [x24, #32]
	mov	x0, x20
	bl	_IS_TX
	cbz	x0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x25
	bl	_ltq_dma_alloc_tx
Lloh28:
	adrp	x8, _ltq_etop_dma_irq@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ltq_etop_dma_irq@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x23
	mov	w2, #0
Lloh31:
	adrp	x3, l_.str.1@PAGE
Lloh32:
	add	x3, x3, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	bl	_IS_RX
	cbz	x0, LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x25
	bl	_ltq_dma_alloc_rx
	madd	x25, x20, x28, x22
	str	xzr, [x25, #16]!
	ldr	x8, [x21]
	cmp	x8, #1
	b.lt	LBB0_12
LBB0_10:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x24
	bl	_ltq_etop_alloc_skb
	cbnz	x0, LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	x8, [x25]
	add	x8, x8, #1
	str	x8, [x25]
	ldr	x9, [x21]
	cmp	x8, x9
	b.lt	LBB0_10
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=1
	str	xzr, [x25]
Lloh33:
	adrp	x8, _ltq_etop_dma_irq@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ltq_etop_dma_irq@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x23
	mov	w2, #0
Lloh36:
	adrp	x3, l_.str.2@PAGE
Lloh37:
	add	x3, x3, l_.str.2@PAGEOFF
LBB0_13:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x4, x19
	bl	_request_irq
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	madd	x8, x20, x28, x22
	str	w23, [x8, #24]
	add	x20, x20, #1
	ldrsw	x8, [x26]
	cmp	x20, x8
	b.lt	LBB0_6
LBB0_15:
	mov	w0, #0
	b	LBB0_19
LBB0_16:
Lloh38:
	adrp	x1, l_.str@PAGE
Lloh39:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_netdev_err
Lloh40:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:
Lloh42:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh43:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_19:
	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	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_PMU_PPE,4,2                    ; @PMU_PPE
	.comm	_ETOP_MII_MASK,4,2              ; @ETOP_MII_MASK
	.comm	_ETOP_MII_REVERSE,4,2           ; @ETOP_MII_REVERSE
	.comm	_LTQ_ETOP_CFG,4,2               ; @LTQ_ETOP_CFG
	.comm	_ETOP_MII_NORMAL,4,2            ; @ETOP_MII_NORMAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown mii mode %d\n"

	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.comm	_PPE32_CGEN,4,2                 ; @PPE32_CGEN
	.comm	_LQ_PPE32_ENET_MAC_CFG,4,2      ; @LQ_PPE32_ENET_MAC_CFG
	.comm	_DMA_PORT_ETOP,4,2              ; @DMA_PORT_ETOP
	.comm	_MAX_DMA_CHAN,4,2               ; @MAX_DMA_CHAN
	.comm	_LTQ_DMA_CH0_INT,4,2            ; @LTQ_DMA_CH0_INT
	.comm	_ltq_etop_dma_irq,4,2           ; @ltq_etop_dma_irq
l_.str.1:                               ; @.str.1
	.asciz	"etop_tx"

	.comm	_LTQ_DESC_NUM,8,3               ; @LTQ_DESC_NUM
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"etop_rx"

	.no_dead_strip	_ltq_etop_hw_init
.subsections_via_symbols
