	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_serial_init                    ## -- Begin function serial_init
	.p2align	4, 0x90
_serial_init:                           ## @serial_init
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$100000000, -28(%rbp)           ## imm = 0x5F5E100
	leaq	-28(%rbp), %rdx
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_ar71xx_sys_frequency
	movl	-28(%rbp), %eax
	movq	_CONFIG_BAUDRATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	shll	$4, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %r14d
	movq	_AR71XX_GPIO_FUNC_UART_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_AR71XX_GPIO_BASE@GOTPCREL(%rip), %rax
	movq	_GPIO_REG_FUNC@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	addq	(%rax), %rdi
	callq	_KSEG1ADDR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writel
	movq	_OFS_LINE_CONTROL@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	$128, %esi
	callq	_UART16550_WRITE
	movq	_OFS_DIVISOR_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %ebx
	movzbl	%bl, %esi
	callq	_UART16550_WRITE
	movq	_OFS_DIVISOR_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movzbl	%bh, %esi
	callq	_UART16550_WRITE
	movl	(%r15), %edi
	xorl	%esi, %esi
	callq	_UART16550_WRITE
	movq	_OFS_DATA_FORMAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$3, %esi
	callq	_UART16550_WRITE
	movq	_OFS_INTR_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_UART16550_WRITE
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CONFIG_BAUDRATE,4,2            ## @CONFIG_BAUDRATE
	.comm	_AR71XX_GPIO_FUNC_UART_EN,4,2   ## @AR71XX_GPIO_FUNC_UART_EN
	.comm	_AR71XX_GPIO_BASE,8,3           ## @AR71XX_GPIO_BASE
	.comm	_GPIO_REG_FUNC,8,3              ## @GPIO_REG_FUNC
	.comm	_OFS_LINE_CONTROL,4,2           ## @OFS_LINE_CONTROL
	.comm	_OFS_DIVISOR_LSB,4,2            ## @OFS_DIVISOR_LSB
	.comm	_OFS_DIVISOR_MSB,4,2            ## @OFS_DIVISOR_MSB
	.comm	_OFS_DATA_FORMAT,4,2            ## @OFS_DATA_FORMAT
	.comm	_OFS_INTR_ENABLE,4,2            ## @OFS_INTR_ENABLE
	.comm	_AR91XX_GPIO_FUNC_UART_EN,4,2   ## @AR91XX_GPIO_FUNC_UART_EN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_serial_init                    ; -- Begin function serial_init
	.p2align	2
_serial_init:                           ; @serial_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	w8, #57600
	movk	w8, #1525, lsl #16
	str	w8, [sp, #12]
	add	x2, sp, #12
	mov	w0, #0
	mov	w1, #0
	bl	_ar71xx_sys_frequency
	ldr	w8, [sp, #12]
Lloh0:
	adrp	x9, _CONFIG_BAUDRATE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CONFIG_BAUDRATE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	lsl	w9, w9, #4
	sdiv	w20, w8, w9
Lloh3:
	adrp	x8, _AR71XX_GPIO_FUNC_UART_EN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR71XX_GPIO_FUNC_UART_EN@GOTPAGEOFF]
Lloh5:
	adrp	x9, _AR71XX_GPIO_BASE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AR71XX_GPIO_BASE@GOTPAGEOFF]
Lloh7:
	ldr	w19, [x8]
Lloh8:
	ldr	x8, [x9]
Lloh9:
	adrp	x9, _GPIO_REG_FUNC@GOTPAGE
Lloh10:
	ldr	x9, [x9, _GPIO_REG_FUNC@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_KSEG1ADDR
	mov	x1, x0
	mov	x0, x19
	bl	_writel
Lloh12:
	adrp	x19, _OFS_LINE_CONTROL@GOTPAGE
Lloh13:
	ldr	x19, [x19, _OFS_LINE_CONTROL@GOTPAGEOFF]
	ldr	w0, [x19]
	mov	w1, #128
	bl	_UART16550_WRITE
Lloh14:
	adrp	x8, _OFS_DIVISOR_LSB@GOTPAGE
Lloh15:
	ldr	x8, [x8, _OFS_DIVISOR_LSB@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	and	w1, w20, #0xff
	bl	_UART16550_WRITE
Lloh17:
	adrp	x8, _OFS_DIVISOR_MSB@GOTPAGE
Lloh18:
	ldr	x8, [x8, _OFS_DIVISOR_MSB@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	ubfx	w1, w20, #8, #8
	bl	_UART16550_WRITE
	ldr	w0, [x19]
	mov	w1, #0
	bl	_UART16550_WRITE
Lloh20:
	adrp	x8, _OFS_DATA_FORMAT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _OFS_DATA_FORMAT@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	mov	w1, #3
	bl	_UART16550_WRITE
Lloh23:
	adrp	x8, _OFS_INTR_ENABLE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _OFS_INTR_ENABLE@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_UART16550_WRITE
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CONFIG_BAUDRATE,4,2            ; @CONFIG_BAUDRATE
	.comm	_AR71XX_GPIO_FUNC_UART_EN,4,2   ; @AR71XX_GPIO_FUNC_UART_EN
	.comm	_AR71XX_GPIO_BASE,8,3           ; @AR71XX_GPIO_BASE
	.comm	_GPIO_REG_FUNC,8,3              ; @GPIO_REG_FUNC
	.comm	_OFS_LINE_CONTROL,4,2           ; @OFS_LINE_CONTROL
	.comm	_OFS_DIVISOR_LSB,4,2            ; @OFS_DIVISOR_LSB
	.comm	_OFS_DIVISOR_MSB,4,2            ; @OFS_DIVISOR_MSB
	.comm	_OFS_DATA_FORMAT,4,2            ; @OFS_DATA_FORMAT
	.comm	_OFS_INTR_ENABLE,4,2            ; @OFS_INTR_ENABLE
	.comm	_AR91XX_GPIO_FUNC_UART_EN,4,2   ; @AR91XX_GPIO_FUNC_UART_EN
.subsections_via_symbols
