	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_octeon_send_command            ## -- Begin function octeon_send_command
	.p2align	4, 0x90
_octeon_send_command:                   ## @octeon_send_command
	.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	%r9, -64(%rbp)                  ## 8-byte Spill
	movq	%r8, %r13
	movq	%rcx, %r14
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movq	(%rax,%rsi,8), %rbx
	cmpq	$0, 16(%rbx)
	je	LBB0_2
## %bb.1:
	leaq	8(%rbx), %rdi
	callq	_spin_lock_bh
LBB0_2:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	___post_command2
	movq	_IQ_SEND_FAILED@GOTPCREL(%rip), %rcx
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.8:
	movq	_instr_dropped@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$1, %ecx
	callq	_INCR_INSTRQUEUE_PKT_COUNT
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_9
LBB0_3:
	movl	%edx, %r14d
	movq	16(%rbp), %rsi
	movq	%r13, %rdi
	callq	_octeon_report_sent_bytes_to_bql
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movq	%r13, %rdx
	movq	16(%rbp), %rcx
	callq	___add_to_request_list
	movq	_bytes_sent@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_INCR_INSTRQUEUE_PKT_COUNT
	movq	_instr_posted@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$1, %ecx
	callq	_INCR_INSTRQUEUE_PKT_COUNT
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_7
## %bb.4:
	movq	_MAX_OCTEON_FILL_COUNT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, (%rbx)
	jge	LBB0_7
## %bb.5:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_7
## %bb.6:
	movq	_IQ_SEND_STOP@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_9
LBB0_7:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_ring_doorbell
LBB0_9:
	cmpq	$0, 16(%rbx)
	je	LBB0_11
## %bb.10:
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_spin_unlock_bh
LBB0_11:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IQ_SEND_FAILED,8,3             ## @IQ_SEND_FAILED
	.comm	_bytes_sent,4,2                 ## @bytes_sent
	.comm	_instr_posted,4,2               ## @instr_posted
	.comm	_MAX_OCTEON_FILL_COUNT,8,3      ## @MAX_OCTEON_FILL_COUNT
	.comm	_IQ_SEND_STOP,8,3               ## @IQ_SEND_STOP
	.comm	_instr_dropped,4,2              ## @instr_dropped
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_octeon_send_command            ; -- Begin function octeon_send_command
	.p2align	2
_octeon_send_command:                   ; @octeon_send_command
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x25, x6
	mov	x24, x5
	mov	x26, x4
	mov	x20, x3
	mov	x23, x2
	mov	x22, x1
	mov	x21, x0
	ldr	x8, [x0]
	ldr	x19, [x8, x1, lsl #3]
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_2
; %bb.1:
	add	x0, x19, #8
	bl	_spin_lock_bh
LBB0_2:
	mov	x0, x19
	mov	x1, x20
	bl	___post_command2
	mov	x20, x0
Lloh0:
	adrp	x8, _IQ_SEND_FAILED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IQ_SEND_FAILED@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _instr_dropped@GOTPAGE
Lloh4:
	ldr	x8, [x8, _instr_dropped@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x22
	mov	w3, #1
	bl	_INCR_INSTRQUEUE_PKT_COUNT
	b	LBB0_7
LBB0_4:
	mov	x28, x1
	mov	x0, x26
	mov	x1, x25
	bl	_octeon_report_sent_bytes_to_bql
	mov	x27, x0
	mov	x0, x19
	mov	x1, x28
	mov	x2, x26
	mov	x3, x25
	bl	___add_to_request_list
Lloh6:
	adrp	x8, _bytes_sent@GOTPAGE
Lloh7:
	ldr	x8, [x8, _bytes_sent@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x22
	mov	x3, x24
	bl	_INCR_INSTRQUEUE_PKT_COUNT
Lloh9:
	adrp	x8, _instr_posted@GOTPAGE
Lloh10:
	ldr	x8, [x8, _instr_posted@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x22
	mov	w3, #1
	bl	_INCR_INSTRQUEUE_PKT_COUNT
	cbnz	x23, LBB0_6
; %bb.5:
	ldr	x8, [x19]
Lloh12:
	adrp	x9, _MAX_OCTEON_FILL_COUNT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MAX_OCTEON_FILL_COUNT@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
Lloh15:
	adrp	x10, _IQ_SEND_STOP@GOTPAGE
Lloh16:
	ldr	x10, [x10, _IQ_SEND_STOP@GOTPAGEOFF]
Lloh17:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	w27, #0, #0, lt
	ccmp	x20, x10, #4, eq
	b.ne	LBB0_7
LBB0_6:
	mov	x0, x21
	mov	x1, x19
	bl	_ring_doorbell
LBB0_7:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_9
; %bb.8:
	add	x0, x19, #8
	bl	_spin_unlock_bh
LBB0_9:
	mov	x0, x20
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_IQ_SEND_FAILED,8,3             ; @IQ_SEND_FAILED
	.comm	_bytes_sent,4,2                 ; @bytes_sent
	.comm	_instr_posted,4,2               ; @instr_posted
	.comm	_MAX_OCTEON_FILL_COUNT,8,3      ; @MAX_OCTEON_FILL_COUNT
	.comm	_IQ_SEND_STOP,8,3               ; @IQ_SEND_STOP
	.comm	_instr_dropped,4,2              ; @instr_dropped
.subsections_via_symbols
