	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _vnic_dev_cmd2
__vnic_dev_cmd2:                        ## @_vnic_dev_cmd2
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	movq	8(%rdi), %r14
	movslq	(%r14), %r13
	movq	40(%r14), %rdi
	addq	$4, %rdi
	callq	_ioread32
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %r15d
	leal	1(%r13), %eax
	movq	_DEVCMD2_RING_SIZE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	cmpl	%r15d, %edx
	jne	LBB0_4
## %bb.3:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	__CMD_N
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	xorl	%r12d, %r12d
	movl	%eax, %edx
	movl	%r15d, %ecx
	movl	%r13d, %r8d
	xorl	%eax, %eax
	callq	_vdev_neterr
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_27
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
LBB0_27:
	subl	(%rax), %r12d
	jmp	LBB0_28
LBB0_4:
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movq	32(%r14), %rax
	shlq	$4, %r13
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, (%rax,%r13)
	movl	$0, 4(%rax,%r13)
	movl	%r15d, %edi
	callq	__CMD_FLAGS
	movq	__CMD_FLAGS_NOWAIT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movq	_DEVCMD2_FNORESULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	32(%r14), %rcx
	orl	%eax, 4(%rcx,%r13)
LBB0_6:
	movl	%r15d, %edi
	callq	__CMD_DIR
	movq	__CMD_DIR_WRITE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.7:
	movq	_VNIC_DEVCMD_NARGS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_10
## %bb.8:
	movq	(%r12), %rcx
	movq	32(%r14), %rdx
	movq	8(%rdx,%r13), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rsi,4), %edi
	movl	%edi, (%rdx,%rsi,4)
	incq	%rsi
	movl	(%rax), %edi
	cmpq	%rdi, %rsi
	jb	LBB0_9
LBB0_10:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_wmb
	movq	40(%r14), %rsi
	movl	-56(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edi
	callq	_iowrite32
	movl	%r15d, (%r14)
	movq	32(%r14), %rax
	movq	_DEVCMD2_FNORESULT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%rax,%r13)
	je	LBB0_11
LBB0_28:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	24(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movslq	4(%r14), %rax
	movq	8(%r14), %r13
	movq	16(%r14), %rcx
	leaq	1(%rax), %rdx
	movl	%edx, 4(%r14)
	cmpq	%rdx, %rcx
	jne	LBB0_13
## %bb.12:
	movl	$0, 4(%r14)
	xorl	%ecx, %ecx
	testq	%r13, %r13
	sete	%cl
	movq	%rcx, 8(%r14)
LBB0_13:
	testl	%ebx, %ebx
	jle	LBB0_26
## %bb.14:
	leaq	(%rax,%rax,2), %r14
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14,8), %r15
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%r13, (%r15)
	je	LBB0_16
## %bb.25:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	$100, %edi
	callq	_udelay
	decl	%ebx
	jne	LBB0_15
LBB0_26:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	__CMD_N
	leaq	L_.str.2(%rip), %rsi
	xorl	%r12d, %r12d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_vdev_neterr
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_27
LBB0_16:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	8(%r15,%r14,8), %ebx
	testl	%ebx, %ebx
	je	LBB0_21
## %bb.17:
	movq	_ERR_ECMDUNKNOWN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	jne	LBB0_19
## %bb.18:
	movq	_CMD_CAPABILITY@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	je	LBB0_20
