	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_eq
_init_eq:                               ## @init_eq
	.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	%r9, %r13
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	(%rsi), %r14
	movq	%rsi, 32(%rdi)
	movl	%edx, (%rdi)
	movl	%ecx, 4(%rdi)
	movq	%r8, 80(%rdi)
	movq	%r9, 72(%rdi)
	callq	_EQ_CONS_IDX_REG_ADDR
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_hinic_hwif_write_reg
	movq	32(%r12), %rbx
	movq	%r12, %rdi
	callq	_EQ_PROD_IDX_REG_ADDR
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_hinic_hwif_write_reg
	xorps	%xmm0, %xmm0
	movups	%xmm0, 56(%r12)
	movq	_HINIC_AEQ@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_5
## %bb.1:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	_HINIC_AEQE_SIZE@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_5:
	movq	_HINIC_CEQ@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_7
## %bb.6:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	_HINIC_CEQE_SIZE@GOTPCREL(%rip), %rax
LBB0_2:
	movq	16(%rbp), %r14
	movq	%r14, %rbx
	shrq	$32, %rbx
	movl	(%rax), %eax
	movl	%eax, 48(%r12)
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_GET_EQ_NUM_PAGES
	movq	%rax, 8(%r12)
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_GET_EQ_NUM_ELEMS_IN_PG
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, 16(%r12)
	movl	%r14d, 20(%r12)
	movl	%ebx, 24(%r12)
	leal	-1(%rax), %ecx
	testl	%ecx, %eax
	jne	LBB0_3
## %bb.9:
	movq	8(%r12), %rax
	movq	_EQ_MAX_PAGES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_11
