	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_init_client_session            ## -- Begin function init_client_session
	.p2align	4, 0x90
_init_client_session:                   ## @init_client_session
	.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	%rsi, %r12
	movq	%rdi, %r13
	movq	48(%rdi), %rax
	movslq	%edx, %rbx
	xorl	%edi, %edi
	cmpq	$0, (%rax,%rbx,8)
	sete	%dil
	callq	_assert
	movq	_last_handshake_id@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	incl	%r14d
	movl	%r14d, (%rax)
	andl	$1073741823, %r14d              ## imm = 0x3FFFFFFF
	incl	%r14d
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_get_client_by_handshake
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_assert
	movl	%r14d, %edi
	movl	$1, %esi
	callq	_get_client_by_handshake
	movq	48(%r13), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	%r13, 16(%rax)
	movq	%r12, 8(%rax)
	movl	4(%r12), %ecx
	movl	%ecx, (%rax)
	movq	_verbosity@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	jle	LBB0_2
## %bb.1:
	movq	_stderr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdx
	movl	%r14d, %ecx
	callq	_fprintf
LBB0_2:
	movq	24(%r13), %rax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	cmpq	$0, 8(%rax)
	sete	%cl
	setne	%dl
	cmpq	$0, 16(%r13)
	cmovel	%ecx, %edx
	movzbl	%dl, %edi
	callq	_assert
	movq	8(%r13), %rcx
	movq	16(%r13), %rax
	movl	(%rcx), %r15d
	testq	%rax, %rax
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_3
## %bb.5:
	movq	8(%rax), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	jne	LBB0_4
## %bb.6:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	jmp	LBB0_7
LBB0_3:
	leaq	L_.str.1(%rip), %rbx
LBB0_4:
	movq	%rbx, %rdi
	movl	$47, %esi
	callq	_strrchr
	leaq	1(%rax), %r12
	testq	%rax, %rax
	cmoveq	%rbx, %r12
	movq	%r12, %rdi
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
LBB0_7:
	cmpl	$0, 32(%r13)
	movq	%r15, %rbx
	jne	LBB0_10
## %bb.8:
	movq	24(%r13), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_10
## %bb.9:
	movq	%r13, %rdi
	callq	_load_binlog_data
	shrq	$63, %rax
	xorl	$1, %eax
	movl	%eax, %edi
	callq	_assert
LBB0_10:
	movq	16(%r13), %rax
	testq	%rax, %rax
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_11
## %bb.12:
	movq	8(%rax), %r12
	jmp	LBB0_13
LBB0_11:
	xorl	%r12d, %r12d
LBB0_13:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leal	(%rax,%rbx), %edi
	addl	$74, %edi
	movl	%edi, -56(%rbp)                 ## 4-byte Spill
	callq	_alloc_packet
	movq	%rax, %r15
	movq	_P_REPL_HANDSHAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%r15)
	movl	%r14d, (%r15)
	movq	$0, 56(%r15)
	movl	40(%r13), %eax
	movl	%eax, 24(%r15)
	movl	36(%r13), %eax
	movl	%eax, 20(%r15)
	testq	%r12, %r12
	je	LBB0_14
## %bb.15:
	movl	8(%r12), %eax
	jmp	LBB0_16
LBB0_14:
	movl	$-1, %eax
LBB0_16:
	movl	%eax, 4(%r15)
	cmpl	$0, 32(%r13)
	je	LBB0_17
LBB0_18:
	movl	$-1, 8(%r15)
	movl	$-1, %eax
LBB0_20:
	movl	%eax, %ecx
LBB0_21:
	movslq	%ebx, %r14
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addl	%eax, %ebx
	xorl	%edi, %edi
	cmpl	(%r13), %ecx
	sete	%dil
	callq	_assert
	movq	48(%r15), %rdi
	leaq	4(%r13), %rsi
	movl	$4, %edx
	callq	_memcpy
	testq	%r12, %r12
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	je	LBB0_22
## %bb.23:
	movq	16(%r13), %rax
	movl	(%rax), %edi
	movl	8(%r12), %esi
	movl	40(%r15), %ecx
	movl	44(%r15), %edx
	callq	_compute_start_end_hashes
	jmp	LBB0_24
