	.file	"extr_extensions_srvr.c_tls_construct_stoc_key_share.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	tls_construct_stoc_key_share
	.type	tls_construct_stoc_key_share, @function
tls_construct_stoc_key_share:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR 8[rdi]
	mov	r12, QWORD PTR 16[rax]
	mov	rax, QWORD PTR SSL_HRR_PENDING[rip]
	cmp	QWORD PTR [rdi], rax
	je	.L43
	test	r12, r12
	je	.L44
	mov	esi, DWORD PTR TLSEXT_TYPE_key_share[rip]
	mov	rdi, r13
	call	WPACKET_put_bytes_u16@PLT
	test	eax, eax
	je	.L11
	mov	rdi, r13
	call	WPACKET_start_sub_packet_u16@PLT
	test	eax, eax
	jne	.L45
.L11:
	mov	ecx, DWORD PTR ERR_R_INTERNAL_ERROR[rip]
.L41:
	mov	edx, DWORD PTR SSL_F_TLS_CONSTRUCT_STOC_KEY_SHARE[rip]
	mov	esi, DWORD PTR SSL_AD_INTERNAL_ERROR[rip]
	mov	rdi, rbp
	call	SSLfatal@PLT
	mov	eax, DWORD PTR EXT_RETURN_FAIL[rip]
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L46
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L44:
	.cfi_restore_state
	mov	eax, DWORD PTR 16[rdi]
	test	eax, eax
	je	.L11
	xor	edx, edx
	xor	esi, esi
	call	tls13_generate_handshake_secret@PLT
	test	eax, eax
	je	.L11