LBB0_19:
	callq	__CMD_N
	leaq	L_.str.1(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_vdev_neterr
LBB0_20:
	negl	%ebx
	movl	%ebx, %r12d
	jmp	LBB0_28
LBB0_21:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	__CMD_DIR
	movq	__CMD_DIR_READ@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_28
## %bb.22:
	movq	_VNIC_DEVCMD2_NARGS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_28
## %bb.23:
	movq	16(%r15,%r14,8), %rcx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	(%rdx), %rdx
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rsi,4), %edi
	movl	%edi, (%rdx,%rsi,4)
	incq	%rsi
	movl	(%rax), %edi
	cmpq	%rdi, %rsi
	jb	LBB0_24
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_DEVCMD2_RING_SIZE,4,2          ## @DEVCMD2_RING_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"devcmd2 %d: wq is full. fetch index: %u, posted index: %u\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	__CMD_FLAGS_NOWAIT,4,2          ## @_CMD_FLAGS_NOWAIT
	.comm	_DEVCMD2_FNORESULT,4,2          ## @DEVCMD2_FNORESULT
	.comm	__CMD_DIR_WRITE,4,2             ## @_CMD_DIR_WRITE
	.comm	_VNIC_DEVCMD_NARGS,4,2          ## @VNIC_DEVCMD_NARGS
	.comm	_ERR_ECMDUNKNOWN,4,2            ## @ERR_ECMDUNKNOWN
	.comm	_CMD_CAPABILITY,4,2             ## @CMD_CAPABILITY
L_.str.1:                               ## @.str.1
	.asciz	"Error %d devcmd %d\n"

	.comm	__CMD_DIR_READ,4,2              ## @_CMD_DIR_READ
	.comm	_VNIC_DEVCMD2_NARGS,4,2         ## @VNIC_DEVCMD2_NARGS
L_.str.2:                               ## @.str.2
	.asciz	"devcmd %d timed out\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _vnic_dev_cmd2
