	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uart_write                     ## -- Begin function uart_write
	.p2align	4, 0x90
_uart_write:                            ## @uart_write
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %ebx
	movq	%rdi, %r12
	leaq	36(%rdi), %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	movq	_LCR_DLAB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_5
## %bb.1:
	movq	_REG_DLL@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_3
## %bb.2:
	movl	%r15d, 4(%r12)
	jmp	LBB0_33
LBB0_3:
	movq	_REG_DLH@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_5
## %bb.4:
	movl	%r15d, 8(%r12)
	jmp	LBB0_33
LBB0_5:
	addl	$-128, %ebx
	cmpl	$7, %ebx
	ja	LBB0_33
## %bb.6:
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rbx,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_7:
	movl	%r15d, 32(%r12)
	jmp	LBB0_33
LBB0_8:
	andl	$31, %r15d
	movl	%r15d, 12(%r12)
	movl	%r15d, %edi
	callq	_modem_status
	movq	_MSR_CTS@GOTPCREL(%rip), %rcx
	movl	28(%r12), %edx
	movl	%edx, %esi
	xorl	%eax, %esi
	movl	(%rcx), %ecx
	andl	%esi, %ecx
	movq	_MSR_DCTS@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	orl	%edx, %edi
	movl	%edi, %ebx
	xorl	%eax, %ebx
	testl	%ecx, %ecx
	cmovel	%esi, %ebx
	cmovel	%edx, %edi
	movq	_MSR_DSR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	%ebx, %esi
	movq	_MSR_DDSR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%edi, %ecx
	movl	%ecx, %edx
	xorl	%eax, %edx
	testl	%esi, %esi
	cmovel	%ebx, %edx
	cmovel	%edi, %ecx
	movq	_MSR_DCD@GOTPCREL(%rip), %rsi
	andl	(%rsi), %edx
	je	LBB0_10
## %bb.9:
	movq	_MSR_DDCD@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_10:
	orl	%edx, %ecx
	movq	_MSR_RI@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	movl	%edi, %edx
	andl	%ecx, %edx
	xorl	%esi, %esi
	testl	%eax, %edi
	jne	LBB0_12
## %bb.11:
	movq	_MSR_TERI@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
LBB0_12:
	testl	%edx, %edx
	cmovel	%edx, %esi
	orl	%esi, %ecx
	movq	_MSR_DELTA_MASK@GOTPCREL(%rip), %rdx
	andl	(%rdx), %ecx
	orl	%eax, %ecx
	movl	%ecx, 28(%r12)
	jmp	LBB0_33
LBB0_13:
	movl	%r15d, (%r12)
	jmp	LBB0_33
LBB0_14:
	movq	_IER_ETXRDY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 20(%r12)
	jne	LBB0_17
## %bb.15:
	andl	%r15d, %eax
	je	LBB0_17
## %bb.16:
	movl	$1, 16(%r12)
LBB0_17:
	andl	$15, %r15d
	movl	%r15d, 20(%r12)
	jmp	LBB0_33
LBB0_18:
	movq	_FCR_ENABLE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	movl	24(%r12), %edx
	andl	%eax, %edx
	movl	%eax, %ecx
	andl	%r15d, %ecx
	cmpl	%ecx, %edx
	je	LBB0_22
## %bb.19:
	movl	$1, %esi
	testl	%ecx, %ecx
	je	LBB0_21
## %bb.20:
	movq	_FIFOSZ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_21:
	movq	%r12, %rdi
	callq	_rxfifo_reset
	movl	(%rbx), %eax
LBB0_22:
	testl	%r15d, %eax
	je	LBB0_29
## %bb.23:
	movq	_FCR_RCV_RST@GOTPCREL(%rip), %rcx
	testl	%r15d, (%rcx)
	je	LBB0_25
## %bb.24:
	movq	_FIFOSZ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rxfifo_reset
	movl	(%rbx), %eax
LBB0_25:
	movq	_FCR_DMA@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_FCR_RX_MASK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	andl	%r15d, %eax
	movl	%eax, 24(%r12)
	jmp	LBB0_33
LBB0_26:
	movq	_MCR_LOOPBACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 12(%r12)
	je	LBB0_30
