	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ssh_packet_read_seqnr          ## -- Begin function ssh_packet_read_seqnr
	.p2align	4, 0x90
_ssh_packet_read_seqnr:                 ## @ssh_packet_read_seqnr
	.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
	movl	$8248, %eax                     ## imm = 0x2038
	callq	____chkstk_darwin
	subq	%rax, %rsp
	popq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -8272(%rbp)               ## 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %r15
	leaq	L_.str(%rip), %rdi
	callq	_debug
	movl	%eax, %edi
	callq	_DBG
	movq	8(%r15), %rdi
	incq	%rdi
	movq	_NFDBITS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_howmany
	movl	%eax, %edi
	movl	$4, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_21
## %bb.1:
	movq	%rax, %rbx
	movq	%r14, -8264(%rbp)               ## 8-byte Spill
	movq	%r12, %rdi
	callq	_ssh_packet_write_wait
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_24
## %bb.2:
	xorl	%r13d, %r13d
	movq	%r12, -8256(%rbp)               ## 8-byte Spill
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
                                        ##       Child Loop BB0_10 Depth 3
	movq	%r12, %rdi
	movq	-8264(%rbp), %r12               ## 8-byte Reload
	movq	%r12, %rsi
	movq	-8272(%rbp), %rdx               ## 8-byte Reload
	callq	_ssh_packet_read_poll_seqnr
	testl	%eax, %eax
	jne	LBB0_27
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r12), %rax
	movq	_SSH_MSG_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_28
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r15), %rdi
	incq	%rdi
	movq	_NFDBITS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_howmany
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,4), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_memset
	movq	8(%r15), %rdi
	movq	%rbx, %rsi
	callq	_FD_SET
	movl	(%r15), %eax
	testl	%eax, %eax
	leaq	-8280(%rbp), %r14
	jle	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, -8244(%rbp)
	movq	%r14, %r13
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-8256(%rbp), %r12               ## 8-byte Reload
LBB0_8:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_10 Depth 3
	movl	(%r15), %eax
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_10 Depth=3
	movl	$-1, %eax
	cmpl	$-1, (%r15)
	jne	LBB0_16
LBB0_10:                                ##   Parent Loop BB0_3 Depth=1
                                        ##     Parent Loop BB0_8 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	cmpl	$-1, %eax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=3
	movl	-8244(%rbp), %esi
	movq	%r14, %rdi
	callq	_ms_to_timeval
	leaq	-8248(%rbp), %rdi
	callq	_monotime_tv
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=3
	movq	8(%r15), %rdi
	incq	%rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%r13, %r8
	callq	_select
	testl	%eax, %eax
	jns	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=3
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=3
	movq	_EINTR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.15:                              ##   in Loop: Header=BB0_10 Depth=3
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
	jmp	LBB0_22
LBB0_16:                                ##   in Loop: Header=BB0_8 Depth=2
	leaq	-8248(%rbp), %rdi
	leaq	-8244(%rbp), %rsi
	callq	_ms_subtract_diff
	cmpl	$0, -8244(%rbp)
	jg	LBB0_8
	jmp	LBB0_29
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	je	LBB0_29
## %bb.18:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r15), %rdi
	leaq	-8240(%rbp), %rsi
	movl	$8192, %edx                     ## imm = 0x2000
	callq	_read
	testl	%eax, %eax
	je	LBB0_30
## %bb.19:                              ##   in Loop: Header=BB0_3 Depth=1
	js	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	leaq	-8240(%rbp), %rsi
	movl	%eax, %edx
	callq	_ssh_packet_process_incoming
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_3
	jmp	LBB0_24
LBB0_21:
	movq	_SSH_ERR_ALLOC_FAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_25
LBB0_22:
	movq	_SSH_ERR_SYSTEM_ERROR@GOTPCREL(%rip), %rax
LBB0_23:
	movl	(%rax), %r14d
LBB0_24:
	movq	%rbx, %rdi
	callq	_free
