	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uart_read                      ## -- Begin function uart_read
	.p2align	4, 0x90
_uart_read:                             ## @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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	leaq	40(%rdi), %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	movl	(%r15), %r12d
	movq	_LCR_DLAB@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_5
## %bb.1:
	movq	_REG_DLL@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_3
## %bb.2:
	movl	4(%r15), %r12d
	jmp	LBB0_22
LBB0_3:
	movq	_REG_DLH@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_5
## %bb.4:
	movl	8(%r15), %r12d
	jmp	LBB0_22
LBB0_5:
	addl	$-128, %ebx
	cmpl	$7, %ebx
	ja	LBB0_6
## %bb.7:
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rbx,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_21:
	movl	36(%r15), %r12d
	jmp	LBB0_22
LBB0_6:
	movl	$255, %r12d
	jmp	LBB0_22
LBB0_20:
	movl	32(%r15), %r12d
	movq	_MSR_DELTA_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%r12d, %eax
	movl	%eax, 32(%r15)
	jmp	LBB0_22
LBB0_15:
	movl	24(%r15), %r12d
	jmp	LBB0_22
LBB0_16:
	movq	_LSR_TEMT@GOTPCREL(%rip), %rax
	movq	_LSR_THRE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%ecx, 28(%r15)
	movq	%r15, %rdi
	callq	_rxfifo_numchars
	movq	_LSR_RXRDY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	testl	%eax, %eax
	jle	LBB0_18
## %bb.17:
	orl	28(%r15), %r12d
	jmp	LBB0_19
LBB0_10:
	movq	_FCR_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	16(%r15), %r12d
	je	LBB0_12
## %bb.11:
	movq	_IIR_FIFO_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_12:
	movq	%r15, %rdi
	callq	_uart_intr_reason
	movq	_IIR_TXRDY@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_14
## %bb.13:
	movl	$0, 20(%r15)
LBB0_14:
	orl	%eax, %r12d
	jmp	LBB0_22
LBB0_9:
	movl	12(%r15), %r12d
	jmp	LBB0_22
LBB0_8:
	movq	%r15, %rdi
	callq	_rxfifo_getchar
	movl	%eax, %r12d
	jmp	LBB0_22
LBB0_18:
	notl	%r12d
	andl	28(%r15), %r12d
LBB0_19:
	movq	_LSR_OE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%r12d, %eax
	movl	%eax, 28(%r15)
LBB0_22:
	movq	%r15, %rdi
	callq	_uart_toggle_intr
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_21, LBB0_21-LJTI0_0
.set L0_0_set_20, LBB0_20-LJTI0_0
.set L0_0_set_15, LBB0_15-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_22, LBB0_22-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
LJTI0_0:
	.long	L0_0_set_21
	.long	L0_0_set_20
	.long	L0_0_set_15
	.long	L0_0_set_16
	.long	L0_0_set_22
	.long	L0_0_set_10
	.long	L0_0_set_9
	.long	L0_0_set_8
	.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	_FCR_ENABLE,4,2                 ## @FCR_ENABLE
	.comm	_IIR_FIFO_MASK,4,2              ## @IIR_FIFO_MASK
	.comm	_IIR_TXRDY,4,2                  ## @IIR_TXRDY
	.comm	_LSR_TEMT,4,2                   ## @LSR_TEMT
	.comm	_LSR_THRE,4,2                   ## @LSR_THRE
	.comm	_LSR_RXRDY,4,2                  ## @LSR_RXRDY
	.comm	_LSR_OE,4,2                     ## @LSR_OE
	.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_read                      ; -- Begin function uart_read
	.p2align	2
_uart_read:                             ; @uart_read
	.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	x22, x1
	mov	x20, x0
	add	x19, x0, #40
	mov	x0, x19
	bl	_pthread_mutex_lock
	ldr	w21, [x20]