__vnic_dev_cmd2:                        ; @_vnic_dev_cmd2
	.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, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x24, [x0, #8]
	ldrsw	x25, [x24]
	ldr	x8, [x24, #40]
	add	x0, x8, #4
	bl	_ioread32
	cmn	w0, #1
	b.eq	LBB0_3
; %bb.1:
	mov	x23, x0
	add	w8, w25, #1
Lloh0:
	adrp	x9, _DEVCMD2_RING_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DEVCMD2_RING_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sdiv	w10, w8, w9
	msub	w22, w10, w9, w8
	cmp	w22, w0
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x20
	bl	__CMD_N
	mov	x2, x0
	stp	x23, x25, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_vdev_neterr
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh7:
	adrp	x8, _ENODEV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_5:
	ldr	x8, [x24, #32]
	add	x8, x8, x25, lsl #4
	stp	w20, wzr, [x8]
	mov	x0, x20
	bl	__CMD_FLAGS
Lloh9:
	adrp	x8, __CMD_FLAGS_NOWAIT@GOTPAGE
Lloh10:
	ldr	x8, [x8, __CMD_FLAGS_NOWAIT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x23, _DEVCMD2_FNORESULT@GOTPAGE
Lloh13:
	ldr	x23, [x23, _DEVCMD2_FNORESULT@GOTPAGEOFF]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.6:
	ldr	w8, [x23]
	ldr	x9, [x24, #32]
	add	x9, x9, x25, lsl #4
	ldr	w10, [x9, #4]
	orr	w8, w10, w8
	str	w8, [x9, #4]
LBB0_7:
	mov	x0, x20
	bl	__CMD_DIR
Lloh14:
	adrp	x8, __CMD_DIR_WRITE@GOTPAGE
Lloh15:
	ldr	x8, [x8, __CMD_DIR_WRITE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	and	w9, w8, w0
Lloh17:
	adrp	x8, _VNIC_DEVCMD_NARGS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _VNIC_DEVCMD_NARGS@GOTPAGEOFF]
	ldr	w10, [x8]
	cmp	w9, #0
	ccmp	w10, #0, #4, ne
	b.eq	LBB0_10
; %bb.8:
	mov	x9, #0
	ldr	x10, [x19]
	ldr	x11, [x24, #32]
	add	x11, x11, x25, lsl #4
	ldr	x11, [x11, #8]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x12, x9, #2
	ldr	w13, [x10, x12]
	str	w13, [x11, x12]
	add	x9, x9, #1
	ldr	w12, [x8]
	cmp	x9, x12
	b.lo	LBB0_9
LBB0_10:
	bl	_wmb
	ldr	x1, [x24, #40]
	mov	x0, x22
	bl	_iowrite32
	str	w22, [x24]
	ldr	x8, [x24, #32]
	add	x8, x8, x25, lsl #4
	ldr	w8, [x8, #4]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_13
LBB0_11:
	mov	w0, #0
LBB0_12:
	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_13:
	ldp	x9, x22, [x24, #16]
	ldrsw	x23, [x24, #4]
	add	x8, x23, #1
	str	w8, [x24, #4]
	ldr	x25, [x24, #8]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	str	wzr, [x24, #4]
	cmp	x25, #0
	cset	w8, eq
	str	x8, [x24, #8]
LBB0_15:
	cmp	w21, #1
	b.lt	LBB0_19
; %bb.16:
	mov	w8, #24
	madd	x24, x23, x8, x22
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	cmp	x8, x25
	b.eq	LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	w0, #100
	bl	_udelay
	subs	w21, w21, #1
	b.ne	LBB0_17
LBB0_19:
	mov	x0, x20
	bl	__CMD_N
	mov	x2, x0
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_vdev_neterr
Lloh21:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_4
LBB0_20:
	mov	w8, #24
	madd	x8, x23, x8, x22
	ldr	w21, [x8, #8]
	cbz	w21, LBB0_24
; %bb.21:
Lloh23:
	adrp	x8, _ERR_ECMDUNKNOWN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ERR_ECMDUNKNOWN@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _CMD_CAPABILITY@GOTPAGE
Lloh27:
	ldr	x9, [x9, _CMD_CAPABILITY@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	cmp	w21, w8
	ccmp	w9, w20, #0, eq
	b.eq	LBB0_23
; %bb.22:
	mov	x0, x20
	bl	__CMD_N
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh29:
	adrp	x1, l_.str.1@PAGE
Lloh30:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_vdev_neterr
LBB0_23:
	neg	w0, w21
	b	LBB0_12
LBB0_24:
	mov	x0, x20
	bl	__CMD_DIR
Lloh31:
	adrp	x8, __CMD_DIR_READ@GOTPAGE
Lloh32:
	ldr	x8, [x8, __CMD_DIR_READ@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	and	w9, w8, w0
Lloh34:
	adrp	x8, _VNIC_DEVCMD2_NARGS@GOTPAGE
Lloh35:
	ldr	x8, [x8, _VNIC_DEVCMD2_NARGS@GOTPAGEOFF]
	ldr	w10, [x8]
	cmp	w9, #0
	ccmp	w10, #0, #4, ne
	b.eq	LBB0_11
; %bb.25:
	mov	x9, #0
	mov	w10, #24
	madd	x10, x23, x10, x22
	ldr	x10, [x10, #16]
	ldr	x11, [x19]
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	mov	w0, #0
	lsl	x12, x9, #2
	ldr	w13, [x10, x12]
	str	w13, [x11, x12]
	add	x9, x9, #1
	ldr	w12, [x8]
	cmp	x9, x12
	b.lo	LBB0_26
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_DEVCMD2_RING_SIZE,4,2          ; @DEVCMD2_RING_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"devcmd2 %d: wq is full. fetch index: %u, posted index: %u\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	__CMD_FLAGS_NOWAIT,4,2          ; @_CMD_FLAGS_NOWAIT
	.comm	_DEVCMD2_FNORESULT,4,2          ; @DEVCMD2_FNORESULT
	.comm	__CMD_DIR_WRITE,4,2             ; @_CMD_DIR_WRITE
	.comm	_VNIC_DEVCMD_NARGS,4,2          ; @VNIC_DEVCMD_NARGS
	.comm	_ERR_ECMDUNKNOWN,4,2            ; @ERR_ECMDUNKNOWN
	.comm	_CMD_CAPABILITY,4,2             ; @CMD_CAPABILITY
l_.str.1:                               ; @.str.1
	.asciz	"Error %d devcmd %d\n"

	.comm	__CMD_DIR_READ,4,2              ; @_CMD_DIR_READ
	.comm	_VNIC_DEVCMD2_NARGS,4,2         ; @VNIC_DEVCMD2_NARGS
l_.str.2:                               ; @.str.2
	.asciz	"devcmd %d timed out\n"

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