	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_hardware
_init_hardware:                         ## @init_hardware
	.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	_hardware_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movq	_UART_IER@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_sinp
	movl	%eax, %r15d
	movl	(%r13), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_soutp
	movl	(%r13), %edi
	callq	_sinp
	movl	%eax, %r12d
	movl	(%r13), %edi
	movl	$15, %esi
	callq	_soutp
	movl	(%r13), %edi
	callq	_sinp
	movl	%eax, %ebx
	movl	(%r13), %edi
	movl	%r15d, %esi
	callq	_soutp
	testb	$15, %r12b
	jne	LBB0_2
## %bb.1:
	andl	$15, %ebx
	cmpl	$15, %ebx
	jne	LBB0_2
## %bb.3:
	movq	_io@GOTPCREL(%rip), %rbx
	movq	_UART_MCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	(%rbx), %esi
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	_outb
	movl	(%r13), %esi
	addl	(%rbx), %esi
	xorl	%edi, %edi
	callq	_outb
	movq	_UART_LCR_DLAB@GOTPCREL(%rip), %rax
	movq	_UART_LCR_WLEN7@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	orl	(%rax), %edi
	movq	_UART_LCR@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	addl	(%rbx), %esi
	callq	_outb
	movq	_UART_DLL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	(%rbx), %esi
	movl	$1, %edi
	callq	_outb
	movq	_UART_DLM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	(%rbx), %esi
	xorl	%edi, %edi
	callq	_outb
	movl	(%r12), %edi
	movl	(%r15), %esi
	addl	(%rbx), %esi
	callq	_outb
	movq	_UART_FCR_ENABLE_FIFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_UART_FCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	(%rbx), %esi
	callq	_outb
	movq	_UART_IER_RDI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r13), %esi
	addl	(%rbx), %esi
	callq	_outb
	movq	_UART_MCR_DTR@GOTPCREL(%rip), %rax
	movq	_UART_MCR_RTS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_UART_MCR_OUT2@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_UART_MCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	(%rbx), %esi
	callq	_outb
	movq	_hardware_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_4
LBB0_2:
	movq	_hardware_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_hardware_lock,4,2              ## @hardware_lock
	.comm	_UART_IER,4,2                   ## @UART_IER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"port existence test failed, cannot continue\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_io,4,2                         ## @io
	.comm	_UART_MCR,4,2                   ## @UART_MCR
	.comm	_UART_LCR_DLAB,4,2              ## @UART_LCR_DLAB
	.comm	_UART_LCR_WLEN7,4,2             ## @UART_LCR_WLEN7
	.comm	_UART_LCR,4,2                   ## @UART_LCR
	.comm	_UART_DLL,4,2                   ## @UART_DLL
	.comm	_UART_DLM,4,2                   ## @UART_DLM
	.comm	_UART_FCR_ENABLE_FIFO,4,2       ## @UART_FCR_ENABLE_FIFO
	.comm	_UART_FCR,4,2                   ## @UART_FCR
	.comm	_UART_IER_RDI,4,2               ## @UART_IER_RDI
	.comm	_UART_MCR_DTR,4,2               ## @UART_MCR_DTR
	.comm	_UART_MCR_RTS,4,2               ## @UART_MCR_RTS
	.comm	_UART_MCR_OUT2,4,2              ## @UART_MCR_OUT2
	.no_dead_strip	_init_hardware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_hardware
_init_hardware:                         ; @init_hardware
	.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
Lloh0:
	adrp	x0, _hardware_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _hardware_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
Lloh2:
	adrp	x20, _UART_IER@GOTPAGE
