	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_ibsd_reset
_qib_ibsd_reset:                        ## @qib_ibsd_reset
	.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
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	_kr_ibserdesctrl@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_qib_read_kreg64
	movq	%rax, %r14
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.1:
	movq	(%r12), %rdi
	addq	$8, %rdi
	callq	_spin_lock_irqsave
	movq	_IB_7220_SERDES@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_epb_access
	orq	$1, %r14
	movq	_kr_hwerrmask@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r12), %rax
	movq	_QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	notq	%rdx
	andq	(%rax), %rdx
	movq	%r12, %rdi
	callq	_qib_write_kreg
	movl	(%r13), %esi
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_qib_write_kreg
	movq	_kr_scratch@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_qib_read_kreg32
	movl	$2, %edi
	callq	_udelay
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	$-1, %edx
	callq	_epb_access
	movq	(%r12), %rdi
	addq	$8, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%r15d, %r15d
LBB0_12:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_kr_hwerrmask@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r12), %rax
	movq	_QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	notq	%rdx
	andq	(%rax), %rdx
	movq	%r12, %rdi
	callq	_qib_write_kreg
	movq	%r12, %rdi
	callq	_qib_resync_ibepb
	testl	%eax, %eax
	jns	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_qib_dev_err
LBB0_4:
	movq	_IB_7220_SERDES@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_IB_MPREG5@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$1, %ecx
	movl	$1, %r8d
	callq	_qib_sd7220_reg_mod
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movl	(%rbx), %esi
	movq	_IB_MPREG6@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$128, %ecx
	movl	$128, %r8d
	callq	_qib_sd7220_reg_mod
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	andq	$-2, %r14
	movl	(%r13), %esi
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_qib_write_kreg
	movq	_kr_scratch@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_qib_read_kreg32
	movl	$1, %edi
	callq	_udelay
	movq	%r12, %rdi
	callq	_qib_sd7220_clr_ibpar
	movq	_kr_hwerrstatus@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_qib_read_kreg64
	movq	_QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR@GOTPCREL(%rip), %rbx
	testq	%rax, (%rbx)
	je	LBB0_9
## %bb.10:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	callq	_qib_dev_err
	movq	(%rbx), %rdx
	notq	%rdx
	movq	(%r12), %rax
	andq	(%rax), %rdx
	movq	%rdx, (%rax)
	jmp	LBB0_11
LBB0_5:
	movl	%eax, %r15d
	jmp	LBB0_12
LBB0_7:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	callq	_qib_dev_err
	jmp	LBB0_12
LBB0_9:
	movq	(%r12), %rax
	movq	(%rax), %rdx
LBB0_11:
	movq	_kr_hwerrmask@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_qib_write_kreg
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_kr_ibserdesctrl,4,2            ## @kr_ibserdesctrl
	.comm	_IB_7220_SERDES,4,2             ## @IB_7220_SERDES
	.comm	_kr_hwerrmask,4,2               ## @kr_hwerrmask
	.comm	_QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR,8,3 ## @QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR
	.comm	_kr_scratch,4,2                 ## @kr_scratch
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to re-sync IB EPB\n"

	.comm	_IB_MPREG5,4,2                  ## @IB_MPREG5
	.comm	_IB_MPREG6,4,2                  ## @IB_MPREG6
L_.str.1:                               ## @.str.1
	.asciz	"Failed to set WDOG disable\n"

	.comm	_kr_hwerrstatus,4,2             ## @kr_hwerrstatus
L_.str.2:                               ## @.str.2
	.asciz	"IBUC Parity still set after RST\n"

	.no_dead_strip	_qib_ibsd_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_ibsd_reset
