	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aml8726_uart_bus_attach
_aml8726_uart_bus_attach:               ## @aml8726_uart_bus_attach
	.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
	movq	%rdi, %r14
	movl	8(%rdi), %edi
	callq	_ofw_bus_get_node
	movl	%eax, %edi
	callq	_aml8726_uart_bus_clk
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	leaq	16(%r14), %r15
	movq	_AML_UART_CONTROL_REG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_uart_getreg
	movq	_AML_UART_CONTROL_TX_INT_EN@GOTPCREL(%rip), %rcx
	movq	_AML_UART_CONTROL_RX_INT_EN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	orl	(%rcx), %ebx
	movq	_AML_UART_CONTROL_TX_RST@GOTPCREL(%rip), %rdx
	movq	_AML_UART_CONTROL_RX_RST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rdx), %ecx
	orl	%ecx, %ebx
	notl	%ebx
	andl	%eax, %ebx
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	(%rax), %rax
	movq	_UART_DEV_CONSOLE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	je	LBB0_5
LBB0_4:
	orl	%ecx, %ebx
LBB0_5:
	movq	_AML_UART_CONTROL_TWO_WIRE_EN@GOTPCREL(%rip), %rax
	movq	_AML_UART_CONTROL_TX_EN@GOTPCREL(%rip), %rcx
	movq	_AML_UART_CONTROL_RX_EN@GOTPCREL(%rip), %rdx
	orl	(%rax), %ebx
	orl	(%rcx), %ebx
	orl	(%rdx), %ebx
	movq	_AML_UART_CONTROL_CLR_ERR@GOTPCREL(%rip), %r13
	orl	(%r13), %ebx
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_uart_setreg
	movq	%r15, %rdi
	callq	_uart_barrier
	movq	_AML_UART_MISC_REG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_uart_getreg
	movq	_AML_UART_MISC_XMIT_IRQ_CNT_MASK@GOTPCREL(%rip), %rcx
	movq	_AML_UART_MISC_RECV_IRQ_CNT_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	_AML_UART_MISC_RECV_IRQ_CNT_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	btsl	%eax, %edx
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_uart_setreg
	movq	%r15, %rdi
	callq	_uart_barrier
	movq	%r14, %rdi
	callq	_aml8726_uart_bus_getsig
	movq	_AML_UART_CONTROL_RX_RST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_AML_UART_CONTROL_TX_RST@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	orl	(%r13), %edx
	notl	%edx
	andl	%ebx, %edx
	movq	_AML_UART_CONTROL_RX_INT_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_AML_UART_CONTROL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_uart_setreg
	movq	%r15, %rdi
	callq	_uart_barrier
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_1:
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"missing clocks attribute in FDT\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_AML_UART_CONTROL_REG,4,2       ## @AML_UART_CONTROL_REG
	.comm	_AML_UART_CONTROL_TX_INT_EN,4,2 ## @AML_UART_CONTROL_TX_INT_EN
	.comm	_AML_UART_CONTROL_RX_INT_EN,4,2 ## @AML_UART_CONTROL_RX_INT_EN
	.comm	_AML_UART_CONTROL_TX_RST,4,2    ## @AML_UART_CONTROL_TX_RST
	.comm	_AML_UART_CONTROL_RX_RST,4,2    ## @AML_UART_CONTROL_RX_RST
	.comm	_UART_DEV_CONSOLE,8,3           ## @UART_DEV_CONSOLE
	.comm	_AML_UART_CONTROL_TWO_WIRE_EN,4,2 ## @AML_UART_CONTROL_TWO_WIRE_EN
	.comm	_AML_UART_CONTROL_TX_EN,4,2     ## @AML_UART_CONTROL_TX_EN
	.comm	_AML_UART_CONTROL_RX_EN,4,2     ## @AML_UART_CONTROL_RX_EN
	.comm	_AML_UART_CONTROL_CLR_ERR,4,2   ## @AML_UART_CONTROL_CLR_ERR
	.comm	_AML_UART_MISC_REG,4,2          ## @AML_UART_MISC_REG
	.comm	_AML_UART_MISC_XMIT_IRQ_CNT_MASK,4,2 ## @AML_UART_MISC_XMIT_IRQ_CNT_MASK
	.comm	_AML_UART_MISC_XMIT_IRQ_CNT_SHIFT,4,2 ## @AML_UART_MISC_XMIT_IRQ_CNT_SHIFT
	.comm	_AML_UART_MISC_RECV_IRQ_CNT_MASK,4,2 ## @AML_UART_MISC_RECV_IRQ_CNT_MASK
	.comm	_AML_UART_MISC_RECV_IRQ_CNT_SHIFT,4,2 ## @AML_UART_MISC_RECV_IRQ_CNT_SHIFT
	.no_dead_strip	_aml8726_uart_bus_attach