LBB0_17:
	movq	24(%r13), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_18
## %bb.19:
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_get_orig_file_size
	movl	%eax, 8(%r15)
	movl	$1048576, %ecx                  ## imm = 0x100000
	cmpl	$1048575, %eax                  ## imm = 0xFFFFF
	jle	LBB0_20
	jmp	LBB0_21
LBB0_22:
	movl	44(%r15), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movl	40(%r15), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
LBB0_24:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%edx, 12(%r15)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	%ebx, 16(%r15)
	movq	32(%r15), %rdi
	movq	8(%r13), %rax
	movq	8(%rax), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movq	32(%r15), %rax
	movq	$0, (%rax,%r14,8)
	leaq	(%rax,%r14,8), %rdi
	addq	$8, %rdi
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movq	32(%r15), %rax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	incl	%ecx
	movslq	%ecx, %rcx
	movq	$0, (%rax,%rcx,8)
	movq	%r12, %rdi
	callq	_show_remote_ip
	movl	(%r12), %ecx
	movq	32(%r15), %r9
	movl	(%r15), %r8d
	movl	4(%r15), %r10d
	movl	24(%r15), %r11d
	movl	20(%r15), %ebx
	leaq	L_.str.2(%rip), %rsi
	movl	$2, %edi
	movl	%eax, %edx
	pushq	%rbx
	pushq	%r11
	pushq	%r10
	pushq	%r14
	callq	_vkprintf
	addq	$32, %rsp
	movq	%r12, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	_push_packet
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_last_handshake_id,4,2          ## @last_handshake_id
	.comm	_verbosity,8,3                  ## @verbosity
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sending handshake to client %p, handshake_id=%d\n"

L_.str.1:                               ## @.str.1
	.space	1

	.comm	_P_REPL_HANDSHAKE,4,2           ## @P_REPL_HANDSHAKE
L_.str.2:                               ## @.str.2
	.asciz	"sending handshake packet to %s:%d, handshake_id=%d, for binlog tag %s, slice name %s (size %lld, pos %lld..%lld)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_init_client_session            ; -- Begin function init_client_session
	.p2align	2
_init_client_session:                   ; @init_client_session
	.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
                                        ; kill: def $w2 killed $w2 def $x2
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0, #48]
	sbfiz	x21, x2, #3, #32
	ldr	x8, [x8, x21]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
Lloh0:
	adrp	x8, _last_handshake_id@GOTPAGE
