	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function getpkt_sane
_getpkt_sane:                           ## @getpkt_sane
	.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
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rsi
	callq	_strcpy
	movq	_watchdog@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	movl	$-1, %ebx
	cmovgl	%eax, %ebx
	testl	%r12d, %r12d
	jne	LBB0_2
## %bb.1:
	movq	_remote_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_2:
	movq	_SERIAL_TIMEOUT@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_readchar
	cmpl	(%r13), %eax
	je	LBB0_4
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$36, %eax
	jne	LBB0_3
## %bb.13:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_read_frame
	testl	%eax, %eax
	jns	LBB0_14
	jmp	LBB0_8
LBB0_4:
	testl	%r12d, %r12d
	je	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	callq	_target_mourn_inferior
	leaq	L_.str.1(%rip), %rdi
	callq	_error
LBB0_6:
	movq	_remote_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.7:
	movq	_gdb_stdlog@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdi
	callq	_fputs_filtered
LBB0_8:
	movq	_remote_desc@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %edx
	callq	_serial_write
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_readchar
	cmpl	(%r13), %eax
	je	LBB0_17
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpl	$36, %eax
	jne	LBB0_9
## %bb.11:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_read_frame
	testl	%eax, %eax
	jns	LBB0_14
	jmp	LBB0_21
LBB0_17:
	testl	%r12d, %r12d
	je	LBB0_19
## %bb.18:
	xorl	%eax, %eax
	callq	_target_mourn_inferior
	leaq	L_.str.1(%rip), %rdi
	callq	_error
LBB0_19:
	movq	_remote_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_21
## %bb.20:
	movq	_gdb_stdlog@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdi
	callq	_fputs_filtered
LBB0_21:
	movq	_remote_desc@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %edx
	callq	_serial_write
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_readchar
	cmpl	(%r13), %eax
	je	LBB0_25
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	cmpl	$36, %eax
	jne	LBB0_22
## %bb.24:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_read_frame
	testl	%eax, %eax
	js	LBB0_29
LBB0_14:
	movq	_remote_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_15
