	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function comc_setup
_comc_setup:                            ## @comc_setup
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r13d
	movl	%edi, %r14d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rdi
	callq	_unsetenv
	movq	_comc_curspeed@GOTPCREL(%rip), %rax
	movl	%r14d, (%rax)
	movq	_comc_port@GOTPCREL(%rip), %r12
	movl	%r13d, (%r12)
	movq	_comconsole@GOTPCREL(%rip), %rdx
	movq	_C_ACTIVEIN@GOTPCREL(%rip), %rax
	movq	_C_ACTIVEOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%ecx, (%rdx)
	je	LBB0_5
## %bb.1:
	movslq	%r13d, %rdi
	movq	_com_cfcr@GOTPCREL(%rip), %rbx
	addq	(%rbx), %rdi
	movq	_CFCR_DLAB@GOTPCREL(%rip), %rax
	movq	_COMC_FMT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	orl	(%rax), %esi
	callq	_outb
	movslq	(%r12), %r13
	movq	_com_dlbl@GOTPCREL(%rip), %rax
	addq	(%rax), %r13
	movl	%r14d, %edi
	callq	_COMC_BPS
	movzbl	%al, %esi
	movq	%r13, %rdi
	callq	_outb
	movslq	(%r12), %r13
	movq	_com_dlbh@GOTPCREL(%rip), %rax
	addq	(%rax), %r13
	movl	%r14d, %edi
	callq	_COMC_BPS
	sarl	$8, %eax
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_outb
	movslq	(%r12), %rdi
	addq	(%rbx), %rdi
	movl	(%r15), %esi
	callq	_outb
	movslq	(%r12), %rdi
	movq	_com_mcr@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	movq	_MCR_RTS@GOTPCREL(%rip), %rax
	movq	_MCR_DTR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	callq	_outb
	movl	$1000000, %ebx                  ## imm = 0xF4240
	movq	_com_data@GOTPCREL(%rip), %r14
	movq	_com_lsr@GOTPCREL(%rip), %r15
	movq	_LSR_RXRDY@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r12), %rdi
	addq	(%r14), %rdi
	callq	_inb
	movslq	(%r12), %rdi
	addq	(%r15), %rdi
	callq	_inb
	testl	%eax, (%r13)
	je	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	decl	%ebx
	jne	LBB0_2
## %bb.4:
	movq	_C_PRESENTIN@GOTPCREL(%rip), %rax
	movq	_C_PRESENTOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	movq	_comconsole@GOTPCREL(%rip), %rax
	andl	%ecx, (%rax)
	jmp	LBB0_5
