	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function modem_in_state
_modem_in_state:                        ## @modem_in_state
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
                                        ## kill: def $esi killed $esi def $rsi
	movl	%edi, %ebx
	movq	_modem@GOTPCREL(%rip), %r14
	movb	(%r14), %al
	cmpb	$75, %bl
	jne	LBB0_3
## %bb.1:
	cmpb	$79, %al
	jne	LBB0_3
## %bb.2:
	incl	12(%r14)
	movb	$75, (%r14)
	jmp	LBB0_13
LBB0_3:
	cmpb	%bl, %al
	jne	LBB0_8
## %bb.4:
	incl	12(%r14)
	leal	1(%rbx), %eax
	movb	%al, (%r14)
	cmpl	$0, 4(%r14)
	jne	LBB0_13
## %bb.5:
	cmpl	$63, 8(%r14)
	jg	LBB0_7
## %bb.6:
	leaq	L_str(%rip), %rdi
	callq	_puts
LBB0_7:
	movl	$1, 4(%r14)
	jmp	LBB0_13
LBB0_8:
	cmpl	$0, 4(%r14)
	je	LBB0_12
## %bb.9:
	movl	8(%r14), %ecx
	cmpl	$63, %ecx
	jg	LBB0_11
## %bb.10:
	movsbl	%al, %ecx
	leal	511(%rsi), %eax
	testl	%esi, %esi
	cmovnsl	%esi, %eax
	andl	$-512, %eax                     ## imm = 0xFE00
	subl	%eax, %esi
	leaq	L_.str.1(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_printf
	movl	8(%r14), %ecx
LBB0_11:
	movl	$0, 4(%r14)
	incl	%ecx
	movl	%ecx, 8(%r14)
LBB0_12:
	leal	1(%rbx), %eax
	movb	%al, (%r14)
LBB0_13:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_modem,16,2                     ## @modem
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"Lost sync @ %d, 0x%02x != 0x%02x\n"

L_str:                                  ## @str
	.asciz	"Got sync"

	.no_dead_strip	_modem_in_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function modem_in_state
_modem_in_state:                        ; @modem_in_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
Lloh0:
	adrp	x20, _modem@GOTPAGE
Lloh1:
	ldr	x20, [x20, _modem@GOTPAGEOFF]
	ldrb	w8, [x20]
	cmp	w0, #75
	b.ne	LBB0_3
; %bb.1:
	cmp	w8, #79
	b.ne	LBB0_3
; %bb.2:
	ldr	w8, [x20, #12]
	add	w8, w8, #1
	str	w8, [x20, #12]
	mov	w8, #75
	b	LBB0_13
LBB0_3:
	sxtb	w8, w8
	cmp	w8, w19
	b.ne	LBB0_8
; %bb.4:
	ldr	w8, [x20, #12]
	add	w8, w8, #1
	str	w8, [x20, #12]
	add	w8, w19, #1
	strb	w8, [x20]
	ldr	w8, [x20, #4]
	cbnz	w8, LBB0_14
; %bb.5:
	ldr	w8, [x20, #8]
	cmp	w8, #63
	b.gt	LBB0_7
; %bb.6:
Lloh2:
	adrp	x0, l_str@PAGE
Lloh3:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
LBB0_7:
	mov	w8, #1
	str	w8, [x20, #4]
	b	LBB0_14
LBB0_8:
	ldr	w9, [x20, #4]
	cbz	w9, LBB0_12
; %bb.9:
	ldr	w9, [x20, #8]
	cmp	w9, #63
	b.gt	LBB0_11
; %bb.10:
	negs	w9, w1
	and	w9, w9, #0x1ff
	and	w10, w1, #0x1ff
	csneg	w9, w10, w9, mi
	stp	x19, x8, [sp, #8]
	str	x9, [sp]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	ldr	w9, [x20, #8]
LBB0_11:
	add	w8, w9, #1
	stp	wzr, w8, [x20, #4]
LBB0_12:
	add	w8, w19, #1
LBB0_13:
	strb	w8, [x20]
LBB0_14:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_modem,16,2                     ; @modem
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"Lost sync @ %d, 0x%02x != 0x%02x\n"

l_str:                                  ; @str
	.asciz	"Got sync"

	.no_dead_strip	_modem_in_state
.subsections_via_symbols
