	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goto_offline
_goto_offline:                          ## @goto_offline
	.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, %r15
	movq	72(%rdi), %r14
	movq	%r14, %rdi
	callq	_update_lcb_cache
	movl	(%r15), %r12d
	movq	_HLS_GOING_OFFLINE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	shll	$8, %ebx
	movq	_PLS_OFFLINE@GOTPCREL(%rip), %r13
	orl	(%r13), %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_set_physical_link_state
	movq	_HCMD_SUCCESS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_1
## %bb.2:
	movq	8(%r15), %rbx
	movq	_OPA_LINKDOWN_REASON_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_HFI1_ODR_MASK
	cmpq	%rax, %rbx
	jne	LBB0_4
## %bb.3:
	movq	_OPA_LINKDOWN_REASON_TRANSIENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_HFI1_ODR_MASK
	movq	%rax, 8(%r15)
LBB0_4:
	movq	%r15, %rdi
	movl	$10000, %esi                    ## imm = 0x2710
	callq	_wait_phys_link_offline_substates
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_23
## %bb.5:
	movq	16(%r15), %rax
	movq	_PORT_TYPE_QSFP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.6:
	cmpq	$0, 64(%r15)
	je	LBB0_11
## %bb.7:
	movq	%r15, %rdi
	callq	_qsfp_mod_present
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	movq	%r14, %rdi
	callq	_qsfp_resource
	movq	_QSFP_WAIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_acquire_chip_resource
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dd_dev_err
	jmp	LBB0_11
LBB0_1:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dd_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_23
LBB0_9:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_set_qsfp_tx
	movq	%r14, %rdi
	callq	_qsfp_resource
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_release_chip_resource
LBB0_11:
	movq	_PLS_OFFLINE_QUIET@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_14
## %bb.12:
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	$30000, %edx                    ## imm = 0x7530
	callq	_wait_physical_linkstate
	testl	%eax, %eax
	js	LBB0_13
LBB0_14:
	movq	%r14, %rdi
	callq	_set_host_lcb_access
	movq	_DC_LCB_ERR_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	$-1, %rdx
	callq	_write_csr
	movq	_IB_PORT_DOWN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	$1000, %edx                     ## imm = 0x3E8
	callq	_wait_logical_linkstate
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movq	%r15, %rdi
	callq	_force_logical_link_state_down
LBB0_16:
	movq	_HLS_LINK_COOLDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_update_statusp
	movq	%r14, %rdi
	movl	$7000, %esi                     ## imm = 0x1B58
	callq	_wait_fm_ready
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dd_dev_err
	movq	_HLS_DN_OFFLINE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	jmp	LBB0_23
LBB0_18:
	movq	_HLS_DN_OFFLINE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movq	_HLS_UP@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_20
## %bb.19:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_handle_linkup_change
	jmp	LBB0_22
LBB0_13:
	movl	%eax, %ebx
	jmp	LBB0_23
LBB0_20:
	movq	_HLS_DN_POLL@GOTPCREL(%rip), %rax
	movq	_HLS_VERIFY_CAP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_HLS_GOING_UP@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	testl	%r12d, %ecx
	je	LBB0_22
## %bb.21:
	movq	%r15, %rdi
	callq	_check_lni_states
	movq	$0, 56(%r15)
LBB0_22:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%r15)
	movups	%xmm0, 24(%r15)
	xorl	%ebx, %ebx
LBB0_23:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HLS_GOING_OFFLINE,4,2          ## @HLS_GOING_OFFLINE
	.comm	_PLS_OFFLINE,4,2                ## @PLS_OFFLINE
	.comm	_HCMD_SUCCESS,4,2               ## @HCMD_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to transition to Offline link state, return %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_OPA_LINKDOWN_REASON_NONE,4,2   ## @OPA_LINKDOWN_REASON_NONE
	.comm	_OPA_LINKDOWN_REASON_TRANSIENT,4,2 ## @OPA_LINKDOWN_REASON_TRANSIENT
	.comm	_PORT_TYPE_QSFP,8,3             ## @PORT_TYPE_QSFP
	.comm	_QSFP_WAIT,4,2                  ## @QSFP_WAIT
L_.str.1:                               ## @.str.1
	.asciz	"Unable to acquire lock to turn off QSFP TX\n"

	.comm	_PLS_OFFLINE_QUIET,4,2          ## @PLS_OFFLINE_QUIET
	.comm	_DC_LCB_ERR_EN,4,2              ## @DC_LCB_ERR_EN
	.comm	_IB_PORT_DOWN,4,2               ## @IB_PORT_DOWN
	.comm	_HLS_LINK_COOLDOWN,4,2          ## @HLS_LINK_COOLDOWN
