	.file	"extr_statem_srvr.c_tls_process_cke_psk_preamble.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	tls_process_cke_psk_preamble, @function
tls_process_cke_psk_preamble:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	r12, rdi
	mov	rdi, rsi
	sub	rsp, 16
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR PSK_MAX_PSK_LEN[rip]
	mov	rcx, rsp
	mov	r13, rax
	add	rax, 15
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L20:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L20
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L21
.L4:
	lea	r15, -44[rbp]
	mov	rsi, r15
	call	PACKET_get_length_prefixed_2@PLT
	mov	r14d, eax
	test	eax, eax
	je	.L22
	mov	rdi, r15
	call	PACKET_remaining@PLT
	cmp	rax, QWORD PTR PSK_MAX_IDENTITY_LEN[rip]
	jg	.L23
	cmp	QWORD PTR [r12], 0
	mov	ecx, DWORD PTR SSL_R_PSK_NO_SERVER_CB[rip]
	je	.L18
	mov	rsi, QWORD PTR 16[r12]
	mov	rdi, r15
	call	PACKET_strndup@PLT
	mov	r14d, eax
	test	eax, eax
	je	.L24
	mov	rax, QWORD PTR 16[r12]
	mov	ecx, r13d
	mov	rdx, rsp
	mov	rdi, r12
	mov	esi, DWORD PTR [rax]
	call	[QWORD PTR [r12]]
	mov	r13, rax
	movsx	rax, DWORD PTR PSK_MAX_PSK_LEN[rip]
	cmp	rax, r13
	jb	.L25
	test	r13, r13
	je	.L26
	mov	rax, QWORD PTR 8[r12]
	mov	rdi, QWORD PTR 8[rax]
	call	OPENSSL_free@PLT
	mov	r14, QWORD PTR 8[r12]
	mov	rsi, r13
	mov	rdi, rsp
	call	OPENSSL_memdup@PLT
	mov	rsi, r13
	mov	rdi, rsp
	mov	QWORD PTR 8[r14], rax
	call	OPENSSL_cleanse@PLT
	mov	rax, QWORD PTR 8[r12]
	mov	ecx, DWORD PTR ERR_R_MALLOC_FAILURE[rip]
	cmp	QWORD PTR 8[rax], 0
	je	.L18
	mov	QWORD PTR [rax], r13
	mov	r14d, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L22:
	mov	ecx, DWORD PTR SSL_R_LENGTH_MISMATCH[rip]
	mov	edx, DWORD PTR SSL_F_TLS_PROCESS_CKE_PSK_PREAMBLE[rip]
	mov	rdi, r12
	mov	esi, DWORD PTR SSL_AD_DECODE_ERROR[rip]
	call	SSLfatal@PLT
