	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sx_receive
_sx_receive:                            ## @sx_receive
	.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
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_func_enter
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_sx_get_port
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	8(%rax), %r15
	movq	_CD186x_RDCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_sx_in
	movl	%eax, %ebx
	movq	_SX_DEBUG_RX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movzbl	%bl, %r13d
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_dprintk
	cmpl	$9, %r13d
	movl	$9, %eax
	cmovbl	%r13d, %eax
	movq	(%r12), %rcx
	incl	(%rcx,%rax,4)
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_tty_buffer_request_room
	testb	%bl, %bl
	je	LBB0_5
## %bb.3:
	movq	_CD186x_RDR@GOTPCREL(%rip), %r12
	movq	_TTY_NORMAL@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_sx_in
	movl	(%r13), %edx
	movzbl	%al, %esi
	movq	%r15, %rdi
	callq	_tty_insert_flip_char
	decb	%bl
	jne	LBB0_4
LBB0_5:
	movq	%r15, %rdi
	callq	_tty_flip_buffer_push
	jmp	LBB0_6
LBB0_1:
	movq	_SX_DEBUG_RX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dprintk
LBB0_6:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_func_exit                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Receive"

	.comm	_SX_DEBUG_RX,4,2                ## @SX_DEBUG_RX
L_.str.1:                               ## @.str.1
	.asciz	"Hmm, couldn't find port.\n"

	.comm	_CD186x_RDCR,4,2                ## @CD186x_RDCR
L_.str.2:                               ## @.str.2
	.asciz	"port: %p: count: %d\n"

	.comm	_CD186x_RDR,4,2                 ## @CD186x_RDR
	.comm	_TTY_NORMAL,4,2                 ## @TTY_NORMAL
	.no_dead_strip	_sx_receive
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sx_receive
_sx_receive:                            ; @sx_receive
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	bl	_func_enter
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_sx_get_port
	cbz	x0, LBB0_5
; %bb.1:
	mov	x22, x0
	ldr	x20, [x0, #8]
Lloh2:
	adrp	x8, _CD186x_RDCR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CD186x_RDCR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sx_in
	mov	x21, x0
Lloh5:
	adrp	x8, _SX_DEBUG_RX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SX_DEBUG_RX@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	w8, w21
	stp	x22, x8, [sp]
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dprintk
	ldr	x8, [x22]
	mov	w9, #9
	cmp	w21, #9
	csel	w9, w21, w9, lo
	lsl	x9, x9, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
	mov	x0, x20
	mov	x1, x21
	bl	_tty_buffer_request_room
	cbz	w21, LBB0_4
; %bb.2:
Lloh10:
	adrp	x22, _CD186x_RDR@GOTPAGE
Lloh11:
	ldr	x22, [x22, _CD186x_RDR@GOTPAGEOFF]
Lloh12:
	adrp	x23, _TTY_NORMAL@GOTPAGE
Lloh13:
	ldr	x23, [x23, _TTY_NORMAL@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	sub	w21, w21, #1
	and	w24, w21, #0xff
	ldr	w1, [x22]
	mov	x0, x19
	bl	_sx_in
	mov	x1, x0
	ldr	w2, [x23]
	mov	x0, x20
	bl	_tty_insert_flip_char
	cbnz	w24, LBB0_3
LBB0_4:
	mov	x0, x20
	bl	_tty_flip_buffer_push
	b	LBB0_6
LBB0_5:
Lloh14:
	adrp	x8, _SX_DEBUG_RX@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SX_DEBUG_RX@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dprintk
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_func_exit
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Receive"

	.comm	_SX_DEBUG_RX,4,2                ; @SX_DEBUG_RX
l_.str.1:                               ; @.str.1
	.asciz	"Hmm, couldn't find port.\n"

	.comm	_CD186x_RDCR,4,2                ; @CD186x_RDCR
l_.str.2:                               ; @.str.2
	.asciz	"port: %p: count: %d\n"

	.comm	_CD186x_RDR,4,2                 ; @CD186x_RDR
	.comm	_TTY_NORMAL,4,2                 ; @TTY_NORMAL
	.no_dead_strip	_sx_receive
.subsections_via_symbols
