	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_setup_7220_reset
_qib_setup_7220_reset:                  ## @qib_setup_7220_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	-44(%rbp), %rsi
	leaq	-40(%rbp), %rdx
	leaq	-36(%rbp), %rcx
	callq	_qib_pcie_getcmd
	movl	52(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_qib_dev_err
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_qib_7220_set_intr_state
	movq	16(%rbx), %rax
	movq	8(%rax), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rax)
	movq	$0, 24(%rax)
	movq	_QIB_INITTED@GOTPCREL(%rip), %rax
	movq	_QIB_PRESENT@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, (%rbx)
	movq	%rbx, %rdi
	callq	_qib_int_counter
	movl	%eax, 48(%rbx)
	movq	_QLOGIC_IB_C_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	4(%rbx), %edi
	movq	_kr_control@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	shlq	$2, %rsi
	addq	40(%rbx), %rsi
	callq	_writeq
	xorl	%eax, %eax
	callq	_mb
	movl	$5000, %edi                     ## imm = 0x1388
	callq	_msleep
	movl	-44(%rbp), %esi
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %ecx
	movq	%rbx, %rdi
	callq	_qib_pcie_reenable
	movq	_kr_revision@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	shlq	$2, %rdi
	addq	40(%rbx), %rdi
	callq	_readq
	cmpl	8(%rbx), %eax
	je	LBB0_5
## %bb.1:
	movl	$7000, %edi                     ## imm = 0x1B58
	callq	_msleep
	movl	-44(%rbp), %esi
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %ecx
	movq	%rbx, %rdi
	callq	_qib_pcie_reenable
	movq	(%r12), %rdi
	shlq	$2, %rdi
	addq	40(%rbx), %rdi
	callq	_readq
	cmpl	8(%rbx), %eax
	je	LBB0_5
## %bb.2:
	movl	$9000, %edi                     ## imm = 0x2328
	callq	_msleep
	movl	-44(%rbp), %esi
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %ecx
	movq	%rbx, %rdi
	callq	_qib_pcie_reenable
	movq	(%r12), %rdi
	shlq	$2, %rdi
	addq	40(%rbx), %rdi
	callq	_readq
	cmpl	8(%rbx), %eax
	je	LBB0_5
## %bb.3:
	movl	$11000, %edi                    ## imm = 0x2AF8
	callq	_msleep
	movl	-44(%rbp), %esi
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %ecx
	movq	%rbx, %rdi
	callq	_qib_pcie_reenable
	movq	(%r12), %rdi
	shlq	$2, %rdi
	addq	40(%rbx), %rdi
	callq	_readq
	cmpl	8(%rbx), %eax
	je	LBB0_5
## %bb.4:
	movl	$13000, %edi                    ## imm = 0x32C8
	callq	_msleep
	movl	-44(%rbp), %esi
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %ecx
	movq	%rbx, %rdi
	callq	_qib_pcie_reenable
	movq	(%r12), %rdi
	shlq	$2, %rdi
	addq	40(%rbx), %rdi
	callq	_readq
	movl	%eax, %ecx
	xorl	%eax, %eax
	cmpl	8(%rbx), %ecx
	jne	LBB0_11
LBB0_5:
	movl	(%r14), %eax
	orl	%eax, (%rbx)
	movq	%rbx, %rdi
	callq	_qib_reinit_intr
	movl	%eax, %r14d
	movl	$0, %eax
	testl	%r14d, %r14d
	je	LBB0_11
## %bb.6:
	movl	32(%rbx), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_qib_pcie_params
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_qib_dev_err
LBB0_8:
	movq	(%r15), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_qib_write_kreg
	movq	%rbx, %rdi
	callq	_qib_7220_init_hwerrors
	movq	16(%rbx), %rdi
	movq	8(%rdi), %rax
	movq	_IBA7220_IBC_IBTA_1_2_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_10
## %bb.9:
	movq	24(%rbx), %rax
	movl	$1, (%rax)