LBB0_7:
	movq	_C_PRESENTIN@GOTPCREL(%rip), %rax
	movq	_C_PRESENTOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_comconsole@GOTPCREL(%rip), %rax
	orl	%ecx, (%rax)
	movl	(%r12), %edx
	movq	_comc_curspeed@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.1(%rip), %rsi
	leaq	-112(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_sprintf
	movq	_EV_VOLATILE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_env_setenv
LBB0_5:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.6:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hw.uart.console"

	.comm	_comc_curspeed,4,2              ## @comc_curspeed
	.comm	_comc_port,4,2                  ## @comc_port
	.comm	_comconsole,4,2                 ## @comconsole
	.comm	_C_ACTIVEIN,4,2                 ## @C_ACTIVEIN
	.comm	_C_ACTIVEOUT,4,2                ## @C_ACTIVEOUT
	.comm	_com_cfcr,8,3                   ## @com_cfcr
	.comm	_CFCR_DLAB,4,2                  ## @CFCR_DLAB
	.comm	_COMC_FMT,4,2                   ## @COMC_FMT
	.comm	_com_dlbl,8,3                   ## @com_dlbl
	.comm	_com_dlbh,8,3                   ## @com_dlbh
	.comm	_com_mcr,8,3                    ## @com_mcr
	.comm	_MCR_RTS,4,2                    ## @MCR_RTS
	.comm	_MCR_DTR,4,2                    ## @MCR_DTR
	.comm	_com_data,8,3                   ## @com_data
	.comm	_com_lsr,8,3                    ## @com_lsr
	.comm	_LSR_RXRDY,4,2                  ## @LSR_RXRDY
	.comm	_C_PRESENTIN,4,2                ## @C_PRESENTIN
	.comm	_C_PRESENTOUT,4,2               ## @C_PRESENTOUT
L_.str.1:                               ## @.str.1
	.asciz	"io:%d,br:%d"

	.comm	_EV_VOLATILE,4,2                ## @EV_VOLATILE
	.no_dead_strip	_comc_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function comc_setup
_comc_setup:                            ; @comc_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #72]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_unsetenv
Lloh5:
	adrp	x22, _comc_curspeed@GOTPAGE
Lloh6:
	ldr	x22, [x22, _comc_curspeed@GOTPAGEOFF]
	str	w19, [x22]
Lloh7:
	adrp	x23, _comc_port@GOTPAGE
Lloh8:
	ldr	x23, [x23, _comc_port@GOTPAGEOFF]
	str	w20, [x23]
Lloh9:
	adrp	x21, _comconsole@GOTPAGE
Lloh10:
	ldr	x21, [x21, _comconsole@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh11:
	adrp	x9, _C_ACTIVEIN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _C_ACTIVEIN@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
Lloh14:
	adrp	x10, _C_ACTIVEOUT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _C_ACTIVEOUT@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_6
; %bb.1:
Lloh17:
	adrp	x24, _com_cfcr@GOTPAGE
Lloh18:
	ldr	x24, [x24, _com_cfcr@GOTPAGEOFF]
	ldr	x8, [x24]
Lloh19:
	adrp	x9, _CFCR_DLAB@GOTPAGE
Lloh20:
	ldr	x9, [x9, _CFCR_DLAB@GOTPAGEOFF]
	add	x0, x8, w20, sxtw
Lloh21:
	ldr	w8, [x9]
Lloh22:
	adrp	x25, _COMC_FMT@GOTPAGE
Lloh23:
	ldr	x25, [x25, _COMC_FMT@GOTPAGEOFF]
	ldr	w9, [x25]
	orr	w1, w9, w8
	bl	_outb
	ldrsw	x8, [x23]
Lloh24:
	adrp	x9, _com_dlbl@GOTPAGE
Lloh25:
	ldr	x9, [x9, _com_dlbl@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	add	x20, x9, x8
	mov	x0, x19
	bl	_COMC_BPS
	and	w1, w0, #0xff
	mov	x0, x20
	bl	_outb
	ldrsw	x8, [x23]
Lloh27:
	adrp	x9, _com_dlbh@GOTPAGE
Lloh28:
	ldr	x9, [x9, _com_dlbh@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	add	x20, x9, x8
	mov	x0, x19
	bl	_COMC_BPS
	asr	w1, w0, #8
	mov	x0, x20
	bl	_outb
	ldrsw	x8, [x23]
	ldr	x9, [x24]
	add	x0, x9, x8
	ldr	w1, [x25]
	bl	_outb
	ldrsw	x8, [x23]
Lloh30:
	adrp	x9, _com_mcr@GOTPAGE
Lloh31:
	ldr	x9, [x9, _com_mcr@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
Lloh33:
	adrp	x10, _MCR_RTS@GOTPAGE
Lloh34:
	ldr	x10, [x10, _MCR_RTS@GOTPAGEOFF]
	add	x0, x9, x8
Lloh35:
	ldr	w8, [x10]
Lloh36:
	adrp	x9, _MCR_DTR@GOTPAGE
Lloh37:
	ldr	x9, [x9, _MCR_DTR@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_outb
	mov	w19, #16960
	movk	w19, #15, lsl #16
Lloh39:
	adrp	x20, _com_data@GOTPAGE
Lloh40:
	ldr	x20, [x20, _com_data@GOTPAGEOFF]
Lloh41:
	adrp	x24, _com_lsr@GOTPAGE
Lloh42:
	ldr	x24, [x24, _com_lsr@GOTPAGEOFF]
Lloh43:
	adrp	x25, _LSR_RXRDY@GOTPAGE
Lloh44:
	ldr	x25, [x25, _LSR_RXRDY@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x8, [x23]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_inb
	ldrsw	x8, [x23]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_inb
	ldr	w8, [x25]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	subs	w19, w19, #1
	b.ne	LBB0_2
; %bb.4:
Lloh45:
	adrp	x8, _C_PRESENTIN@GOTPAGE
Lloh46:
	ldr	x8, [x8, _C_PRESENTIN@GOTPAGEOFF]
Lloh47:
	adrp	x9, _C_PRESENTOUT@GOTPAGE
Lloh48:
	ldr	x9, [x9, _C_PRESENTOUT@GOTPAGEOFF]
Lloh49:
	ldr	w8, [x8]
Lloh50:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x21]
	bic	w8, w9, w8
	str	w8, [x21]
	b	LBB0_6
LBB0_5:
Lloh51:
	adrp	x8, _C_PRESENTIN@GOTPAGE
Lloh52:
	ldr	x8, [x8, _C_PRESENTIN@GOTPAGEOFF]
Lloh53:
	ldr	w8, [x8]
Lloh54:
	adrp	x9, _C_PRESENTOUT@GOTPAGE
Lloh55:
	ldr	x9, [x9, _C_PRESENTOUT@GOTPAGEOFF]
Lloh56:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x21]
	orr	w8, w8, w9
	str	w8, [x21]
	ldr	w2, [x23]
	ldr	w3, [x22]
Lloh57:
	adrp	x1, l_.str.1@PAGE
Lloh58:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #8
	bl	_sprintf
Lloh59:
	adrp	x8, _EV_VOLATILE@GOTPAGE
Lloh60:
	ldr	x8, [x8, _EV_VOLATILE@GOTPAGEOFF]
Lloh61:
	ldr	w1, [x8]
Lloh62:
	adrp	x0, l_.str@PAGE
Lloh63:
	add	x0, x0, l_.str@PAGEOFF
	add	x2, sp, #8
	mov	x3, #0
	mov	x4, #0
	bl	_env_setenv
LBB0_6:
	ldr	x8, [sp, #72]
Lloh64:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh65:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh66:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh49
	.loh AdrpAdd	Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpAdd	Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh64, Lloh65, Lloh66
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hw.uart.console"

	.comm	_comc_curspeed,4,2              ; @comc_curspeed
	.comm	_comc_port,4,2                  ; @comc_port
	.comm	_comconsole,4,2                 ; @comconsole
	.comm	_C_ACTIVEIN,4,2                 ; @C_ACTIVEIN
	.comm	_C_ACTIVEOUT,4,2                ; @C_ACTIVEOUT
	.comm	_com_cfcr,8,3                   ; @com_cfcr
	.comm	_CFCR_DLAB,4,2                  ; @CFCR_DLAB
	.comm	_COMC_FMT,4,2                   ; @COMC_FMT
	.comm	_com_dlbl,8,3                   ; @com_dlbl
	.comm	_com_dlbh,8,3                   ; @com_dlbh
	.comm	_com_mcr,8,3                    ; @com_mcr
	.comm	_MCR_RTS,4,2                    ; @MCR_RTS
	.comm	_MCR_DTR,4,2                    ; @MCR_DTR
	.comm	_com_data,8,3                   ; @com_data
	.comm	_com_lsr,8,3                    ; @com_lsr
	.comm	_LSR_RXRDY,4,2                  ; @LSR_RXRDY
	.comm	_C_PRESENTIN,4,2                ; @C_PRESENTIN
	.comm	_C_PRESENTOUT,4,2               ; @C_PRESENTOUT
l_.str.1:                               ; @.str.1
	.asciz	"io:%d,br:%d"

	.comm	_EV_VOLATILE,4,2                ; @EV_VOLATILE
	.no_dead_strip	_comc_setup
.subsections_via_symbols
