	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function comc_pcidev_handle
_comc_pcidev_handle:                    ## @comc_pcidev_handle
	.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
	subq	$88, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movzwl	%bx, %edi
	movl	%ebx, %eax
	shrl	$16, %eax
	movzbl	%al, %esi
	movq	_BIOSPCI_32BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-100(%rbp), %rcx
	callq	_biospci_read_config
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.1:
	movl	-100(%rbp), %edi
	cmpl	$-1, %edi
	je	LBB0_5
## %bb.2:
	callq	_PCI_BAR_IO
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	movq	_PCIM_BAR_IO_BASE@GOTPCREL(%rip), %rax
	movl	-100(%rbp), %edx
	andl	(%rax), %edx
	movl	%edx, -100(%rbp)
	leaq	L_.str.3(%rip), %rsi
	leaq	-96(%rbp), %r14
	movq	%r14, %rdi
	callq	_sprintf
	leaq	L_.str.4(%rip), %r15
	movq	%r15, %rdi
	callq	_unsetenv
	movq	_EV_VOLATILE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_comc_port_set@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_env_nounset@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_env_setenv
	movq	_comc_curspeed@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-100(%rbp), %esi
	callq	_comc_setup
	movq	_comc_locator@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movq	_CMD_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_4:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_7
LBB0_5:
	leaq	L_str(%rip), %rdi
	callq	_puts
	jmp	LBB0_8
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
LBB0_7:
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_printf
LBB0_8:
	movq	_CMD_ERROR@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_11
## %bb.10:
	addq	$88, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BIOSPCI_32BITS,4,2             ## @BIOSPCI_32BITS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot read bar at 0x%x\n"

	.comm	_CMD_ERROR,4,2                  ## @CMD_ERROR
L_.str.2:                               ## @.str.2
	.asciz	"Memory bar at 0x%x\n"

	.comm	_PCIM_BAR_IO_BASE,4,2           ## @PCIM_BAR_IO_BASE
L_.str.3:                               ## @.str.3
	.asciz	"%d"

L_.str.4:                               ## @.str.4
	.asciz	"comconsole_port"

	.comm	_EV_VOLATILE,4,2                ## @EV_VOLATILE
	.comm	_comc_port_set,4,2              ## @comc_port_set
	.comm	_env_nounset,4,2                ## @env_nounset
	.comm	_comc_curspeed,4,2              ## @comc_curspeed
	.comm	_comc_locator,4,2               ## @comc_locator
	.comm	_CMD_OK,4,2                     ## @CMD_OK
L_str:                                  ## @str
	.asciz	"Cannot find specified pcidev"

	.no_dead_strip	_comc_pcidev_handle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function comc_pcidev_handle
_comc_pcidev_handle:                    ; @comc_pcidev_handle
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	and	w0, w0, #0xffff
	ubfx	w1, w19, #16, #8
Lloh3:
	adrp	x8, _BIOSPCI_32BITS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BIOSPCI_32BITS@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x3, sp, #20
	bl	_biospci_read_config
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.1:
	ldr	w0, [sp, #20]
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.2:
	bl	_PCI_BAR_IO
	cbz	w0, LBB0_6
; %bb.3:
Lloh6:
	adrp	x8, _PCIM_BAR_IO_BASE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PCIM_BAR_IO_BASE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [sp, #20]
	and	w2, w9, w8
	str	w2, [sp, #20]
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x0, sp, #24
	bl	_sprintf
Lloh11:
	adrp	x20, l_.str.4@PAGE
Lloh12:
	add	x20, x20, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_unsetenv
Lloh13:
	adrp	x8, _EV_VOLATILE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EV_VOLATILE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _comc_port_set@GOTPAGE
Lloh17:
	ldr	x8, [x8, _comc_port_set@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
Lloh19:
	adrp	x8, _env_nounset@GOTPAGE
Lloh20:
	ldr	x8, [x8, _env_nounset@GOTPAGEOFF]
Lloh21:
	ldr	w4, [x8]
	add	x2, sp, #24
	mov	x0, x20
	bl	_env_setenv
Lloh22:
	adrp	x8, _comc_curspeed@GOTPAGE
Lloh23:
	ldr	x8, [x8, _comc_curspeed@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	ldr	w1, [sp, #20]
	bl	_comc_setup
Lloh25:
	adrp	x8, _comc_locator@GOTPAGE
Lloh26:
	ldr	x8, [x8, _comc_locator@GOTPAGEOFF]
Lloh27:
	str	w19, [x8]
Lloh28:
	adrp	x8, _CMD_OK@GOTPAGE
Lloh29:
	ldr	x8, [x8, _CMD_OK@GOTPAGEOFF]
	b	LBB0_9
LBB0_4:
	str	x19, [sp]
Lloh30:
	adrp	x0, l_.str@PAGE
Lloh31:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_5:
Lloh32:
	adrp	x0, l_str@PAGE
Lloh33:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	b	LBB0_8
LBB0_6:
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	str	x19, [sp]
Lloh34:
	adrp	x0, l_.str.2@PAGE
Lloh35:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_7:
	bl	_printf
LBB0_8:
Lloh36:
	adrp	x8, _CMD_ERROR@GOTPAGE
Lloh37:
	ldr	x8, [x8, _CMD_ERROR@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
	ldur	x8, [x29, #-24]
Lloh38:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh39:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh40:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotStr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_BIOSPCI_32BITS,4,2             ; @BIOSPCI_32BITS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot read bar at 0x%x\n"

	.comm	_CMD_ERROR,4,2                  ; @CMD_ERROR
l_.str.2:                               ; @.str.2
	.asciz	"Memory bar at 0x%x\n"

	.comm	_PCIM_BAR_IO_BASE,4,2           ; @PCIM_BAR_IO_BASE
l_.str.3:                               ; @.str.3
	.asciz	"%d"

l_.str.4:                               ; @.str.4
	.asciz	"comconsole_port"

	.comm	_EV_VOLATILE,4,2                ; @EV_VOLATILE
	.comm	_comc_port_set,4,2              ; @comc_port_set
	.comm	_env_nounset,4,2                ; @env_nounset
	.comm	_comc_curspeed,4,2              ; @comc_curspeed
	.comm	_comc_locator,4,2               ; @comc_locator
	.comm	_CMD_OK,4,2                     ; @CMD_OK
l_str:                                  ; @str
	.asciz	"Cannot find specified pcidev"

	.no_dead_strip	_comc_pcidev_handle
.subsections_via_symbols