LBB0_25:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_31
## %bb.26:
	movl	%r14d, %eax
	addq	$8248, %rsp                     ## imm = 0x2038
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_27:
	movl	%eax, %r14d
	jmp	LBB0_24
LBB0_28:
	xorl	%r14d, %r14d
	jmp	LBB0_24
LBB0_29:
	movq	_SSH_ERR_CONN_TIMEOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_30:
	movq	_SSH_ERR_CONN_CLOSED@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_31:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"packet_read()"

	.comm	_NFDBITS,4,2                    ## @NFDBITS
	.comm	_SSH_ERR_ALLOC_FAIL,4,2         ## @SSH_ERR_ALLOC_FAIL
	.comm	_SSH_MSG_NONE,8,3               ## @SSH_MSG_NONE
	.comm	_errno,8,3                      ## @errno
	.comm	_EAGAIN,8,3                     ## @EAGAIN
	.comm	_EINTR,8,3                      ## @EINTR
	.comm	_EWOULDBLOCK,8,3                ## @EWOULDBLOCK
	.comm	_SSH_ERR_SYSTEM_ERROR,4,2       ## @SSH_ERR_SYSTEM_ERROR
	.comm	_SSH_ERR_CONN_TIMEOUT,4,2       ## @SSH_ERR_CONN_TIMEOUT
	.comm	_SSH_ERR_CONN_CLOSED,4,2        ## @SSH_ERR_CONN_CLOSED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ssh_packet_read_seqnr          ; -- Begin function ssh_packet_read_seqnr
	.p2align	2
