	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_sd7220_init                ## -- Begin function qib_sd7220_init
	.p2align	4, 0x90
_qib_sd7220_init:                       ## @qib_sd7220_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_kr_ibserdesctrl@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_qib_read_kreg64
	testb	$1, %al
	jne	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_qib_ibsd_reset
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_qib_sd_trimdone_monitor
LBB0_2:
	movq	_SD7220_FW_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	16(%r15), %rdx
	leaq	-32(%rbp), %rdi
	callq	_request_firmware
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_qib_dev_err
	jmp	LBB0_27
LBB0_4:
	movl	8(%r15), %edi
	movq	-32(%rbp), %rsi
	callq	_qib_ibsd_ucode_loaded
	testl	%eax, %eax
	js	LBB0_26
## %bb.5:
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_qib_sd_early
	testl	%eax, %eax
	js	LBB0_6
## %bb.8:
	testl	%r14d, %r14d
	jne	LBB0_11
## %bb.9:
	movq	%r15, %rdi
	callq	_qib_sd_dactrim
	testl	%eax, %eax
	js	LBB0_10
LBB0_11:
	movq	%r15, %rdi
	callq	_qib_internal_presets
	testl	%eax, %eax
	js	LBB0_12
## %bb.13:
	movq	%r15, %rdi
	movl	$128, %esi
	callq	_qib_sd_trimself
	testl	%eax, %eax
	js	LBB0_14
## %bb.15:
	testl	%r14d, %r14d
	je	LBB0_16
LBB0_25:
	movq	%r15, %rdi
	callq	_qib_sd_setvals
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jns	LBB0_27
	jmp	LBB0_26
LBB0_6:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_7
LBB0_12:
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_7
LBB0_14:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_7
LBB0_10:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_7
LBB0_16:
	movq	-32(%rbp), %rsi
	movq	%r15, %rdi
	callq	_qib_sd7220_ib_load
	testl	%eax, %eax
	js	LBB0_17
## %bb.18:
	movl	%eax, %ebx
	movq	-32(%rbp), %rsi
	movq	%r15, %rdi
	callq	_qib_sd7220_ib_vfy
	cmpl	%ebx, %eax
	jne	LBB0_19
## %bb.20:
	xorl	%edi, %edi
	callq	_START_EQ1
	movq	%r15, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	movl	$56, %ecx
	callq	_ibsd_mod_allchnls
	testl	%eax, %eax
	js	LBB0_21
## %bb.22:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_qib_ibsd_reset
	movq	%r15, %rdi
	callq	_qib_sd_trimdone_poll
	movl	%eax, %ebx
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_qib_ibsd_reset
	testl	%ebx, %ebx
	je	LBB0_23
## %bb.24:
	leaq	L_.str.9(%rip), %rsi
	movq	%r15, %rdi
	callq	_qib_sd_trimdone_monitor
	movq	(%r15), %rax
	movl	$1, (%rax)
	jmp	LBB0_25
LBB0_17:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_7
LBB0_19:
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_7
LBB0_21:
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_7
LBB0_23:
	leaq	L_.str.8(%rip), %rsi
LBB0_7:
	movq	%r15, %rdi
	callq	_qib_dev_err
LBB0_26:
	movl	$1, %ebx
LBB0_27:
	movq	%r15, %rdi
	movl	$-1, %esi
	callq	_set_7220_relock_poll
	movq	-32(%rbp), %rdi
	callq	_release_firmware
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_kr_ibserdesctrl,4,2            ## @kr_ibserdesctrl
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Driver-reload"

	.comm	_SD7220_FW_NAME,4,2             ## @SD7220_FW_NAME
L_.str.1:                               ## @.str.1
	.asciz	"Failed to load IB SERDES image\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to set IB SERDES early defaults\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed IB SERDES DAC trim\n"

L_.str.4:                               ## @.str.4
	.asciz	"Failed to set IB SERDES presets\n"

L_.str.5:                               ## @.str.5
	.asciz	"Failed to set IB SERDES TRIMSELF\n"

L_.str.6:                               ## @.str.6
	.asciz	"SERDES PRAM VFY failed\n"

L_.str.7:                               ## @.str.7
	.asciz	"Failed clearing START_EQ1\n"

L_.str.8:                               ## @.str.8
	.asciz	"No TRIMDONE seen\n"

L_.str.9:                               ## @.str.9
	.asciz	"First-reset"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_sd7220_init                ; -- Begin function qib_sd7220_init
	.p2align	2
