	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sx_receive_chars
_sx_receive_chars:                      ## @sx_receive_chars
	.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	%rdi, %r12
	xorl	%eax, %eax
	callq	_func_enter2
	movq	16(%r12), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_SX_DEBUG_RECEIVE@GOTPCREL(%rip), %rbx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_hi_rxopos@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_sx_read_channel_byte
	movl	%eax, %r15d
	movq	_hi_rxipos@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_sx_read_channel_byte
	subl	%r15d, %eax
	movzbl	%al, %r14d
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_sx_dprintk
	leal	(%r14,%r15), %eax
	movl	$256, %ebx                      ## imm = 0x100
	subl	%r15d, %ebx
	cmpl	$257, %eax                      ## imm = 0x101
	cmovll	%r14d, %ebx
	movq	_SX_DEBUG_RECEIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %r13
	movq	%r13, %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_sx_dprintk
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	-64(%rbp), %rsi
	movl	%ebx, %edx
	movq	_SX_DEBUG_RECEIVE@GOTPCREL(%rip), %rbx
	callq	_tty_prepare_flip_string
	movl	%eax, %r14d
	movl	(%rbx), %edi
	movq	%r13, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_sx_dprintk
	testl	%r14d, %r14d
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%rbx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	8(%r12), %rbx
	movq	_hi_rxbuf@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_CHAN_OFFSET
	movslq	%r15d, %r13
	leaq	(%rax,%r13), %rsi
	movq	%rbx, %rdi
	callq	_read_sx_byte
	movl	%eax, %ebx
	movq	_hi_rxbuf@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_CHAN_OFFSET
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edx
	movl	%ebx, %ecx
	movq	%rax, %r8
	xorl	%eax, %eax
	callq	_sx_dprintk
	movq	-64(%rbp), %rbx
	movq	8(%r12), %rax
	movq	_hi_rxbuf@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	addq	(%rax), %r13
	movq	%r12, %rdi
	callq	_CHAN_OFFSET
	addq	%rax, %r13
	movq	%rbx, %rdi
	movq	_SX_DEBUG_RECEIVE@GOTPCREL(%rip), %rbx
	movq	%r13, %rsi
	movl	%r14d, %edx
	callq	_memcpy_fromio
	movq	_hi_rxopos@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	%r14d, %r15d
	movzbl	%r15b, %edx
	movq	%r12, %rdi
	callq	_sx_write_channel_byte
	addl	%r14d, -44(%rbp)                ## 4-byte Folded Spill
	jmp	LBB0_1
LBB0_3:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_5
## %bb.4:
	leaq	-80(%rbp), %rdi
	callq	_do_gettimeofday
	movl	(%rbx), %edi
	movl	(%r12), %edx
	movslq	-80(%rbp), %r8
	imulq	$-2004318071, %r8, %rax         ## imm = 0x88888889
	shrq	$32, %rax
	addl	%r8d, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	sarl	$5, %eax
	addl	%ecx, %eax
	imull	$60, %eax, %eax
	subl	%eax, %r8d
	movl	-72(%rbp), %r9d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %r11d
	movl	4(%rbx), %r10d
	leaq	L_.str.3(%rip), %rsi
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	xorl	%eax, %eax
	pushq	%r11
	pushq	%r10
	callq	_sx_dprintk
	addq	$16, %rsp
	movq	%rbx, %rdi
	callq	_tty_flip_buffer_push
LBB0_5:
	xorl	%eax, %eax
	callq	_func_exit
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_hi_rxopos,4,2                  ## @hi_rxopos
	.comm	_hi_rxipos,4,2                  ## @hi_rxipos
	.comm	_SX_DEBUG_RECEIVE,4,2           ## @SX_DEBUG_RECEIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rxop=%d, c = %d.\n"

L_.str.1:                               ## @.str.1
	.asciz	"c = %d.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Copying over %d chars. First is %d at %lx\n"

	.comm	_hi_rxbuf,4,2                   ## @hi_rxbuf
L_.str.3:                               ## @.str.3
	.asciz	"pushing flipq port %d (%3d chars): %d.%06d  (%d/%d)\n"

	.no_dead_strip	_sx_receive_chars
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sx_receive_chars
_sx_receive_chars:                      ; @sx_receive_chars
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x20, x0
	bl	_func_enter2
	mov	w28, #0
Lloh0:
	adrp	x23, _hi_rxopos@GOTPAGE