## %bb.16:
	movq	_gdb_stdlog@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_fprintf_unfiltered
	movl	(%r14), %edx
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_fputstr_unfiltered
	movl	(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_fprintf_unfiltered
	jmp	LBB0_30
LBB0_15:
	xorl	%ebx, %ebx
	jmp	LBB0_30
LBB0_25:
	testl	%r12d, %r12d
	je	LBB0_27
## %bb.26:
	xorl	%eax, %eax
	callq	_target_mourn_inferior
	leaq	L_.str.1(%rip), %rdi
	callq	_error
LBB0_27:
	movq	_remote_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_29
## %bb.28:
	movq	_gdb_stdlog@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdi
	callq	_fputs_filtered
LBB0_29:
	movq	_remote_desc@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %ebx
	movl	$1, %edx
	callq	_serial_write
	leaq	L_.str.7(%rip), %rdi
	callq	_printf_unfiltered
LBB0_30:
	movq	_remote_desc@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	movl	$1, %edx
	callq	_serial_write
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout"

	.comm	_watchdog,8,3                   ## @watchdog
	.comm	_remote_timeout,4,2             ## @remote_timeout
	.comm	_SERIAL_TIMEOUT,4,2             ## @SERIAL_TIMEOUT
	.comm	_QUIT,4,2                       ## @QUIT
L_.str.1:                               ## @.str.1
	.asciz	"Watchdog has expired.  Target detached.\n"

	.comm	_remote_debug,8,3               ## @remote_debug
L_.str.2:                               ## @.str.2
	.asciz	"Timed out.\n"

	.comm	_gdb_stdlog,4,2                 ## @gdb_stdlog
L_.str.3:                               ## @.str.3
	.asciz	"Packet received: "

L_.str.4:                               ## @.str.4
	.asciz	"\n"

	.comm	_remote_desc,4,2                ## @remote_desc
L_.str.5:                               ## @.str.5
	.asciz	"+"

L_.str.6:                               ## @.str.6
	.asciz	"-"

L_.str.7:                               ## @.str.7
	.asciz	"Ignoring packet error, continuing...\n"

	.comm	_MAX_TRIES,4,2                  ## @MAX_TRIES
	.no_dead_strip	_getpkt_sane
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function getpkt_sane
_getpkt_sane:                           ; @getpkt_sane
	.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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcpy
Lloh2:
	adrp	x8, _watchdog@GOTPAGE
Lloh3:
	ldr	x8, [x8, _watchdog@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x8, #0
Lloh5:
	adrp	x9, _remote_timeout@GOTPAGE
Lloh6:
	ldr	x9, [x9, _remote_timeout@GOTPAGEOFF]
	csinv	w8, w8, wzr, gt
Lloh7:
	ldr	w9, [x9]
	cmp	w21, #0
	csel	w22, w9, w8, eq
Lloh8:
	adrp	x23, _SERIAL_TIMEOUT@GOTPAGE
Lloh9:
	ldr	x23, [x23, _SERIAL_TIMEOUT@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_readchar
	ldr	w8, [x23]
	cmp	w0, w8
	b.eq	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w0, #36
	b.ne	LBB0_1
; %bb.3:
	mov	x0, x19
	mov	x1, x20
	bl	_read_frame
	tbz	w0, #31, LBB0_20
	b	LBB0_8
LBB0_4:
	cbz	w21, LBB0_6
; %bb.5:
	bl	_target_mourn_inferior
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_error
LBB0_6:
Lloh12:
	adrp	x8, _remote_debug@GOTPAGE
Lloh13:
	ldr	x8, [x8, _remote_debug@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.7:
Lloh15:
	adrp	x8, _gdb_stdlog@GOTPAGE
Lloh16:
	ldr	x8, [x8, _gdb_stdlog@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_fputs_filtered
LBB0_8:
Lloh20:
	adrp	x24, _remote_desc@GOTPAGE
Lloh21:
	ldr	x24, [x24, _remote_desc@GOTPAGEOFF]
	ldr	w0, [x24]
Lloh22:
	adrp	x1, l_.str.6@PAGE
Lloh23:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w2, #1
	bl	_serial_write
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_readchar
	ldr	w8, [x23]
	cmp	w0, w8
	b.eq	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w0, #36
	b.ne	LBB0_9
; %bb.11:
	mov	x0, x19
	mov	x1, x20
	bl	_read_frame
	tbz	w0, #31, LBB0_20
	b	LBB0_16
LBB0_12:
	cbz	w21, LBB0_14
; %bb.13:
	bl	_target_mourn_inferior
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_error
LBB0_14:
Lloh26:
	adrp	x8, _remote_debug@GOTPAGE
Lloh27:
	ldr	x8, [x8, _remote_debug@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	cbz	x8, LBB0_16
; %bb.15:
Lloh29:
	adrp	x8, _gdb_stdlog@GOTPAGE
Lloh30:
	ldr	x8, [x8, _gdb_stdlog@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x0, l_.str.2@PAGE
Lloh33:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_fputs_filtered
LBB0_16:
	ldr	w0, [x24]
Lloh34:
	adrp	x1, l_.str.6@PAGE
Lloh35:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w2, #1
	bl	_serial_write
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_readchar
	ldr	w8, [x23]
	cmp	w0, w8
	b.eq	LBB0_23
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	cmp	w0, #36
	b.ne	LBB0_17
; %bb.19:
	mov	x0, x19
	mov	x1, x20
	bl	_read_frame
	tbnz	w0, #31, LBB0_27
LBB0_20:
Lloh36:
	adrp	x8, _remote_debug@GOTPAGE
Lloh37:
	ldr	x8, [x8, _remote_debug@GOTPAGEOFF]
Lloh38:
	ldr	x8, [x8]
	cbz	x8, LBB0_22
; %bb.21:
Lloh39:
	adrp	x20, _gdb_stdlog@GOTPAGE
Lloh40:
	ldr	x20, [x20, _gdb_stdlog@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh41:
	adrp	x1, l_.str.3@PAGE
Lloh42:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fprintf_unfiltered
	ldr	w2, [x20]
	mov	x0, x19
	mov	w1, #0
	bl	_fputstr_unfiltered
	ldr	w0, [x20]
Lloh43:
	adrp	x1, l_.str.4@PAGE
Lloh44:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_fprintf_unfiltered
LBB0_22:
	mov	w19, #0
	b	LBB0_28
LBB0_23:
	cbz	w21, LBB0_25
; %bb.24:
	bl	_target_mourn_inferior
Lloh45:
	adrp	x0, l_.str.1@PAGE
Lloh46:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_error
LBB0_25:
Lloh47:
	adrp	x8, _remote_debug@GOTPAGE
Lloh48:
	ldr	x8, [x8, _remote_debug@GOTPAGEOFF]
Lloh49:
	ldr	x8, [x8]
	cbz	x8, LBB0_27
; %bb.26:
Lloh50:
	adrp	x8, _gdb_stdlog@GOTPAGE
Lloh51:
	ldr	x8, [x8, _gdb_stdlog@GOTPAGEOFF]
Lloh52:
	ldr	w1, [x8]
Lloh53:
	adrp	x0, l_.str.2@PAGE
Lloh54:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_fputs_filtered
LBB0_27:
	ldr	w0, [x24]
Lloh55:
	adrp	x1, l_.str.6@PAGE
Lloh56:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w19, #1
	mov	w2, #1
	bl	_serial_write
Lloh57:
	adrp	x0, l_.str.7@PAGE
Lloh58:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_printf_unfiltered
LBB0_28:
Lloh59:
	adrp	x8, _remote_desc@GOTPAGE
Lloh60:
	ldr	x8, [x8, _remote_desc@GOTPAGEOFF]
Lloh61:
	ldr	w0, [x8]
Lloh62:
	adrp	x1, l_.str.5@PAGE
Lloh63:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w2, #1
	bl	_serial_write
	mov	x0, x19
	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
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpAdd	Lloh57, Lloh58
	.loh AdrpAdd	Lloh55, Lloh56
	.loh AdrpAdd	Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout"

	.comm	_watchdog,8,3                   ; @watchdog
	.comm	_remote_timeout,4,2             ; @remote_timeout
	.comm	_SERIAL_TIMEOUT,4,2             ; @SERIAL_TIMEOUT
	.comm	_QUIT,4,2                       ; @QUIT
l_.str.1:                               ; @.str.1
	.asciz	"Watchdog has expired.  Target detached.\n"

	.comm	_remote_debug,8,3               ; @remote_debug
l_.str.2:                               ; @.str.2
	.asciz	"Timed out.\n"

	.comm	_gdb_stdlog,4,2                 ; @gdb_stdlog
l_.str.3:                               ; @.str.3
	.asciz	"Packet received: "

l_.str.4:                               ; @.str.4
	.asciz	"\n"

	.comm	_remote_desc,4,2                ; @remote_desc
l_.str.5:                               ; @.str.5
	.asciz	"+"

l_.str.6:                               ; @.str.6
	.asciz	"-"

l_.str.7:                               ; @.str.7
	.asciz	"Ignoring packet error, continuing...\n"

	.comm	_MAX_TRIES,4,2                  ; @MAX_TRIES
	.no_dead_strip	_getpkt_sane
.subsections_via_symbols