_qib_sd7220_init:                       ; @qib_sd7220_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _kr_ibserdesctrl@GOTPAGE
Lloh1:
	ldr	x8, [x8, _kr_ibserdesctrl@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_qib_read_kreg64
	tbnz	w0, #0, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #1
	bl	_qib_ibsd_reset
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_qib_sd_trimdone_monitor
LBB0_2:
Lloh5:
	adrp	x8, _SD7220_FW_NAME@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SD7220_FW_NAME@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	ldr	x2, [x19, #16]
	add	x0, sp, #8
	bl	_request_firmware
	cbz	w0, LBB0_4
; %bb.3:
	mov	x20, x0
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_qib_dev_err
	b	LBB0_28
LBB0_4:
	ldr	w0, [x19, #8]
	ldr	x1, [sp, #8]
	bl	_qib_ibsd_ucode_loaded
	tbnz	w0, #31, LBB0_27
; %bb.5:
	mov	x20, x0
	mov	x0, x19
	bl	_qib_sd_early
	tbnz	w0, #31, LBB0_13
; %bb.6:
	cbnz	w20, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_qib_sd_dactrim
	tbnz	w0, #31, LBB0_16
LBB0_8:
	mov	x0, x19
	bl	_qib_internal_presets
	tbnz	w0, #31, LBB0_14
; %bb.9:
	mov	x0, x19
	mov	w1, #128
	bl	_qib_sd_trimself
	tbnz	w0, #31, LBB0_15
; %bb.10:
	cbz	w20, LBB0_17
LBB0_11:
	mov	x0, x19
	bl	_qib_sd_setvals
	tbnz	x0, #63, LBB0_27
; %bb.12:
	mov	w20, #0
	b	LBB0_28
LBB0_13:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_26
LBB0_14:
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_26
LBB0_15:
Lloh14:
	adrp	x1, l_.str.5@PAGE
Lloh15:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_26
LBB0_16:
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_26
LBB0_17:
	ldr	x1, [sp, #8]
	mov	x0, x19
	bl	_qib_sd7220_ib_load
	tbnz	w0, #31, LBB0_22
; %bb.18:
	mov	x20, x0
	ldr	x1, [sp, #8]
	mov	x0, x19
	bl	_qib_sd7220_ib_vfy
	cmp	w0, w20
	b.ne	LBB0_23
; %bb.19:
	mov	w0, #0
	bl	_START_EQ1
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	mov	w3, #56
	bl	_ibsd_mod_allchnls
	tbnz	w0, #31, LBB0_24
; %bb.20:
	mov	x0, x19
	mov	w1, #0
	bl	_qib_ibsd_reset
	mov	x0, x19
	bl	_qib_sd_trimdone_poll
	mov	x20, x0
	mov	w21, #1
	mov	x0, x19
	mov	w1, #1
	bl	_qib_ibsd_reset
	cbz	w20, LBB0_25
; %bb.21:
Lloh18:
	adrp	x1, l_.str.9@PAGE
Lloh19:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	x0, x19
	bl	_qib_sd_trimdone_monitor
	ldr	x8, [x19]
	str	w21, [x8]
	b	LBB0_11
LBB0_22:
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_26
LBB0_23:
Lloh22:
	adrp	x1, l_.str.6@PAGE
Lloh23:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_26
LBB0_24:
Lloh24:
	adrp	x1, l_.str.7@PAGE
Lloh25:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_26
LBB0_25:
Lloh26:
	adrp	x1, l_.str.8@PAGE
Lloh27:
	add	x1, x1, l_.str.8@PAGEOFF
LBB0_26:
	mov	x0, x19
	bl	_qib_dev_err
LBB0_27:
	mov	w20, #1
LBB0_28:
	mov	x0, x19
	mov	w1, #-1
	bl	_set_7220_relock_poll
	ldr	x0, [sp, #8]
	bl	_release_firmware
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_kr_ibserdesctrl,4,2            ; @kr_ibserdesctrl
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Driver-reload"

	.comm	_SD7220_FW_NAME,4,2             ; @SD7220_FW_NAME
l_.str.1:                               ; @.str.1
	.asciz	"Failed to load IB SERDES image\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to set IB SERDES early defaults\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed IB SERDES DAC trim\n"

l_.str.4:                               ; @.str.4
	.asciz	"Failed to set IB SERDES presets\n"

l_.str.5:                               ; @.str.5
	.asciz	"Failed to set IB SERDES TRIMSELF\n"

l_.str.6:                               ; @.str.6
	.asciz	"SERDES PRAM VFY failed\n"

l_.str.7:                               ; @.str.7
	.asciz	"Failed clearing START_EQ1\n"

l_.str.8:                               ; @.str.8
	.asciz	"No TRIMDONE seen\n"

l_.str.9:                               ; @.str.9
	.asciz	"First-reset"

.subsections_via_symbols
