	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_packet_read_with_status        ## -- Begin function packet_read_with_status
	.p2align	4, 0x90
_packet_read_with_status:               ## @packet_read_with_status
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movl	%r8d, %r15d
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movl	%edi, %r14d
	movl	16(%rbp), %r12d
	leaq	-44(%rbp), %rcx
	movl	$4, %r8d
	movl	%r12d, %r9d
	callq	_get_packet_data
	movq	_PACKET_READ_EOF@GOTPCREL(%rip), %rcx
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	movl	%r15d, -68(%rbp)                ## 4-byte Spill
	leaq	-44(%rbp), %rdi
	callq	_packet_length
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	cmpl	$1, %r15d
	je	LBB0_7
## %bb.5:
	testl	%r15d, %r15d
	jne	LBB0_8
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movl	$4, %esi
	xorl	%edx, %edx
	callq	_packet_trace
	movq	_PACKET_READ_FLUSH@GOTPCREL(%rip), %rcx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_21
LBB0_1:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	$-1, %ebx
	jmp	LBB0_21
LBB0_3:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movl	%r12d, %ebx
	leaq	L_.str(%rip), %rdi
	callq	__
	leaq	-44(%rbp), %rsi
	movl	%eax, %edi
	xorl	%eax, %eax
	callq	_die
	jmp	LBB0_10
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movl	$4, %esi
	xorl	%edx, %edx
	callq	_packet_trace
	movq	_PACKET_READ_DELIM@GOTPCREL(%rip), %rcx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_21
LBB0_8:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movl	%r12d, %ebx
	cmpl	$3, %r15d
	ja	LBB0_10
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	callq	__
	movl	%eax, %edi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_die
LBB0_10:
	leal	-4(%r15), %r12d
	cmpl	-68(%rbp), %r12d                ## 4-byte Folded Reload
	jb	LBB0_12
## %bb.11:
	leaq	L_.str.3(%rip), %rdi
	callq	__
	movl	%eax, %edi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_die
LBB0_12:
	movl	%r14d, %edi
	movq	%r13, %rsi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%r12d, %r8d
	movl	%ebx, %r13d
	movl	%ebx, %r9d
	callq	_get_packet_data
	testq	%rax, %rax
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	$-1, %ebx
	movq	_PACKET_READ_EOF@GOTPCREL(%rip), %rcx
	js	LBB0_21
## %bb.13:
	movq	_PACKET_READ_CHOMP_NEWLINE@GOTPCREL(%rip), %rax
	movl	%r13d, %edx
	testl	%r13d, (%rax)
	je	LBB0_14
## %bb.15:
	testl	%r12d, %r12d
	je	LBB0_14
## %bb.16:
	movslq	%r15d, %rax
	leaq	-5(%rax), %rcx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	cmpb	$10, -5(%r13,%rax)
	cmovel	%ecx, %r12d
	movl	%r12d, %ebx
	movl	%edx, %r15d
	jmp	LBB0_17
LBB0_14:
	movl	%r12d, %ebx
	movl	%edx, %r15d
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_17:
	movslq	%ebx, %rsi
	movb	$0, (%r13,%rsi)
	movq	%r13, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%edx, %edx
	callq	_packet_trace
	movq	_PACKET_READ_DIE_ON_ERR_PACKET@GOTPCREL(%rip), %rax
	movq	_PACKET_READ_NORMAL@GOTPCREL(%rip), %rcx
	testl	%r15d, (%rax)
	je	LBB0_21
## %bb.18:
	movq	%rcx, %r15
	leaq	L_.str.4(%rip), %rsi
	movq	%r13, %rdi
	callq	_starts_with
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:
	leaq	L_.str.5(%rip), %rdi
	callq	__
	addq	$4, %r13
	movl	%eax, %edi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_die
LBB0_20:
	movq	%r15, %rcx
LBB0_21:
	movl	%ebx, (%r14)
	movl	(%rcx), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PACKET_READ_EOF,4,2            ## @PACKET_READ_EOF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"protocol error: bad line length character: %.4s"

L_.str.1:                               ## @.str.1
	.asciz	"0000"

	.comm	_PACKET_READ_FLUSH,4,2          ## @PACKET_READ_FLUSH
L_.str.2:                               ## @.str.2
	.asciz	"0001"

	.comm	_PACKET_READ_DELIM,4,2          ## @PACKET_READ_DELIM
L_.str.3:                               ## @.str.3
	.asciz	"protocol error: bad line length %d"

	.comm	_PACKET_READ_CHOMP_NEWLINE,4,2  ## @PACKET_READ_CHOMP_NEWLINE
	.comm	_PACKET_READ_DIE_ON_ERR_PACKET,4,2 ## @PACKET_READ_DIE_ON_ERR_PACKET
L_.str.4:                               ## @.str.4
	.asciz	"ERR "

L_.str.5:                               ## @.str.5
	.asciz	"remote error: %s"

	.comm	_PACKET_READ_NORMAL,4,2         ## @PACKET_READ_NORMAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_packet_read_with_status        ; -- Begin function packet_read_with_status
	.p2align	2
