	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function packet_hook
_packet_hook:                           ## @packet_hook
	.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	%rcx, %rbx
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	_S2C@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %r13d
	cmpq	%rdi, 40(%rcx)
	je	LBB0_2
## %bb.1:
	movq	_C2S@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
LBB0_2:
	xorl	%ecx, %ecx
	cmpl	%eax, %r13d
	setne	%cl
	movq	(%rbx,%rcx,8), %r12
	movq	_do_debug@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_4
## %bb.3:
	cmpl	%eax, %r13d
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rsi
	cmoveq	%rax, %rsi
	movl	(%r12), %edx
	movl	(%r15), %ecx
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_sshbuf_dump
LBB0_4:
	cmpl	16(%rbx), %r13d
	jne	LBB0_11
## %bb.5:
	movl	20(%rbx), %eax
	cmpl	(%r12), %eax
	jne	LBB0_11
## %bb.6:
	cmpq	$0, 32(%rbx)
	je	LBB0_13
## %bb.7:
	movq	%r14, %rdi
	callq	_sshbuf_reset
	movq	32(%rbx), %rdi
	movq	%r15, %rsi
	callq	_sshbuf_get_u8
	testl	%eax, %eax
	jne	LBB0_12
## %bb.8:
	movq	32(%rbx), %rsi
	movq	%r14, %rdi
	callq	_sshbuf_putb
	testl	%eax, %eax
	jne	LBB0_12
## %bb.9:
	movq	_do_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_11
## %bb.10:
	movl	(%r15), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_sshbuf_dump
	jmp	LBB0_11