LBB0_10:
	callq	_spin_lock_irqsave
	movq	_QIBL_IB_FORCE_NOTIFY@GOTPCREL(%rip), %rax
	movq	16(%rbx), %rdi
	movl	4(%rdi), %ecx
	orl	(%rax), %ecx
	movq	_QIBL_IB_AUTONEG_FAILED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%ecx, %eax
	movl	%eax, 4(%rdi)
	callq	_spin_unlock_irqrestore
	movl	%r14d, %eax
LBB0_11:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Resetting InfiniPath unit %u\n"

	.comm	_QIB_INITTED,4,2                ## @QIB_INITTED
	.comm	_QIB_PRESENT,4,2                ## @QIB_PRESENT
	.comm	_QLOGIC_IB_C_RESET,4,2          ## @QLOGIC_IB_C_RESET
	.comm	_kr_control,8,3                 ## @kr_control
	.comm	_kr_revision,8,3                ## @kr_revision
L_.str.1:                               ## @.str.1
	.asciz	"Reset failed to setup PCIe or interrupts; continuing anyway\n"

	.comm	_IBA7220_IBC_IBTA_1_2_MASK,4,2  ## @IBA7220_IBC_IBTA_1_2_MASK
	.comm	_QIBL_IB_FORCE_NOTIFY,4,2       ## @QIBL_IB_FORCE_NOTIFY
	.comm	_QIBL_IB_AUTONEG_FAILED,4,2     ## @QIBL_IB_AUTONEG_FAILED
	.no_dead_strip	_qib_setup_7220_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_setup_7220_reset
