	.file	"extr_TCP_client.c_handle_handshake.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	handle_handshake, @function
handle_handshake:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r13
	push	r12
	push	rbx
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 24
	movsx	rdx, DWORD PTR crypto_box_NONCEBYTES[rip]
	mov	r12d, DWORD PTR crypto_box_PUBLICKEYBYTES[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	mov	rdi, rsp
	add	r12d, edx
	movsx	r12, r12d
	sal	r12, 2
	lea	rax, 15[r12]
	mov	rcx, rax
	and	rax, -4096
	sub	rdi, rax
	and	rcx, -16
	mov	rax, rdi
	cmp	rsp, rax
	je	.L3
.L13:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L13
.L3:
	and	ecx, 4095
	sub	rsp, rcx
	test	rcx, rcx
	jne	.L14
.L4:
	mov	ecx, DWORD PTR TCP_SERVER_HANDSHAKE_SIZE[rip]
	mov	edi, DWORD PTR 4[rbx]
	mov	r13, rsp
	mov	r8, r13
	sub	ecx, edx
	lea	rdx, [rsi+rdx*4]
	call	decrypt_data_symmetric@PLT
	cdqe
	cmp	rax, r12
	jne	.L7
	movsx	rax, DWORD PTR crypto_box_PUBLICKEYBYTES[rip]
	mov	edi, DWORD PTR 8[rbx]
	mov	edx, DWORD PTR crypto_box_NONCEBYTES[rip]
	lea	rsi, 0[r13+rax*4]
	call	memcpy@PLT
	mov	edx, DWORD PTR 4[rbx]
	mov	esi, DWORD PTR [rbx]
	mov	rdi, r13
	call	encrypt_precompute@PLT
	mov	esi, DWORD PTR crypto_box_SECRETKEYBYTES[rip]
	mov	edi, DWORD PTR [rbx]
	call	sodium_memzero@PLT
	xor	eax, eax
.L1:
	mov	rbx, QWORD PTR -40[rbp]
	xor	rbx, QWORD PTR fs:40
	jne	.L15
	lea	rsp, -24[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rcx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	mov	eax, -1
	jmp	.L1
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	handle_handshake, .-handle_handshake
	.comm	crypto_box_SECRETKEYBYTES,4,4
	.comm	crypto_box_PUBLICKEYBYTES,4,4
	.comm	crypto_box_NONCEBYTES,4,4
	.comm	TCP_SERVER_HANDSHAKE_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_TCP_client.c_handle_handshake.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_handshake, %function
handle_handshake:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, fp, lr}
	add	fp, sp, #24
	sub	sp, sp, #20
	mov	r4, r0
	ldr	r6, .L8
	ldr	r7, .L8+4
	ldr	r2, [r6]
	ldr	r5, [r7]
	ldr	r0, .L8+8
	add	r5, r2, r5
	lsl	r5, r5, #2
	add	r3, r5, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	add	r8, sp, #8
	ldr	r3, [r0]
	ldr	ip, .L8+12
	str	r8, [sp]
	sub	r3, r3, r2
	ldr	r0, [r4, #4]
	add	r2, r1, r2, lsl #2
	ldr	ip, [ip]
	str	ip, [fp, #-32]
	mov	ip,#0
	bl	decrypt_data_symmetric
	cmp	r0, r5
	bne	.L4
	ldr	r1, [r7]
	ldr	r2, [r6]
	add	r1, r8, r1, lsl #2
	ldr	r0, [r4, #8]
	bl	memcpy
	ldm	r4, {r1, r2}
	mov	r0, r8
	bl	encrypt_precompute
	ldr	r3, .L8+16
	ldr	r0, [r4]
	ldr	r1, [r3]
	bl	sodium_memzero
	mov	r0, #0
.L1:
	ldr	r3, .L8+12
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L7
	sub	sp, fp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, fp, pc}
.L4:
	mvn	r0, #0
	b	.L1
.L7:
	bl	__stack_chk_fail
.L9:
	.align	2
.L8:
	.word	crypto_box_NONCEBYTES
	.word	crypto_box_PUBLICKEYBYTES
	.word	TCP_SERVER_HANDSHAKE_SIZE
	.word	.LC0
	.word	crypto_box_SECRETKEYBYTES
	.size	handle_handshake, .-handle_handshake
	.comm	crypto_box_SECRETKEYBYTES,4,4
	.comm	crypto_box_PUBLICKEYBYTES,4,4
	.comm	crypto_box_NONCEBYTES,4,4
	.comm	TCP_SERVER_HANDSHAKE_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