## %bb.10:
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_8
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_8
LBB0_7:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
LBB0_8:
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_23:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r12, %rdi
	callq	_set_eq_ctrls
	movq	%r12, %rdi
	callq	_eq_update_ci
	movq	%r12, %rdi
	callq	_alloc_eq_pages
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %r13d
	leaq	L_.str.3(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	jmp	LBB0_23
LBB0_13:
	movq	_HINIC_AEQ@GOTPCREL(%rip), %rbx
	cmpl	%r15d, (%rbx)
	jne	LBB0_15
## %bb.14:
	leaq	44(%r12), %rdi
	movq	_eq_irq_work@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_WORK
	jmp	LBB0_17
LBB0_15:
	movq	_HINIC_CEQ@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_17
## %bb.16:
	leaq	40(%r12), %rdi
	movq	_ceq_tasklet@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdx
	callq	_tasklet_init
LBB0_17:
	movq	32(%r12), %rdi
	movl	24(%r12), %esi
	movq	_HINIC_EQ_MSIX_PENDING_LIMIT_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_HINIC_EQ_MSIX_COALESC_TIMER_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_HINIC_EQ_MSIX_LLI_TIMER_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_HINIC_EQ_MSIX_LLI_CREDIT_LIMIT_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_HINIC_EQ_MSIX_RESEND_TIMER_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	callq	_hinic_msix_attr_set
	cmpl	%r15d, (%rbx)
	jne	LBB0_19
## %bb.18:
	leaq	L_.str.4(%rip), %rcx
	movq	_aeq_interrupt@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_19:
	movq	_HINIC_CEQ@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	cmpl	%r15d, (%rax)
	jne	LBB0_23
## %bb.20:
	leaq	L_.str.5(%rip), %rcx
	movq	_ceq_interrupt@GOTPCREL(%rip), %rax
LBB0_21:
	movl	(%rax), %esi
	xorl	%r13d, %r13d
	movl	%r14d, %edi
	xorl	%edx, %edx
	movq	%r12, %r8
	callq	_request_irq
	testl	%eax, %eax
	je	LBB0_23
## %bb.22:
	movl	%eax, %r15d
	leaq	L_.str.6(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	movq	%r12, %rdi
	callq	_free_eq_pages
	movl	%r15d, %r13d
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_HINIC_AEQ,4,2                  ## @HINIC_AEQ
	.comm	_HINIC_AEQE_SIZE,4,2            ## @HINIC_AEQE_SIZE
	.comm	_HINIC_CEQ,4,2                  ## @HINIC_CEQ
	.comm	_HINIC_CEQE_SIZE,4,2            ## @HINIC_CEQE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid EQ type\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"num elements in eq page != power of 2\n"

	.comm	_EQ_MAX_PAGES,8,3               ## @EQ_MAX_PAGES
L_.str.2:                               ## @.str.2
	.asciz	"too many pages for eq\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to allocate pages for eq\n"

	.comm	_eq_irq_work,4,2                ## @eq_irq_work
	.comm	_ceq_tasklet,4,2                ## @ceq_tasklet
	.comm	_HINIC_EQ_MSIX_PENDING_LIMIT_DEFAULT,4,2 ## @HINIC_EQ_MSIX_PENDING_LIMIT_DEFAULT
	.comm	_HINIC_EQ_MSIX_COALESC_TIMER_DEFAULT,4,2 ## @HINIC_EQ_MSIX_COALESC_TIMER_DEFAULT
	.comm	_HINIC_EQ_MSIX_LLI_TIMER_DEFAULT,4,2 ## @HINIC_EQ_MSIX_LLI_TIMER_DEFAULT
	.comm	_HINIC_EQ_MSIX_LLI_CREDIT_LIMIT_DEFAULT,4,2 ## @HINIC_EQ_MSIX_LLI_CREDIT_LIMIT_DEFAULT
	.comm	_HINIC_EQ_MSIX_RESEND_TIMER_DEFAULT,4,2 ## @HINIC_EQ_MSIX_RESEND_TIMER_DEFAULT
	.comm	_aeq_interrupt,4,2              ## @aeq_interrupt
L_.str.4:                               ## @.str.4
	.asciz	"hinic_aeq"

	.comm	_ceq_interrupt,4,2              ## @ceq_interrupt
L_.str.5:                               ## @.str.5
	.asciz	"hinic_ceq"

L_.str.6:                               ## @.str.6
	.asciz	"Failed to request irq for the EQ\n"

	.no_dead_strip	_init_eq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_eq
_init_eq:                               ; @init_eq
	.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	x21, x6
	mov	x23, x5
	mov	x22, x2
	mov	x24, x1
	mov	x20, x0
	ldr	x19, [x1]
	str	x1, [x0, #32]
	stp	w2, w3, [x0]
	stp	x5, x4, [x0, #72]
	bl	_EQ_CONS_IDX_REG_ADDR
	mov	x1, x0
	mov	x0, x24
	mov	w2, #0
	bl	_hinic_hwif_write_reg
	ldr	x24, [x20, #32]
	mov	x0, x20
	bl	_EQ_PROD_IDX_REG_ADDR
	mov	x1, x0
	mov	x0, x24
	mov	w2, #0
	bl	_hinic_hwif_write_reg
	stp	xzr, xzr, [x20, #56]
Lloh0:
	adrp	x24, _HINIC_AEQ@GOTPAGE
Lloh1:
	ldr	x24, [x24, _HINIC_AEQ@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, w22
	b.ne	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _HINIC_AEQE_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HINIC_AEQE_SIZE@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
Lloh4:
	adrp	x8, _HINIC_CEQ@GOTPAGE
Lloh5:
	ldr	x8, [x8, _HINIC_CEQ@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_8
; %bb.3:
Lloh7:
	adrp	x8, _HINIC_CEQE_SIZE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _HINIC_CEQE_SIZE@GOTPAGEOFF]
LBB0_4:
	lsr	x25, x21, #32
	ldr	w8, [x8]
	str	w8, [x20, #48]
	mov	x0, x20
	mov	x1, x23
	bl	_GET_EQ_NUM_PAGES
	str	x0, [x20, #8]
	mov	x0, x20
	mov	x1, x23
	bl	_GET_EQ_NUM_ELEMS_IN_PG
	stp	w0, w21, [x20, #16]
	str	w25, [x20, #24]
	sub	w8, w0, #1
	tst	w0, w8
	b.ne	LBB0_7
; %bb.5:
	ldr	x8, [x20, #8]
Lloh9:
	adrp	x9, _EQ_MAX_PAGES@GOTPAGE
Lloh10:
	ldr	x9, [x9, _EQ_MAX_PAGES@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_11
; %bb.6:
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_7:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
LBB0_9:
	mov	x0, x19
	bl	_dev_err
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_10:
	mov	x0, x23
	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
LBB0_11:
	mov	x0, x20
	bl	_set_eq_ctrls
	mov	x0, x20
	bl	_eq_update_ci
	mov	x0, x20
	bl	_alloc_eq_pages
	cbz	w0, LBB0_13
; %bb.12:
	mov	x23, x0
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_10
LBB0_13:
	ldr	w8, [x24]
	cmp	w8, w22
	b.ne	LBB0_15
; %bb.14:
	add	x0, x20, #44
Lloh23:
	adrp	x8, _eq_irq_work@GOTPAGE
Lloh24:
	ldr	x8, [x8, _eq_irq_work@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	bl	_INIT_WORK
	b	LBB0_17
LBB0_15:
Lloh26:
	adrp	x8, _HINIC_CEQ@GOTPAGE
Lloh27:
	ldr	x8, [x8, _HINIC_CEQ@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_17
; %bb.16:
	add	x0, x20, #40
Lloh29:
	adrp	x8, _ceq_tasklet@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ceq_tasklet@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_tasklet_init
LBB0_17:
	ldr	x0, [x20, #32]
	ldr	w1, [x20, #24]
Lloh32:
	adrp	x8, _HINIC_EQ_MSIX_PENDING_LIMIT_DEFAULT@GOTPAGE
Lloh33:
	ldr	x8, [x8, _HINIC_EQ_MSIX_PENDING_LIMIT_DEFAULT@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
Lloh35:
	adrp	x8, _HINIC_EQ_MSIX_COALESC_TIMER_DEFAULT@GOTPAGE
Lloh36:
	ldr	x8, [x8, _HINIC_EQ_MSIX_COALESC_TIMER_DEFAULT@GOTPAGEOFF]
Lloh37:
	ldr	w3, [x8]
Lloh38:
	adrp	x8, _HINIC_EQ_MSIX_LLI_TIMER_DEFAULT@GOTPAGE
Lloh39:
	ldr	x8, [x8, _HINIC_EQ_MSIX_LLI_TIMER_DEFAULT@GOTPAGEOFF]
Lloh40:
	ldr	w4, [x8]
Lloh41:
	adrp	x8, _HINIC_EQ_MSIX_LLI_CREDIT_LIMIT_DEFAULT@GOTPAGE
Lloh42:
	ldr	x8, [x8, _HINIC_EQ_MSIX_LLI_CREDIT_LIMIT_DEFAULT@GOTPAGEOFF]
Lloh43:
	ldr	w5, [x8]
Lloh44:
	adrp	x8, _HINIC_EQ_MSIX_RESEND_TIMER_DEFAULT@GOTPAGE
Lloh45:
	ldr	x8, [x8, _HINIC_EQ_MSIX_RESEND_TIMER_DEFAULT@GOTPAGEOFF]
Lloh46:
	ldr	w6, [x8]
	bl	_hinic_msix_attr_set
	ldr	w8, [x24]
	cmp	w8, w22
	b.ne	LBB0_19
; %bb.18:
Lloh47:
	adrp	x3, l_.str.4@PAGE
Lloh48:
	add	x3, x3, l_.str.4@PAGEOFF
Lloh49:
	adrp	x8, _aeq_interrupt@GOTPAGE
Lloh50:
	ldr	x8, [x8, _aeq_interrupt@GOTPAGEOFF]
	b	LBB0_21
LBB0_19:
Lloh51:
	adrp	x8, _HINIC_CEQ@GOTPAGE
Lloh52:
	ldr	x8, [x8, _HINIC_CEQ@GOTPAGEOFF]
Lloh53:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_23
; %bb.20:
Lloh54:
	adrp	x3, l_.str.5@PAGE
Lloh55:
	add	x3, x3, l_.str.5@PAGEOFF
Lloh56:
	adrp	x8, _ceq_interrupt@GOTPAGE
Lloh57:
	ldr	x8, [x8, _ceq_interrupt@GOTPAGEOFF]
LBB0_21:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #0
	mov	x4, x20
	bl	_request_irq
	mov	x23, x0
	cbz	w0, LBB0_10
; %bb.22:
Lloh58:
	adrp	x1, l_.str.6@PAGE
Lloh59:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	mov	x0, x20
	bl	_free_eq_pages
	b	LBB0_10
LBB0_23:
	mov	w23, #0
	b	LBB0_10
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGot	Lloh56, Lloh57
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpAdd	Lloh58, Lloh59
	.cfi_endproc
                                        ; -- End function
	.comm	_HINIC_AEQ,4,2                  ; @HINIC_AEQ
	.comm	_HINIC_AEQE_SIZE,4,2            ; @HINIC_AEQE_SIZE
	.comm	_HINIC_CEQ,4,2                  ; @HINIC_CEQ
	.comm	_HINIC_CEQE_SIZE,4,2            ; @HINIC_CEQE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid EQ type\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"num elements in eq page != power of 2\n"

	.comm	_EQ_MAX_PAGES,8,3               ; @EQ_MAX_PAGES
l_.str.2:                               ; @.str.2
	.asciz	"too many pages for eq\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to allocate pages for eq\n"

	.comm	_eq_irq_work,4,2                ; @eq_irq_work
	.comm	_ceq_tasklet,4,2                ; @ceq_tasklet
	.comm	_HINIC_EQ_MSIX_PENDING_LIMIT_DEFAULT,4,2 ; @HINIC_EQ_MSIX_PENDING_LIMIT_DEFAULT
	.comm	_HINIC_EQ_MSIX_COALESC_TIMER_DEFAULT,4,2 ; @HINIC_EQ_MSIX_COALESC_TIMER_DEFAULT
	.comm	_HINIC_EQ_MSIX_LLI_TIMER_DEFAULT,4,2 ; @HINIC_EQ_MSIX_LLI_TIMER_DEFAULT
	.comm	_HINIC_EQ_MSIX_LLI_CREDIT_LIMIT_DEFAULT,4,2 ; @HINIC_EQ_MSIX_LLI_CREDIT_LIMIT_DEFAULT
	.comm	_HINIC_EQ_MSIX_RESEND_TIMER_DEFAULT,4,2 ; @HINIC_EQ_MSIX_RESEND_TIMER_DEFAULT
	.comm	_aeq_interrupt,4,2              ; @aeq_interrupt
l_.str.4:                               ; @.str.4
	.asciz	"hinic_aeq"

	.comm	_ceq_interrupt,4,2              ; @ceq_interrupt
l_.str.5:                               ; @.str.5
	.asciz	"hinic_ceq"

l_.str.6:                               ; @.str.6
	.asciz	"Failed to request irq for the EQ\n"

	.no_dead_strip	_init_eq
.subsections_via_symbols