## %bb.27:
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_rxfifo_putchar
	testl	%eax, %eax
	je	LBB0_32
## %bb.28:
	movq	_LSR_OE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 44(%r12)
	jmp	LBB0_32
LBB0_29:
	movl	$0, 24(%r12)
	jmp	LBB0_33
LBB0_30:
	cmpl	$0, 40(%r12)
	je	LBB0_32
## %bb.31:
	leaq	40(%r12), %rdi
	movl	%r15d, %esi
	callq	_ttywrite
LBB0_32:
	movl	$1, 16(%r12)
LBB0_33:
	movq	%r12, %rdi
	callq	_uart_toggle_intr
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pthread_mutex_unlock           ## TAILCALL
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_33, LBB0_33-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_18, LBB0_18-LJTI0_0
.set L0_0_set_26, LBB0_26-LJTI0_0
LJTI0_0:
	.long	L0_0_set_7
	.long	L0_0_set_33
	.long	L0_0_set_8
	.long	L0_0_set_33
	.long	L0_0_set_13
	.long	L0_0_set_14
	.long	L0_0_set_18
	.long	L0_0_set_26
	.end_data_region
                                        ## -- End function
	.comm	_LCR_DLAB,4,2                   ## @LCR_DLAB
	.comm	_REG_DLL,4,2                    ## @REG_DLL
	.comm	_REG_DLH,4,2                    ## @REG_DLH
	.comm	_MCR_LOOPBACK,4,2               ## @MCR_LOOPBACK
	.comm	_LSR_OE,4,2                     ## @LSR_OE
	.comm	_IER_ETXRDY,4,2                 ## @IER_ETXRDY
	.comm	_FCR_ENABLE,4,2                 ## @FCR_ENABLE
	.comm	_FIFOSZ,4,2                     ## @FIFOSZ
	.comm	_FCR_RCV_RST,4,2                ## @FCR_RCV_RST
	.comm	_FCR_DMA,4,2                    ## @FCR_DMA
	.comm	_FCR_RX_MASK,4,2                ## @FCR_RX_MASK
	.comm	_MSR_CTS,4,2                    ## @MSR_CTS
	.comm	_MSR_DCTS,4,2                   ## @MSR_DCTS
	.comm	_MSR_DSR,4,2                    ## @MSR_DSR
	.comm	_MSR_DDSR,4,2                   ## @MSR_DDSR
	.comm	_MSR_DCD,4,2                    ## @MSR_DCD
	.comm	_MSR_DDCD,4,2                   ## @MSR_DDCD
	.comm	_MSR_RI,4,2                     ## @MSR_RI
	.comm	_MSR_TERI,4,2                   ## @MSR_TERI
	.comm	_MSR_DELTA_MASK,4,2             ## @MSR_DELTA_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uart_write                     ; -- Begin function uart_write
	.p2align	2
_uart_write:                            ; @uart_write
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	add	x19, x0, #36
	mov	x0, x19
	bl	_pthread_mutex_lock
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _LCR_DLAB@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LCR_DLAB@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.1:
Lloh3:
	adrp	x8, _REG_DLL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_DLL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_3
