	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lpc_init
_lpc_init:                              ## @lpc_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_romfile@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	callq	_bootrom_init
	testl	%eax, %eax
	jne	LBB0_11
LBB0_2:
	movq	_LPC_UART_NUM@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_7
## %bb.3:
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_lpc_uart_softc@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	_lpc_uart_names@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rbx,8), %r15
	leaq	(%r14,%r13), %rsi
	addq	$12, %rsi
	leaq	(%r14,%r13), %rdx
	addq	$20, %rdx
	movl	%ebx, %edi
	callq	_uart_legacy_alloc
	testq	%rax, %rax
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	(%r14,%r13), %r12
	movl	20(%r14,%r13), %edi
	callq	_pci_irq_reserve
	movq	_lpc_uart_intr_assert@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_lpc_uart_intr_deassert@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdx
	callq	_uart_init
	movl	%eax, 16(%r14,%r13)
	movq	(%r14,%r13), %rsi
	movl	%eax, %edi
	callq	_uart_set_backend
	testq	%rax, %rax
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	-72(%rbp), %rdi
	movl	$32, %esi
	callq	_bzero
	movq	%r15, -72(%rbp)
	movl	12(%r14,%r13), %eax
	movl	%eax, -44(%rbp)
	movq	_UART_IO_BAR_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	_IOPORT_F_INOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	_lpc_uart_io_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	%r12, -64(%rbp)
	leaq	-72(%rbp), %rdi
	callq	_register_inout
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_assert
	movl	$1, 8(%r14,%r13)
	incq	%rbx
	movq	_LPC_UART_NUM@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$24, %r13
	cmpq	%rax, %rbx
	jl	LBB0_4
LBB0_7:
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_8:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_10
LBB0_9:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14,%r13), %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_10:
	movl	$-1, %eax
LBB0_11:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_romfile,8,3                    ## @romfile
	.comm	_LPC_UART_NUM,4,2               ## @LPC_UART_NUM
	.comm	_lpc_uart_softc,8,3             ## @lpc_uart_softc
	.comm	_lpc_uart_names,8,3             ## @lpc_uart_names
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to allocate resources for LPC device %s\n"

	.comm	_lpc_uart_intr_assert,4,2       ## @lpc_uart_intr_assert
	.comm	_lpc_uart_intr_deassert,4,2     ## @lpc_uart_intr_deassert
L_.str.1:                               ## @.str.1
	.asciz	"Unable to initialize backend '%s' for LPC device %s\n"

	.comm	_UART_IO_BAR_SIZE,4,2           ## @UART_IO_BAR_SIZE
	.comm	_IOPORT_F_INOUT,4,2             ## @IOPORT_F_INOUT
	.comm	_lpc_uart_io_handler,4,2        ## @lpc_uart_io_handler
	.no_dead_strip	_lpc_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lpc_init
_lpc_init:                              ; @lpc_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
Lloh0:
	adrp	x8, _romfile@GOTPAGE
Lloh1:
	ldr	x8, [x8, _romfile@GOTPAGEOFF]
Lloh2:
	ldr	x1, [x8]
	cbz	x1, LBB0_2
; %bb.1:
	bl	_bootrom_init
	cbnz	w0, LBB0_11
LBB0_2:
Lloh3:
	adrp	x24, _LPC_UART_NUM@GOTPAGE
Lloh4:
	ldr	x24, [x24, _LPC_UART_NUM@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.3:
	mov	x25, #0
	mov	x19, #0
	mov	w26, #1
Lloh5:
	adrp	x28, _lpc_uart_io_handler@GOTPAGE
Lloh6:
	ldr	x28, [x28, _lpc_uart_io_handler@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
Lloh7:
	adrp	x8, _lpc_uart_softc@GOTPAGE
Lloh8:
	ldr	x8, [x8, _lpc_uart_softc@GOTPAGEOFF]
Lloh9:
	ldr	x27, [x8]
	add	x21, x27, x25
Lloh10:
	adrp	x8, _lpc_uart_names@GOTPAGE
Lloh11:
	ldr	x8, [x8, _lpc_uart_names@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	ldr	x20, [x8, x19, lsl #3]
	add	x22, x21, #12
	add	x23, x21, #20
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_uart_legacy_alloc
	cbnz	x0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x23]
	bl	_pci_irq_reserve
Lloh13:
	adrp	x8, _lpc_uart_intr_assert@GOTPAGE
Lloh14:
	ldr	x8, [x8, _lpc_uart_intr_assert@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x8, _lpc_uart_intr_deassert@GOTPAGE
Lloh17:
	ldr	x8, [x8, _lpc_uart_intr_deassert@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x2, x21
	bl	_uart_init
	str	w0, [x21, #16]
	ldr	x1, [x21]
	bl	_uart_set_backend
	cbnz	x0, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x0, sp, #16
	mov	w1, #32
	bl	_bzero
	str	x20, [sp, #16]
	ldr	w8, [x22]
Lloh19:
	adrp	x9, _UART_IO_BAR_SIZE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _UART_IO_BAR_SIZE@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #40]
Lloh22:
	adrp	x8, _IOPORT_F_INOUT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _IOPORT_F_INOUT@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	ldr	w9, [x28]
	stp	w9, w8, [sp, #32]
	str	x21, [sp, #24]
	add	x0, sp, #16
	bl	_register_inout
	cmp	w0, #0
	cset	w0, eq
	bl	_assert
	add	x8, x27, x25
	str	w26, [x8, #8]
	add	x19, x19, #1
	ldrsw	x8, [x24]
	add	x25, x25, #24
	cmp	x19, x8
	b.lt	LBB0_4
LBB0_7:
	mov	w0, #0
	b	LBB0_11
LBB0_8:
Lloh25:
	adrp	x8, _stderr@GOTPAGE
Lloh26:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	b	LBB0_10
LBB0_9:
Lloh30:
	adrp	x8, _stderr@GOTPAGE
Lloh31:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	ldr	x2, [x27, x25]
	str	x20, [sp]
Lloh33:
	adrp	x1, l_.str.1@PAGE
Lloh34:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_10:
	bl	_fprintf
	mov	w0, #-1
LBB0_11:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_romfile,8,3                    ; @romfile
	.comm	_LPC_UART_NUM,4,2               ; @LPC_UART_NUM
	.comm	_lpc_uart_softc,8,3             ; @lpc_uart_softc
	.comm	_lpc_uart_names,8,3             ; @lpc_uart_names
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to allocate resources for LPC device %s\n"

	.comm	_lpc_uart_intr_assert,4,2       ; @lpc_uart_intr_assert
	.comm	_lpc_uart_intr_deassert,4,2     ; @lpc_uart_intr_deassert
l_.str.1:                               ; @.str.1
	.asciz	"Unable to initialize backend '%s' for LPC device %s\n"

	.comm	_UART_IO_BAR_SIZE,4,2           ; @UART_IO_BAR_SIZE
	.comm	_IOPORT_F_INOUT,4,2             ; @IOPORT_F_INOUT
	.comm	_lpc_uart_io_handler,4,2        ; @lpc_uart_io_handler
	.no_dead_strip	_lpc_init
.subsections_via_symbols
