	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cosa_reset_and_read_id
_cosa_reset_and_read_id:                ## @cosa_reset_and_read_id
	.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	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_cosa_putstatus
	movq	%rbx, %rdi
	callq	_cosa_getdata8
	movq	_SR_RST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cosa_putstatus
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_msleep
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_cosa_putstatus
	movq	_COSA_MAX_ID_STRING@GOTPCREL(%rip), %r12
	cmpl	$2, (%r12)
	jl	LBB0_10
## %bb.1:
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	incl	%r14d
	movl	(%r12), %ecx
	decl	%ecx
	cmpl	%ecx, %r14d
	jge	LBB0_10
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_get_wait_data
                                        ## kill: def $eax killed $eax def $rax
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpb	$46, %al
	ja	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movzbl	%al, %ecx
	movabsq	$70368744186880, %rdx           ## imm = 0x400000002400
	btq	%rcx, %rdx
	jb	LBB0_8
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movslq	%r15d, %rcx
	incl	%r15d
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movb	%al, (%rdx,%rcx)
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movzbl	%al, %eax
	cmpl	$10, %r13d
	jne	LBB0_2
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$46, %eax
	jne	LBB0_2
LBB0_10:
	movslq	%r15d, %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movb	$0, (%rcx,%rax)
LBB0_11:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	$-1, %r15d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_SR_RST,4,2                     ## @SR_RST
	.comm	_COSA_MAX_ID_STRING,4,2         ## @COSA_MAX_ID_STRING
	.no_dead_strip	_cosa_reset_and_read_id
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cosa_reset_and_read_id
_cosa_reset_and_read_id:                ; @cosa_reset_and_read_id
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	mov	w1, #0
	bl	_cosa_putstatus
	mov	x0, x20
	bl	_cosa_getdata8
Lloh0:
	adrp	x8, _SR_RST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SR_RST@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_cosa_putstatus
	mov	w0, #500
	bl	_msleep
	mov	x0, x20
	mov	w1, #0
	bl	_cosa_putstatus
	mov	w21, #0
Lloh3:
	adrp	x22, _COSA_MAX_ID_STRING@GOTPAGE
Lloh4:
	ldr	x22, [x22, _COSA_MAX_ID_STRING@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #2
	b.lt	LBB0_9
; %bb.1:
	mov	w26, #0
	mov	w21, #0
	mov	w23, #0
	mov	w24, #1
	mov	x25, #9216
	movk	x25, #16384, lsl #32
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w23, w23, #1
	ldr	w9, [x22]
	sub	w9, w9, #1
	mov	x26, x8
	cmp	w23, w9
	b.ge	LBB0_9
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_get_wait_data
                                        ; kill: def $w0 killed $w0 def $x0
	cmn	w0, #1
	b.eq	LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	and	w8, w0, #0xff
	cmp	w8, #46
	b.hi	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	and	x9, x0, #0xff
	lsl	x9, x24, x9
	tst	x9, x25
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w26, #10
	b.ne	LBB0_2
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w8, #46
	b.ne	LBB0_2
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	strb	w0, [x19, w21, sxtw]
	add	w21, w21, #1
	cmp	w26, #10
	b.eq	LBB0_7
	b	LBB0_2
LBB0_9:
	strb	wzr, [x19, w21, sxtw]
LBB0_10:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_11:
	mov	w21, #-1
	b	LBB0_10
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_SR_RST,4,2                     ; @SR_RST
	.comm	_COSA_MAX_ID_STRING,4,2         ; @COSA_MAX_ID_STRING
	.no_dead_strip	_cosa_reset_and_read_id
.subsections_via_symbols