_ssh_packet_read_seqnr:                 ; @ssh_packet_read_seqnr
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	w9, #8240
Lloh0:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh1:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	sub	sp, sp, #2, lsl #12             ; =8192
	sub	sp, sp, #48
	str	x2, [sp, #8]                    ; 8-byte Folded Spill
	mov	x21, x1
	mov	x22, x0
Lloh2:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh3:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
	ldr	x25, [x0]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_debug
	bl	_DBG
	ldr	x8, [x25, #8]
	add	x0, x8, #1
Lloh7:
	adrp	x8, _NFDBITS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _NFDBITS@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_howmany
	mov	w1, #4
	bl	_calloc
	cbz	x0, LBB0_18
; %bb.1:
	mov	x19, x0
	mov	x0, x22
	bl	_ssh_packet_write_wait
	mov	x24, x0
	cbnz	w0, LBB0_21
; %bb.2:
	mov	x23, #0
Lloh10:
	adrp	x28, _errno@GOTPAGE
Lloh11:
	ldr	x28, [x28, _errno@GOTPAGEOFF]
Lloh12:
	adrp	x27, _EAGAIN@GOTPAGE
Lloh13:
	ldr	x27, [x27, _EAGAIN@GOTPAGEOFF]
Lloh14:
	adrp	x26, _EINTR@GOTPAGE
Lloh15:
	ldr	x26, [x26, _EINTR@GOTPAGEOFF]
Lloh16:
	adrp	x20, _EWOULDBLOCK@GOTPAGE
Lloh17:
	ldr	x20, [x20, _EWOULDBLOCK@GOTPAGEOFF]
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;       Child Loop BB0_8 Depth 3
	mov	x0, x22
	mov	x1, x21
	ldr	x2, [sp, #8]                    ; 8-byte Folded Reload
	bl	_ssh_packet_read_poll_seqnr
	cbnz	w0, LBB0_24
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x21]
Lloh18:
	adrp	x9, _SSH_MSG_NONE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SSH_MSG_NONE@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_25
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x25, #8]
	add	x0, x8, #1
Lloh21:
	adrp	x8, _NFDBITS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _NFDBITS@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	bl	_howmany
	lsl	w2, w0, #2
	mov	x0, x19
	mov	w1, #0
	bl	_memset
	ldr	x0, [x25, #8]
	mov	x1, x19
	bl	_FD_SET
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	str	w8, [sp, #28]
	add	x23, sp, #24
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_8 Depth 3
	ldr	w8, [x25]
LBB0_8:                                 ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	cmn	w8, #1
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=3
	ldr	w1, [sp, #28]
	add	x0, sp, #24
	bl	_ms_to_timeval
	add	x0, sp, #16
	bl	_monotime_tv
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=3
	ldr	x8, [x25, #8]
	add	x0, x8, #1
	mov	x1, x19
	mov	x2, #0
	mov	x3, #0
	mov	x4, x23
	bl	_select
	tbz	w0, #31, LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=3
	ldr	x8, [x28]
	ldr	x9, [x27]
	ldr	x10, [x26]
	ldr	x11, [x20]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	ccmp	x8, x11, #4, ne
	b.ne	LBB0_19
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=3
	ldr	w9, [x25]
	mov	w8, #-1
	cmn	w9, #1
	b.eq	LBB0_8
; %bb.13:                               ;   in Loop: Header=BB0_7 Depth=2
	add	x0, sp, #16
	add	x1, sp, #28
	bl	_ms_subtract_diff
	ldr	w8, [sp, #28]
	cmp	w8, #1
	b.ge	LBB0_7
	b	LBB0_26
LBB0_14:                                ;   in Loop: Header=BB0_3 Depth=1
	cbz	w0, LBB0_26
; %bb.15:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x25, #8]
	add	x1, sp, #32
	mov	w2, #8192
	bl	_read
	cbz	w0, LBB0_27
; %bb.16:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x2, x0
	tbnz	w0, #31, LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_3 Depth=1
	add	x1, sp, #32
	mov	x0, x22
	bl	_ssh_packet_process_incoming
	mov	x24, x0
	cbz	w0, LBB0_3
	b	LBB0_21
LBB0_18:
Lloh24:
	adrp	x8, _SSH_ERR_ALLOC_FAIL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SSH_ERR_ALLOC_FAIL@GOTPAGEOFF]
Lloh26:
	ldr	w24, [x8]
	b	LBB0_22
LBB0_19:
Lloh27:
	adrp	x8, _SSH_ERR_SYSTEM_ERROR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SSH_ERR_SYSTEM_ERROR@GOTPAGEOFF]
LBB0_20:
	ldr	w24, [x8]
LBB0_21:
	mov	x0, x19
	bl	_free
LBB0_22:
	ldur	x8, [x29, #-96]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_28
; %bb.23:
	mov	x0, x24
	add	sp, sp, #2, lsl #12             ; =8192
	add	sp, sp, #48
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_24:
	mov	x24, x0
	b	LBB0_21
LBB0_25:
	mov	w24, #0
	b	LBB0_21
LBB0_26:
Lloh32:
	adrp	x8, _SSH_ERR_CONN_TIMEOUT@GOTPAGE
Lloh33:
	ldr	x8, [x8, _SSH_ERR_CONN_TIMEOUT@GOTPAGEOFF]
	b	LBB0_20
LBB0_27:
Lloh34:
	adrp	x8, _SSH_ERR_CONN_CLOSED@GOTPAGE
Lloh35:
	ldr	x8, [x8, _SSH_ERR_CONN_CLOSED@GOTPAGEOFF]
	b	LBB0_20
LBB0_28:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"packet_read()"

	.comm	_NFDBITS,4,2                    ; @NFDBITS
	.comm	_SSH_ERR_ALLOC_FAIL,4,2         ; @SSH_ERR_ALLOC_FAIL
	.comm	_SSH_MSG_NONE,8,3               ; @SSH_MSG_NONE
	.comm	_errno,8,3                      ; @errno
	.comm	_EAGAIN,8,3                     ; @EAGAIN
	.comm	_EINTR,8,3                      ; @EINTR
	.comm	_EWOULDBLOCK,8,3                ; @EWOULDBLOCK
	.comm	_SSH_ERR_SYSTEM_ERROR,4,2       ; @SSH_ERR_SYSTEM_ERROR
	.comm	_SSH_ERR_CONN_TIMEOUT,4,2       ; @SSH_ERR_CONN_TIMEOUT
	.comm	_SSH_ERR_CONN_CLOSED,4,2        ; @SSH_ERR_CONN_CLOSED
.subsections_via_symbols
