	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rs_wait_until_sent
_rs_wait_until_sent:                    ## @rs_wait_until_sent
	.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, %r14d
	movq	8(%rdi), %rbx
	movl	(%rdi), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_serial_paranoia_check
	testq	%rax, %rax
	je	LBB0_1
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %eax
	movq	_HZ@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	imulq	$-1374389535, %rcx, %rcx        ## imm = 0xAE147AE1
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$36, %rcx
	addl	%edx, %ecx
	leal	(%rax,%rcx), %esi
	addl	$5119, %esi                     ## imm = 0x13FF
	movl	$1, %edx
	cmpl	$10239, %esi                    ## imm = 0x27FF
	jb	LBB0_3
## %bb.2:
	addl	%eax, %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rdx         ## imm = 0x66666667
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$43, %rdx
	addl	%eax, %edx
LBB0_3:
	movslq	%edx, %r13
	leaq	4(%rbx), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	_UART_ESI_CMD1@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_ESI_NO_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_serial_out
	movl	(%r15), %esi
	movq	_ESI_GET_TX_AVAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_serial_out
	movslq	%r14d, %rax
	addq	%rax, -48(%rbp)                 ## 8-byte Folded Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movl	(%r15), %esi
	movq	_ESI_NO_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_serial_out
	movl	(%r15), %esi
	movq	_ESI_GET_TX_AVAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_serial_out
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_UART_ESI_STAT1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_serial_in
	cmpl	$3, %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_UART_ESI_STAT2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_serial_in
	cmpl	$255, %eax
	je	LBB0_10
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r13, %rdi
	callq	_jiffies_to_msecs
	movl	%eax, %edi
	callq	_msleep_interruptible
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_signal_pending
	testq	%rax, %rax
	jne	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_time_after
	testq	%rax, %rax
	je	LBB0_9
	jmp	LBB0_11
LBB0_10:
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movq	_TASK_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_set_current_state              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rs_wait_until_sent"

	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_HZ,4,2                         ## @HZ
	.comm	_UART_ESI_CMD1,4,2              ## @UART_ESI_CMD1
	.comm	_ESI_NO_COMMAND,4,2             ## @ESI_NO_COMMAND
	.comm	_ESI_GET_TX_AVAIL,4,2           ## @ESI_GET_TX_AVAIL
	.comm	_UART_ESI_STAT1,4,2             ## @UART_ESI_STAT1
	.comm	_UART_ESI_STAT2,4,2             ## @UART_ESI_STAT2
	.comm	_current,4,2                    ## @current
	.comm	_TASK_RUNNING,4,2               ## @TASK_RUNNING
	.no_dead_strip	_rs_wait_until_sent
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rs_wait_until_sent
_rs_wait_until_sent:                    ; @rs_wait_until_sent
	.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	x19, x1
	ldr	x20, [x0, #8]
	ldr	w1, [x0]
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_serial_paranoia_check
	cbz	x0, LBB0_2
LBB0_1:
	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
LBB0_2:
Lloh2:
	adrp	x8, _jiffies@GOTPAGE
Lloh3:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh4:
	ldr	x23, [x8]
	mov	x21, x20
	ldr	w8, [x21], #4
Lloh5:
	adrp	x9, _HZ@GOTPAGE
Lloh6:
	ldr	x9, [x9, _HZ@GOTPAGEOFF]
Lloh7:
	ldrsw	x9, [x9]
	mov	x10, #-34079
	movk	x10, #44564, lsl #16
	mul	x9, x9, x10
	lsr	x10, x9, #63
	asr	x9, x9, #36
	add	w9, w9, w10
	add	w8, w9, w8
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #63
	asr	x9, x9, #43
	add	w9, w9, w10
	mov	w10, #5119
	mov	w11, #10239
	add	w8, w8, w10
	cmp	w8, w11
	csinc	w8, w9, wzr, hs
	sxtw	x22, w8
	mov	x0, x21
	bl	_spin_lock_irqsave
Lloh8:
	adrp	x25, _UART_ESI_CMD1@GOTPAGE
Lloh9:
	ldr	x25, [x25, _UART_ESI_CMD1@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh10:
	adrp	x26, _ESI_NO_COMMAND@GOTPAGE
Lloh11:
	ldr	x26, [x26, _ESI_NO_COMMAND@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	x0, x20
	bl	_serial_out
	ldr	w1, [x25]
Lloh12:
	adrp	x27, _ESI_GET_TX_AVAIL@GOTPAGE
Lloh13:
	ldr	x27, [x27, _ESI_GET_TX_AVAIL@GOTPAGEOFF]
	ldr	w2, [x27]
	mov	x0, x20
	bl	_serial_out
	add	x23, x23, w19, sxtw
Lloh14:
	adrp	x28, _UART_ESI_STAT1@GOTPAGE
Lloh15:
	ldr	x28, [x28, _UART_ESI_STAT1@GOTPAGEOFF]
Lloh16:
	adrp	x24, _current@GOTPAGE
Lloh17:
	ldr	x24, [x24, _current@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w1, [x25]
	ldr	w2, [x26]
	mov	x0, x20
	bl	_serial_out
	ldr	w1, [x25]
	ldr	w2, [x27]
	mov	x0, x20
	bl	_serial_out
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x28]
	mov	x0, x20
	bl	_serial_in
	cmp	w0, #3
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh18:
	adrp	x8, _UART_ESI_STAT2@GOTPAGE
Lloh19:
	ldr	x8, [x8, _UART_ESI_STAT2@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_serial_in
	cmp	w0, #255
	b.eq	LBB0_9
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	x0, x22
	bl	_jiffies_to_msecs
	bl	_msleep_interruptible
	ldr	w0, [x24]
	bl	_signal_pending
	cbnz	x0, LBB0_1
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	w19, LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh21:
	adrp	x8, _jiffies@GOTPAGE
Lloh22:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh23:
	ldr	x0, [x8]
	mov	x1, x23
	bl	_time_after
	cbz	x0, LBB0_3
	b	LBB0_1
LBB0_9:
	mov	x0, x21
	bl	_spin_unlock_irqrestore
Lloh24:
	adrp	x8, _TASK_RUNNING@GOTPAGE
Lloh25:
	ldr	x8, [x8, _TASK_RUNNING@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	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
	b	_set_current_state
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rs_wait_until_sent"

	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_HZ,4,2                         ; @HZ
	.comm	_UART_ESI_CMD1,4,2              ; @UART_ESI_CMD1
	.comm	_ESI_NO_COMMAND,4,2             ; @ESI_NO_COMMAND
	.comm	_ESI_GET_TX_AVAIL,4,2           ; @ESI_GET_TX_AVAIL
	.comm	_UART_ESI_STAT1,4,2             ; @UART_ESI_STAT1
	.comm	_UART_ESI_STAT2,4,2             ; @UART_ESI_STAT2
	.comm	_current,4,2                    ; @current
	.comm	_TASK_RUNNING,4,2               ; @TASK_RUNNING
	.no_dead_strip	_rs_wait_until_sent
.subsections_via_symbols
