	.file	"extr_ssl_tls.c_mbedtls_ssl_parse_finished.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"=> parse finished"
.LC1:
	.string	"mbedtls_ssl_read_record"
.LC2:
	.string	"bad finished message"
.LC3:
	.string	"<= parse finished"
	.text
	.p2align 4
	.globl	mbedtls_ssl_parse_finished
	.type	mbedtls_ssl_parse_finished, @function
mbedtls_ssl_parse_finished:
.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
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	mov	r12, rdi
	push	rbx
	sub	rsp, 24
	.cfi_offset 3, -40
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR SSL_MAX_HASH_LEN[rip]
	mov	rcx, rsp
	add	rax, 15
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L19:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L19
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L20
.L4:
	lea	rsi, .LC0[rip]
	mov	edi, 2
	call	MBEDTLS_SSL_DEBUG_MSG@PLT
	mov	rax, QWORD PTR 40[r12]
	mov	rsi, rsp
	mov	rdi, r12
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR 56[r12]
	xor	edx, 1
	call	[QWORD PTR 8[rax]]
	mov	rdi, r12
	call	mbedtls_ssl_read_record@PLT
	mov	r13d, eax
	test	eax, eax
	jne	.L21
	mov	rax, QWORD PTR MBEDTLS_SSL_MSG_HANDSHAKE[rip]
	cmp	QWORD PTR [r12], rax
	jne	.L22
	mov	rax, QWORD PTR 16[r12]
	mov	rbx, QWORD PTR MBEDTLS_SSL_HS_FINISHED[rip]
	cmp	QWORD PTR [rax], rbx
	jne	.L17
	mov	rdi, r12
	mov	rbx, QWORD PTR 24[r12]
	call	mbedtls_ssl_hs_hdr_len@PLT
	add	eax, 12
	cmp	rbx, rax
	je	.L23
.L17:
	lea	rsi, .LC2[rip]
	mov	edi, 1
	call	MBEDTLS_SSL_DEBUG_MSG@PLT
	mov	edx, DWORD PTR MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR[rip]
	mov	esi, DWORD PTR MBEDTLS_SSL_ALERT_LEVEL_FATAL[rip]
	mov	rdi, r12
	call	mbedtls_ssl_send_alert_message@PLT
	mov	r13d, DWORD PTR MBEDTLS_ERR_SSL_BAD_HS_FINISHED[rip]
