	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qlcnic_loopback_test
_qlcnic_loopback_test:                  ## @qlcnic_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r13
	callq	_netdev_priv
	movq	%rax, %r12
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	4(%r12), %ebx
	movq	16(%r12), %r14
	movq	%r12, %rdi
	callq	_qlcnic_83xx_check
	testq	%rax, %rax
	je	LBB0_1
## %bb.19:
	movq	%r13, %rdi
	movl	%r15d, %esi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_qlcnic_83xx_loopback_test      ## TAILCALL
LBB0_1:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	_QLCNIC_FW_CAPABILITY_MULTI_LOOPBACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	32(%r12), %rdi
	testl	%eax, (%r14)
	je	LBB0_2
## %bb.3:
	movq	_QLCNIC_ILB_MODE@GOTPCREL(%rip), %rax
	movl	%r15d, %r12d
	cmpl	%r15d, (%rax)
	leaq	L_.str.2(%rip), %rax
	movq	%r14, %r15
	leaq	L_.str.3(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.1(%rip), %rsi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_dev_warn
	movq	%r14, %rax
	movq	8(%r14), %rax
	movq	_QLCNIC_NON_PRIV_FUNC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	32(%rax), %rdi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	jmp	LBB0_18
LBB0_2:
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	___QLCNIC_RESETTING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %r14
	addq	$8, %r14
	movq	%r14, %rsi
	callq	_test_and_set_bit
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_18:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	_QLCNIC_LOOPBACK_TEST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_qlcnic_diag_alloc_res
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_17
## %bb.9:
	movq	24(%rbx), %rax
	movq	(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_qlcnic_set_lb_mode
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_10
LBB0_16:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_qlcnic_diag_free_res
LBB0_17:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%rbx)
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rbx)
	movq	___QLCNIC_RESETTING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	callq	_clear_bit
	jmp	LBB0_18
LBB0_10:
	movl	$0, 16(%r15)
	movl	$-1, %r14d
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_msleep
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_qlcnic_process_rcv_ring_diag
	incl	%r14d
	movq	_QLCNIC_ILB_MAX_RCV_LOOP@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jg	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	16(%rbx), %rax
	movl	16(%rax), %r13d
	testl	%r13d, %r13d
	jne	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	20(%r15), %edi
	callq	_QLCNIC_IS_LB_CONFIGURED
	testl	%eax, %eax
	je	LBB0_11
## %bb.15:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_qlcnic_do_lb_test
	movl	%eax, %r13d
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_qlcnic_clear_lb_mode
	jmp	LBB0_16
