	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function moxa_tiocmget
_moxa_tiocmget:                         ## @moxa_tiocmget
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_moxa_openlock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	leaq	-20(%rbp), %rsi
	leaq	-24(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_MoxaPortGetLineOut
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	_TIOCM_DTR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_4:
	movl	-24(%rbp), %r14d
	testl	%r14d, %r14d
	je	LBB0_6
## %bb.5:
	movq	_TIOCM_RTS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
LBB0_6:
	orl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_MoxaPortLineStatus
	movl	%eax, %ebx
	movl	%eax, -20(%rbp)
	andl	$1, %eax
	negl	%eax
	movq	_TIOCM_CTS@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%ebx, %ecx
	shll	$30, %ecx
	sarl	$31, %ecx
	movq	_TIOCM_DSR@GOTPCREL(%rip), %rdx
	andl	(%rdx), %ecx
	orl	%eax, %ecx
	orl	%r14d, %ecx
	shll	$29, %ebx
	sarl	$31, %ebx
	movq	_TIOCM_CD@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	orl	%ecx, %ebx
	movq	_moxa_openlock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	jmp	LBB0_7
LBB0_1:
	movq	_moxa_openlock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_moxa_openlock,4,2              ## @moxa_openlock
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TIOCM_DTR,4,2                  ## @TIOCM_DTR
	.comm	_TIOCM_RTS,4,2                  ## @TIOCM_RTS
	.comm	_TIOCM_CTS,4,2                  ## @TIOCM_CTS
	.comm	_TIOCM_DSR,4,2                  ## @TIOCM_DSR
	.comm	_TIOCM_CD,4,2                   ## @TIOCM_CD
	.no_dead_strip	_moxa_tiocmget
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function moxa_tiocmget
_moxa_tiocmget:                         ; @moxa_tiocmget
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x0, _moxa_openlock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _moxa_openlock@GOTPAGEOFF]
	bl	_mutex_lock
	ldr	x19, [x19]
	cbz	x19, LBB0_2
; %bb.1:
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x19
	bl	_MoxaPortGetLineOut
	ldr	w8, [sp, #12]
Lloh2:
	adrp	x9, _TIOCM_DTR@GOTPAGE
Lloh3:
	ldr	x9, [x9, _TIOCM_DTR@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, #0
	csel	w8, wzr, w9, eq
	ldr	w9, [sp, #8]
Lloh5:
	adrp	x10, _TIOCM_RTS@GOTPAGE
Lloh6:
	ldr	x10, [x10, _TIOCM_RTS@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	cmp	w9, #0
	csel	w9, wzr, w10, eq
	orr	w20, w9, w8
	mov	x0, x19
	bl	_MoxaPortLineStatus
	str	w0, [sp, #12]
	sbfx	w8, w0, #0, #1
Lloh8:
	adrp	x9, _TIOCM_CTS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TIOCM_CTS@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	and	w8, w8, w9
	orr	w8, w20, w8
	lsl	w9, w0, #30
Lloh11:
	adrp	x10, _TIOCM_DSR@GOTPAGE
Lloh12:
	ldr	x10, [x10, _TIOCM_DSR@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	and	w9, w10, w9, asr #31
	orr	w8, w8, w9
	lsl	w9, w0, #29
Lloh14:
	adrp	x10, _TIOCM_CD@GOTPAGE
Lloh15:
	ldr	x10, [x10, _TIOCM_CD@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	and	w9, w10, w9, asr #31
	orr	w19, w8, w9
Lloh17:
	adrp	x0, _moxa_openlock@GOTPAGE
Lloh18:
	ldr	x0, [x0, _moxa_openlock@GOTPAGEOFF]
	bl	_mutex_unlock
	b	LBB0_3
LBB0_2:
Lloh19:
	adrp	x0, _moxa_openlock@GOTPAGE
Lloh20:
	ldr	x0, [x0, _moxa_openlock@GOTPAGEOFF]
	bl	_mutex_unlock
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_3:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_moxa_openlock,4,2              ; @moxa_openlock
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TIOCM_DTR,4,2                  ; @TIOCM_DTR
	.comm	_TIOCM_RTS,4,2                  ; @TIOCM_RTS
	.comm	_TIOCM_CTS,4,2                  ; @TIOCM_CTS
	.comm	_TIOCM_DSR,4,2                  ; @TIOCM_DSR
	.comm	_TIOCM_CD,4,2                   ; @TIOCM_CD
	.no_dead_strip	_moxa_tiocmget
.subsections_via_symbols