.L1:
	mov	rax, QWORD PTR -40[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L27
	lea	rsp, -32[rbp]
	mov	eax, r14d
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L26:
	mov	ecx, DWORD PTR SSL_R_PSK_IDENTITY_NOT_FOUND[rip]
	mov	edx, DWORD PTR SSL_F_TLS_PROCESS_CKE_PSK_PREAMBLE[rip]
	mov	rdi, r12
	xor	r14d, r14d
	mov	esi, DWORD PTR SSL_AD_UNKNOWN_PSK_IDENTITY[rip]
	call	SSLfatal@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L25:
	mov	ecx, DWORD PTR ERR_R_INTERNAL_ERROR[rip]
.L18:
	mov	edx, DWORD PTR SSL_F_TLS_PROCESS_CKE_PSK_PREAMBLE[rip]
	mov	esi, DWORD PTR SSL_AD_INTERNAL_ERROR[rip]
	mov	rdi, r12
	xor	r14d, r14d
	call	SSLfatal@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L23:
	mov	ecx, DWORD PTR SSL_R_DATA_LENGTH_TOO_LONG[rip]
	mov	edx, DWORD PTR SSL_F_TLS_PROCESS_CKE_PSK_PREAMBLE[rip]
	mov	rdi, r12
	xor	r14d, r14d
	mov	esi, DWORD PTR SSL_AD_DECODE_ERROR[rip]
	call	SSLfatal@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L24:
	mov	ecx, DWORD PTR ERR_R_INTERNAL_ERROR[rip]
	mov	edx, DWORD PTR SSL_F_TLS_PROCESS_CKE_PSK_PREAMBLE[rip]
	mov	rdi, r12
	mov	esi, DWORD PTR SSL_AD_INTERNAL_ERROR[rip]
	call	SSLfatal@PLT
	jmp	.L1
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	tls_process_cke_psk_preamble, .-tls_process_cke_psk_preamble
	.comm	SSL_R_PSK_NO_SERVER_CB,4,4
	.comm	SSL_R_PSK_IDENTITY_NOT_FOUND,4,4
	.comm	SSL_R_LENGTH_MISMATCH,4,4
	.comm	SSL_R_DATA_LENGTH_TOO_LONG,4,4
	.comm	SSL_F_TLS_PROCESS_CKE_PSK_PREAMBLE,4,4
	.comm	SSL_AD_UNKNOWN_PSK_IDENTITY,4,4
	.comm	SSL_AD_INTERNAL_ERROR,4,4
	.comm	SSL_AD_DECODE_ERROR,4,4
	.comm	PSK_MAX_PSK_LEN,4,4
	.comm	PSK_MAX_IDENTITY_LEN,8,8
	.comm	ERR_R_MALLOC_FAILURE,4,4
	.comm	ERR_R_INTERNAL_ERROR,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_statem_srvr.c_tls_process_cke_psk_preamble.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tls_process_cke_psk_preamble, %function
tls_process_cke_psk_preamble:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, fp, lr}
	add	fp, sp, #20
	sub	sp, sp, #8
	ldr	r6, .L22
	mov	r5, r0
	ldr	r7, [r6]
	mov	r0, r1
	add	r3, r7, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	ldr	r3, .L22+4
	sub	r1, fp, #28
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	mov	r3,#0
	bl	PACKET_get_length_prefixed_2
	subs	r4, r0, #0
	beq	.L16
	sub	r0, fp, #28
	bl	PACKET_remaining
	ldr	r3, .L22+8
	ldr	r3, [r3]
	cmp	r0, r3
	bgt	.L17
	ldr	r4, [r5]
	cmp	r4, #0
	beq	.L18
	ldr	r1, [r5, #8]
	sub	r0, fp, #28
	bl	PACKET_strndup
	subs	r4, r0, #0
	ldreq	r3, .L22+12
	beq	.L13
	ldr	r2, [r5, #8]
	mov	r3, r7
	ldr	r1, [r2]
	mov	r0, r5
	mov	r2, sp
	ldr	r4, [r5]
	blx	r4
	ldr	r3, [r6]
	mov	r7, r0
	cmp	r3, r0
	bcc	.L19
	cmp	r0, #0
	beq	.L20
	ldr	r3, [r5, #4]
	ldr	r0, [r3, #4]
	bl	OPENSSL_free
	mov	r1, r7
	mov	r0, sp
	ldr	r4, [r5, #4]
	bl	OPENSSL_memdup
	mov	r1, r7
	str	r0, [r4, #4]
	mov	r0, sp
	bl	OPENSSL_cleanse
	ldr	r3, [r5, #4]
	ldr	r4, [r3, #4]
	cmp	r4, #0
	ldreq	r3, .L22+16
	beq	.L13
	mov	r4, #1
	str	r7, [r3]
	b	.L1
.L16:
	ldr	r3, .L22+20
	ldr	r2, .L22+24
	ldr	r1, .L22+28
.L12:
	mov	r0, r5
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	bl	SSLfatal
.L1:
	ldr	r3, .L22+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	mov	r0, r4
	sub	sp, fp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, fp, pc}
.L18:
	ldr	r3, .L22+32
.L13:
	ldr	r2, .L22+24
	ldr	r1, .L22+36
	b	.L12
.L20:
	ldr	r3, .L22+40
	ldr	r2, .L22+24
	ldr	r1, .L22+44
	mov	r0, r5
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	mov	r4, r7
	bl	SSLfatal
	b	.L1
.L17:
	ldr	r3, .L22+48
	ldr	r2, .L22+24
	ldr	r1, .L22+28
.L14:
	mov	r0, r5
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	bl	SSLfatal
	mov	r4, #0
	b	.L1
.L19:
	ldr	r3, .L22+12
	ldr	r2, .L22+24
	ldr	r1, .L22+36
	b	.L14
.L21:
	bl	__stack_chk_fail
.L23:
	.align	2
.L22:
	.word	PSK_MAX_PSK_LEN
	.word	.LC0
	.word	PSK_MAX_IDENTITY_LEN
	.word	ERR_R_INTERNAL_ERROR
	.word	ERR_R_MALLOC_FAILURE
	.word	SSL_R_LENGTH_MISMATCH
	.word	SSL_F_TLS_PROCESS_CKE_PSK_PREAMBLE
	.word	SSL_AD_DECODE_ERROR
	.word	SSL_R_PSK_NO_SERVER_CB
	.word	SSL_AD_INTERNAL_ERROR
	.word	SSL_R_PSK_IDENTITY_NOT_FOUND
	.word	SSL_AD_UNKNOWN_PSK_IDENTITY
	.word	SSL_R_DATA_LENGTH_TOO_LONG
	.size	tls_process_cke_psk_preamble, .-tls_process_cke_psk_preamble
	.comm	SSL_R_PSK_NO_SERVER_CB,4,4
	.comm	SSL_R_PSK_IDENTITY_NOT_FOUND,4,4
	.comm	SSL_R_LENGTH_MISMATCH,4,4
	.comm	SSL_R_DATA_LENGTH_TOO_LONG,4,4
	.comm	SSL_F_TLS_PROCESS_CKE_PSK_PREAMBLE,4,4
	.comm	SSL_AD_UNKNOWN_PSK_IDENTITY,4,4
	.comm	SSL_AD_INTERNAL_ERROR,4,4
	.comm	SSL_AD_DECODE_ERROR,4,4
	.comm	PSK_MAX_PSK_LEN,4,4
	.comm	PSK_MAX_IDENTITY_LEN,4,4
	.comm	ERR_R_MALLOC_FAILURE,4,4
	.comm	ERR_R_INTERNAL_ERROR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