_qib_ibsd_reset:                        ; @qib_ibsd_reset
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _kr_ibserdesctrl@GOTPAGE
Lloh1:
	ldr	x23, [x23, _kr_ibserdesctrl@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_qib_read_kreg64
	mov	x21, x0
	cbz	w20, LBB0_3
; %bb.1:
	ldr	x8, [x19]
	add	x0, x8, #8
	bl	_spin_lock_irqsave
Lloh2:
	adrp	x22, _IB_7220_SERDES@GOTPAGE
Lloh3:
	ldr	x22, [x22, _IB_7220_SERDES@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #1
	bl	_epb_access
	orr	x20, x21, #0x1
Lloh4:
	adrp	x8, _kr_hwerrmask@GOTPAGE
Lloh5:
	ldr	x8, [x8, _kr_hwerrmask@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldr	x8, [x19]
	ldr	x8, [x8]
Lloh7:
	adrp	x9, _QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR@GOTPAGE
Lloh8:
	ldr	x9, [x9, _QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	bic	x2, x8, x9
	mov	x0, x19
	bl	_qib_write_kreg
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x20
	bl	_qib_write_kreg
Lloh10:
	adrp	x8, _kr_scratch@GOTPAGE
Lloh11:
	ldr	x8, [x8, _kr_scratch@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_qib_read_kreg32
	mov	w0, #2
	bl	_udelay
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #-1
	bl	_epb_access
	ldr	x8, [x19]
	add	x0, x8, #8
	bl	_spin_unlock_irqrestore
	mov	w20, #0
LBB0_2:
	mov	x0, x20
	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_3:
Lloh13:
	adrp	x22, _kr_hwerrmask@GOTPAGE
Lloh14:
	ldr	x22, [x22, _kr_hwerrmask@GOTPAGEOFF]
	ldr	w1, [x22]
	ldr	x8, [x19]
	ldr	x8, [x8]
Lloh15:
	adrp	x24, _QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR@GOTPAGE
Lloh16:
	ldr	x24, [x24, _QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR@GOTPAGEOFF]
	ldr	x9, [x24]
	bic	x2, x8, x9
	mov	x0, x19
	bl	_qib_write_kreg
	mov	x0, x19
	bl	_qib_resync_ibepb
	tbz	w0, #31, LBB0_5
; %bb.4:
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_qib_dev_err
LBB0_5:
Lloh19:
	adrp	x25, _IB_7220_SERDES@GOTPAGE
Lloh20:
	ldr	x25, [x25, _IB_7220_SERDES@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh21:
	adrp	x8, _IB_MPREG5@GOTPAGE
Lloh22:
	ldr	x8, [x8, _IB_MPREG5@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #1
	mov	w4, #1
	bl	_qib_sd7220_reg_mod
	tbnz	w0, #31, LBB0_9
; %bb.6:
	ldr	w1, [x25]
Lloh24:
	adrp	x8, _IB_MPREG6@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IB_MPREG6@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #128
	mov	w4, #128
	bl	_qib_sd7220_reg_mod
	mov	x20, x0
	tbnz	w0, #31, LBB0_10
; %bb.7:
	and	x2, x21, #0xfffffffffffffffe
	ldr	w1, [x23]
	mov	x0, x19
	bl	_qib_write_kreg
Lloh27:
	adrp	x8, _kr_scratch@GOTPAGE
Lloh28:
	ldr	x8, [x8, _kr_scratch@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_qib_read_kreg32
	mov	w0, #1
	bl	_udelay
	mov	x0, x19
	bl	_qib_sd7220_clr_ibpar
Lloh30:
	adrp	x8, _kr_hwerrstatus@GOTPAGE
Lloh31:
	ldr	x8, [x8, _kr_hwerrstatus@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_qib_read_kreg64
	ldr	x8, [x24]
	tst	x8, x0
	b.eq	LBB0_11
; %bb.8:
Lloh33:
	adrp	x1, l_.str.2@PAGE
Lloh34:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_qib_dev_err
	ldr	x8, [x24]
	ldr	x9, [x19]
	ldr	x10, [x9]
	bic	x2, x10, x8
	str	x2, [x9]
	b	LBB0_12
LBB0_9:
	mov	x20, x0
	b	LBB0_2
LBB0_10:
Lloh35:
	adrp	x1, l_.str.1@PAGE
Lloh36:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_qib_dev_err
	b	LBB0_2
LBB0_11:
	ldr	x8, [x19]
	ldr	x2, [x8]
LBB0_12:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_qib_write_kreg
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_kr_ibserdesctrl,4,2            ; @kr_ibserdesctrl
	.comm	_IB_7220_SERDES,4,2             ; @IB_7220_SERDES
	.comm	_kr_hwerrmask,4,2               ; @kr_hwerrmask
	.comm	_QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR,8,3 ; @QLOGIC_IB_HWE_IB_UC_MEMORYPARITYERR
	.comm	_kr_scratch,4,2                 ; @kr_scratch
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to re-sync IB EPB\n"

	.comm	_IB_MPREG5,4,2                  ; @IB_MPREG5
	.comm	_IB_MPREG6,4,2                  ; @IB_MPREG6
l_.str.1:                               ; @.str.1
	.asciz	"Failed to set WDOG disable\n"

	.comm	_kr_hwerrstatus,4,2             ; @kr_hwerrstatus
l_.str.2:                               ; @.str.2
	.asciz	"IBUC Parity still set after RST\n"

	.no_dead_strip	_qib_ibsd_reset
.subsections_via_symbols
