	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipath_wait_linkstate           ## -- Begin function ipath_wait_linkstate
	.p2align	4, 0x90
_ipath_wait_linkstate:                  ## @ipath_wait_linkstate
	.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	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %r13
	movl	%esi, (%rdi)
	movq	_ipath_state_wait@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	4(%rdi), %ebx
	andl	%esi, %ebx
	movl	%edx, %edi
	callq	_msecs_to_jiffies
	movl	%r12d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_wait_event_interruptible_timeout
	movl	$0, (%r13)
	movl	4(%r13), %ecx
	andl	%r14d, %ecx
	jne	LBB0_7
## %bb.1:
	movq	_VERBOSE@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_IPATH_LINKINIT@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_3
## %bb.2:
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_6
LBB0_3:
	movq	_IPATH_LINKDOWN@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_5
## %bb.4:
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_6
LBB0_5:
	movq	_IPATH_LINKARMED@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.3(%rip), %rdx
	cmoveq	%rax, %rdx
LBB0_6:
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_ipath_cdbg
	movq	16(%r13), %rax
	movl	4(%rax), %esi
	movq	%r13, %rdi
	callq	_ipath_read_kreg64
	movq	%rax, %rbx
	movl	(%r12), %r15d
	movq	16(%r13), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_ipath_read_kreg64
	movq	_ipath_ibcstatus_str@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	8(%r13), %rdx
	andq	%rbx, %rdx
	movl	(%rcx,%rdx,4), %r8d
	leaq	L_.str.5(%rip), %rsi
	movl	%r15d, %edi
	movq	%rax, %rdx
	movq	%rbx, %rcx
	xorl	%eax, %eax
	callq	_ipath_cdbg
	andl	4(%r13), %r14d
	movl	%r14d, %ecx
LBB0_7:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	subl	(%rdx), %eax
	xorl	%edx, %edx
	testl	%ecx, %ecx
	cmovnel	%edx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ipath_state_wait,4,2           ## @ipath_state_wait
	.comm	_VERBOSE,4,2                    ## @VERBOSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Didn't reach linkstate %s within %u ms\n"

	.comm	_IPATH_LINKINIT,4,2             ## @IPATH_LINKINIT
L_.str.1:                               ## @.str.1
	.asciz	"INIT"

	.comm	_IPATH_LINKDOWN,4,2             ## @IPATH_LINKDOWN
L_.str.2:                               ## @.str.2
	.asciz	"DOWN"

	.comm	_IPATH_LINKARMED,4,2            ## @IPATH_LINKARMED
L_.str.3:                               ## @.str.3
	.asciz	"ARM"

L_.str.4:                               ## @.str.4
	.asciz	"ACTIVE"

L_.str.5:                               ## @.str.5
	.asciz	"ibcc=%llx ibcstatus=%llx (%s)\n"

	.comm	_ipath_ibcstatus_str,8,3        ## @ipath_ibcstatus_str
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipath_wait_linkstate           ; -- Begin function ipath_wait_linkstate
	.p2align	2
_ipath_wait_linkstate:                  ; @ipath_wait_linkstate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	str	w1, [x0]
Lloh0:
	adrp	x8, _ipath_state_wait@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ipath_state_wait@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	ldr	w8, [x0, #4]
	and	w23, w8, w1
	mov	x0, x2
	bl	_msecs_to_jiffies
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_wait_event_interruptible_timeout
	str	wzr, [x20]
	ldr	w8, [x20, #4]
	ands	w8, w8, w19
	b.ne	LBB0_7
; %bb.1:
Lloh3:
	adrp	x22, _VERBOSE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _VERBOSE@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh5:
	adrp	x8, _IPATH_LINKINIT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IPATH_LINKINIT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_3
; %bb.2:
Lloh8:
	adrp	x8, l_.str.1@PAGE
Lloh9:
	add	x8, x8, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_3:
Lloh10:
	adrp	x8, _IPATH_LINKDOWN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IPATH_LINKDOWN@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_5
; %bb.4:
Lloh13:
	adrp	x8, l_.str.2@PAGE
Lloh14:
	add	x8, x8, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh15:
	adrp	x8, _IPATH_LINKARMED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IPATH_LINKARMED@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, l_.str.3@PAGE
Lloh19:
	add	x9, x9, l_.str.3@PAGEOFF
Lloh20:
	adrp	x10, l_.str.4@PAGE
Lloh21:
	add	x10, x10, l_.str.4@PAGEOFF
	tst	w8, w19
	csel	x8, x10, x9, eq
LBB0_6:
	stp	x8, x21, [sp]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ipath_cdbg
	ldr	x8, [x20, #16]
	ldr	w1, [x8, #4]
	mov	x0, x20
	bl	_ipath_read_kreg64
	mov	x21, x0
	ldr	w22, [x22]
	ldr	x8, [x20, #16]
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ipath_read_kreg64
Lloh24:
	adrp	x8, _ipath_ibcstatus_str@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ipath_ibcstatus_str@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	ldr	x9, [x20, #8]
	and	x9, x9, x21
	ldr	w8, [x8, x9, lsl #2]
	stp	x21, x8, [sp, #8]
	str	x0, [sp]
Lloh27:
	adrp	x1, l_.str.5@PAGE
Lloh28:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x22
	bl	_ipath_cdbg
	ldr	w8, [x20, #4]
	and	w8, w8, w19
LBB0_7:
Lloh29:
	adrp	x9, _ETIMEDOUT@GOTPAGE
Lloh30:
	ldr	x9, [x9, _ETIMEDOUT@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	cmp	w8, #0
	csneg	w0, wzr, w9, ne
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_ipath_state_wait,4,2           ; @ipath_state_wait
	.comm	_VERBOSE,4,2                    ; @VERBOSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Didn't reach linkstate %s within %u ms\n"

	.comm	_IPATH_LINKINIT,4,2             ; @IPATH_LINKINIT
l_.str.1:                               ; @.str.1
	.asciz	"INIT"

	.comm	_IPATH_LINKDOWN,4,2             ; @IPATH_LINKDOWN
l_.str.2:                               ; @.str.2
	.asciz	"DOWN"

	.comm	_IPATH_LINKARMED,4,2            ; @IPATH_LINKARMED
l_.str.3:                               ; @.str.3
	.asciz	"ARM"

l_.str.4:                               ; @.str.4
	.asciz	"ACTIVE"

l_.str.5:                               ; @.str.5
	.asciz	"ibcc=%llx ibcstatus=%llx (%s)\n"

	.comm	_ipath_ibcstatus_str,8,3        ; @ipath_ibcstatus_str
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
