	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbefifo_send_command
_sbefifo_send_command:                  ## @sbefifo_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	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	(%rdi), %r13
	movl	4(%rsi), %edi
	callq	_be32_to_cpu
	movslq	%eax, %rcx
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_dev_vdbg
	movq	_SBEFIFO_TIMEOUT_START_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rax, %rcx
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	testq	%r14, %r14
	je	LBB0_10
## %bb.1:
	leaq	-44(%rbp), %rdx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_sbefifo_wait
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_SBEFIFO_TIMEOUT_IN_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %edi
	callq	_sbefifo_vacant
	movq	%rax, %r14
	movq	%rax, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_min
	movq	%rax, %r15
	movslq	-44(%rbp), %rdx
	movq	%r13, %rdi
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %rcx
	movq	%rax, %r8
	xorl	%eax, %eax
	callq	_dev_vdbg
	movq	%r15, %r13
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	subq	$1, %r13
	jb	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movl	(%rbx), %esi
	addq	$4, %rbx
	movq	%r12, %rdi
	callq	_sbefifo_up_write
	testl	%eax, %eax
	je	LBB0_5
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	subq	%r15, -64(%rbp)                 ## 8-byte Folded Spill
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	leaq	-44(%rbp), %rdx
	jne	LBB0_2
## %bb.9:
	cmpq	%r15, -72(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_11
LBB0_10:
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_sbefifo_wait
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_13
LBB0_11:
	movq	_SBEFIFO_UP@GOTPCREL(%rip), %rax
	movq	_SBEFIFO_EOT_RAISE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_sbefifo_regw
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	movq	%r13, %rdi
	movl	%eax, %edx
	callq	_dev_err
	movl	%ebx, %r14d
	jmp	LBB0_13
LBB0_7:
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	callq	_dev_err
LBB0_13:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	%eax, %r14d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sending command (%zd words, cmd=%04x)\n"

	.comm	_SBEFIFO_TIMEOUT_START_CMD,4,2  ## @SBEFIFO_TIMEOUT_START_CMD
	.comm	_SBEFIFO_TIMEOUT_IN_CMD,4,2     ## @SBEFIFO_TIMEOUT_IN_CMD
L_.str.1:                               ## @.str.1
	.asciz	"  status=%08x vacant=%zd chunk=%zd\n"

L_.str.2:                               ## @.str.2
	.asciz	"FSI error %d writing UP FIFO\n"

	.comm	_SBEFIFO_UP,4,2                 ## @SBEFIFO_UP
	.comm	_SBEFIFO_EOT_RAISE,4,2          ## @SBEFIFO_EOT_RAISE
L_.str.3:                               ## @.str.3
	.asciz	"FSI error %d writing EOT\n"

	.no_dead_strip	_sbefifo_send_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sbefifo_send_command
_sbefifo_send_command:                  ; @sbefifo_send_command
	.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	x21, x2
	mov	x22, x1
	mov	x20, x0
	ldr	x19, [x0]
	ldr	w0, [x1, #4]
	bl	_be32_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x3, w0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dev_vdbg
Lloh2:
	adrp	x8, _SBEFIFO_TIMEOUT_START_CMD@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SBEFIFO_TIMEOUT_START_CMD@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x23, x0
	cbz	x21, LBB0_8
; %bb.1:
Lloh5:
	adrp	x26, _SBEFIFO_TIMEOUT_IN_CMD@GOTPAGE
Lloh6:
	ldr	x26, [x26, _SBEFIFO_TIMEOUT_IN_CMD@GOTPAGEOFF]
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	add	x2, sp, #12
	mov	x0, x20
	mov	w1, #1
	mov	x3, x23
	bl	_sbefifo_wait
	tbnz	w0, #31, LBB0_14
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x24, x26
	ldr	w0, [x26]
	bl	_msecs_to_jiffies
	mov	x23, x0
	ldr	w0, [sp, #12]
	bl	_sbefifo_vacant
	mov	x25, x0
	mov	x1, x21
	bl	_min
	mov	x28, x0
	ldrsw	x2, [sp, #12]
	str	x0, [sp]
	mov	x0, x19
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x3, x25
	bl	_dev_vdbg
	mov	x26, x28
LBB0_4:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cbz	x26, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	sub	x26, x26, #1
	ldr	w1, [x22], #4
	mov	x0, x20
	bl	_sbefifo_up_write
	cbz	w0, LBB0_4
	b	LBB0_11
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	subs	x21, x21, x28
	mov	x26, x24
	b.ne	LBB0_2
; %bb.7:
	cmp	x25, x28
	b.ne	LBB0_9
LBB0_8:
	add	x2, sp, #12
	mov	x0, x20
	mov	w1, #1
	mov	x3, x23
	bl	_sbefifo_wait
	mov	x27, x0
	cbnz	w0, LBB0_13
LBB0_9:
Lloh9:
	adrp	x8, _SBEFIFO_UP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SBEFIFO_UP@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _SBEFIFO_EOT_RAISE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SBEFIFO_EOT_RAISE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x20
	mov	w2, #0
	bl	_sbefifo_regw
	mov	x27, x0
	cbz	w0, LBB0_13
; %bb.10:
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_12
LBB0_11:
	mov	x27, x0
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_12:
	mov	x0, x19
	mov	x2, x27
	bl	_dev_err
LBB0_13:
	mov	x0, x27
	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_14:
	mov	x27, x0
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sending command (%zd words, cmd=%04x)\n"

	.comm	_SBEFIFO_TIMEOUT_START_CMD,4,2  ; @SBEFIFO_TIMEOUT_START_CMD
	.comm	_SBEFIFO_TIMEOUT_IN_CMD,4,2     ; @SBEFIFO_TIMEOUT_IN_CMD
l_.str.1:                               ; @.str.1
	.asciz	"  status=%08x vacant=%zd chunk=%zd\n"

l_.str.2:                               ; @.str.2
	.asciz	"FSI error %d writing UP FIFO\n"

	.comm	_SBEFIFO_UP,4,2                 ; @SBEFIFO_UP
	.comm	_SBEFIFO_EOT_RAISE,4,2          ; @SBEFIFO_EOT_RAISE
l_.str.3:                               ; @.str.3
	.asciz	"FSI error %d writing EOT\n"

	.no_dead_strip	_sbefifo_send_command
.subsections_via_symbols