Lloh1:
	ldr	x23, [x23, _hi_rxopos@GOTPAGEOFF]
	ldr	x8, [x20, #16]
	str	x8, [sp, #48]                   ; 8-byte Folded Spill
Lloh2:
	adrp	x21, _SX_DEBUG_RECEIVE@GOTPAGE
Lloh3:
	ldr	x21, [x21, _SX_DEBUG_RECEIVE@GOTPAGEOFF]
Lloh4:
	adrp	x19, _hi_rxbuf@GOTPAGE
Lloh5:
	ldr	x19, [x19, _hi_rxbuf@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x20
	bl	_sx_read_channel_byte
	mov	x24, x0
Lloh6:
	adrp	x8, _hi_rxipos@GOTPAGE
Lloh7:
	ldr	x8, [x8, _hi_rxipos@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_sx_read_channel_byte
	sub	w8, w0, w24
	and	w25, w8, #0xff
	ldr	w0, [x21]
	str	x25, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x24
	bl	_sx_dprintk
	add	w8, w25, w24
	mov	w9, #256
	sub	w9, w9, w24
	cmp	w8, #256
	csel	w25, w9, w25, gt
	ldr	w0, [x21]
Lloh11:
	adrp	x22, l_.str.1@PAGE
Lloh12:
	add	x22, x22, l_.str.1@PAGEOFF
	mov	x1, x22
	mov	x2, x25
	bl	_sx_dprintk
	add	x1, sp, #72
	ldr	x0, [sp, #48]                   ; 8-byte Folded Reload
	mov	x2, x25
	bl	_tty_prepare_flip_string
	mov	x25, x0
	ldr	w0, [x21]
	mov	x1, x22
	mov	x2, x25
	bl	_sx_dprintk
	cbz	w25, LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w26, [x21]
	ldr	x27, [x20, #8]
	ldr	w1, [x19]
	mov	x0, x20
	bl	_CHAN_OFFSET
	mov	x22, x23
	sxtw	x23, w24
	add	x1, x0, x23
	mov	x0, x27
	bl	_read_sx_byte
	mov	x27, x0
	ldr	w1, [x19]
	mov	x0, x20
	bl	_CHAN_OFFSET
	stp	x27, x0, [sp]
	mov	x0, x26
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x25
	bl	_sx_dprintk
	ldr	x26, [sp, #72]
	ldr	x8, [x20, #8]
	ldr	x27, [x8]
	ldr	w1, [x19]
	mov	x0, x20
	bl	_CHAN_OFFSET
	add	x8, x27, x23
	mov	x23, x22
	add	x1, x8, x0
	mov	x0, x26
	mov	x2, x25
	bl	_memcpy_fromio
	ldr	w1, [x22]
	add	w8, w25, w24
	and	w2, w8, #0xff
	mov	x0, x20
	bl	_sx_write_channel_byte
	add	w28, w25, w28
	b	LBB0_1
LBB0_3:
	cbz	w28, LBB0_5
; %bb.4:
	add	x0, sp, #56
	bl	_do_gettimeofday
	ldr	w0, [x21]
	ldr	w2, [x20]
	ldrsw	x8, [sp, #56]
	mov	x9, #-30583
	movk	x9, #34952, lsl #16
	mul	x9, x8, x9
	lsr	x9, x9, #32
	add	w9, w9, w8
	asr	w10, w9, #5
	add	w9, w10, w9, lsr #31
	mov	w10, #60
	msub	w8, w9, w10, w8
	ldr	x9, [sp, #64]
	ldr	x19, [sp, #48]                  ; 8-byte Folded Reload
	ldp	w11, w10, [x19]
	stp	x10, x11, [sp, #24]
	stp	x8, x9, [sp, #8]
	str	x28, [sp]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_sx_dprintk
	mov	x0, x19
	bl	_tty_flip_buffer_push
LBB0_5:
	bl	_func_exit
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_hi_rxopos,4,2                  ; @hi_rxopos
	.comm	_hi_rxipos,4,2                  ; @hi_rxipos
	.comm	_SX_DEBUG_RECEIVE,4,2           ; @SX_DEBUG_RECEIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rxop=%d, c = %d.\n"

l_.str.1:                               ; @.str.1
	.asciz	"c = %d.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Copying over %d chars. First is %d at %lx\n"

	.comm	_hi_rxbuf,4,2                   ; @hi_rxbuf
l_.str.3:                               ; @.str.3
	.asciz	"pushing flipq port %d (%3d chars): %d.%06d  (%d/%d)\n"

	.no_dead_strip	_sx_receive_chars
.subsections_via_symbols