.L1:
	mov	rax, QWORD PTR -40[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L24
	lea	rsp, -24[rbp]
	mov	eax, r13d
	pop	rbx
	pop	r12
	pop	r13
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	lea	rsi, .LC2[rip]
	mov	edi, 1
	call	MBEDTLS_SSL_DEBUG_MSG@PLT
	mov	edx, DWORD PTR MBEDTLS_SSL_ALERT_MSG_UNEXPECTED_MESSAGE[rip]
	mov	esi, DWORD PTR MBEDTLS_SSL_ALERT_LEVEL_FATAL[rip]
	mov	rdi, r12
	call	mbedtls_ssl_send_alert_message@PLT
	mov	r13d, DWORD PTR MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	mov	edx, eax
	lea	rsi, .LC1[rip]
	mov	edi, 1
	call	MBEDTLS_SSL_DEBUG_RET@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L23:
	mov	rdi, r12
	mov	rbx, QWORD PTR 16[r12]
	call	mbedtls_ssl_hs_hdr_len@PLT
	mov	edx, 12
	mov	rsi, rsp
	cdqe
	lea	rdi, [rbx+rax*8]
	call	mbedtls_ssl_safer_memcmp@PLT
	test	rax, rax
	jne	.L17
	mov	rax, QWORD PTR 56[r12]
	cmp	QWORD PTR [rax], 0
	je	.L25
.L11:
	lea	rsi, .LC3[rip]
	mov	edi, 2
	call	MBEDTLS_SSL_DEBUG_MSG@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L25:
	add	DWORD PTR 48[r12], 1
	jmp	.L11
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	mbedtls_ssl_parse_finished, .-mbedtls_ssl_parse_finished
	.comm	SSL_MAX_HASH_LEN,4,4
	.comm	MBEDTLS_SSL_TRANSPORT_DATAGRAM,8,8
	.comm	MBEDTLS_SSL_MSG_HANDSHAKE,8,8
	.comm	MBEDTLS_SSL_MINOR_VERSION_0,8,8
	.comm	MBEDTLS_SSL_IS_SERVER,4,4
	.comm	MBEDTLS_SSL_IS_CLIENT,4,4
	.comm	MBEDTLS_SSL_HS_FINISHED,8,8
	.comm	MBEDTLS_SSL_HANDSHAKE_WRAPUP,4,4
	.comm	MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC,4,4
	.comm	MBEDTLS_SSL_ALERT_MSG_UNEXPECTED_MESSAGE,4,4
	.comm	MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR,4,4
	.comm	MBEDTLS_SSL_ALERT_LEVEL_FATAL,4,4
	.comm	MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE,4,4
	.comm	MBEDTLS_ERR_SSL_BAD_HS_FINISHED,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_ssl_tls.c_mbedtls_ssl_parse_finished.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"=> parse finished\000"
	.align	2
.LC1:
	.ascii	"mbedtls_ssl_read_record\000"
	.align	2
.LC2:
	.ascii	"bad finished message\000"
	.align	2
.LC3:
	.ascii	"<= parse finished\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	mbedtls_ssl_parse_finished
	.syntax unified
	.arm
	.fpu softvfp
	.type	mbedtls_ssl_parse_finished, %function
mbedtls_ssl_parse_finished:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #8
	mov	r4, r0
	ldr	r3, .L16
	ldr	r1, .L16+4
	ldr	r3, [r3]
	mov	r0, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	ldr	r3, .L16+8
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	bl	MBEDTLS_SSL_DEBUG_MSG
	ldr	r2, [r4, #20]
	ldr	r3, [r4, #28]
	ldr	r2, [r2]
	mov	r1, sp
	ldr	r3, [r3, #4]
	eor	r2, r2, #1
	mov	r0, r4
	blx	r3
	mov	r0, r4
	bl	mbedtls_ssl_read_record
	subs	r5, r0, #0
	bne	.L13
	ldr	r3, .L16+12
	ldr	r2, [r4]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L14
	ldr	r2, [r4, #8]
	ldr	r3, .L16+16
	ldr	r2, [r2]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L5
.L11:
	ldr	r1, .L16+20
	mov	r0, #1
	bl	MBEDTLS_SSL_DEBUG_MSG
	ldr	r3, .L16+24
	ldr	r2, .L16+28
	ldr	r1, [r3]
	mov	r0, r4
	ldr	r2, [r2]
	bl	mbedtls_ssl_send_alert_message
	ldr	r3, .L16+32
	ldr	r5, [r3]
.L1:
	ldr	r3, .L16+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L15
	mov	r0, r5
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L5:
	mov	r0, r4
	ldr	r5, [r4, #12]
	bl	mbedtls_ssl_hs_hdr_len
	add	r0, r0, #12
	cmp	r5, r0
	bne	.L11
	mov	r0, r4
	ldr	r5, [r4, #8]
	bl	mbedtls_ssl_hs_hdr_len
	mov	r2, #12
	add	r0, r5, r0, lsl #2
	mov	r1, sp
	bl	mbedtls_ssl_safer_memcmp
	subs	r5, r0, #0
	bne	.L11
	ldr	r3, [r4, #28]
	ldr	r1, .L16+36
	ldr	r3, [r3]
	mov	r0, #2
	cmp	r3, #0
	ldreq	r3, [r4, #24]
	addeq	r3, r3, #1
	streq	r3, [r4, #24]
	bl	MBEDTLS_SSL_DEBUG_MSG
	b	.L1
.L14:
	ldr	r1, .L16+20
	mov	r0, #1
	bl	MBEDTLS_SSL_DEBUG_MSG
	ldr	r3, .L16+24
	ldr	r2, .L16+40
	ldr	r1, [r3]
	mov	r0, r4
	ldr	r2, [r2]
	bl	mbedtls_ssl_send_alert_message
	ldr	r3, .L16+44
	ldr	r5, [r3]
	b	.L1
.L13:
	mov	r2, r5
	ldr	r1, .L16+48
	mov	r0, #1
	bl	MBEDTLS_SSL_DEBUG_RET
	b	.L1
.L15:
	bl	__stack_chk_fail
.L17:
	.align	2
.L16:
	.word	SSL_MAX_HASH_LEN
	.word	.LC0
	.word	.LC4
	.word	MBEDTLS_SSL_MSG_HANDSHAKE
	.word	MBEDTLS_SSL_HS_FINISHED
	.word	.LC2
	.word	MBEDTLS_SSL_ALERT_LEVEL_FATAL
	.word	MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR
	.word	MBEDTLS_ERR_SSL_BAD_HS_FINISHED
	.word	.LC3
	.word	MBEDTLS_SSL_ALERT_MSG_UNEXPECTED_MESSAGE
	.word	MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE
	.word	.LC1
	.size	mbedtls_ssl_parse_finished, .-mbedtls_ssl_parse_finished
	.comm	SSL_MAX_HASH_LEN,4,4
	.comm	MBEDTLS_SSL_TRANSPORT_DATAGRAM,4,4
	.comm	MBEDTLS_SSL_MSG_HANDSHAKE,4,4
	.comm	MBEDTLS_SSL_MINOR_VERSION_0,4,4
	.comm	MBEDTLS_SSL_IS_SERVER,4,4
	.comm	MBEDTLS_SSL_IS_CLIENT,4,4
	.comm	MBEDTLS_SSL_HS_FINISHED,4,4
	.comm	MBEDTLS_SSL_HANDSHAKE_WRAPUP,4,4
	.comm	MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC,4,4
	.comm	MBEDTLS_SSL_ALERT_MSG_UNEXPECTED_MESSAGE,4,4
	.comm	MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR,4,4
	.comm	MBEDTLS_SSL_ALERT_LEVEL_FATAL,4,4
	.comm	MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE,4,4
	.comm	MBEDTLS_ERR_SSL_BAD_HS_FINISHED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
