	.file	"extr_47080.c_read_ssl_packet.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"read_ssl_packet: Record length out of range (rec_len = %d)\n"
	.align 8
.LC1:
	.string	"read_ssl_packet: Encrypted message is too short (rec_len = %d)\n"
	.align 8
.LC2:
	.string	"Malformed server error message"
	.text
	.p2align 4
	.globl	read_ssl_packet
	.type	read_ssl_packet, @function
read_ssl_packet:
.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, rdi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	edi, DWORD PTR 16[rdi]
	mov	ebx, edx
	mov	edx, 2
	call	read_data@PLT
	movzx	r12d, BYTE PTR 0[rbp]
	test	r12b, r12b
	jns	.L26
	movzx	eax, BYTE PTR 1[rbp]
	sal	r12d, 8
	xor	r14d, r14d
	and	r12d, 32512
	or	r12d, eax
	test	r12d, r12d
	jle	.L11
.L28:
	cmp	r12d, ebx
	jg	.L11
.L4:
	mov	edi, DWORD PTR 16[r13]
	mov	edx, r12d
	mov	rsi, rbp
	call	read_data@PLT
	cmp	QWORD PTR 8[r13], 0
	je	.L6
	mov	eax, DWORD PTR MD5_DIGEST_LENGTH[rip]
	add	eax, r14d
	cmp	eax, r12d
	jl	.L7
	movzx	eax, BYTE PTR SSL2_MT_ERROR[rip]
	cmp	BYTE PTR 0[rbp], al
	jne	.L8
	cmp	r12d, 3
	je	.L10
.L8:
	lea	rdi, .LC1[rip]
	mov	esi, r12d
	xor	eax, eax
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	edi, DWORD PTR 0[r13]
	mov	esi, r12d
	mov	rdx, rbp
	mov	rcx, rbp
	call	RC4@PLT
	movsx	rsi, DWORD PTR MD5_DIGEST_LENGTH[rip]
	mov	rdi, rbp
	sub	r12d, esi
	add	rsi, rbp
	sub	r12d, r14d
	mov	edx, r12d
	call	memmove@PLT
.L6:
	movzx	eax, BYTE PTR SSL2_MT_ERROR[rip]
	cmp	BYTE PTR 0[rbp], al
	je	.L27
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L26:
	.cfi_restore_state
	movzx	eax, BYTE PTR 1[rbp]
	sal	r12d, 8
	mov	edi, DWORD PTR 16[r13]
	lea	rsi, 2[rbp]
	and	r12d, 16128
	mov	edx, 1
	or	r12d, eax
	call	read_data@PLT
	movzx	r14d, BYTE PTR 2[rbp]
	test	r12d, r12d
	jg	.L28
.L11:
	mov	esi, r12d
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L27:
	cmp	r12d, 3
	je	.L10
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L10:
	.cfi_restore_state
	xor	r12d, r12d
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	read_ssl_packet, .-read_ssl_packet
	.comm	SSL2_MT_ERROR,1,1
	.comm	MD5_DIGEST_LENGTH,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_47080.c_read_ssl_packet.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"read_ssl_packet: Record length out of range (rec_le"
	.ascii	"n = %d)\012\000"
	.align	2
.LC1:
	.ascii	"read_ssl_packet: Encrypted message is too short (re"
	.ascii	"c_len = %d)\012\000"
	.align	2
.LC2:
	.ascii	"Malformed server error message\000"
	.text
	.align	2
	.global	read_ssl_packet
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_ssl_packet, %function
read_ssl_packet:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r7, r1
	mov	r6, r0
	mov	r5, r2
	ldr	r0, [r0, #8]
	mov	r2, #2
	bl	read_data
	ldrb	r4, [r7]	@ zero_extendqisi2
	tst	r4, #128
	beq	.L23
	mov	r8, #0
	ldrb	r3, [r7, #1]	@ zero_extendqisi2
	lsl	r4, r4, #8
	and	r4, r4, #32512
	orr	r4, r4, r3
.L3:
	cmp	r4, r5
	movle	r5, #0
	movgt	r5, #1
	cmp	r4, #0
	orrle	r5, r5, #1
	cmp	r5, #0
	bne	.L24
.L4:
	mov	r2, r4
	mov	r1, r7
	ldr	r0, [r6, #8]
	bl	read_data
	ldr	r3, [r6, #4]
	cmp	r3, #0
	bne	.L19
	ldr	r5, .L26
	ldrb	r2, [r7]	@ zero_extendqisi2
	ldrb	r3, [r5]	@ zero_extendqisi2
	cmp	r2, r3
	beq	.L25
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L19:
	ldr	r9, .L26+4
	ldr	r5, .L26
	ldr	r3, [r9]
	add	r3, r8, r3
	cmp	r3, r4
	blt	.L6
	ldrb	r2, [r7]	@ zero_extendqisi2
	ldrb	r3, [r5]	@ zero_extendqisi2
	cmp	r2, r3
	cmpeq	r4, #3
	beq	.L9
	mov	r1, r4
	ldr	r0, .L26+8
	bl	printf
	mov	r0, #1
	bl	exit
.L6:
	mov	r3, r7
	mov	r1, r4
	mov	r2, r7
	ldr	r0, [r6]
	bl	RC4
	ldr	r1, [r9]
	mov	r0, r7
	sub	r4, r4, r1
	sub	r4, r4, r8
	mov	r2, r4
	add	r1, r7, r1
	bl	memmove
	ldrb	r2, [r7]	@ zero_extendqisi2
	ldrb	r3, [r5]	@ zero_extendqisi2
	cmp	r2, r3
	bne	.L1
.L25:
	cmp	r4, #3
	beq	.L9
	ldr	r0, .L26+12
	bl	puts
	mov	r0, #1
	bl	exit
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L23:
	ldrb	r3, [r7, #1]	@ zero_extendqisi2
	lsl	r4, r4, #8
	mov	r2, #1
	ldr	r0, [r6, #8]
	and	r4, r4, #16128
	add	r1, r7, #2
	orr	r4, r4, r3
	bl	read_data
	ldrb	r8, [r7, #2]	@ zero_extendqisi2
	b	.L3
.L24:
	mov	r1, r4
	ldr	r0, .L26+16
	bl	printf
	mov	r0, #1
	bl	exit
	b	.L4
.L9:
	mov	r4, #0
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L27:
	.align	2
.L26:
	.word	SSL2_MT_ERROR
	.word	MD5_DIGEST_LENGTH
	.word	.LC1
	.word	.LC2
	.word	.LC0
	.size	read_ssl_packet, .-read_ssl_packet
	.comm	SSL2_MT_ERROR,1,1
	.comm	MD5_DIGEST_LENGTH,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
