	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aml8726_uart_bus_flush
_aml8726_uart_bus_flush:                ## @aml8726_uart_bus_flush
	.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
	movl	%esi, %r12d
	movq	%rdi, %r14
	leaq	4(%rdi), %r15
	movl	(%rdi), %edi
	callq	_uart_lock
	movq	_AML_UART_CONTROL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_uart_getreg
	movq	_UART_FLUSH_TRANSMITTER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movq	_AML_UART_CONTROL_TX_RST@GOTPCREL(%rip), %rcx
	andl	%r12d, %ebx
	je	LBB0_2
## %bb.1:
	movl	(%rcx), %ebx
LBB0_2:
	orl	%eax, %ebx
	movq	_UART_FLUSH_RECEIVER@GOTPCREL(%rip), %rax
	movq	_AML_UART_CONTROL_RX_RST@GOTPCREL(%rip), %r13
	andl	(%rax), %r12d
	je	LBB0_4
## %bb.3:
	movl	(%r13), %r12d
LBB0_4:
	orl	%r12d, %ebx
	movq	_AML_UART_CONTROL_REG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_uart_setreg
	movq	%r15, %rdi
	callq	_uart_barrier
	movl	(%r13), %edx
	movq	_AML_UART_CONTROL_TX_RST@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	notl	%edx
	andl	%ebx, %edx
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_uart_setreg
	movq	%r15, %rdi
	callq	_uart_barrier
	movl	(%r14), %edi
	callq	_uart_unlock
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AML_UART_CONTROL_REG,4,2       ## @AML_UART_CONTROL_REG
	.comm	_UART_FLUSH_TRANSMITTER,4,2     ## @UART_FLUSH_TRANSMITTER
	.comm	_AML_UART_CONTROL_TX_RST,4,2    ## @AML_UART_CONTROL_TX_RST
	.comm	_UART_FLUSH_RECEIVER,4,2        ## @UART_FLUSH_RECEIVER
	.comm	_AML_UART_CONTROL_RX_RST,4,2    ## @AML_UART_CONTROL_RX_RST
	.no_dead_strip	_aml8726_uart_bus_flush
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aml8726_uart_bus_flush
_aml8726_uart_bus_flush:                ; @aml8726_uart_bus_flush
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x1
	mov	x20, x0
	add	x21, x0, #4
	ldr	w0, [x0]
	bl	_uart_lock
Lloh0:
	adrp	x22, _AML_UART_CONTROL_REG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _AML_UART_CONTROL_REG@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_uart_getreg
Lloh2:
	adrp	x8, _UART_FLUSH_TRANSMITTER@GOTPAGE
Lloh3:
	ldr	x8, [x8, _UART_FLUSH_TRANSMITTER@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x23, _AML_UART_CONTROL_TX_RST@GOTPAGE
Lloh6:
	ldr	x23, [x23, _AML_UART_CONTROL_TX_RST@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w8, w19
	csel	w8, wzr, w9, eq
	orr	w8, w8, w0
Lloh7:
	adrp	x9, _UART_FLUSH_RECEIVER@GOTPAGE
Lloh8:
	ldr	x9, [x9, _UART_FLUSH_RECEIVER@GOTPAGEOFF]
Lloh9:
	adrp	x24, _AML_UART_CONTROL_RX_RST@GOTPAGE
Lloh10:
	ldr	x24, [x24, _AML_UART_CONTROL_RX_RST@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	ldr	w10, [x24]
	tst	w9, w19
	csel	w9, wzr, w10, eq
	orr	w19, w8, w9
	ldr	w1, [x22]
	mov	x0, x21
	mov	x2, x19
	bl	_uart_setreg
	mov	x0, x21
	bl	_uart_barrier
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w8, w9, w8
	bic	w2, w19, w8
	ldr	w1, [x22]
	mov	x0, x21
	bl	_uart_setreg
	mov	x0, x21
	bl	_uart_barrier
	ldr	w0, [x20]
	bl	_uart_unlock
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh11
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_AML_UART_CONTROL_REG,4,2       ; @AML_UART_CONTROL_REG
	.comm	_UART_FLUSH_TRANSMITTER,4,2     ; @UART_FLUSH_TRANSMITTER
	.comm	_AML_UART_CONTROL_TX_RST,4,2    ; @AML_UART_CONTROL_TX_RST
	.comm	_UART_FLUSH_RECEIVER,4,2        ; @UART_FLUSH_RECEIVER
	.comm	_AML_UART_CONTROL_RX_RST,4,2    ; @AML_UART_CONTROL_RX_RST
	.no_dead_strip	_aml8726_uart_bus_flush
.subsections_via_symbols