; %bb.2:
	str	w21, [x20, #4]
	b	LBB0_26
LBB0_3:
Lloh6:
	adrp	x8, _REG_DLH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_DLH@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_5
; %bb.4:
	str	w21, [x20, #8]
	b	LBB0_26
LBB0_5:
	sub	w8, w22, #128
	cmp	w8, #7
	b.hi	LBB0_26
; %bb.6:
Lloh9:
	adrp	x9, lJTI0_0@PAGE
Lloh10:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_7
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_7:
	str	w21, [x20, #32]
	b	LBB0_26
LBB0_8:
	and	w0, w21, #0x1f
	str	w0, [x20, #12]
	bl	_modem_status
Lloh11:
	adrp	x8, _MSR_CTS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MSR_CTS@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldr	w9, [x20, #28]
	eor	w10, w9, w0
Lloh14:
	adrp	x11, _MSR_DCTS@GOTPAGE
Lloh15:
	ldr	x11, [x11, _MSR_DCTS@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x11]
	orr	w11, w11, w9
	eor	w12, w11, w0
	tst	w10, w8
	csel	w8, w10, w12, eq
Lloh17:
	adrp	x10, _MSR_DSR@GOTPAGE
Lloh18:
	ldr	x10, [x10, _MSR_DSR@GOTPAGEOFF]
	csel	w9, w9, w11, eq
Lloh19:
	ldr	w10, [x10]
Lloh20:
	adrp	x11, _MSR_DDSR@GOTPAGE
Lloh21:
	ldr	x11, [x11, _MSR_DDSR@GOTPAGEOFF]
Lloh22:
	ldr	w11, [x11]
	orr	w11, w11, w9
	eor	w12, w11, w0
	tst	w8, w10
	csel	w8, w8, w12, eq
	csel	w9, w9, w11, eq
Lloh23:
	adrp	x10, _MSR_DCD@GOTPAGE
Lloh24:
	ldr	x10, [x10, _MSR_DCD@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
Lloh26:
	adrp	x11, _MSR_DDCD@GOTPAGE
Lloh27:
	ldr	x11, [x11, _MSR_DDCD@GOTPAGEOFF]
Lloh28:
	ldr	w11, [x11]
	tst	w8, w10
	csel	w8, wzr, w11, eq
	orr	w8, w9, w8
Lloh29:
	adrp	x9, _MSR_RI@GOTPAGE
Lloh30:
	ldr	x9, [x9, _MSR_RI@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	and	w10, w9, w8
	tst	w9, w0
	ccmp	w10, #0, #4, eq
Lloh32:
	adrp	x9, _MSR_TERI@GOTPAGE
Lloh33:
	ldr	x9, [x9, _MSR_TERI@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	csel	w9, w9, wzr, ne
	orr	w8, w8, w9
Lloh35:
	adrp	x9, _MSR_DELTA_MASK@GOTPAGE
Lloh36:
	ldr	x9, [x9, _MSR_DELTA_MASK@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	and	w8, w8, w9
	orr	w8, w8, w0
	str	w8, [x20, #28]
	b	LBB0_26
LBB0_9:
	str	w21, [x20]
	b	LBB0_26
LBB0_10:
Lloh38:
	adrp	x8, _IER_ETXRDY@GOTPAGE
Lloh39:
	ldr	x8, [x8, _IER_ETXRDY@GOTPAGEOFF]
	ldr	w9, [x20, #20]
Lloh40:
	ldr	w8, [x8]
	and	w9, w8, w9
	and	w8, w8, w21
	cmp	w9, #0
	ccmp	w8, #0, #4, eq
	b.eq	LBB0_12
; %bb.11:
	mov	w8, #1
	str	w8, [x20, #16]
LBB0_12:
	and	w8, w21, #0xf
	str	w8, [x20, #20]
	b	LBB0_26
LBB0_13:
	ldr	w9, [x20, #24]
Lloh41:
	adrp	x22, _FCR_ENABLE@GOTPAGE
Lloh42:
	ldr	x22, [x22, _FCR_ENABLE@GOTPAGEOFF]
	ldr	w8, [x22]
	and	w10, w8, w9
	and	w9, w8, w21
	cmp	w10, w9
	b.eq	LBB0_15
; %bb.14:
Lloh43:
	adrp	x8, _FIFOSZ@GOTPAGE
Lloh44:
	ldr	x8, [x8, _FIFOSZ@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	cmp	w9, #0
	csinc	w1, w8, wzr, ne
	mov	x0, x20
	bl	_rxfifo_reset
	ldr	w8, [x22]
LBB0_15:
	tst	w8, w21
	b.eq	LBB0_22
; %bb.16:
Lloh46:
	adrp	x9, _FCR_RCV_RST@GOTPAGE
Lloh47:
	ldr	x9, [x9, _FCR_RCV_RST@GOTPAGEOFF]
Lloh48:
	ldr	w9, [x9]
	tst	w9, w21
	b.eq	LBB0_18
; %bb.17:
Lloh49:
	adrp	x8, _FIFOSZ@GOTPAGE
Lloh50:
	ldr	x8, [x8, _FIFOSZ@GOTPAGEOFF]
Lloh51:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rxfifo_reset
	ldr	w8, [x22]
LBB0_18:
Lloh52:
	adrp	x9, _FCR_DMA@GOTPAGE
Lloh53:
	ldr	x9, [x9, _FCR_DMA@GOTPAGEOFF]
Lloh54:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh55:
	adrp	x9, _FCR_RX_MASK@GOTPAGE
Lloh56:
	ldr	x9, [x9, _FCR_RX_MASK@GOTPAGEOFF]
Lloh57:
	ldr	w9, [x9]
	orr	w8, w8, w9
	and	w8, w8, w21
	str	w8, [x20, #24]
	b	LBB0_26
LBB0_19:
	ldr	w8, [x20, #12]
Lloh58:
	adrp	x9, _MCR_LOOPBACK@GOTPAGE
Lloh59:
	ldr	x9, [x9, _MCR_LOOPBACK@GOTPAGEOFF]
Lloh60:
	ldr	w9, [x9]
	mov	x0, x20
	tst	w9, w8
	b.eq	LBB0_23
; %bb.20:
	mov	x1, x21
	bl	_rxfifo_putchar
	cbz	w0, LBB0_25
; %bb.21:
Lloh61:
	adrp	x8, _LSR_OE@GOTPAGE
Lloh62:
	ldr	x8, [x8, _LSR_OE@GOTPAGEOFF]
Lloh63:
	ldr	w8, [x8]
	ldr	w9, [x20, #44]
	orr	w8, w9, w8
	str	w8, [x20, #44]
	b	LBB0_25
LBB0_22:
	str	wzr, [x20, #24]
	b	LBB0_26
LBB0_23:
	ldr	w8, [x0, #40]!
	cbz	w8, LBB0_25
; %bb.24:
	mov	x1, x21
	bl	_ttywrite
LBB0_25:
	mov	w8, #1
	str	w8, [x20, #16]
LBB0_26:
	mov	x0, x20
	bl	_uart_toggle_intr
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_pthread_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_7-LBB0_7)>>2
	.byte	(LBB0_26-LBB0_7)>>2
	.byte	(LBB0_8-LBB0_7)>>2
	.byte	(LBB0_26-LBB0_7)>>2
	.byte	(LBB0_9-LBB0_7)>>2
	.byte	(LBB0_10-LBB0_7)>>2
	.byte	(LBB0_13-LBB0_7)>>2
	.byte	(LBB0_19-LBB0_7)>>2
                                        ; -- End function
	.comm	_LCR_DLAB,4,2                   ; @LCR_DLAB
	.comm	_REG_DLL,4,2                    ; @REG_DLL
	.comm	_REG_DLH,4,2                    ; @REG_DLH
	.comm	_MCR_LOOPBACK,4,2               ; @MCR_LOOPBACK
	.comm	_LSR_OE,4,2                     ; @LSR_OE
	.comm	_IER_ETXRDY,4,2                 ; @IER_ETXRDY
	.comm	_FCR_ENABLE,4,2                 ; @FCR_ENABLE
	.comm	_FIFOSZ,4,2                     ; @FIFOSZ
	.comm	_FCR_RCV_RST,4,2                ; @FCR_RCV_RST
	.comm	_FCR_DMA,4,2                    ; @FCR_DMA
	.comm	_FCR_RX_MASK,4,2                ; @FCR_RX_MASK
	.comm	_MSR_CTS,4,2                    ; @MSR_CTS
	.comm	_MSR_DCTS,4,2                   ; @MSR_DCTS
	.comm	_MSR_DSR,4,2                    ; @MSR_DSR
	.comm	_MSR_DDSR,4,2                   ; @MSR_DDSR
	.comm	_MSR_DCD,4,2                    ; @MSR_DCD
	.comm	_MSR_DDCD,4,2                   ; @MSR_DDCD
	.comm	_MSR_RI,4,2                     ; @MSR_RI
	.comm	_MSR_TERI,4,2                   ; @MSR_TERI
	.comm	_MSR_DELTA_MASK,4,2             ; @MSR_DELTA_MASK
.subsections_via_symbols
