	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipath_ht_bringup_serdes
_ipath_ht_bringup_serdes:               ## @ipath_ht_bringup_serdes
	.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
	movq	%rdi, %r13
	leaq	L_.str(%rip), %rdi
	callq	_ipath_dbg
	movq	8(%r13), %rax
	movl	24(%rax), %esi
	movq	%r13, %rdi
	callq	_ipath_read_kreg64
	movq	_INFINIPATH_HWE_SERDESPLLFAILED@GOTPCREL(%rip), %rbx
	testl	%eax, (%rbx)
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	callq	_ipath_dbg
	movq	8(%r13), %rax
	movl	20(%rax), %esi
	movl	(%rbx), %edx
	movq	%r13, %rdi
	callq	_ipath_write_kreg
LBB0_2:
	movq	8(%r13), %rax
	movl	12(%rax), %esi
	movq	%r13, %rdi
	callq	_ipath_read_kreg64
	movl	%eax, %r15d
	movq	8(%r13), %rax
	movl	8(%rax), %esi
	movq	%r13, %rdi
	callq	_ipath_read_kreg64
	movq	_VERBOSE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	movslq	%r15d, %r15
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movslq	%eax, %rbx
	movq	8(%r13), %rax
	movl	4(%rax), %esi
	movq	%r13, %rdi
	callq	_ipath_read_kreg64
	movslq	%eax, %r14
	movq	8(%r13), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_ipath_read_kreg64
	movslq	%eax, %r9
	leaq	L_.str.2(%rip), %rsi
	movl	%r12d, %edi
	movq	%r15, %rdx
	movq	%rbx, %rcx
	movq	%r14, %r8
	xorl	%eax, %eax
	callq	_ipath_cdbg
	movq	_INFINIPATH_SERDC0_RESET_PLL@GOTPCREL(%rip), %rbx
	orl	(%rbx), %r15d
	movq	8(%r13), %rax
	movl	12(%rax), %esi
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_ipath_write_kreg
	movl	$15, %edi
	callq	_udelay
	movl	(%rbx), %eax
	testl	%r15d, %eax
	je	LBB0_3
## %bb.4:
	notl	%eax
	andl	%eax, %r15d
	movq	_INFINIPATH_SERDC0_RESET_MASK@GOTPCREL(%rip), %rax
	movq	_INFINIPATH_SERDC0_TXIDLE@GOTPCREL(%rip), %rcx
	orl	(%rax), %r15d
	orl	(%rcx), %r15d
	movslq	%r15d, %r14
	movq	_VERBOSE@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_ipath_cdbg
	movq	8(%r13), %rax
	movl	12(%rax), %esi
	movq	%r13, %rdi
	movl	%r14d, %edx
	callq	_ipath_write_kreg
	movq	8(%r13), %rax
	movl	16(%rax), %esi
	movq	%r13, %rdi
	callq	_ipath_read_kreg64
	movl	$15, %edi
	callq	_udelay
	movl	(%rbx), %eax
	jmp	LBB0_5
LBB0_3:
	movq	_VERBOSE@GOTPCREL(%rip), %r12
LBB0_5:
	movq	_INFINIPATH_SERDC0_RESET_MASK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_INFINIPATH_SERDC0_TXIDLE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	testl	%r15d, %eax
	je	LBB0_7
## %bb.6:
	notl	%eax
	andl	%eax, %r15d
	movq	8(%r13), %rax
	movl	12(%rax), %esi
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_ipath_write_kreg
LBB0_7:
	movq	8(%r13), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_ipath_read_kreg64
	movq	_INFINIPATH_XGXS_RESET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movl	%r8d, %ecx
	andl	%eax, %ecx
	movl	%r8d, %edi
	notl	%edi
	xorl	%edx, %edx
	cmpl	$1, %ecx
	sbbl	%edx, %edx
	orl	%edi, %edx
	andl	%eax, %edx
	movq	_INFINIPATH_XGXS_RX_POL_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%edx, %esi
	sarl	%cl, %esi
	movq	_INFINIPATH_XGXS_RX_POL_MASK@GOTPCREL(%rip), %rdi
	movl	(%rdi), %ebx
	andl	%ebx, %esi
	movl	(%r13), %edi
	cmpl	%edi, %esi
	jne	LBB0_8
## %bb.9:
	testl	%eax, %r8d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jne	LBB0_10
	jmp	LBB0_11
LBB0_8:
	shll	%cl, %ebx
	notl	%ebx
	andl	%ebx, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edi
	orl	%edi, %edx
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
LBB0_10:
	movq	8(%r13), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_ipath_write_kreg