_packet_read_with_status:               ; @packet_read_with_status
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x6
	mov	x19, x5
	mov	x27, x4
	mov	x20, x3
	mov	x23, x2
	mov	x24, x1
	mov	x25, x0
	add	x3, sp, #12
	mov	w4, #4
	mov	x5, x6
	bl	_get_packet_data
	tbnz	x0, #63, LBB0_19
; %bb.1:
	add	x22, sp, #12
	add	x0, sp, #12
	bl	_packet_length
	mov	x26, x0
	tbnz	w0, #31, LBB0_5
; %bb.2:
	cmp	w26, #1
	b.eq	LBB0_6
; %bb.3:
	cbnz	w26, LBB0_7
; %bb.4:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	w1, #4
	mov	w2, #0
	bl	_packet_trace
	mov	w22, #0
Lloh2:
	adrp	x8, _PACKET_READ_FLUSH@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PACKET_READ_FLUSH@GOTPAGEOFF]
	b	LBB0_20
LBB0_5:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	__
	str	x22, [sp]
	b	LBB0_9
LBB0_6:
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	w1, #4
	mov	w2, #0
	bl	_packet_trace
	mov	w22, #0
Lloh8:
	adrp	x8, _PACKET_READ_DELIM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PACKET_READ_DELIM@GOTPAGEOFF]
	b	LBB0_20
LBB0_7:
	cmp	w26, #3
	b.hi	LBB0_10
; %bb.8:
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	__
	str	x26, [sp]
LBB0_9:
	bl	_die
LBB0_10:
	sub	w22, w26, #4
	cmp	w22, w27
	b.lo	LBB0_12
; %bb.11:
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	__
	str	x22, [sp]
	bl	_die
LBB0_12:
	mov	x0, x25
	mov	x1, x24
	mov	x2, x23
	mov	x3, x20
	mov	x4, x22
	mov	x5, x21
	bl	_get_packet_data
	tbnz	x0, #63, LBB0_19
; %bb.13:
Lloh14:
	adrp	x8, _PACKET_READ_CHOMP_NEWLINE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PACKET_READ_CHOMP_NEWLINE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	and	w8, w8, w21
	cmp	w8, #0
	ccmp	w22, #0, #4, ne
	b.eq	LBB0_15
; %bb.14:
                                        ; kill: def $w26 killed $w26 killed $x26 def $x26
	sxtw	x8, w26
	sub	x8, x8, #5
	ldrb	w9, [x20, x8]
	cmp	w9, #10
	csel	w22, w8, w22, eq
LBB0_15:
	strb	wzr, [x20, w22, sxtw]
	mov	x0, x20
	mov	x1, x22
	mov	w2, #0
	bl	_packet_trace
Lloh17:
	adrp	x8, _PACKET_READ_DIE_ON_ERR_PACKET@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PACKET_READ_DIE_ON_ERR_PACKET@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_18
; %bb.16:
Lloh20:
	adrp	x1, l_.str.4@PAGE
Lloh21:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_starts_with
	cbz	x0, LBB0_18
; %bb.17:
Lloh22:
	adrp	x0, l_.str.5@PAGE
Lloh23:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	__
	add	x8, x20, #4
	str	x8, [sp]
	bl	_die
LBB0_18:
Lloh24:
	adrp	x8, _PACKET_READ_NORMAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PACKET_READ_NORMAL@GOTPAGEOFF]
	b	LBB0_20
LBB0_19:
Lloh26:
	adrp	x8, _PACKET_READ_EOF@GOTPAGE
Lloh27:
	ldr	x8, [x8, _PACKET_READ_EOF@GOTPAGEOFF]
	mov	w22, #-1
LBB0_20:
	str	w22, [x19]
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_PACKET_READ_EOF,4,2            ; @PACKET_READ_EOF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"protocol error: bad line length character: %.4s"

l_.str.1:                               ; @.str.1
	.asciz	"0000"

	.comm	_PACKET_READ_FLUSH,4,2          ; @PACKET_READ_FLUSH
l_.str.2:                               ; @.str.2
	.asciz	"0001"

	.comm	_PACKET_READ_DELIM,4,2          ; @PACKET_READ_DELIM
l_.str.3:                               ; @.str.3
	.asciz	"protocol error: bad line length %d"

	.comm	_PACKET_READ_CHOMP_NEWLINE,4,2  ; @PACKET_READ_CHOMP_NEWLINE
	.comm	_PACKET_READ_DIE_ON_ERR_PACKET,4,2 ; @PACKET_READ_DIE_ON_ERR_PACKET
l_.str.4:                               ; @.str.4
	.asciz	"ERR "

l_.str.5:                               ; @.str.5
	.asciz	"remote error: %s"

	.comm	_PACKET_READ_NORMAL,4,2         ; @PACKET_READ_NORMAL
.subsections_via_symbols