_qib_setup_7220_reset:                  ; @qib_setup_7220_reset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
	add	x1, sp, #28
	add	x2, sp, #24
	add	x3, sp, #20
	bl	_qib_pcie_getcmd
	ldr	w8, [x19, #52]
	str	x8, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_qib_dev_err
	mov	x0, x19
	mov	w1, #0
	bl	_qib_7220_set_intr_state
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #8]
	stp	xzr, xzr, [x8, #8]
	str	xzr, [x8, #24]
Lloh2:
	adrp	x8, _QIB_INITTED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _QIB_INITTED@GOTPAGEOFF]
Lloh4:
	adrp	x20, _QIB_PRESENT@GOTPAGE
Lloh5:
	ldr	x20, [x20, _QIB_PRESENT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	mov	x0, x19
	bl	_qib_int_counter
	str	w0, [x19, #48]
	ldr	w8, [x19, #4]
Lloh7:
	adrp	x9, _QLOGIC_IB_C_RESET@GOTPAGE
Lloh8:
	ldr	x9, [x9, _QLOGIC_IB_C_RESET@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w0, w9, w8
	ldr	x8, [x19, #40]
Lloh10:
	adrp	x21, _kr_control@GOTPAGE
Lloh11:
	ldr	x21, [x21, _kr_control@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x1, x8, x9, lsl #2
	bl	_writeq
	bl	_mb
	mov	w0, #5000
	bl	_msleep
	ldp	w2, w1, [sp, #24]
	ldr	w3, [sp, #20]
	mov	x0, x19
	bl	_qib_pcie_reenable
	ldr	x8, [x19, #40]
Lloh12:
	adrp	x22, _kr_revision@GOTPAGE
Lloh13:
	ldr	x22, [x22, _kr_revision@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x8, x9, lsl #2
	bl	_readq
	ldr	w8, [x19, #8]
	cmp	w0, w8
	b.eq	LBB0_5
; %bb.1:
	mov	w0, #7000
	bl	_msleep
	ldp	w2, w1, [sp, #24]
	ldr	w3, [sp, #20]
	mov	x0, x19
	bl	_qib_pcie_reenable
	ldr	x8, [x19, #40]
	ldr	x9, [x22]
	add	x0, x8, x9, lsl #2
	bl	_readq
	ldr	w8, [x19, #8]
	cmp	w0, w8
	b.eq	LBB0_5
; %bb.2:
	mov	w0, #9000
	bl	_msleep
	ldp	w2, w1, [sp, #24]
	ldr	w3, [sp, #20]
	mov	x0, x19
	bl	_qib_pcie_reenable
	ldr	x8, [x19, #40]
	ldr	x9, [x22]
	add	x0, x8, x9, lsl #2
	bl	_readq
	ldr	w8, [x19, #8]
	cmp	w0, w8
	b.eq	LBB0_5
; %bb.3:
	mov	w0, #11000
	bl	_msleep
	ldp	w2, w1, [sp, #24]
	ldr	w3, [sp, #20]
	mov	x0, x19
	bl	_qib_pcie_reenable
	ldr	x8, [x19, #40]
	ldr	x9, [x22]
	add	x0, x8, x9, lsl #2
	bl	_readq
	ldr	w8, [x19, #8]
	cmp	w0, w8
	b.eq	LBB0_5
; %bb.4:
	mov	w0, #13000
	bl	_msleep
	ldp	w2, w1, [sp, #24]
	ldr	w3, [sp, #20]
	mov	x0, x19
	bl	_qib_pcie_reenable
	ldr	x8, [x19, #40]
	ldr	x9, [x22]
	add	x0, x8, x9, lsl #2
	bl	_readq
	ldr	w8, [x19, #8]
	cmp	w0, w8
	b.ne	LBB0_12
LBB0_5:
	ldr	w8, [x20]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	mov	x0, x19
	bl	_qib_reinit_intr
	mov	x20, x0
	cbz	w0, LBB0_11
; %bb.6:
	ldr	w1, [x19, #32]
	mov	x0, x19
	mov	x2, #0
	bl	_qib_pcie_params
	cbz	x0, LBB0_8
; %bb.7:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_qib_dev_err
LBB0_8:
	ldr	x1, [x21]
	mov	x0, x19
	mov	x2, #0
	bl	_qib_write_kreg
	mov	x0, x19
	bl	_qib_7220_init_hwerrors
	ldr	x0, [x19, #16]
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _IBA7220_IBC_IBTA_1_2_MASK@GOTPAGE
Lloh17:
	ldr	x9, [x9, _IBA7220_IBC_IBTA_1_2_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
	ldr	x8, [x19, #24]
	mov	w9, #1
	str	w9, [x8]
LBB0_10:
	bl	_spin_lock_irqsave
Lloh19:
	adrp	x8, _QIBL_IB_FORCE_NOTIFY@GOTPAGE
Lloh20:
	ldr	x8, [x8, _QIBL_IB_FORCE_NOTIFY@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	ldr	x0, [x19, #16]
	ldr	w9, [x0, #4]
	orr	w8, w9, w8
Lloh22:
	adrp	x9, _QIBL_IB_AUTONEG_FAILED@GOTPAGE
Lloh23:
	ldr	x9, [x9, _QIBL_IB_AUTONEG_FAILED@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	bic	w8, w8, w9
	str	w8, [x0, #4]
	bl	_spin_unlock_irqrestore
LBB0_11:
	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
	add	sp, sp, #80
	ret
LBB0_12:
	mov	w20, #0
	b	LBB0_11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Resetting InfiniPath unit %u\n"

	.comm	_QIB_INITTED,4,2                ; @QIB_INITTED
	.comm	_QIB_PRESENT,4,2                ; @QIB_PRESENT
	.comm	_QLOGIC_IB_C_RESET,4,2          ; @QLOGIC_IB_C_RESET
	.comm	_kr_control,8,3                 ; @kr_control
	.comm	_kr_revision,8,3                ; @kr_revision
l_.str.1:                               ; @.str.1
	.asciz	"Reset failed to setup PCIe or interrupts; continuing anyway\n"

	.comm	_IBA7220_IBC_IBTA_1_2_MASK,4,2  ; @IBA7220_IBC_IBTA_1_2_MASK
	.comm	_QIBL_IB_FORCE_NOTIFY,4,2       ; @QIBL_IB_FORCE_NOTIFY
	.comm	_QIBL_IB_AUTONEG_FAILED,4,2     ; @QIBL_IB_AUTONEG_FAILED
	.no_dead_strip	_qib_setup_7220_reset
.subsections_via_symbols
