	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mantis_uart_read
_mantis_uart_read:                      ## @mantis_uart_read
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %rbx
	movq	_MANTIS_DEBUG@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rdx
	movl	$1, %esi
	xorl	%eax, %eax
	callq	_dprintk
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rbx)
	js	LBB0_9
## %bb.1:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	$-1, %r15d
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	orl	%r14d, %ebx
	orl	%r13d, %r12d
	incl	%r15d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpl	(%rax), %r15d
	jge	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_MANTIS_UART_RXD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_mmread
	movl	%eax, %r13d
	movq	_MANTIS_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	leaq	L_.str.1(%rip), %rdx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_dprintk
	testb	$-128, %r13b
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_MANTIS_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	leaq	L_.str.2(%rip), %rdx
	xorl	%eax, %eax
	callq	_dprintk
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	shll	$8, %ebx
	movl	%r13d, %r14d
	andl	$63, %r14d
	testb	$64, %r13b
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_MANTIS_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	leaq	L_.str.3(%rip), %rdx
	xorl	%eax, %eax
	callq	_dprintk
	jmp	LBB0_6
LBB0_7:
	movq	_MANTIS_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rdx
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_dprintk
	testb	$-64, %r12b
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_10
## %bb.8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	(%r15), %edi
	leaq	L_.str.4(%rip), %rdx
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_dprintk
LBB0_10:
	movq	%r14, %rdi
	movl	%ebx, %esi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mantis_input_process           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MANTIS_DEBUG,4,2               ## @MANTIS_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"UART Reading ..."

	.comm	_MANTIS_UART_RXD,4,2            ## @MANTIS_UART_RXD
L_.str.1:                               ## @.str.1
	.asciz	" <%02x>"

	.comm	_MANTIS_ERROR,4,2               ## @MANTIS_ERROR
L_.str.2:                               ## @.str.2
	.asciz	"UART framing error"

L_.str.3:                               ## @.str.3
	.asciz	"UART parity error"

L_.str.4:                               ## @.str.4
	.asciz	"\n"

	.no_dead_strip	_mantis_uart_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mantis_uart_read
_mantis_uart_read:                      ; @mantis_uart_read
	.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, x0
	ldr	x26, [x0]
Lloh0:
	adrp	x25, _MANTIS_DEBUG@GOTPAGE
Lloh1:
	ldr	x25, [x25, _MANTIS_DEBUG@GOTPAGEOFF]
	ldr	w0, [x25]
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
	mov	w1, #1
	bl	_dprintk
	ldr	w8, [x26]
	tbnz	w8, #31, LBB0_9
; %bb.1:
	str	x21, [sp, #8]                   ; 8-byte Folded Spill
	mov	w27, #0
	mov	w20, #0
	mov	w28, #-1
Lloh4:
	adrp	x19, _MANTIS_UART_RXD@GOTPAGE
Lloh5:
	ldr	x19, [x19, _MANTIS_UART_RXD@GOTPAGEOFF]
Lloh6:
	adrp	x21, l_.str.1@PAGE
Lloh7:
	add	x21, x21, l_.str.1@PAGEOFF
Lloh8:
	adrp	x22, _MANTIS_ERROR@GOTPAGE
Lloh9:
	ldr	x22, [x22, _MANTIS_ERROR@GOTPAGEOFF]
Lloh10:
	adrp	x23, l_.str.2@PAGE
Lloh11:
	add	x23, x23, l_.str.2@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	and	w8, w24, #0x3f
	bfi	w8, w20, #8, #24
	mov	x20, x8
	orr	w27, w24, w27
	ldr	w8, [x26]
	add	w28, w28, #1
	cmp	w28, w8
	b.ge	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	bl	_mmread
	mov	x24, x0
	ldr	w0, [x25]
	str	x24, [sp]
	mov	w1, #0
	mov	x2, x21
	bl	_dprintk
	tbz	w24, #7, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x22]
	mov	w1, #1
	mov	x2, x23
	bl	_dprintk
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	tbz	w24, #6, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x22]
	mov	w1, #1
Lloh12:
	adrp	x2, l_.str.3@PAGE
Lloh13:
	add	x2, x2, l_.str.3@PAGEOFF
	bl	_dprintk
	b	LBB0_2
LBB0_7:
	and	w19, w27, #0xc0
	ldr	w0, [x25]
Lloh14:
	adrp	x2, l_.str.4@PAGE
Lloh15:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	w1, #0
	bl	_dprintk
	ldr	x21, [sp, #8]                   ; 8-byte Folded Reload
	cbz	w19, LBB0_10
; %bb.8:
	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_9:
	ldr	w0, [x25]
Lloh16:
	adrp	x2, l_.str.4@PAGE
Lloh17:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	w1, #0
	bl	_dprintk
	mov	w20, #0
LBB0_10:
	mov	x0, x21
	mov	x1, x20
	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
	b	_mantis_input_process
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MANTIS_DEBUG,4,2               ; @MANTIS_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"UART Reading ..."

	.comm	_MANTIS_UART_RXD,4,2            ; @MANTIS_UART_RXD
l_.str.1:                               ; @.str.1
	.asciz	" <%02x>"

	.comm	_MANTIS_ERROR,4,2               ; @MANTIS_ERROR
l_.str.2:                               ; @.str.2
	.asciz	"UART framing error"

l_.str.3:                               ; @.str.3
	.asciz	"UART parity error"

l_.str.4:                               ; @.str.4
	.asciz	"\n"

	.no_dead_strip	_mantis_uart_read
.subsections_via_symbols
