	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function SerialPortQuery
_SerialPortQuery:                       ## @SerialPortQuery
	.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	%rcx, %r14
	movl	%edx, %r15d
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_PORTNAME_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movl	%r13d, %edi
	callq	_ASSERT
	movl	%r15d, %edi
	callq	_ASSERT
	leaq	l_.str(%rip), %rsi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	movq	%r14, %rbx
	callq	_swprintf
	testq	%r14, %r14
	jne	LBB0_1
## %bb.2:
	movq	_GENERIC_READ@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_GENERIC_WRITE@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %esi
	movq	_OPEN_EXISTING@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	subq	$8, %rsp
	movq	%r12, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	pushq	$0
	callq	_CreateFileW
	addq	$16, %rsp
	movq	%rax, %r14
	movq	_INVALID_HANDLE_VALUE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_8
## %bb.4:
	xorl	%eax, %eax
	callq	_GetLastError
	movq	_ERROR_ACCESS_DENIED@GOTPCREL(%rip), %rcx
	movq	_StdErr@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	_IDS_ERROR_DEVICE_NOT_AVAILABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_ConResPrintf
	jmp	LBB0_7
LBB0_8:
	movq	%r14, %rdi
	movl	%r13d, %esi
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.11:
	callq	_SetCommState
	testq	%rax, %rax
	je	LBB0_10
## %bb.12:
	movq	%rbx, %r13
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_SetCommTimeouts
	jmp	LBB0_14
LBB0_6:
	movq	_IDS_ERROR_ILLEGAL_DEVICE_NAME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r12, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_ConResPrintf
LBB0_7:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_18
LBB0_9:
	callq	_GetCommState
	testq	%rax, %rax
	je	LBB0_10
## %bb.13:
	movq	%rbx, %r13
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_GetCommTimeouts
LBB0_14:
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_17
## %bb.15:
	movq	_IDS_ERROR_TIMEOUT_GET_DEVICE@GOTPCREL(%rip), %rax
	movq	_IDS_ERROR_TIMEOUT_SET_DEVICE@GOTPCREL(%rip), %rcx
	movq	%r13, %rbx
	jmp	LBB0_16
LBB0_10:
	movq	_IDS_ERROR_STATUS_GET_DEVICE@GOTPCREL(%rip), %rax
	movq	_IDS_ERROR_STATUS_SET_DEVICE@GOTPCREL(%rip), %rcx
LBB0_16:
	testq	%rbx, %rbx
	movq	_StdErr@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	cmoveq	%rax, %rcx
	movl	(%rcx), %esi
	xorl	%ebx, %ebx
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_ConResPrintf
LBB0_17:
	movq	%r14, %rdi
	callq	_CloseHandle
LBB0_18:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_20
## %bb.19:
	movq	%rbx, %rax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_PORTNAME_LEN,4,2           ## @MAX_PORTNAME_LEN
	.section	__TEXT,__const
	.p2align	2                               ## @.str
l_.str:
	.long	67                              ## 0x43
	.long	79                              ## 0x4f
	.long	77                              ## 0x4d
	.long	37                              ## 0x25
	.long	100                             ## 0x64
	.long	0                               ## 0x0

	.comm	_GENERIC_WRITE,4,2              ## @GENERIC_WRITE
	.comm	_GENERIC_READ,4,2               ## @GENERIC_READ
	.comm	_OPEN_EXISTING,4,2              ## @OPEN_EXISTING
	.comm	_INVALID_HANDLE_VALUE,8,3       ## @INVALID_HANDLE_VALUE
	.comm	_ERROR_ACCESS_DENIED,8,3        ## @ERROR_ACCESS_DENIED
	.comm	_StdErr,4,2                     ## @StdErr
	.comm	_IDS_ERROR_DEVICE_NOT_AVAILABLE,4,2 ## @IDS_ERROR_DEVICE_NOT_AVAILABLE
	.comm	_IDS_ERROR_ILLEGAL_DEVICE_NAME,4,2 ## @IDS_ERROR_ILLEGAL_DEVICE_NAME
	.comm	_FALSE,8,3                      ## @FALSE
	.comm	_IDS_ERROR_STATUS_SET_DEVICE,4,2 ## @IDS_ERROR_STATUS_SET_DEVICE
	.comm	_IDS_ERROR_STATUS_GET_DEVICE,4,2 ## @IDS_ERROR_STATUS_GET_DEVICE
	.comm	_IDS_ERROR_TIMEOUT_SET_DEVICE,4,2 ## @IDS_ERROR_TIMEOUT_SET_DEVICE
	.comm	_IDS_ERROR_TIMEOUT_GET_DEVICE,4,2 ## @IDS_ERROR_TIMEOUT_GET_DEVICE
	.no_dead_strip	_SerialPortQuery
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function SerialPortQuery
_SerialPortQuery:                       ; @SerialPortQuery
	.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
	sub	sp, sp, #16
	mov	x20, x3
	mov	x22, x2
	mov	x23, 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, #-56]
Lloh3:
	adrp	x8, _MAX_PORTNAME_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_PORTNAME_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x19, x9, x8
	mov	sp, x19
	mov	x0, x1
	bl	_ASSERT
	mov	x0, x22
	bl	_ASSERT
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_swprintf
Lloh10:
	adrp	x8, _GENERIC_WRITE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GENERIC_WRITE@GOTPAGEOFF]
Lloh12:
	adrp	x9, _GENERIC_READ@GOTPAGE
Lloh13:
	ldr	x9, [x9, _GENERIC_READ@GOTPAGEOFF]
	cmp	x20, #0
	csel	x8, x9, x8, eq
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _OPEN_EXISTING@GOTPAGE
Lloh15:
	ldr	x8, [x8, _OPEN_EXISTING@GOTPAGEOFF]