Lloh1:
	ldr	x8, [x8, _last_handshake_id@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	and	w8, w9, #0x3fffffff
	add	w25, w8, #1
	mov	x0, x25
	mov	w1, #0
	bl	_get_client_by_handshake
	cmp	x0, #0
	cset	w0, eq
	bl	_assert
	mov	x0, x25
	mov	w1, #1
	bl	_get_client_by_handshake
	ldr	x8, [x20, #48]
	str	x0, [x8, x21]
	stp	x19, x20, [x0, #8]
	ldr	w8, [x19, #4]
	str	w8, [x0]
Lloh2:
	adrp	x8, _verbosity@GOTPAGE
Lloh3:
	ldr	x8, [x8, _verbosity@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x8, #1
	b.lt	LBB0_2
; %bb.1:
	mov	x2, x0
Lloh5:
	adrp	x8, _stderr@GOTPAGE
Lloh6:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x25
	bl	_fprintf
LBB0_2:
	ldp	x8, x9, [x20, #16]
	ldr	x9, [x9, #8]
	cmp	x9, #0
	cset	w9, eq
	cset	w10, ne
	cmp	x8, #0
	csel	w0, w9, w10, eq
	bl	_assert
	ldp	x9, x8, [x20, #8]
	ldr	w22, [x9]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x8, [x8, #8]
	ldr	x21, [x8]
	cbnz	x21, LBB0_6
; %bb.4:
	mov	w23, #0
	ldr	w8, [x20, #32]
	cbnz	w8, LBB0_9
	b	LBB0_7
LBB0_5:
Lloh10:
	adrp	x21, l_.str.1@PAGE
Lloh11:
	add	x21, x21, l_.str.1@PAGEOFF
LBB0_6:
	mov	x0, x21
	mov	w1, #47
	bl	_strrchr
	cmp	x0, #0
	csinc	x21, x21, x0, eq
	mov	x0, x21
	bl	_strlen
	mov	x23, x0
	ldr	w8, [x20, #32]
	cbnz	w8, LBB0_9
LBB0_7:
	ldr	x8, [x20, #24]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x20
	bl	_load_binlog_data
	lsr	x8, x0, #63
	eor	w0, w8, #0x1
	bl	_assert
LBB0_9:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_11
; %bb.10:
	ldr	x28, [x8, #8]
	b	LBB0_12
LBB0_11:
	mov	x28, #0
LBB0_12:
	add	w27, w23, w22
	add	w0, w27, #74
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
	bl	_alloc_packet
	mov	x26, x0
Lloh12:
	adrp	x8, _P_REPL_HANDSHAKE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _P_REPL_HANDSHAKE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x0, #64]
	str	w25, [x0]
	str	xzr, [x0, #56]
	ldur	d0, [x20, #36]
	stur	d0, [x0, #20]
	cbz	x28, LBB0_14
; %bb.13:
	ldr	w8, [x28, #8]
	b	LBB0_15
LBB0_14:
	mov	w8, #-1
LBB0_15:
	str	w8, [x26, #4]
	ldr	w8, [x20, #32]
	cbz	w8, LBB0_19
LBB0_16:
	mov	w0, #-1
	str	w0, [x26, #8]
LBB0_17:
	sxtw	x24, w22
	mov	x25, x20
	ldr	w8, [x25], #4
	cmp	w0, w8
	cset	w0, eq
	bl	_assert
	ldr	x0, [x26, #48]
	mov	x1, x25
	mov	w2, #4
	bl	_memcpy
	cbz	x28, LBB0_22
; %bb.18:
	ldr	x8, [x20, #16]
	ldr	w0, [x8]
	ldr	w1, [x28, #8]
	ldp	w3, w2, [x26, #40]
	bl	_compute_start_end_hashes
	b	LBB0_23
LBB0_19:
	ldr	x8, [x20, #24]
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_16
; %bb.20:
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_get_orig_file_size
	str	w0, [x26, #8]
	cmp	w0, #256, lsl #12               ; =1048576
	b.lt	LBB0_17
; %bb.21:
	mov	w0, #1048576
	b	LBB0_17
LBB0_22:
	ldr	w0, [x26, #44]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	w0, [x26, #40]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
LBB0_23:
	ldr	w25, [sp, #12]                  ; 4-byte Folded Reload
	stp	w22, w23, [x26, #12]
	ldr	x0, [x26, #32]
	ldr	x8, [x20, #8]
	ldr	x1, [x8, #8]
	mov	x2, x22
	bl	_memcpy
	ldr	x8, [x26, #32]
	add	x0, x8, x24, lsl #3
	str	xzr, [x0], #8
	mov	x1, x21
	mov	x2, x23
	bl	_memcpy
	ldr	x8, [x26, #32]
	add	w9, w27, #1
	str	xzr, [x8, w9, sxtw #3]
	mov	x0, x19
	bl	_show_remote_ip
	mov	x2, x0
	ldr	w3, [x19]
	ldr	x5, [x26, #32]
	ldp	w4, w7, [x26]
	ldp	w9, w8, [x26, #20]
	stp	w8, w9, [sp]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #2
	mov	x6, x21
	bl	_vkprintf
	mov	x0, x19
	mov	x1, x25
	bl	_push_packet
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_last_handshake_id,4,2          ; @last_handshake_id
	.comm	_verbosity,8,3                  ; @verbosity
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sending handshake to client %p, handshake_id=%d\n"

l_.str.1:                               ; @.str.1
	.space	1

	.comm	_P_REPL_HANDSHAKE,4,2           ; @P_REPL_HANDSHAKE
l_.str.2:                               ; @.str.2
	.asciz	"sending handshake packet to %s:%d, handshake_id=%d, for binlog tag %s, slice name %s (size %lld, pos %lld..%lld)\n"

.subsections_via_symbols
