	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uart_phyp_get
_uart_phyp_get:                         ## @uart_phyp_get
	.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
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	leaq	16(%rdi), %r14
	movq	%r14, %rdi
	callq	_uart_lock
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	cmpq	%r15, %rax
	cmovbq	%rax, %r15
LBB0_8:
	movq	24(%rbx), %rsi
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_memcpy
	movq	(%rbx), %rdx
	subq	%r15, %rdx
	movq	%rdx, (%rbx)
	je	LBB0_10
## %bb.9:
	movq	24(%rbx), %rdi
	leaq	(%rdi,%r15,4), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memmove
LBB0_10:
	movq	%r14, %rdi
	callq	_uart_unlock
LBB0_11:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_H_GET_TERM_CHAR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	40(%rbx), %esi
	movq	32(%rbx), %rax
	leaq	4(%rax), %r10
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movq	%rbx, %r9
	pushq	%r10
	pushq	%rax
	callq	_phyp_pft_hcall
	addq	$16, %rsp
	movq	_H_SUCCESS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_3
## %bb.4:
	movq	(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_5
## %bb.6:
	cmpq	%r15, %rdx
	cmovbq	%rdx, %r15
	movq	8(%rbx), %rax
	movq	_HVTERMPROT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	addq	$-4, %rdx
	movq	%rdx, (%rbx)
	movq	24(%rbx), %rdi
	leaq	16(%rdi), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memmove
	jmp	LBB0_8
LBB0_3:
	movq	%r14, %rdi
	callq	_uart_unlock
	movl	$-1, %r15d
	jmp	LBB0_11
LBB0_5:
	movq	%r14, %rdi
	callq	_uart_unlock
	xorl	%r15d, %r15d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_H_GET_TERM_CHAR,4,2            ## @H_GET_TERM_CHAR
	.comm	_H_SUCCESS,4,2                  ## @H_SUCCESS
	.comm	_HVTERMPROT,8,3                 ## @HVTERMPROT
	.no_dead_strip	_uart_phyp_get
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uart_phyp_get
_uart_phyp_get:                         ; @uart_phyp_get
	.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, x2
	mov	x21, x1
	mov	x20, x0
	add	x19, x0, #16
	mov	x0, x19
	bl	_uart_lock
	ldr	x8, [x20]
	cbz	x8, LBB0_6
; %bb.1:
	cmp	x8, x22
	csel	x22, x8, x22, lo
LBB0_2:
	ldr	x1, [x20, #24]
	mov	x0, x21
	mov	x2, x22
	bl	_memcpy
	ldr	x8, [x20]
	subs	x2, x8, x22
	str	x2, [x20]
	b.eq	LBB0_4
; %bb.3:
	ldr	x0, [x20, #24]
	add	x1, x0, x22, lsl #2
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memmove
LBB0_4:
	mov	x0, x19
	bl	_uart_unlock
LBB0_5:
	mov	x0, x22
	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
LBB0_6:
Lloh0:
	adrp	x8, _H_GET_TERM_CHAR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _H_GET_TERM_CHAR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	w1, [x20, #40]
	ldr	x6, [x20, #32]
	add	x7, x6, #4
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	x5, x20
	bl	_phyp_pft_hcall
Lloh3:
	adrp	x8, _H_SUCCESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _H_SUCCESS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.7:
	ldr	x8, [x20]
	cbz	x8, LBB0_11
; %bb.8:
	cmp	x8, x22
	csel	x22, x8, x22, lo
	ldr	x9, [x20, #8]
Lloh6:
	adrp	x10, _HVTERMPROT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _HVTERMPROT@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_2
; %bb.9:
	sub	x2, x8, #4
	str	x2, [x20]
	ldr	x0, [x20, #24]
	add	x1, x0, #16
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memmove
	b	LBB0_2
LBB0_10:
	mov	x0, x19
	bl	_uart_unlock
	mov	w22, #-1
	b	LBB0_5
LBB0_11:
	mov	x0, x19
	bl	_uart_unlock
	mov	w22, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_H_GET_TERM_CHAR,4,2            ; @H_GET_TERM_CHAR
	.comm	_H_SUCCESS,4,2                  ; @H_SUCCESS
	.comm	_HVTERMPROT,8,3                 ; @HVTERMPROT
	.no_dead_strip	_uart_phyp_get
.subsections_via_symbols