.L40:
	mov	eax, DWORD PTR EXT_RETURN_NOT_SENT[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L43:
	test	r12, r12
	jne	.L40
	mov	esi, DWORD PTR TLSEXT_TYPE_key_share[rip]
	mov	rdi, r13
	call	WPACKET_put_bytes_u16@PLT
	test	eax, eax
	je	.L11
	mov	rdi, r13
	call	WPACKET_start_sub_packet_u16@PLT
	test	eax, eax
	je	.L11
	mov	rax, QWORD PTR 8[rbp]
	mov	rdi, r13
	mov	esi, DWORD PTR 8[rax]
	call	WPACKET_put_bytes_u16@PLT
	test	eax, eax
	je	.L11
	mov	rdi, r13
	call	WPACKET_close@PLT
	test	eax, eax
	je	.L11
	mov	eax, DWORD PTR EXT_RETURN_SENT[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L45:
	mov	rax, QWORD PTR 8[rbp]
	mov	rdi, r13
	mov	esi, DWORD PTR 8[rax]
	call	WPACKET_put_bytes_u16@PLT
	test	eax, eax
	je	.L11
	mov	rdi, r12
	call	ssl_generate_pkey@PLT
	mov	r14, rax
	test	rax, rax
	je	.L47
	mov	rsi, rsp
	mov	rdi, rax
	call	EVP_PKEY_get1_tls_encodedpoint@PLT
	mov	rdx, rax
	test	rax, rax
	je	.L48
	mov	rsi, QWORD PTR [rsp]
	mov	rdi, r13
	call	WPACKET_sub_memcpy_u16@PLT
	test	eax, eax
	je	.L15
	mov	rdi, r13
	call	WPACKET_close@PLT
	test	eax, eax
	je	.L15
	mov	rdi, QWORD PTR [rsp]
	call	OPENSSL_free@PLT
	mov	rax, QWORD PTR 8[rbp]
	mov	rdx, r12
	mov	rsi, r14
	mov	ecx, 1
	mov	rdi, rbp
	mov	QWORD PTR [rax], r14
	call	ssl_derive@PLT
	test	rax, rax
	mov	eax, DWORD PTR EXT_RETURN_FAIL[rip]
	cmovne	eax, DWORD PTR EXT_RETURN_SENT[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L47:
	mov	ecx, DWORD PTR ERR_R_MALLOC_FAILURE[rip]
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L15:
	mov	ecx, DWORD PTR ERR_R_INTERNAL_ERROR[rip]
	mov	edx, DWORD PTR SSL_F_TLS_CONSTRUCT_STOC_KEY_SHARE[rip]
	mov	rdi, rbp
	mov	esi, DWORD PTR SSL_AD_INTERNAL_ERROR[rip]
	call	SSLfatal@PLT
	mov	rdi, r14
	call	EVP_PKEY_free@PLT
	mov	rdi, QWORD PTR [rsp]
	call	OPENSSL_free@PLT
	mov	eax, DWORD PTR EXT_RETURN_FAIL[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L48:
	mov	ecx, DWORD PTR ERR_R_EC_LIB[rip]
	mov	edx, DWORD PTR SSL_F_TLS_CONSTRUCT_STOC_KEY_SHARE[rip]
	mov	rdi, rbp
	mov	esi, DWORD PTR SSL_AD_INTERNAL_ERROR[rip]
	call	SSLfatal@PLT
	mov	rdi, r14
	call	EVP_PKEY_free@PLT
	mov	eax, DWORD PTR EXT_RETURN_FAIL[rip]
	jmp	.L1
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	tls_construct_stoc_key_share, .-tls_construct_stoc_key_share
	.comm	TLSEXT_TYPE_key_share,4,4
	.comm	SSL_HRR_PENDING,8,8
	.comm	SSL_F_TLS_CONSTRUCT_STOC_KEY_SHARE,4,4
	.comm	SSL_AD_INTERNAL_ERROR,4,4
	.comm	EXT_RETURN_SENT,4,4
	.comm	EXT_RETURN_NOT_SENT,4,4
	.comm	EXT_RETURN_FAIL,4,4
	.comm	ERR_R_MALLOC_FAILURE,4,4
	.comm	ERR_R_INTERNAL_ERROR,4,4
	.comm	ERR_R_EC_LIB,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_extensions_srvr.c_tls_construct_stoc_key_share.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	tls_construct_stoc_key_share
	.syntax unified
	.arm
	.fpu softvfp
	.type	tls_construct_stoc_key_share, %function
tls_construct_stoc_key_share:
	@ args = 4, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L50
	ldr	ip, [r0]
	ldr	r2, [r3]
	ldr	r3, [r0, #4]
	cmp	ip, r2
	ldr	r2, .L50+4
	sub	sp, sp, #12
	mov	r4, r0
	mov	r6, r1
	ldr	r2, [r2]
	str	r2, [sp, #4]
	mov	r2,#0
	ldr	r5, [r3, #8]
	beq	.L44
	cmp	r5, #0
	beq	.L45
	ldr	r3, .L50+8
	mov	r0, r1
	ldr	r1, [r3]
	bl	WPACKET_put_bytes_u16
	cmp	r0, #0
	beq	.L11
	mov	r0, r6
	bl	WPACKET_start_sub_packet_u16
	cmp	r0, #0
	bne	.L46
.L11:
	ldr	r3, .L50+12
.L41:
	ldr	r2, .L50+16
	ldr	r1, .L50+20
	mov	r0, r4
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	bl	SSLfatal
.L42:
	ldr	r3, .L50+24
	ldr	r0, [r3]
.L1:
	ldr	r3, .L50+4
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L47
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L45:
	ldr	r3, [r0, #8]
	cmp	r3, #0
	beq	.L11
	mov	r2, r5
	mov	r1, r5
	bl	tls13_generate_handshake_secret
	cmp	r0, #0
	beq	.L11
.L40:
	ldr	r3, .L50+28
	ldr	r0, [r3]
	b	.L1
.L44:
	cmp	r5, #0
	bne	.L40
	ldr	r3, .L50+8
	mov	r0, r1
	ldr	r1, [r3]
	bl	WPACKET_put_bytes_u16
	cmp	r0, #0
	beq	.L11
	mov	r0, r6
	bl	WPACKET_start_sub_packet_u16
	cmp	r0, #0
	beq	.L11
	ldr	r3, [r4, #4]
	mov	r0, r6
	ldr	r1, [r3, #4]
	bl	WPACKET_put_bytes_u16
	cmp	r0, #0
	beq	.L11
	mov	r0, r6
	bl	WPACKET_close
	cmp	r0, #0
	beq	.L11
	b	.L16
.L46:
	ldr	r3, [r4, #4]
	mov	r0, r6
	ldr	r1, [r3, #4]
	bl	WPACKET_put_bytes_u16
	cmp	r0, #0
	beq	.L11
	mov	r0, r5
	bl	ssl_generate_pkey
	subs	r7, r0, #0
	beq	.L48
	mov	r1, sp
	bl	EVP_PKEY_get1_tls_encodedpoint
	subs	r2, r0, #0
	beq	.L49
	mov	r0, r6
	ldr	r1, [sp]
	bl	WPACKET_sub_memcpy_u16
	cmp	r0, #0
	beq	.L15
	mov	r0, r6
	bl	WPACKET_close
	cmp	r0, #0
	beq	.L15
	ldr	r0, [sp]
	bl	OPENSSL_free
	ldr	r3, [r4, #4]
	mov	r2, r5
	str	r7, [r3]
	mov	r1, r7
	mov	r0, r4
	mov	r3, #1
	bl	ssl_derive
	cmp	r0, #0
	beq	.L42
.L16:
	ldr	r3, .L50+32
	ldr	r0, [r3]
	b	.L1
.L48:
	ldr	r3, .L50+36
	b	.L41
.L15:
	ldr	r3, .L50+12
	ldr	r2, .L50+16
	ldr	r1, .L50+20
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	mov	r0, r4
	bl	SSLfatal
	mov	r0, r7
	bl	EVP_PKEY_free
	ldr	r0, [sp]
	bl	OPENSSL_free
	ldr	r3, .L50+24
	ldr	r0, [r3]
	b	.L1
.L49:
	ldr	r3, .L50+40
	ldr	r2, .L50+16
	ldr	r1, .L50+20
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	mov	r0, r4
	bl	SSLfatal
	mov	r0, r7
	bl	EVP_PKEY_free
	ldr	r3, .L50+24
	ldr	r0, [r3]
	b	.L1
.L47:
	bl	__stack_chk_fail
.L51:
	.align	2
.L50:
	.word	SSL_HRR_PENDING
	.word	.LC0
	.word	TLSEXT_TYPE_key_share
	.word	ERR_R_INTERNAL_ERROR
	.word	SSL_F_TLS_CONSTRUCT_STOC_KEY_SHARE
	.word	SSL_AD_INTERNAL_ERROR
	.word	EXT_RETURN_FAIL
	.word	EXT_RETURN_NOT_SENT
	.word	EXT_RETURN_SENT
	.word	ERR_R_MALLOC_FAILURE
	.word	ERR_R_EC_LIB
	.size	tls_construct_stoc_key_share, .-tls_construct_stoc_key_share
	.comm	TLSEXT_TYPE_key_share,4,4
	.comm	SSL_HRR_PENDING,4,4
	.comm	SSL_F_TLS_CONSTRUCT_STOC_KEY_SHARE,4,4
	.comm	SSL_AD_INTERNAL_ERROR,4,4
	.comm	EXT_RETURN_SENT,4,4
	.comm	EXT_RETURN_NOT_SENT,4,4
	.comm	EXT_RETURN_FAIL,4,4
	.comm	ERR_R_MALLOC_FAILURE,4,4
	.comm	ERR_R_INTERNAL_ERROR,4,4
	.comm	ERR_R_EC_LIB,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