LBB0_11:
	movq	8(%r13), %rax
	movl	12(%rax), %esi
	movq	%r13, %rdi
	callq	_ipath_read_kreg64
	movl	%eax, %r14d
	movzbl	%bl, %ebx
	orl	$-872415232, %ebx               ## imm = 0xCC000000
	movq	8(%r13), %rax
	movl	8(%rax), %esi
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_ipath_write_kreg
	movl	(%r12), %r15d
	movslq	%r14d, %r14
	movslq	%ebx, %r12
	movq	8(%r13), %rax
	movl	4(%rax), %esi
	movq	%r13, %rdi
	callq	_ipath_read_kreg64
	movslq	%eax, %rbx
	movq	8(%r13), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_ipath_read_kreg64
	movslq	%eax, %r9
	leaq	L_.str.4(%rip), %rsi
	movl	%r15d, %edi
	movq	%r14, %rdx
	movq	%r12, %rcx
	movq	%rbx, %r8
	xorl	%eax, %eax
	callq	_ipath_cdbg
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Trying to bringup serdes\n"

	.comm	_INFINIPATH_HWE_SERDESPLLFAILED,4,2 ## @INFINIPATH_HWE_SERDESPLLFAILED
L_.str.1:                               ## @.str.1
	.asciz	"At start, serdes PLL failed bit set in hwerrstatus, clearing and continuing\n"

	.comm	_VERBOSE,4,2                    ## @VERBOSE
L_.str.2:                               ## @.str.2
	.asciz	"Initial serdes status is config0=%llx config1=%llx, sstatus=%llx xgxs %llx\n"

	.comm	_INFINIPATH_SERDC0_RESET_PLL,4,2 ## @INFINIPATH_SERDC0_RESET_PLL
	.comm	_INFINIPATH_SERDC0_RESET_MASK,4,2 ## @INFINIPATH_SERDC0_RESET_MASK
	.comm	_INFINIPATH_SERDC0_TXIDLE,4,2   ## @INFINIPATH_SERDC0_TXIDLE
L_.str.3:                               ## @.str.3
	.asciz	"Clearing serdes PLL reset (writing %llx)\n"

	.comm	_INFINIPATH_XGXS_RESET,4,2      ## @INFINIPATH_XGXS_RESET
	.comm	_INFINIPATH_XGXS_RX_POL_SHIFT,4,2 ## @INFINIPATH_XGXS_RX_POL_SHIFT
	.comm	_INFINIPATH_XGXS_RX_POL_MASK,4,2 ## @INFINIPATH_XGXS_RX_POL_MASK
L_.str.4:                               ## @.str.4
	.asciz	"After setup: serdes status is config0=%llx config1=%llx, sstatus=%llx xgxs %llx\n"

	.no_dead_strip	_ipath_ht_bringup_serdes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipath_ht_bringup_serdes
_ipath_ht_bringup_serdes:               ; @ipath_ht_bringup_serdes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ipath_dbg
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #24]
	mov	x0, x19
	bl	_ipath_read_kreg64
Lloh2:
	adrp	x20, _INFINIPATH_HWE_SERDESPLLFAILED@GOTPAGE
Lloh3:
	ldr	x20, [x20, _INFINIPATH_HWE_SERDESPLLFAILED@GOTPAGEOFF]
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.1:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ipath_dbg
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #20]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_ipath_write_kreg
LBB0_2:
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #12]
	mov	x0, x19
	bl	_ipath_read_kreg64
	mov	x21, x0
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #8]
	mov	x0, x19
	bl	_ipath_read_kreg64
	mov	x20, x0
Lloh6:
	adrp	x24, _VERBOSE@GOTPAGE