LBB0_12:
	leaq	L_.str.5(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_netdev_info
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_QLCNIC_FW_CAPABILITY_MULTI_LOOPBACK,4,2 ## @QLCNIC_FW_CAPABILITY_MULTI_LOOPBACK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Firmware do not support loopback test\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
L_.str.1:                               ## @.str.1
	.asciz	"%s loopback test in progress\n"

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

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

	.comm	_QLCNIC_NON_PRIV_FUNC,8,3       ## @QLCNIC_NON_PRIV_FUNC
L_.str.4:                               ## @.str.4
	.asciz	"Loopback test not supported in nonprivileged mode\n"

	.comm	___QLCNIC_RESETTING,4,2         ## @__QLCNIC_RESETTING
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_QLCNIC_LOOPBACK_TEST,4,2       ## @QLCNIC_LOOPBACK_TEST
	.comm	_QLCNIC_ILB_MAX_RCV_LOOP,4,2    ## @QLCNIC_ILB_MAX_RCV_LOOP
L_.str.5:                               ## @.str.5
	.asciz	"Firmware didn't sent link up event to loopback request\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qlcnic_loopback_test
_qlcnic_loopback_test:                  ; @qlcnic_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	x20, x0
	bl	_netdev_priv
	mov	x19, x0
	ldp	w26, w21, [x0]
	ldr	x28, [x0, #16]
	bl	_qlcnic_83xx_check
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	mov	x1, x22
	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
	b	_qlcnic_83xx_loopback_test
LBB0_2:
	ldr	w8, [x28]
Lloh0:
	adrp	x9, _QLCNIC_FW_CAPABILITY_MULTI_LOOPBACK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _QLCNIC_FW_CAPABILITY_MULTI_LOOPBACK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	ldr	x0, [x19, #32]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.3:
Lloh3:
	adrp	x8, _QLCNIC_ILB_MODE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _QLCNIC_ILB_MODE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, l_.str.3@PAGE
Lloh7:
	add	x9, x9, l_.str.3@PAGEOFF
Lloh8:
	adrp	x10, l_.str.2@PAGE
Lloh9:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	w8, w22
	csel	x8, x10, x9, eq
	str	x8, [sp]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
	ldr	x8, [x28, #8]
Lloh12:
	adrp	x9, _QLCNIC_NON_PRIV_FUNC@GOTPAGE
Lloh13:
	ldr	x9, [x9, _QLCNIC_NON_PRIV_FUNC@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	ldr	x0, [x19, #32]
Lloh15:
	adrp	x1, l_.str.4@PAGE
Lloh16:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_warn
	mov	w24, #0
	b	LBB0_9
LBB0_5:
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
Lloh19:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
Lloh21:
	adrp	x27, ___QLCNIC_RESETTING@GOTPAGE
Lloh22:
	ldr	x27, [x27, ___QLCNIC_RESETTING@GOTPAGEOFF]
	ldr	w0, [x27]
	add	x23, x19, #8
	mov	x1, x23
	bl	_test_and_set_bit
	cbz	x0, LBB0_10
; %bb.7:
Lloh23:
	adrp	x8, _EBUSY@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_9:
	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_10:
Lloh25:
	adrp	x8, _QLCNIC_LOOPBACK_TEST@GOTPAGE
Lloh26:
	ldr	x8, [x8, _QLCNIC_LOOPBACK_TEST@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_qlcnic_diag_alloc_res
	mov	x24, x0
	cbnz	w0, LBB0_20
; %bb.11:
	ldr	x8, [x19, #24]
	ldr	x25, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_qlcnic_set_lb_mode
	mov	x24, x0
	cbnz	w0, LBB0_19
; %bb.12:
	str	wzr, [x28, #16]
	mov	w27, #-1
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	w0, #500
	bl	_msleep
	mov	x0, x25
	bl	_qlcnic_process_rcv_ring_diag
Lloh28:
	adrp	x8, _QLCNIC_ILB_MAX_RCV_LOOP@GOTPAGE
Lloh29:
	ldr	x8, [x8, _QLCNIC_ILB_MAX_RCV_LOOP@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	add	w27, w27, #1
	cmp	w27, w8
	b.gt	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x19, #16]
	ldr	w24, [x8, #16]
	cbnz	w24, LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w0, [x28, #20]
	bl	_QLCNIC_IS_LB_CONFIGURED
	cbz	w0, LBB0_13
; %bb.16:
	mov	x0, x19
	mov	x1, x22
	bl	_qlcnic_do_lb_test
	mov	x24, x0
	mov	x0, x19
	mov	x1, x22
	bl	_qlcnic_clear_lb_mode
	b	LBB0_18
LBB0_17:
Lloh31:
	adrp	x1, l_.str.5@PAGE
Lloh32:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	_netdev_info
Lloh33:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_18:
Lloh36:
	adrp	x27, ___QLCNIC_RESETTING@GOTPAGE
Lloh37:
	ldr	x27, [x27, ___QLCNIC_RESETTING@GOTPAGEOFF]
LBB0_19:
	mov	x0, x20
	mov	x1, x21
	bl	_qlcnic_diag_free_res
LBB0_20:
	stp	w26, w21, [x19]
	ldr	w0, [x27]
	mov	x1, x23
	bl	_clear_bit
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_QLCNIC_FW_CAPABILITY_MULTI_LOOPBACK,4,2 ; @QLCNIC_FW_CAPABILITY_MULTI_LOOPBACK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Firmware do not support loopback test\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
l_.str.1:                               ; @.str.1
	.asciz	"%s loopback test in progress\n"

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

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

	.comm	_QLCNIC_NON_PRIV_FUNC,8,3       ; @QLCNIC_NON_PRIV_FUNC
l_.str.4:                               ; @.str.4
	.asciz	"Loopback test not supported in nonprivileged mode\n"

	.comm	___QLCNIC_RESETTING,4,2         ; @__QLCNIC_RESETTING
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_QLCNIC_LOOPBACK_TEST,4,2       ; @QLCNIC_LOOPBACK_TEST
	.comm	_QLCNIC_ILB_MAX_RCV_LOOP,4,2    ; @QLCNIC_ILB_MAX_RCV_LOOP
l_.str.5:                               ; @.str.5
	.asciz	"Firmware didn't sent link up event to loopback request\n"

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