	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %r14
	callq	_netdev_priv
	movq	%rax, %r13
	movq	16(%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
	xorl	%ebx, %ebx
	jmp	LBB0_23
LBB0_2:
	movl	(%r13), %ebx
	movq	___QLCNIC_RESETTING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	24(%r13), %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_5:
	movq	%r13, %rdi
	callq	_qlcnic_get_diag_lock
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
LBB0_4:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_netdev_info
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_23:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_QLCNIC_ILB_MODE@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%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
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_qlcnic_83xx_diag_alloc_res
	movl	%ebx, %ecx
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_22
## %bb.8:
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_qlcnic_83xx_set_lb_mode
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_21
## %bb.9:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=1
	incl	%ebx
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_msleep
	movq	_QLCNIC_MSIX_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r13)
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%r13, %rdi
	callq	_qlcnic_83xx_process_aen
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	_QLCNIC_ILB_MAX_RCV_LOOP@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jg	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	16(%r13), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpq	$0, 8(%r15)
	je	LBB0_16
## %bb.17:
	movq	%r14, %rdi
	callq	_netif_running
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	movq	%r14, %rdi
	callq	_netif_carrier_off
	movq	%r14, %rdi
	callq	_netif_stop_queue
LBB0_19:
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_qlcnic_do_lb_test
	movl	%eax, %ebx
	jmp	LBB0_20
LBB0_13:
	movq	8(%r13), %rdi
	leaq	L_.str.6(%rip), %rsi
	callq	_dev_info
	movq	_QLCNIC_FW_NOT_RESPOND@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_20:
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_qlcnic_83xx_clear_lb_mode
LBB0_21:
	movq	%r14, %rdi
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %esi
	callq	_qlcnic_83xx_diag_free_res
	movl	%r14d, %ecx
LBB0_22:
	movl	%ecx, (%r13)
	movq	%r13, %rdi
	callq	_qlcnic_release_diag_lock
	jmp	LBB0_23
	.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	___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,4,2            ## @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	_QLCNIC_MSIX_ENABLED,4,2        ## @QLCNIC_MSIX_ENABLED
	.comm	_QLCNIC_ILB_MAX_RCV_LOOP,4,2    ## @QLCNIC_ILB_MAX_RCV_LOOP
L_.str.6:                               ## @.str.6
	.asciz	"Firmware didn't sent link up event to loopback request\n"

	.comm	_QLCNIC_FW_NOT_RESPOND,4,2      ## @QLCNIC_FW_NOT_RESPOND
.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, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x1
	mov	x19, x0
	bl	_netdev_priv
	ldr	x24, [x0, #16]
	ldr	x8, [x24]
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
	mov	w23, #0
	b	LBB0_7
LBB0_2:
	mov	x20, x0
	ldr	w22, [x0]
Lloh5:
	adrp	x8, ___QLCNIC_RESETTING@GOTPAGE
Lloh6:
	ldr	x8, [x8, ___QLCNIC_RESETTING@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x1, x20, #24
	bl	_test_bit
	cbz	x0, LBB0_4
; %bb.3:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:
	mov	x0, x20
	bl	_qlcnic_get_diag_lock
	cbz	x0, LBB0_8
; %bb.5:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_6:
	mov	x0, x19
	bl	_netdev_info
Lloh12:
	adrp	x8, _EBUSY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_7:
	mov	x0, x23
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_8:
Lloh15:
	adrp	x8, _QLCNIC_ILB_MODE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _QLCNIC_ILB_MODE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [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	w8, w21
	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, x22
	bl	_qlcnic_83xx_diag_alloc_res
	mov	x23, x0
	cbnz	w0, LBB0_23
; %bb.9:
	mov	x0, x20
	mov	x1, x21
	bl	_qlcnic_83xx_set_lb_mode
	mov	x23, x0
	cbnz	w0, LBB0_22
; %bb.10:
Lloh27:
	adrp	x25, _QLCNIC_MSIX_ENABLED@GOTPAGE
Lloh28:
	ldr	x25, [x25, _QLCNIC_MSIX_ENABLED@GOTPAGEOFF]
Lloh29:
	adrp	x26, _QLCNIC_ILB_MAX_RCV_LOOP@GOTPAGE
Lloh30:
	ldr	x26, [x26, _QLCNIC_ILB_MAX_RCV_LOOP@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	w23, w23, #1
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	w0, #500
	bl	_msleep
	ldr	w8, [x20, #4]
	ldr	w9, [x25]
	tst	w9, w8
	b.ne	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x20
	bl	_qlcnic_83xx_process_aen
LBB0_14:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x26]
	cmp	w23, w8
	b.gt	LBB0_20
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x20, #16]
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_11
; %bb.16:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x24, #8]
	cbz	x8, LBB0_11
; %bb.17:
	mov	x0, x19
	bl	_netif_running
	cbz	x0, LBB0_19
; %bb.18:
	mov	x0, x19
	bl	_netif_carrier_off
	mov	x0, x19
	bl	_netif_stop_queue
LBB0_19:
	mov	x0, x20
	mov	x1, x21
	bl	_qlcnic_do_lb_test
	mov	x23, x0
	b	LBB0_21
LBB0_20:
	ldr	x0, [x20, #8]
Lloh31:
	adrp	x1, l_.str.6@PAGE
Lloh32:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_dev_info
Lloh33:
	adrp	x8, _QLCNIC_FW_NOT_RESPOND@GOTPAGE
Lloh34:
	ldr	x8, [x8, _QLCNIC_FW_NOT_RESPOND@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_21:
	mov	x0, x20
	mov	x1, x21
	bl	_qlcnic_83xx_clear_lb_mode
LBB0_22:
	mov	x0, x19
	mov	x1, x22
	bl	_qlcnic_83xx_diag_free_res
LBB0_23:
	str	w22, [x20]
	mov	x0, x20
	bl	_qlcnic_release_diag_lock
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, 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 AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.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	___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,4,2            ; @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	_QLCNIC_MSIX_ENABLED,4,2        ; @QLCNIC_MSIX_ENABLED
	.comm	_QLCNIC_ILB_MAX_RCV_LOOP,4,2    ; @QLCNIC_ILB_MAX_RCV_LOOP
l_.str.6:                               ; @.str.6
	.asciz	"Firmware didn't sent link up event to loopback request\n"

	.comm	_QLCNIC_FW_NOT_RESPOND,4,2      ; @QLCNIC_FW_NOT_RESPOND
.subsections_via_symbols