Lloh16:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	x3, #0
	mov	w5, #0
	mov	x6, #0
	bl	_CreateFileW
Lloh17:
	adrp	x8, _INVALID_HANDLE_VALUE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _INVALID_HANDLE_VALUE@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.1:
	bl	_GetLastError
	mov	x8, x0
Lloh20:
	adrp	x9, _ERROR_ACCESS_DENIED@GOTPAGE
Lloh21:
	ldr	x9, [x9, _ERROR_ACCESS_DENIED@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
Lloh23:
	adrp	x10, _StdErr@GOTPAGE
Lloh24:
	ldr	x10, [x10, _StdErr@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x10]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.2:
Lloh26:
	adrp	x8, _IDS_ERROR_DEVICE_NOT_AVAILABLE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _IDS_ERROR_DEVICE_NOT_AVAILABLE@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_ConResPrintf
	b	LBB0_7
LBB0_3:
	mov	x21, x0
	mov	x1, x23
	cbz	x20, LBB0_8
; %bb.4:
	bl	_SetCommState
	cbz	x0, LBB0_11
; %bb.5:
	mov	x0, x21
	mov	x1, x22
	bl	_SetCommTimeouts
	mov	x22, x0
	cbnz	x0, LBB0_13
	b	LBB0_10
LBB0_6:
Lloh29:
	adrp	x9, _IDS_ERROR_ILLEGAL_DEVICE_NAME@GOTPAGE
Lloh30:
	ldr	x9, [x9, _IDS_ERROR_ILLEGAL_DEVICE_NAME@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x9]
	str	x8, [sp, #-16]!
	mov	x2, x19
	bl	_ConResPrintf
	add	sp, sp, #16
LBB0_7:
Lloh32:
	adrp	x8, _FALSE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh34:
	ldr	x22, [x8]
	b	LBB0_14
LBB0_8:
	bl	_GetCommState
	cbz	x0, LBB0_11
; %bb.9:
	mov	x0, x21
	mov	x1, x22
	bl	_GetCommTimeouts
	mov	x22, x0
	cbnz	x0, LBB0_13
LBB0_10:
Lloh35:
	adrp	x8, _IDS_ERROR_TIMEOUT_GET_DEVICE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _IDS_ERROR_TIMEOUT_GET_DEVICE@GOTPAGEOFF]
Lloh37:
	adrp	x9, _IDS_ERROR_TIMEOUT_SET_DEVICE@GOTPAGE
Lloh38:
	ldr	x9, [x9, _IDS_ERROR_TIMEOUT_SET_DEVICE@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh39:
	adrp	x8, _IDS_ERROR_STATUS_GET_DEVICE@GOTPAGE
Lloh40:
	ldr	x8, [x8, _IDS_ERROR_STATUS_GET_DEVICE@GOTPAGEOFF]
Lloh41:
	adrp	x9, _IDS_ERROR_STATUS_SET_DEVICE@GOTPAGE
Lloh42:
	ldr	x9, [x9, _IDS_ERROR_STATUS_SET_DEVICE@GOTPAGEOFF]
LBB0_12:
Lloh43:
	adrp	x10, _StdErr@GOTPAGE
Lloh44:
	ldr	x10, [x10, _StdErr@GOTPAGEOFF]
Lloh45:
	ldr	w0, [x10]
	cmp	x20, #0
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	mov	x2, x19
	bl	_ConResPrintf
	mov	x22, #0
LBB0_13:
	mov	x0, x21
	bl	_CloseHandle
LBB0_14:
	ldur	x8, [x29, #-56]
Lloh46:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh47:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh48:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.15:
	mov	x0, x22
	sub	sp, x29, #48
	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
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_PORTNAME_LEN,4,2           ; @MAX_PORTNAME_LEN
	.section	__TEXT,__const
	.p2align	2                               ; @.str
l_.str:
	.long	67                              ; 0x43
	.long	79                              ; 0x4f
	.long	77                              ; 0x4d
	.long	37                              ; 0x25
	.long	100                             ; 0x64
	.long	0                               ; 0x0

	.comm	_GENERIC_WRITE,4,2              ; @GENERIC_WRITE
	.comm	_GENERIC_READ,4,2               ; @GENERIC_READ
	.comm	_OPEN_EXISTING,4,2              ; @OPEN_EXISTING
	.comm	_INVALID_HANDLE_VALUE,8,3       ; @INVALID_HANDLE_VALUE
	.comm	_ERROR_ACCESS_DENIED,8,3        ; @ERROR_ACCESS_DENIED
	.comm	_StdErr,4,2                     ; @StdErr
	.comm	_IDS_ERROR_DEVICE_NOT_AVAILABLE,4,2 ; @IDS_ERROR_DEVICE_NOT_AVAILABLE
	.comm	_IDS_ERROR_ILLEGAL_DEVICE_NAME,4,2 ; @IDS_ERROR_ILLEGAL_DEVICE_NAME
	.comm	_FALSE,8,3                      ; @FALSE
	.comm	_IDS_ERROR_STATUS_SET_DEVICE,4,2 ; @IDS_ERROR_STATUS_SET_DEVICE
	.comm	_IDS_ERROR_STATUS_GET_DEVICE,4,2 ; @IDS_ERROR_STATUS_GET_DEVICE
	.comm	_IDS_ERROR_TIMEOUT_SET_DEVICE,4,2 ; @IDS_ERROR_TIMEOUT_SET_DEVICE
	.comm	_IDS_ERROR_TIMEOUT_GET_DEVICE,4,2 ; @IDS_ERROR_TIMEOUT_GET_DEVICE
	.no_dead_strip	_SerialPortQuery
.subsections_via_symbols