L_.str.2:                               ## @.str.2
	.asciz	"After going offline, timed out waiting for the 8051 to become ready to accept host requests\n"

	.comm	_HLS_DN_OFFLINE,8,3             ## @HLS_DN_OFFLINE
	.comm	_HLS_UP,4,2                     ## @HLS_UP
	.comm	_HLS_DN_POLL,4,2                ## @HLS_DN_POLL
	.comm	_HLS_VERIFY_CAP,4,2             ## @HLS_VERIFY_CAP
	.comm	_HLS_GOING_UP,4,2               ## @HLS_GOING_UP
	.no_dead_strip	_goto_offline
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goto_offline
_goto_offline:                          ; @goto_offline
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x20, [x0, #72]
	mov	x0, x20
	bl	_update_lcb_cache
	ldr	w22, [x19]
Lloh0:
	adrp	x8, _HLS_GOING_OFFLINE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HLS_GOING_OFFLINE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19]
Lloh3:
	adrp	x23, _PLS_OFFLINE@GOTPAGE
Lloh4:
	ldr	x23, [x23, _PLS_OFFLINE@GOTPAGEOFF]
	ldr	w8, [x23]
	orr	w1, w8, w21, lsl #8
	mov	x0, x20
	bl	_set_physical_link_state
                                        ; kill: def $w0 killed $w0 def $x0
Lloh5:
	adrp	x8, _HCMD_SUCCESS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HCMD_SUCCESS@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_9