Lloh3:
	ldr	x20, [x20, _UART_IER@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_sinp
	mov	x19, x0
	ldr	w0, [x20]
	mov	w1, #0
	bl	_soutp
	ldr	w0, [x20]
	bl	_sinp
	and	w21, w0, #0xf
	ldr	w0, [x20]
	mov	w1, #15
	bl	_soutp
	ldr	w0, [x20]
	bl	_sinp
	and	w22, w0, #0xf
	ldr	w0, [x20]
	mov	x1, x19
	bl	_soutp
	cmp	w21, #0
	ccmp	w22, #15, #0, eq
	b.eq	LBB0_2
; %bb.1:
Lloh4:
	adrp	x0, _hardware_lock@GOTPAGE
Lloh5:
	ldr	x0, [x0, _hardware_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh8:
	adrp	x8, _ENODEV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
Lloh11:
	adrp	x19, _io@GOTPAGE
Lloh12:
	ldr	x19, [x19, _io@GOTPAGEOFF]
	ldr	w8, [x19]
Lloh13:
	adrp	x21, _UART_MCR@GOTPAGE
Lloh14:
	ldr	x21, [x21, _UART_MCR@GOTPAGEOFF]
	ldr	w9, [x21]
	add	w1, w9, w8
	mov	w0, #0
	bl	_outb
	ldr	w8, [x19]
	ldr	w9, [x20]
	add	w1, w9, w8
	mov	w0, #0
	bl	_outb
Lloh15:
	adrp	x8, _UART_LCR_DLAB@GOTPAGE
Lloh16:
	ldr	x8, [x8, _UART_LCR_DLAB@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x22, _UART_LCR_WLEN7@GOTPAGE
Lloh19:
	ldr	x22, [x22, _UART_LCR_WLEN7@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w0, w9, w8
	ldr	w8, [x19]
Lloh20:
	adrp	x23, _UART_LCR@GOTPAGE
Lloh21:
	ldr	x23, [x23, _UART_LCR@GOTPAGEOFF]
	ldr	w9, [x23]
	add	w1, w9, w8
	bl	_outb
	ldr	w8, [x19]
Lloh22:
	adrp	x9, _UART_DLL@GOTPAGE
Lloh23:
	ldr	x9, [x9, _UART_DLL@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	add	w1, w9, w8
	mov	w0, #1
	bl	_outb
	ldr	w8, [x19]
Lloh25:
	adrp	x9, _UART_DLM@GOTPAGE
Lloh26:
	ldr	x9, [x9, _UART_DLM@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	add	w1, w9, w8
	mov	w0, #0
	bl	_outb
	ldr	w0, [x22]
	ldr	w8, [x19]
	ldr	w9, [x23]
	add	w1, w9, w8
	bl	_outb
Lloh28:
	adrp	x8, _UART_FCR_ENABLE_FIFO@GOTPAGE
Lloh29:
	ldr	x8, [x8, _UART_FCR_ENABLE_FIFO@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	ldr	w8, [x19]
Lloh31:
	adrp	x9, _UART_FCR@GOTPAGE
Lloh32:
	ldr	x9, [x9, _UART_FCR@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	add	w1, w9, w8
	bl	_outb
Lloh34:
	adrp	x8, _UART_IER_RDI@GOTPAGE
Lloh35:
	ldr	x8, [x8, _UART_IER_RDI@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	ldr	w8, [x19]
	ldr	w9, [x20]
	add	w1, w9, w8
	bl	_outb
Lloh37:
	adrp	x8, _UART_MCR_DTR@GOTPAGE
Lloh38:
	ldr	x8, [x8, _UART_MCR_DTR@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
Lloh40:
	adrp	x9, _UART_MCR_RTS@GOTPAGE
Lloh41:
	ldr	x9, [x9, _UART_MCR_RTS@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
Lloh43:
	adrp	x10, _UART_MCR_OUT2@GOTPAGE
Lloh44:
	ldr	x10, [x10, _UART_MCR_OUT2@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh45:
	ldr	w9, [x10]
	orr	w0, w8, w9
	ldr	w8, [x19]
	ldr	w9, [x21]
	add	w1, w9, w8
	bl	_outb
Lloh46:
	adrp	x0, _hardware_lock@GOTPAGE
Lloh47:
	ldr	x0, [x0, _hardware_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	mov	w0, #0
LBB0_3:
	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	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_hardware_lock,4,2              ; @hardware_lock
	.comm	_UART_IER,4,2                   ; @UART_IER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"port existence test failed, cannot continue\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_io,4,2                         ; @io
	.comm	_UART_MCR,4,2                   ; @UART_MCR
	.comm	_UART_LCR_DLAB,4,2              ; @UART_LCR_DLAB
	.comm	_UART_LCR_WLEN7,4,2             ; @UART_LCR_WLEN7
	.comm	_UART_LCR,4,2                   ; @UART_LCR
	.comm	_UART_DLL,4,2                   ; @UART_DLL
	.comm	_UART_DLM,4,2                   ; @UART_DLM
	.comm	_UART_FCR_ENABLE_FIFO,4,2       ; @UART_FCR_ENABLE_FIFO
	.comm	_UART_FCR,4,2                   ; @UART_FCR
	.comm	_UART_IER_RDI,4,2               ; @UART_IER_RDI
	.comm	_UART_MCR_DTR,4,2               ; @UART_MCR_DTR
	.comm	_UART_MCR_RTS,4,2               ; @UART_MCR_RTS
	.comm	_UART_MCR_OUT2,4,2              ; @UART_MCR_OUT2
	.no_dead_strip	_init_hardware
.subsections_via_symbols