Lloh7:
	ldr	x24, [x24, _VERBOSE@GOTPAGEOFF]
	ldr	w22, [x24]
	sxtw	x23, w21
	sxtw	x25, w20
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #4]
	mov	x0, x19
	bl	_ipath_read_kreg64
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x26, w0
	ldr	x8, [x19, #8]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ipath_read_kreg64
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	stp	x26, x8, [sp, #8]
	str	x25, [sp]
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	mov	x2, x23
	bl	_ipath_cdbg
Lloh10:
	adrp	x22, _INFINIPATH_SERDC0_RESET_PLL@GOTPAGE
Lloh11:
	ldr	x22, [x22, _INFINIPATH_SERDC0_RESET_PLL@GOTPAGEOFF]
	ldr	w8, [x22]
	orr	w21, w8, w21
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #12]
	mov	x0, x19
	mov	x2, x21
	bl	_ipath_write_kreg
	mov	w0, #15
	bl	_udelay
	ldr	w8, [x22]
Lloh12:
	adrp	x25, _INFINIPATH_SERDC0_RESET_MASK@GOTPAGE
Lloh13:
	ldr	x25, [x25, _INFINIPATH_SERDC0_RESET_MASK@GOTPAGEOFF]
Lloh14:
	adrp	x23, _INFINIPATH_SERDC0_TXIDLE@GOTPAGE
Lloh15:
	ldr	x23, [x23, _INFINIPATH_SERDC0_TXIDLE@GOTPAGEOFF]
	tst	w8, w21
	b.eq	LBB0_4
; %bb.3:
	bic	w8, w21, w8
	ldr	w9, [x25]
	ldr	w10, [x23]
	orr	w8, w9, w8
	orr	w21, w8, w10
	sxtw	x2, w21
	ldr	w0, [x24]
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_ipath_cdbg
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #12]
	mov	x0, x19
	mov	x2, x21
	bl	_ipath_write_kreg
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #16]
	mov	x0, x19
	bl	_ipath_read_kreg64
	mov	w0, #15
	bl	_udelay
	ldr	w8, [x22]
LBB0_4:
	ldr	w9, [x25]
	orr	w8, w9, w8
	ldr	w9, [x23]
	orr	w8, w8, w9
	tst	w8, w21
	b.eq	LBB0_6
; %bb.5:
	bic	w2, w21, w8
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #12]
	mov	x0, x19
	bl	_ipath_write_kreg
LBB0_6:
	ldr	x8, [x19, #8]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ipath_read_kreg64
Lloh18:
	adrp	x8, _INFINIPATH_XGXS_RESET@GOTPAGE
Lloh19:
	ldr	x8, [x8, _INFINIPATH_XGXS_RESET@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x8]
	ands	w8, w9, w0
	mov	w10, #-1
	csinv	w9, w10, w9, eq
	and	w2, w9, w0
Lloh21:
	adrp	x9, _INFINIPATH_XGXS_RX_POL_SHIFT@GOTPAGE
Lloh22:
	ldr	x9, [x9, _INFINIPATH_XGXS_RX_POL_SHIFT@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	asr	w11, w2, w9
Lloh24:
	adrp	x10, _INFINIPATH_XGXS_RX_POL_MASK@GOTPAGE
Lloh25:
	ldr	x10, [x10, _INFINIPATH_XGXS_RX_POL_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	and	w12, w11, w10
	ldr	w11, [x19]
	cmp	w12, w11
	b.ne	LBB0_8
; %bb.7:
	cbnz	w8, LBB0_9
	b	LBB0_10
LBB0_8:
	lsl	w8, w10, w9
	bic	w8, w2, w8
	lsl	w9, w11, w9
	orr	w2, w8, w9
LBB0_9:
	ldr	x8, [x19, #8]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ipath_write_kreg
LBB0_10:
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #12]
	mov	x0, x19
	bl	_ipath_read_kreg64
	mov	x21, x0
	mov	w22, #-872415232
	bfxil	w22, w20, #0, #8
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #8]
	mov	x0, x19
	mov	x2, x22
	bl	_ipath_write_kreg
	ldr	w20, [x24]
	sxtw	x21, w21
	sxtw	x22, w22
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #4]
	mov	x0, x19
	bl	_ipath_read_kreg64
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x23, w0
	ldr	x8, [x19, #8]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ipath_read_kreg64
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	stp	x23, x8, [sp, #8]
	str	x22, [sp]
Lloh27:
	adrp	x1, l_.str.4@PAGE
Lloh28:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_ipath_cdbg
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Trying to bringup serdes\n"

	.comm	_INFINIPATH_HWE_SERDESPLLFAILED,4,2 ; @INFINIPATH_HWE_SERDESPLLFAILED
l_.str.1:                               ; @.str.1
	.asciz	"At start, serdes PLL failed bit set in hwerrstatus, clearing and continuing\n"

	.comm	_VERBOSE,4,2                    ; @VERBOSE
l_.str.2:                               ; @.str.2
	.asciz	"Initial serdes status is config0=%llx config1=%llx, sstatus=%llx xgxs %llx\n"

	.comm	_INFINIPATH_SERDC0_RESET_PLL,4,2 ; @INFINIPATH_SERDC0_RESET_PLL
	.comm	_INFINIPATH_SERDC0_RESET_MASK,4,2 ; @INFINIPATH_SERDC0_RESET_MASK
	.comm	_INFINIPATH_SERDC0_TXIDLE,4,2   ; @INFINIPATH_SERDC0_TXIDLE
l_.str.3:                               ; @.str.3
	.asciz	"Clearing serdes PLL reset (writing %llx)\n"

	.comm	_INFINIPATH_XGXS_RESET,4,2      ; @INFINIPATH_XGXS_RESET
	.comm	_INFINIPATH_XGXS_RX_POL_SHIFT,4,2 ; @INFINIPATH_XGXS_RX_POL_SHIFT
	.comm	_INFINIPATH_XGXS_RX_POL_MASK,4,2 ; @INFINIPATH_XGXS_RX_POL_MASK
l_.str.4:                               ; @.str.4
	.asciz	"After setup: serdes status is config0=%llx config1=%llx, sstatus=%llx xgxs %llx\n"

	.no_dead_strip	_ipath_ht_bringup_serdes
.subsections_via_symbols