LBB0_13:
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	jne	LBB0_14
LBB0_11:
	incl	(%r12)
	xorl	%eax, %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	leaq	L_.str.4(%rip), %rsi
	callq	_fopen
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_16
## %bb.15:
	movq	24(%rbx), %rdx
	leaq	L_.str.5(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_16:
	movq	%r15, %rdi
	movl	$1, %esi
	movl	$1, %edx
	movq	%r12, %rcx
	callq	_fwrite
	cmpl	$1, %eax
	je	LBB0_18
## %bb.17:
	movq	24(%rbx), %rdx
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_18:
	movq	%r14, %rdi
	callq	_sshbuf_len
	testl	%eax, %eax
	je	LBB0_21
## %bb.19:
	movq	%r14, %rdi
	callq	_sshbuf_ptr
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_sshbuf_len
	movq	%r13, %rdi
	movl	%eax, %esi
	movl	$1, %edx
	movq	%r12, %rcx
	callq	_fwrite
	cmpl	$1, %eax
	je	LBB0_21
## %bb.20:
	movq	24(%rbx), %rdx
	leaq	L_.str.7(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_21:
	movq	_do_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_23
## %bb.22:
	movl	(%r15), %ebx
	movq	%r14, %rdi
	callq	_sshbuf_len
	leaq	L_.str.8(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_printf
LBB0_23:
	movq	%r12, %rdi
	callq	_fclose
	xorl	%edi, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_S2C,4,2                        ## @S2C
	.comm	_C2S,4,2                        ## @C2S
	.comm	_do_debug,8,3                   ## @do_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s packet %d type %u:\n"

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

L_.str.2:                               ## @.str.2
	.asciz	"c2s"

	.comm	_stdout,4,2                     ## @stdout
L_.str.3:                               ## @.str.3
	.asciz	"***** replaced packet type %u\n"

L_.str.4:                               ## @.str.4
	.asciz	"w+"

L_.str.5:                               ## @.str.5
	.asciz	"fopen %s"

L_.str.6:                               ## @.str.6
	.asciz	"fwrite type %s"

L_.str.7:                               ## @.str.7
	.asciz	"fwrite body %s"

L_.str.8:                               ## @.str.8
	.asciz	"***** dumped packet type %u len %zu\n"

	.no_dead_strip	_packet_hook
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function packet_hook
_packet_hook:                           ; @packet_hook
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x3
	mov	x20, x2
	mov	x19, x1
	ldr	x9, [x3, #40]
Lloh0:
	adrp	x8, _S2C@GOTPAGE
Lloh1:
	ldr	x8, [x8, _S2C@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x10, _C2S@GOTPAGE
Lloh4:
	ldr	x10, [x10, _C2S@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	x9, x0
	csel	w24, w8, w10, eq
	cmp	w24, w8
	cset	w9, ne
	ldr	x22, [x3, w9, uxtw #3]
Lloh6:
	adrp	x23, _do_debug@GOTPAGE
Lloh7:
	ldr	x23, [x23, _do_debug@GOTPAGEOFF]
	ldr	x9, [x23]
	cbz	x9, LBB0_2
; %bb.1:
Lloh8:
	adrp	x9, l_.str.2@PAGE
Lloh9:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh10:
	adrp	x10, l_.str.1@PAGE
Lloh11:
	add	x10, x10, l_.str.1@PAGEOFF
	cmp	w24, w8
	csel	x8, x10, x9, eq
	ldr	w9, [x22]
	ldr	w10, [x20]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
Lloh14:
	adrp	x8, _stdout@GOTPAGE
Lloh15:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sshbuf_dump
LBB0_2:
	ldr	w8, [x21, #16]
	cmp	w24, w8
	b.ne	LBB0_10
; %bb.3:
	ldr	w8, [x21, #20]
	ldr	w9, [x22]
	cmp	w8, w9
	b.ne	LBB0_10
; %bb.4:
	ldr	x8, [x21, #32]
	cbz	x8, LBB0_9
; %bb.5:
	mov	x0, x19
	bl	_sshbuf_reset
	ldr	x0, [x21, #32]
	mov	x1, x20
	bl	_sshbuf_get_u8
	cbnz	w0, LBB0_11
; %bb.6:
	ldr	x1, [x21, #32]
	mov	x0, x19
	bl	_sshbuf_putb
	cbnz	w0, LBB0_11
; %bb.7:
	ldr	x8, [x23]
	cbz	x8, LBB0_10
; %bb.8:
	ldr	w8, [x20]
	str	x8, [sp]
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf
Lloh19:
	adrp	x8, _stdout@GOTPAGE
Lloh20:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sshbuf_dump
	b	LBB0_10
LBB0_9:
	ldr	x0, [x21, #24]
	cbnz	x0, LBB0_12
LBB0_10:
	mov	w0, #0
	ldr	w8, [x22]
	add	w8, w8, #1
	str	w8, [x22]
LBB0_11:
	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
	add	sp, sp, #96
	ret
LBB0_12:
Lloh22:
	adrp	x1, l_.str.4@PAGE
Lloh23:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_fopen
	mov	x22, x0
	cbnz	x0, LBB0_14
; %bb.13:
	ldr	x2, [x21, #24]
Lloh24:
	adrp	x1, l_.str.5@PAGE
Lloh25:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_14:
	mov	x0, x20
	mov	w1, #1
	mov	w2, #1
	mov	x3, x22
	bl	_fwrite
	cmp	w0, #1
	b.eq	LBB0_16
; %bb.15:
	ldr	x2, [x21, #24]
Lloh26:
	adrp	x1, l_.str.6@PAGE
Lloh27:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_16:
	mov	x0, x19
	bl	_sshbuf_len
	cbz	w0, LBB0_19
; %bb.17:
	mov	x0, x19
	bl	_sshbuf_ptr
	mov	x23, x0
	mov	x0, x19
	bl	_sshbuf_len
	mov	x1, x0
	mov	x0, x23
	mov	w2, #1
	mov	x3, x22
	bl	_fwrite
	cmp	w0, #1
	b.eq	LBB0_19
; %bb.18:
	ldr	x2, [x21, #24]
Lloh28:
	adrp	x1, l_.str.7@PAGE
Lloh29:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_19:
Lloh30:
	adrp	x8, _do_debug@GOTPAGE
Lloh31:
	ldr	x8, [x8, _do_debug@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	cbz	x8, LBB0_21
; %bb.20:
	ldr	w20, [x20]
	mov	x0, x19
	bl	_sshbuf_len
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x20, x0, [sp]
Lloh33:
	adrp	x0, l_.str.8@PAGE
Lloh34:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_printf
LBB0_21:
	mov	x0, x22
	bl	_fclose
	mov	w0, #0
	bl	_exit
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_S2C,4,2                        ; @S2C
	.comm	_C2S,4,2                        ; @C2S
	.comm	_do_debug,8,3                   ; @do_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s packet %d type %u:\n"

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

l_.str.2:                               ; @.str.2
	.asciz	"c2s"

	.comm	_stdout,4,2                     ; @stdout
l_.str.3:                               ; @.str.3
	.asciz	"***** replaced packet type %u\n"

l_.str.4:                               ; @.str.4
	.asciz	"w+"

l_.str.5:                               ; @.str.5
	.asciz	"fopen %s"

l_.str.6:                               ; @.str.6
	.asciz	"fwrite type %s"

l_.str.7:                               ; @.str.7
	.asciz	"fwrite body %s"

l_.str.8:                               ; @.str.8
	.asciz	"***** dumped packet type %u len %zu\n"

	.no_dead_strip	_packet_hook
.subsections_via_symbols