; %bb.1:
	ldr	x21, [x19, #8]
Lloh8:
	adrp	x8, _OPA_LINKDOWN_REASON_NONE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _OPA_LINKDOWN_REASON_NONE@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_HFI1_ODR_MASK
	cmp	x21, x0
	b.ne	LBB0_3
; %bb.2:
Lloh11:
	adrp	x8, _OPA_LINKDOWN_REASON_TRANSIENT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _OPA_LINKDOWN_REASON_TRANSIENT@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_HFI1_ODR_MASK
	str	x0, [x19, #8]
LBB0_3:
	mov	x0, x19
	mov	w1, #10000
	bl	_wait_phys_link_offline_substates
	mov	x21, x0
	tbnz	w0, #31, LBB0_23
; %bb.4:
	ldr	x8, [x19, #16]
Lloh14:
	adrp	x9, _PORT_TYPE_QSFP@GOTPAGE
Lloh15:
	ldr	x9, [x9, _PORT_TYPE_QSFP@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.5:
	ldr	x8, [x19, #64]
	cbz	x8, LBB0_11
; %bb.6:
	mov	x0, x19
	bl	_qsfp_mod_present
	cbz	x0, LBB0_11
; %bb.7:
	mov	x0, x20
	bl	_qsfp_resource
	mov	x1, x0
Lloh17:
	adrp	x8, _QSFP_WAIT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _QSFP_WAIT@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_acquire_chip_resource
	cbz	w0, LBB0_10
; %bb.8:
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dd_dev_err
	b	LBB0_11
LBB0_9:
	str	x0, [sp]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dd_dev_err
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_23
LBB0_10:
	mov	x0, x19
	mov	w1, #0
	bl	_set_qsfp_tx
	mov	x0, x20
	bl	_qsfp_resource
	mov	x1, x0
	mov	x0, x20
	bl	_release_chip_resource
LBB0_11:
Lloh27:
	adrp	x8, _PLS_OFFLINE_QUIET@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PLS_OFFLINE_QUIET@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	cmp	w21, w8
	b.eq	LBB0_13
; %bb.12:
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #30000
	bl	_wait_physical_linkstate
	tbnz	w0, #31, LBB0_19
LBB0_13:
	mov	x0, x20
	bl	_set_host_lcb_access
Lloh30:
	adrp	x8, _DC_LCB_ERR_EN@GOTPAGE
Lloh31:
	ldr	x8, [x8, _DC_LCB_ERR_EN@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, #-1
	bl	_write_csr
Lloh33:
	adrp	x21, _IB_PORT_DOWN@GOTPAGE
Lloh34:
	ldr	x21, [x21, _IB_PORT_DOWN@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #1000
	bl	_wait_logical_linkstate
	cbz	w0, LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_force_logical_link_state_down
LBB0_15:
Lloh35:
	adrp	x8, _HLS_LINK_COOLDOWN@GOTPAGE
Lloh36:
	ldr	x8, [x8, _HLS_LINK_COOLDOWN@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	str	w8, [x19]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_update_statusp
	mov	x0, x20
	mov	w1, #7000
	bl	_wait_fm_ready
	cbz	w0, LBB0_17
; %bb.16:
	mov	x21, x0
Lloh38:
	adrp	x1, l_.str.2@PAGE
Lloh39:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dd_dev_err
Lloh40:
	adrp	x8, _HLS_DN_OFFLINE@GOTPAGE
Lloh41:
	ldr	x8, [x8, _HLS_DN_OFFLINE@GOTPAGEOFF]
Lloh42:
	ldr	x8, [x8]
	str	w8, [x19]
	b	LBB0_23
LBB0_17:
Lloh43:
	adrp	x8, _HLS_DN_OFFLINE@GOTPAGE
Lloh44:
	ldr	x8, [x8, _HLS_DN_OFFLINE@GOTPAGEOFF]
Lloh45:
	ldr	x8, [x8]
	str	w8, [x19]
Lloh46:
	adrp	x8, _HLS_UP@GOTPAGE
Lloh47:
	ldr	x8, [x8, _HLS_UP@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_20
; %bb.18:
	mov	x0, x20
	mov	w1, #0
	bl	_handle_linkup_change
	b	LBB0_22
LBB0_19:
	mov	x21, x0
	b	LBB0_23
LBB0_20:
Lloh49:
	adrp	x8, _HLS_DN_POLL@GOTPAGE
Lloh50:
	ldr	x8, [x8, _HLS_DN_POLL@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
Lloh52:
	adrp	x9, _HLS_VERIFY_CAP@GOTPAGE
Lloh53:
	ldr	x9, [x9, _HLS_VERIFY_CAP@GOTPAGEOFF]
Lloh54:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh55:
	adrp	x9, _HLS_GOING_UP@GOTPAGE
Lloh56:
	ldr	x9, [x9, _HLS_GOING_UP@GOTPAGEOFF]
Lloh57:
	ldr	w9, [x9]
	orr	w8, w8, w9
	tst	w8, w22
	b.eq	LBB0_22
; %bb.21:
	mov	x0, x19
	bl	_check_lni_states
	str	xzr, [x19, #56]
LBB0_22:
	mov	w21, #0
	movi.2d	v0, #0000000000000000
	stur	q0, [x19, #40]
	stur	q0, [x19, #24]
LBB0_23:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.cfi_endproc
                                        ; -- End function
	.comm	_HLS_GOING_OFFLINE,4,2          ; @HLS_GOING_OFFLINE
	.comm	_PLS_OFFLINE,4,2                ; @PLS_OFFLINE
	.comm	_HCMD_SUCCESS,4,2               ; @HCMD_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to transition to Offline link state, return %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_OPA_LINKDOWN_REASON_NONE,4,2   ; @OPA_LINKDOWN_REASON_NONE
	.comm	_OPA_LINKDOWN_REASON_TRANSIENT,4,2 ; @OPA_LINKDOWN_REASON_TRANSIENT
	.comm	_PORT_TYPE_QSFP,8,3             ; @PORT_TYPE_QSFP
	.comm	_QSFP_WAIT,4,2                  ; @QSFP_WAIT
l_.str.1:                               ; @.str.1
	.asciz	"Unable to acquire lock to turn off QSFP TX\n"

	.comm	_PLS_OFFLINE_QUIET,4,2          ; @PLS_OFFLINE_QUIET
	.comm	_DC_LCB_ERR_EN,4,2              ; @DC_LCB_ERR_EN
	.comm	_IB_PORT_DOWN,4,2               ; @IB_PORT_DOWN
	.comm	_HLS_LINK_COOLDOWN,4,2          ; @HLS_LINK_COOLDOWN
l_.str.2:                               ; @.str.2
	.asciz	"After going offline, timed out waiting for the 8051 to become ready to accept host requests\n"

	.comm	_HLS_DN_OFFLINE,8,3             ; @HLS_DN_OFFLINE
	.comm	_HLS_UP,4,2                     ; @HLS_UP
	.comm	_HLS_DN_POLL,4,2                ; @HLS_DN_POLL
	.comm	_HLS_VERIFY_CAP,4,2             ; @HLS_VERIFY_CAP
	.comm	_HLS_GOING_UP,4,2               ; @HLS_GOING_UP
	.no_dead_strip	_goto_offline
.subsections_via_symbols