.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_attach
_aml8726_uart_bus_attach:               ; @aml8726_uart_bus_attach
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x0
	ldr	w0, [x0, #8]
	bl	_ofw_bus_get_node
	bl	_aml8726_uart_bus_clk
	mov	x19, x20
	str	x0, [x19, #16]!
	cbz	x0, LBB0_5
; %bb.1:
Lloh0:
	adrp	x22, _AML_UART_CONTROL_REG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _AML_UART_CONTROL_REG@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_uart_getreg
Lloh2:
	adrp	x8, _AML_UART_CONTROL_TX_INT_EN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AML_UART_CONTROL_TX_INT_EN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x23, _AML_UART_CONTROL_RX_INT_EN@GOTPAGE
Lloh6:
	ldr	x23, [x23, _AML_UART_CONTROL_RX_INT_EN@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w8, w9, w8
Lloh7:
	adrp	x24, _AML_UART_CONTROL_TX_RST@GOTPAGE
Lloh8:
	ldr	x24, [x24, _AML_UART_CONTROL_TX_RST@GOTPAGEOFF]
Lloh9:
	adrp	x25, _AML_UART_CONTROL_RX_RST@GOTPAGE
Lloh10:
	ldr	x25, [x25, _AML_UART_CONTROL_RX_RST@GOTPAGEOFF]
	ldr	w9, [x24]
	ldr	w10, [x25]
	orr	w9, w10, w9
	orr	w8, w8, w9
	bic	w8, w0, w8
	ldr	x10, [x20]
	cbz	x10, LBB0_3
; %bb.2:
	ldr	x10, [x10]
Lloh11:
	adrp	x11, _UART_DEV_CONSOLE@GOTPAGE
Lloh12:
	ldr	x11, [x11, _UART_DEV_CONSOLE@GOTPAGEOFF]
Lloh13:
	ldr	x11, [x11]
	cmp	x10, x11
	b.eq	LBB0_4
LBB0_3:
	orr	w8, w8, w9
LBB0_4:
Lloh14:
	adrp	x9, _AML_UART_CONTROL_TWO_WIRE_EN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _AML_UART_CONTROL_TWO_WIRE_EN@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _AML_UART_CONTROL_TX_EN@GOTPAGE
Lloh18:
	ldr	x10, [x10, _AML_UART_CONTROL_TX_EN@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
Lloh20:
	adrp	x11, _AML_UART_CONTROL_RX_EN@GOTPAGE
Lloh21:
	ldr	x11, [x11, _AML_UART_CONTROL_RX_EN@GOTPAGEOFF]
Lloh22:
	ldr	w11, [x11]
Lloh23:
	adrp	x26, _AML_UART_CONTROL_CLR_ERR@GOTPAGE
Lloh24:
	ldr	x26, [x26, _AML_UART_CONTROL_CLR_ERR@GOTPAGEOFF]
	ldr	w12, [x26]
	orr	w8, w9, w8
	orr	w8, w8, w10
	orr	w8, w8, w11
	orr	w21, w8, w12
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_uart_setreg
	mov	x0, x19
	bl	_uart_barrier
Lloh25:
	adrp	x27, _AML_UART_MISC_REG@GOTPAGE
Lloh26:
	ldr	x27, [x27, _AML_UART_MISC_REG@GOTPAGEOFF]
	ldr	w1, [x27]
	mov	x0, x19
	bl	_uart_getreg
Lloh27:
	adrp	x8, _AML_UART_MISC_XMIT_IRQ_CNT_MASK@GOTPAGE
Lloh28:
	ldr	x8, [x8, _AML_UART_MISC_XMIT_IRQ_CNT_MASK@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
Lloh30:
	adrp	x9, _AML_UART_MISC_RECV_IRQ_CNT_MASK@GOTPAGE
Lloh31:
	ldr	x9, [x9, _AML_UART_MISC_RECV_IRQ_CNT_MASK@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh33:
	adrp	x9, _AML_UART_MISC_RECV_IRQ_CNT_SHIFT@GOTPAGE
Lloh34:
	ldr	x9, [x9, _AML_UART_MISC_RECV_IRQ_CNT_SHIFT@GOTPAGEOFF]
	bic	w8, w0, w8
Lloh35:
	ldr	w9, [x9]
	mov	w10, #1
	lsl	w9, w10, w9
	orr	w2, w8, w9
	ldr	w1, [x27]
	mov	x0, x19
	bl	_uart_setreg
	mov	x0, x19
	bl	_uart_barrier
	mov	x0, x20
	bl	_aml8726_uart_bus_getsig
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w8, w9, w8
	ldr	w9, [x26]
	orr	w8, w8, w9
	bic	w8, w21, w8
	ldr	w9, [x23]
	orr	w2, w8, w9
	ldr	w1, [x22]
	mov	x0, x19
	bl	_uart_setreg
	mov	x0, x19
	bl	_uart_barrier
	mov	w0, #0
	b	LBB0_6
LBB0_5:
	ldr	w0, [x20, #8]
Lloh36:
	adrp	x1, l_.str@PAGE
Lloh37:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
Lloh38:
	adrp	x8, _ENXIO@GOTPAGE
Lloh39:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh40:
	ldr	w0, [x8]
LBB0_6:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"missing clocks attribute in FDT\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_AML_UART_CONTROL_REG,4,2       ; @AML_UART_CONTROL_REG
	.comm	_AML_UART_CONTROL_TX_INT_EN,4,2 ; @AML_UART_CONTROL_TX_INT_EN
	.comm	_AML_UART_CONTROL_RX_INT_EN,4,2 ; @AML_UART_CONTROL_RX_INT_EN
	.comm	_AML_UART_CONTROL_TX_RST,4,2    ; @AML_UART_CONTROL_TX_RST
	.comm	_AML_UART_CONTROL_RX_RST,4,2    ; @AML_UART_CONTROL_RX_RST
	.comm	_UART_DEV_CONSOLE,8,3           ; @UART_DEV_CONSOLE
	.comm	_AML_UART_CONTROL_TWO_WIRE_EN,4,2 ; @AML_UART_CONTROL_TWO_WIRE_EN
	.comm	_AML_UART_CONTROL_TX_EN,4,2     ; @AML_UART_CONTROL_TX_EN
	.comm	_AML_UART_CONTROL_RX_EN,4,2     ; @AML_UART_CONTROL_RX_EN
	.comm	_AML_UART_CONTROL_CLR_ERR,4,2   ; @AML_UART_CONTROL_CLR_ERR
	.comm	_AML_UART_MISC_REG,4,2          ; @AML_UART_MISC_REG
	.comm	_AML_UART_MISC_XMIT_IRQ_CNT_MASK,4,2 ; @AML_UART_MISC_XMIT_IRQ_CNT_MASK
	.comm	_AML_UART_MISC_XMIT_IRQ_CNT_SHIFT,4,2 ; @AML_UART_MISC_XMIT_IRQ_CNT_SHIFT
	.comm	_AML_UART_MISC_RECV_IRQ_CNT_MASK,4,2 ; @AML_UART_MISC_RECV_IRQ_CNT_MASK
	.comm	_AML_UART_MISC_RECV_IRQ_CNT_SHIFT,4,2 ; @AML_UART_MISC_RECV_IRQ_CNT_SHIFT
	.no_dead_strip	_aml8726_uart_bus_attach
.subsections_via_symbols