Lloh0:
	adrp	x8, _LCR_DLAB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LCR_DLAB@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w21
	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:
	ldr	w21, [x20, #4]
	b	LBB0_20
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:
	ldr	w21, [x20, #8]
	b	LBB0_20
LBB0_5:
	sub	w8, w22, #128
	cmp	w8, #7
	b.hi	LBB0_8
; %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:
	ldr	w21, [x20, #36]
	b	LBB0_20
LBB0_8:
	mov	w21, #255
	b	LBB0_20
LBB0_9:
	ldr	w21, [x20, #32]
Lloh11:
	adrp	x8, _MSR_DELTA_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MSR_DELTA_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	bic	w8, w21, w8
	str	w8, [x20, #32]
	b	LBB0_20
LBB0_10:
	ldr	w21, [x20, #24]
	b	LBB0_20
LBB0_11:
Lloh14:
	adrp	x8, _LSR_TEMT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _LSR_TEMT@GOTPAGEOFF]
Lloh16:
	adrp	x9, _LSR_THRE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _LSR_THRE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x20, #28]
	orr	w8, w8, w9
	str	w8, [x20, #28]
	mov	x0, x20
	bl	_rxfifo_numchars
Lloh20:
	adrp	x8, _LSR_RXRDY@GOTPAGE
Lloh21:
	ldr	x8, [x8, _LSR_RXRDY@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	cmp	w0, #1
	b.lt	LBB0_18
; %bb.12:
	ldr	w9, [x20, #28]
	orr	w21, w9, w8
	b	LBB0_19
LBB0_13:
	ldr	w8, [x20, #16]
Lloh23:
	adrp	x9, _FCR_ENABLE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _FCR_ENABLE@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
Lloh26:
	adrp	x10, _IIR_FIFO_MASK@GOTPAGE
Lloh27:
	ldr	x10, [x10, _IIR_FIFO_MASK@GOTPAGEOFF]
Lloh28:
	ldr	w10, [x10]
	tst	w9, w8
	csel	w21, wzr, w10, eq
	mov	x0, x20
	bl	_uart_intr_reason
Lloh29:
	adrp	x8, _IIR_TXRDY@GOTPAGE
Lloh30:
	ldr	x8, [x8, _IIR_TXRDY@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_15
; %bb.14:
	str	wzr, [x20, #20]
LBB0_15:
	orr	w21, w21, w0
	b	LBB0_20
LBB0_16:
	ldr	w21, [x20, #12]
	b	LBB0_20
LBB0_17:
	mov	x0, x20
	bl	_rxfifo_getchar
	mov	x21, x0
	b	LBB0_20
LBB0_18:
	ldr	w9, [x20, #28]
	bic	w21, w9, w8
LBB0_19:
Lloh32:
	adrp	x8, _LSR_OE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _LSR_OE@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	bic	w8, w21, w8
	str	w8, [x20, #28]
LBB0_20:
	mov	x0, x20
	bl	_uart_toggle_intr
	mov	x0, x19
	bl	_pthread_mutex_unlock
	mov	x0, x21
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh18
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_7-LBB0_7)>>2
	.byte	(LBB0_9-LBB0_7)>>2
	.byte	(LBB0_10-LBB0_7)>>2
	.byte	(LBB0_11-LBB0_7)>>2
	.byte	(LBB0_20-LBB0_7)>>2
	.byte	(LBB0_13-LBB0_7)>>2
	.byte	(LBB0_16-LBB0_7)>>2
	.byte	(LBB0_17-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	_FCR_ENABLE,4,2                 ; @FCR_ENABLE
	.comm	_IIR_FIFO_MASK,4,2              ; @IIR_FIFO_MASK
	.comm	_IIR_TXRDY,4,2                  ; @IIR_TXRDY
	.comm	_LSR_TEMT,4,2                   ; @LSR_TEMT
	.comm	_LSR_THRE,4,2                   ; @LSR_THRE
	.comm	_LSR_RXRDY,4,2                  ; @LSR_RXRDY
	.comm	_LSR_OE,4,2                     ; @LSR_OE
	.comm	_MSR_DELTA_MASK,4,2             ; @MSR_DELTA_MASK
.subsections_via_symbols
