	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DetectSerialPorts              ## -- Begin function DetectSerialPorts
	.p2align	4, 0x90
_DetectSerialPorts:                     ## @DetectSerialPorts
	.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	$360, %rsp                      ## imm = 0x168
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r14
	movl	%edi, -388(%rbp)                ## 4-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	testq	%r15, %r15
	jle	LBB0_11
## %bb.1:
	leaq	-384(%rbp), %rbx
	xorl	%eax, %eax
	movq	%rax, -376(%rbp)                ## 8-byte Spill
	xorl	%r13d, %r13d
	movq	%r15, -400(%rbp)                ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movq	%rbx, -376(%rbp)                ## 8-byte Spill
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-400(%rbp), %r15                ## 8-byte Reload
	leaq	-384(%rbp), %rbx
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r13
	cmpq	%r13, %r15
	je	LBB0_11
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	*%r14
	testq	%rax, %rax
	je	LBB0_10
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_UlongToPtr
	movl	%eax, %edi
	callq	_CpDoesPortExist
	testl	%eax, %eax
	je	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	1(%r13), %rbx
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_TRACE
	leaq	-368(%rbp), %rdi
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdx
	callq	_sprintf
	movq	_TAG_HW_RESOURCE_LIST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_FrLdrHeapAlloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r15
	movl	$16, %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, (%r15)
	movl	$3, 8(%r15)
	movq	16(%r15), %rax
	movq	_CmResourceTypePort@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 72(%rax)
	movq	_CmResourceShareDeviceExclusive@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 64(%rax)
	movq	_CM_RESOURCE_PORT_IO@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 56(%rax)
	movq	%r12, 48(%rax)
	movl	$0, 40(%rax)
	movl	$7, 32(%rax)
	movq	_CmResourceTypeInterrupt@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 152(%rax)
	movq	_CmResourceShareUndetermined@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 144(%rax)
	movq	_CM_RESOURCE_INTERRUPT_LATCHED@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, 136(%rax)
	movq	-384(%rbp), %rdx
	movq	%rdx, 104(%rax)
	movq	%rdx, 96(%rax)
	movl	$-1, 88(%rax)
	movq	_CmResourceTypeDeviceSpecific@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 232(%rax)
	movq	%rcx, 224(%rax)
	movq	$0, 216(%rax)
	movl	$4, 160(%rax)
	movl	$1843200, 240(%rax)             ## imm = 0x1C2000
	movq	_ControllerClass@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SerialController@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_Input@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_Output@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_ConsoleIn@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_ConsoleOut@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	-388(%rbp), %edi                ## 4-byte Reload
	movq	-376(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %r8
	movl	$-1, %r9d
	leaq	-392(%rbp), %rax
	pushq	%rax
	pushq	$16
	pushq	%r15
	leaq	-368(%rbp), %rax
	pushq	%rax
	callq	_FldrCreateComponentKey
	addq	$32, %rsp
	movq	%r12, %rdi
	callq	_UlongToPtr
	movl	%eax, %edi
	callq	_Rs232PortInUse
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-392(%rbp), %ebx
	movq	%r12, %rdi
	callq	_UlongToPtr
	movl	%ebx, %edi
	movq	-376(%rbp), %rbx                ## 8-byte Reload
	movl	%eax, %esi
	callq	_DetectSerialPointerPeripheral
	jmp	LBB0_8
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.3(%rip), %rdi
	callq	_ERR
	jmp	LBB0_9
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	addq	$360, %rsp                      ## imm = 0x168
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DetectSerialPorts()\n"

L_.str.1:                               ## @.str.1
	.asciz	"Found COM%u port at 0x%x\n"

L_.str.2:                               ## @.str.2
	.asciz	"COM%ld"

	.comm	_TAG_HW_RESOURCE_LIST,4,2       ## @TAG_HW_RESOURCE_LIST
L_.str.3:                               ## @.str.3
	.asciz	"Failed to allocate resource descriptor\n"

	.comm	_CmResourceTypePort,4,2         ## @CmResourceTypePort
	.comm	_CmResourceShareDeviceExclusive,8,3 ## @CmResourceShareDeviceExclusive
	.comm	_CM_RESOURCE_PORT_IO,8,3        ## @CM_RESOURCE_PORT_IO
	.comm	_CmResourceTypeInterrupt,4,2    ## @CmResourceTypeInterrupt
	.comm	_CmResourceShareUndetermined,8,3 ## @CmResourceShareUndetermined
	.comm	_CM_RESOURCE_INTERRUPT_LATCHED,8,3 ## @CM_RESOURCE_INTERRUPT_LATCHED
	.comm	_CmResourceTypeDeviceSpecific,4,2 ## @CmResourceTypeDeviceSpecific
	.comm	_ControllerClass,4,2            ## @ControllerClass
	.comm	_SerialController,4,2           ## @SerialController
	.comm	_Output,4,2                     ## @Output
	.comm	_Input,4,2                      ## @Input
	.comm	_ConsoleIn,4,2                  ## @ConsoleIn
	.comm	_ConsoleOut,4,2                 ## @ConsoleOut
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DetectSerialPorts              ; -- Begin function DetectSerialPorts
	.p2align	2
_DetectSerialPorts:                     ; @DetectSerialPorts
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #480
	.cfi_def_cfa_offset 480
	stp	d9, d8, [sp, #368]              ; 16-byte Folded Spill
	stp	x28, x27, [sp, #384]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #400]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #416]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #432]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #448]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #464]            ; 16-byte Folded Spill
	add	x29, sp, #464
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-112]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	cmp	x19, #1
	b.lt	LBB0_10
; %bb.1:
	mov	x22, #0
	mov	x23, #0
Lloh5:
	adrp	x26, _TAG_HW_RESOURCE_LIST@GOTPAGE
Lloh6:
	ldr	x26, [x26, _TAG_HW_RESOURCE_LIST@GOTPAGEOFF]
	movi.2s	v8, #1
Lloh7:
	adrp	x24, l_.str.1@PAGE
Lloh8:
	add	x24, x24, l_.str.1@PAGEOFF
Lloh9:
	adrp	x25, l_.str.2@PAGE
Lloh10:
	add	x25, x25, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x22, x22, #1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x23, #1
	cmp	x19, x23
	b.eq	LBB0_10
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #24
	mov	x0, x23
	blr	x20
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x27, x0
	bl	_UlongToPtr
	bl	_CpDoesPortExist
	cbz	w0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x28, x23, #1
	stp	x28, x27, [sp]
	mov	x0, x24
	bl	_TRACE
	add	x0, sp, #32
	mov	x1, x25
	mov	x2, x28
	bl	_sprintf
	ldr	w1, [x26]
	mov	w0, #16
	bl	_FrLdrHeapAlloc
	cbz	x0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x28, x0
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	str	d8, [x28]
	mov	w8, #3
	str	w8, [x28, #8]
	ldr	x8, [x28, #16]
Lloh11:
	adrp	x9, _CmResourceTypePort@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CmResourceTypePort@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	str	w9, [x8, #72]
Lloh14:
	adrp	x9, _CmResourceShareDeviceExclusive@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CmResourceShareDeviceExclusive@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	str	x9, [x8, #64]
Lloh17:
	adrp	x9, _CM_RESOURCE_PORT_IO@GOTPAGE
Lloh18:
	ldr	x9, [x9, _CM_RESOURCE_PORT_IO@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	stp	x27, x9, [x8, #48]
	str	wzr, [x8, #40]
	mov	w9, #7
	str	w9, [x8, #32]
Lloh20:
	adrp	x9, _CmResourceTypeInterrupt@GOTPAGE
Lloh21:
	ldr	x9, [x9, _CmResourceTypeInterrupt@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	str	w9, [x8, #152]
Lloh23:
	adrp	x9, _CmResourceShareUndetermined@GOTPAGE
Lloh24:
	ldr	x9, [x9, _CmResourceShareUndetermined@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
Lloh26:
	adrp	x10, _CM_RESOURCE_INTERRUPT_LATCHED@GOTPAGE
Lloh27:
	ldr	x10, [x10, _CM_RESOURCE_INTERRUPT_LATCHED@GOTPAGEOFF]
Lloh28:
	ldr	x10, [x10]
	stp	x10, x9, [x8, #136]
	ldr	x10, [sp, #24]
	stp	x10, x10, [x8, #96]
	mov	w10, #-1
	str	w10, [x8, #88]
Lloh29:
	adrp	x10, _CmResourceTypeDeviceSpecific@GOTPAGE
Lloh30:
	ldr	x10, [x10, _CmResourceTypeDeviceSpecific@GOTPAGEOFF]
Lloh31:
	ldr	w10, [x10]
	str	w10, [x8, #232]
	stp	xzr, x9, [x8, #216]
	mov	w9, #4
	str	w9, [x8, #160]
	mov	w9, #8192
	movk	w9, #28, lsl #16
	str	w9, [x8, #240]
Lloh32:
	adrp	x8, _ControllerClass@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ControllerClass@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
Lloh35:
	adrp	x8, _Output@GOTPAGE
Lloh36:
	ldr	x8, [x8, _Output@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
Lloh38:
	adrp	x9, _Input@GOTPAGE
Lloh39:
	ldr	x9, [x9, _Input@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh41:
	adrp	x9, _ConsoleIn@GOTPAGE
Lloh42:
	ldr	x9, [x9, _ConsoleIn@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh44:
	adrp	x9, _ConsoleOut@GOTPAGE
Lloh45:
	ldr	x9, [x9, _ConsoleOut@GOTPAGEOFF]
Lloh46:
	ldr	w9, [x9]
	orr	w3, w8, w9
Lloh47:
	adrp	x8, _SerialController@GOTPAGE
Lloh48:
	ldr	x8, [x8, _SerialController@GOTPAGEOFF]
Lloh49:
	ldr	w2, [x8]
	add	x8, sp, #20
	str	x8, [sp, #8]
	mov	w8, #16
	str	x8, [sp]
	add	x6, sp, #32
	mov	x0, x21
	mov	x4, x22
	mov	w5, #-1
	mov	x7, x28
	bl	_FldrCreateComponentKey
	mov	x0, x27
	bl	_UlongToPtr
	bl	_Rs232PortInUse
	cbnz	w0, LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w28, [sp, #20]
	mov	x0, x27
	bl	_UlongToPtr
	mov	x1, x0
	mov	x0, x28
	bl	_DetectSerialPointerPeripheral
	b	LBB0_2
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
Lloh50:
	adrp	x0, l_.str.3@PAGE
Lloh51:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_ERR
	b	LBB0_3
LBB0_10:
	ldur	x8, [x29, #-112]
Lloh52:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh53:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh54:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	ldp	x29, x30, [sp, #464]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #448]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #432]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #416]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #400]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #384]            ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #368]              ; 16-byte Folded Reload
	add	sp, sp, #480
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DetectSerialPorts()\n"

l_.str.1:                               ; @.str.1
	.asciz	"Found COM%u port at 0x%x\n"

l_.str.2:                               ; @.str.2
	.asciz	"COM%ld"

	.comm	_TAG_HW_RESOURCE_LIST,4,2       ; @TAG_HW_RESOURCE_LIST
l_.str.3:                               ; @.str.3
	.asciz	"Failed to allocate resource descriptor\n"

	.comm	_CmResourceTypePort,4,2         ; @CmResourceTypePort
	.comm	_CmResourceShareDeviceExclusive,8,3 ; @CmResourceShareDeviceExclusive
	.comm	_CM_RESOURCE_PORT_IO,8,3        ; @CM_RESOURCE_PORT_IO
	.comm	_CmResourceTypeInterrupt,4,2    ; @CmResourceTypeInterrupt
	.comm	_CmResourceShareUndetermined,8,3 ; @CmResourceShareUndetermined
	.comm	_CM_RESOURCE_INTERRUPT_LATCHED,8,3 ; @CM_RESOURCE_INTERRUPT_LATCHED
	.comm	_CmResourceTypeDeviceSpecific,4,2 ; @CmResourceTypeDeviceSpecific
	.comm	_ControllerClass,4,2            ; @ControllerClass
	.comm	_SerialController,4,2           ; @SerialController
	.comm	_Output,4,2                     ; @Output
	.comm	_Input,4,2                      ; @Input
	.comm	_ConsoleIn,4,2                  ; @ConsoleIn
	.comm	_ConsoleOut,4,2                 ; @ConsoleOut
.subsections_via_symbols
