	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qlcnic_83xx_loopback_test      ## -- Begin function qlcnic_83xx_loopback_test
	.p2align	4, 0x90
_qlcnic_83xx_loopback_test:             ## @qlcnic_83xx_loopback_test
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	callq	_netdev_priv
	movq	%rax, %rbx
	movq	24(%rax), %r15
	movq	(%r15), %rax
	movq	_QLCNIC_NON_PRIV_FUNC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_netdev_warn
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	jmp	LBB0_7
LBB0_2:
	movups	(%rbx), %xmm0
	movaps	%xmm0, -64(%rbp)                ## 16-byte Spill
	movq	___QLCNIC_RESETTING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	16(%rbx), %r13
	movq	%r13, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_6
LBB0_4:
	movq	%rbx, %rdi
	callq	_qlcnic_get_diag_lock
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
LBB0_6:
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_netdev_info
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_7:
	subl	(%rax), %r12d
LBB0_8:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_QLCNIC_ILB_MODE@GOTPCREL(%rip), %rax
	cmpq	%r12, (%rax)
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.5(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_netdev_info
	movq	_QLCNIC_LOOPBACK_TEST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movdqa	-64(%rbp), %xmm0                ## 16-byte Reload
	pextrq	$1, %xmm0, %rdx
	movq	%r14, %rdi
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	callq	_qlcnic_83xx_diag_alloc_res
	movaps	-64(%rbp), %xmm0                ## 16-byte Reload
	movq	%r12, %rcx
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_22
## %bb.10:
	movq	%rbx, %rdi
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rcx, %rsi
	callq	_qlcnic_83xx_set_lb_mode
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.11:
	movq	_QLC_83XX_LB_MSLEEP_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	movq	___QLCNIC_RESETTING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_13
LBB0_12:
	leaq	L_.str.6(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_netdev_info
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_21
LBB0_13:
	movl	$-1, %r12d
	jmp	LBB0_15
LBB0_14:                                ##   in Loop: Header=BB0_15 Depth=1
	movq	_QLC_83XX_LB_MSLEEP_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	movq	___QLCNIC_RESETTING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_12
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	incl	%r12d
	movq	_QLC_83XX_LB_WAIT_COUNT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jg	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movq	24(%rbx), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_14
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=1
	cmpq	$0, 8(%r15)
	je	LBB0_14
## %bb.18:
	movq	%rbx, %rdi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_qlcnic_do_lb_test
	movl	%eax, %r12d
	movq	%rbx, %rdi
	movq	%r15, %rsi
	jmp	LBB0_20
LBB0_19:
	leaq	L_.str.7(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_netdev_info
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
LBB0_20:
	callq	_qlcnic_83xx_clear_lb_mode
LBB0_21:
	movq	%r14, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_qlcnic_83xx_diag_free_res
	movaps	-64(%rbp), %xmm0                ## 16-byte Reload
LBB0_22:
	movups	%xmm0, (%rbx)
	movq	%rbx, %rdi
	callq	_qlcnic_release_diag_lock
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_QLCNIC_NON_PRIV_FUNC,8,3       ## @QLCNIC_NON_PRIV_FUNC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Loopback test not supported in non privileged mode\n"

	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.comm	___QLCNIC_RESETTING,4,2         ## @__QLCNIC_RESETTING
L_.str.1:                               ## @.str.1
	.asciz	"Device is resetting\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.2:                               ## @.str.2
	.asciz	"Device is in diagnostics mode\n"

L_.str.3:                               ## @.str.3
	.asciz	"%s loopback test in progress\n"

	.comm	_QLCNIC_ILB_MODE,8,3            ## @QLCNIC_ILB_MODE
L_.str.4:                               ## @.str.4
	.asciz	"internal"

L_.str.5:                               ## @.str.5
	.asciz	"external"

	.comm	_QLCNIC_LOOPBACK_TEST,4,2       ## @QLCNIC_LOOPBACK_TEST
	.comm	_QLC_83XX_LB_MSLEEP_COUNT,4,2   ## @QLC_83XX_LB_MSLEEP_COUNT
L_.str.6:                               ## @.str.6
	.asciz	"Device is resetting, free LB test resources\n"

	.comm	_QLC_83XX_LB_WAIT_COUNT,4,2     ## @QLC_83XX_LB_WAIT_COUNT
L_.str.7:                               ## @.str.7
	.asciz	"Firmware didn't sent link up event to loopback request\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qlcnic_83xx_loopback_test      ; -- Begin function qlcnic_83xx_loopback_test
	.p2align	2
_qlcnic_83xx_loopback_test:             ; @qlcnic_83xx_loopback_test
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x1
	mov	x19, x0
	bl	_netdev_priv
	ldr	x26, [x0, #24]
	ldr	x8, [x26]
Lloh0:
	adrp	x9, _QLCNIC_NON_PRIV_FUNC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _QLCNIC_NON_PRIV_FUNC@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netdev_warn
Lloh5:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
	b	LBB0_7
LBB0_2:
	mov	x20, x0
	ldp	x25, x21, [x0]
Lloh7:
	adrp	x27, ___QLCNIC_RESETTING@GOTPAGE
Lloh8:
	ldr	x27, [x27, ___QLCNIC_RESETTING@GOTPAGEOFF]
	ldr	w0, [x27]
	add	x23, x20, #16
	mov	x1, x23
	bl	_test_bit
	cbz	x0, LBB0_4
; %bb.3:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:
	mov	x0, x20
	bl	_qlcnic_get_diag_lock
	cbz	x0, LBB0_9
; %bb.5:
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_6:
	mov	x0, x19
	bl	_netdev_info
Lloh13:
	adrp	x8, _EBUSY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_8:
	mov	x0, x24
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_9:
Lloh15:
	adrp	x8, _QLCNIC_ILB_MODE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _QLCNIC_ILB_MODE@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
Lloh18:
	adrp	x9, l_.str.5@PAGE
Lloh19:
	add	x9, x9, l_.str.5@PAGEOFF
Lloh20:
	adrp	x10, l_.str.4@PAGE
Lloh21:
	add	x10, x10, l_.str.4@PAGEOFF
	cmp	x8, x22
	csel	x8, x10, x9, eq
	str	x8, [sp]
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_netdev_info
Lloh24:
	adrp	x8, _QLCNIC_LOOPBACK_TEST@GOTPAGE
Lloh25:
	ldr	x8, [x8, _QLCNIC_LOOPBACK_TEST@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_qlcnic_83xx_diag_alloc_res
	mov	x24, x0
	cbnz	w0, LBB0_22
; %bb.10:
	mov	x0, x20
	mov	x1, x22
	bl	_qlcnic_83xx_set_lb_mode
	mov	x24, x0
	cbnz	w0, LBB0_21
; %bb.11:
Lloh27:
	adrp	x8, _QLC_83XX_LB_MSLEEP_COUNT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _QLC_83XX_LB_MSLEEP_COUNT@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	bl	_msleep
	ldr	w0, [x27]
	mov	x1, x23
	bl	_test_bit
	cbz	x0, LBB0_13
LBB0_12:
Lloh30:
	adrp	x1, l_.str.6@PAGE
Lloh31:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_netdev_info
Lloh32:
	adrp	x8, _EBUSY@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_21
LBB0_13:
	mov	w28, #-1
Lloh35:
	adrp	x24, _QLC_83XX_LB_WAIT_COUNT@GOTPAGE
Lloh36:
	ldr	x24, [x24, _QLC_83XX_LB_WAIT_COUNT@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
Lloh37:
	adrp	x8, _QLC_83XX_LB_MSLEEP_COUNT@GOTPAGE
Lloh38:
	ldr	x8, [x8, _QLC_83XX_LB_MSLEEP_COUNT@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
	bl	_msleep
	ldr	w0, [x27]
	mov	x1, x23
	bl	_test_bit
	cbnz	x0, LBB0_12
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	add	w28, w28, #1
	cmp	w28, w8
	b.gt	LBB0_19
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x20, #24]
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_14
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x26, #8]
	cbz	x8, LBB0_14
; %bb.18:
	mov	x0, x20
	mov	x1, x22
	bl	_qlcnic_do_lb_test
	mov	x24, x0
	b	LBB0_20
LBB0_19:
Lloh40:
	adrp	x1, l_.str.7@PAGE
Lloh41:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_netdev_info
Lloh42:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh43:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_20:
	mov	x0, x20
	mov	x1, x22
	bl	_qlcnic_83xx_clear_lb_mode
LBB0_21:
	mov	x0, x19
	mov	x1, x21
	bl	_qlcnic_83xx_diag_free_res
LBB0_22:
	stp	x25, x21, [x20]
	mov	x0, x20
	bl	_qlcnic_release_diag_lock
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpAdd	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_QLCNIC_NON_PRIV_FUNC,8,3       ; @QLCNIC_NON_PRIV_FUNC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Loopback test not supported in non privileged mode\n"

	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.comm	___QLCNIC_RESETTING,4,2         ; @__QLCNIC_RESETTING
l_.str.1:                               ; @.str.1
	.asciz	"Device is resetting\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.2:                               ; @.str.2
	.asciz	"Device is in diagnostics mode\n"

l_.str.3:                               ; @.str.3
	.asciz	"%s loopback test in progress\n"

	.comm	_QLCNIC_ILB_MODE,8,3            ; @QLCNIC_ILB_MODE
l_.str.4:                               ; @.str.4
	.asciz	"internal"

l_.str.5:                               ; @.str.5
	.asciz	"external"

	.comm	_QLCNIC_LOOPBACK_TEST,4,2       ; @QLCNIC_LOOPBACK_TEST
	.comm	_QLC_83XX_LB_MSLEEP_COUNT,4,2   ; @QLC_83XX_LB_MSLEEP_COUNT
l_.str.6:                               ; @.str.6
	.asciz	"Device is resetting, free LB test resources\n"

	.comm	_QLC_83XX_LB_WAIT_COUNT,4,2     ; @QLC_83XX_LB_WAIT_COUNT
l_.str.7:                               ; @.str.7
	.asciz	"Firmware didn't sent link up event to loopback request\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
