	.file	"extr_tlsv1_client.c_tls_derive_keys.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"TLSv1: pre_master_secret"
.LC1:
	.string	"master secret"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"TLSv1: Failed to derive master_secret"
	.section	.rodata.str1.1
.LC3:
	.string	"TLSv1: master_secret"
.LC4:
	.string	"key expansion"
	.section	.rodata.str1.8
	.align 8
.LC5:
	.string	"TLSv1: Failed to derive key_block"
	.section	.rodata.str1.1
.LC6:
	.string	"TLSv1: key_block"
	.text
	.p2align 4
	.globl	tls_derive_keys
	.type	tls_derive_keys, @function
tls_derive_keys:
.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
	.cfi_offset 15, -24
	mov	r15, rdx
	push	r14
	push	r13
	push	r12
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	r12, rsi
	push	rbx
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 24
	mov	edx, DWORD PTR TLS_RANDOM_LEN[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rsi, rsp
	lea	eax, [rdx+rdx]
	cdqe
	lea	rax, 15[0+rax*4]
	mov	rcx, rax
	and	rax, -4096
	sub	rsi, rax
	and	rcx, -16
	mov	rax, rsi
	cmp	rsp, rax
	je	.L3
.L26:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L26
.L3:
	and	ecx, 4095
	sub	rsp, rcx
	test	rcx, rcx
	jne	.L27
.L4:
	movsx	rax, DWORD PTR TLS_MAX_KEY_BLOCK_LEN[rip]
	mov	rsi, rsp
	mov	r13, rsp
	lea	rax, 15[0+rax*4]
	mov	rcx, rax
	and	rax, -4096
	sub	rsi, rax
	and	rcx, -16
	mov	rax, rsi
	cmp	rsp, rax
	je	.L6
.L28:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L28
.L6:
	and	ecx, 4095
	sub	rsp, rcx
	test	rcx, rcx
	jne	.L29
.L7:
	mov	r14, rsp
	test	r12, r12
	je	.L8
	mov	edi, DWORD PTR MSG_MSGDUMP[rip]
	mov	rcx, r15
	mov	rdx, r12
	lea	rsi, .LC0[rip]
	call	wpa_hexdump_key@PLT
	mov	rsi, QWORD PTR 80[rbx]
	mov	edx, DWORD PTR TLS_RANDOM_LEN[rip]
	mov	rdi, r13
	call	os_memcpy@PLT
	movsx	rax, DWORD PTR TLS_RANDOM_LEN[rip]
	mov	rsi, QWORD PTR 88[rbx]
	mov	rdx, rax
	lea	rdi, 0[r13+rax*4]
	call	os_memcpy@PLT
	mov	rdi, QWORD PTR [rbx]
	mov	rsi, r12
	mov	r8, r13
	push	QWORD PTR TLS_MASTER_SECRET_LEN[rip]
	mov	r9d, DWORD PTR TLS_RANDOM_LEN[rip]
	lea	rcx, .LC1[rip]
	mov	rdx, r15
	push	QWORD PTR 72[rbx]
	add	r9d, r9d
	call	tls_prf@PLT
	pop	rsi
	pop	rdi
	test	rax, rax
	jne	.L30
	mov	rdx, QWORD PTR 72[rbx]
	mov	rcx, QWORD PTR TLS_MASTER_SECRET_LEN[rip]
	lea	rsi, .LC3[rip]
	mov	edi, DWORD PTR MSG_MSGDUMP[rip]
	call	wpa_hexdump_key@PLT
	mov	edx, DWORD PTR TLS_RANDOM_LEN[rip]
.L8:
	mov	rsi, QWORD PTR 88[rbx]
	mov	rdi, r13
	call	os_memcpy@PLT
	movsx	rax, DWORD PTR TLS_RANDOM_LEN[rip]
	mov	rsi, QWORD PTR 80[rbx]
	lea	rdi, 0[r13+rax*4]
	mov	rdx, rax
	call	os_memcpy@PLT
	mov	r12d, DWORD PTR 12[rbx]
	add	r12d, DWORD PTR 8[rbx]
	add	r12d, r12d
	mov	rdi, QWORD PTR [rbx]
	cmp	rdi, QWORD PTR TLS_VERSION_1[rip]
	movsx	r12, r12d
	jne	.L11
	mov	eax, DWORD PTR 16[rbx]
	add	eax, eax
	cdqe
	add	r12, rax
.L11:
	push	r12
	mov	rsi, QWORD PTR 72[rbx]
	lea	rcx, .LC4[rip]
	mov	r8, r13
	mov	r9d, DWORD PTR TLS_RANDOM_LEN[rip]
	mov	rdx, QWORD PTR TLS_MASTER_SECRET_LEN[rip]
	push	r14
	add	r9d, r9d
	call	tls_prf@PLT
	pop	rdx
	pop	rcx
	test	rax, rax
	jne	.L31
	mov	edi, DWORD PTR MSG_MSGDUMP[rip]
	mov	rcx, r12
	mov	rdx, r14
	lea	rsi, .LC6[rip]
	call	wpa_hexdump_key@PLT
	mov	edx, DWORD PTR 8[rbx]
	mov	rdi, QWORD PTR 64[rbx]
	mov	rsi, r14
	call	os_memcpy@PLT
	movsx	rax, DWORD PTR 8[rbx]
	mov	rdi, QWORD PTR 56[rbx]
	lea	r12, [r14+rax*4]
	mov	rdx, rax
	mov	rsi, r12
	call	os_memcpy@PLT
	movsx	rax, DWORD PTR 8[rbx]
	mov	edx, DWORD PTR 12[rbx]
	mov	rdi, QWORD PTR 48[rbx]
	lea	r12, [r12+rax*4]
	mov	rsi, r12
	call	os_memcpy@PLT
	movsx	rax, DWORD PTR 12[rbx]
	mov	rdi, QWORD PTR 40[rbx]
	lea	r12, [r12+rax*4]
	mov	rdx, rax
	mov	rsi, r12
	call	os_memcpy@PLT
	mov	rax, QWORD PTR TLS_VERSION_1[rip]
	cmp	QWORD PTR [rbx], rax
	je	.L32
	mov	edx, DWORD PTR 16[rbx]
	mov	rdi, QWORD PTR 24[rbx]
	xor	esi, esi
	call	os_memset@PLT
	xor	eax, eax
.L1:
	mov	rcx, QWORD PTR -56[rbp]
	xor	rcx, QWORD PTR fs:40
	jne	.L33
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rcx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L32:
	movsx	rax, DWORD PTR 12[rbx]
	mov	edx, DWORD PTR 16[rbx]
	mov	rdi, QWORD PTR 24[rbx]
	lea	r12, [r12+rax*4]
	mov	rsi, r12
	call	os_memcpy@PLT
	movsx	rax, DWORD PTR 16[rbx]
	mov	rdi, QWORD PTR 32[rbx]
	mov	rdx, rax
	lea	rsi, [r12+rax*4]
	call	os_memcpy@PLT
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L29:
	or	QWORD PTR -8[rsp+rcx], 0
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L31:
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	lea	rsi, .LC5[rip]
	call	wpa_printf@PLT
	mov	eax, -1
	jmp	.L1
.L30:
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	lea	rsi, .LC2[rip]
	call	wpa_printf@PLT
	mov	eax, -1
	jmp	.L1
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	tls_derive_keys, .-tls_derive_keys
	.comm	TLS_VERSION_1,8,8
	.comm	TLS_RANDOM_LEN,4,4
	.comm	TLS_MAX_KEY_BLOCK_LEN,4,4
	.comm	TLS_MASTER_SECRET_LEN,8,8
	.comm	MSG_MSGDUMP,4,4
	.comm	MSG_DEBUG,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_tlsv1_client.c_tls_derive_keys.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"TLSv1: pre_master_secret\000"
	.align	2
.LC1:
	.ascii	"master secret\000"
	.align	2
.LC2:
	.ascii	"TLSv1: Failed to derive master_secret\000"
	.align	2
.LC3:
	.ascii	"TLSv1: master_secret\000"
	.align	2
.LC4:
	.ascii	"key expansion\000"
	.align	2
.LC5:
	.ascii	"TLSv1: Failed to derive key_block\000"
	.align	2
.LC6:
	.ascii	"TLSv1: key_block\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	tls_derive_keys
	.syntax unified
	.arm
	.fpu softvfp
	.type	tls_derive_keys, %function
tls_derive_keys:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #36
	ldr	r3, .L18
	ldr	r6, .L18+4
	ldr	ip, [r3]
	mov	r3, sp
	ldr	lr, [r6]
	lsl	ip, ip, #2
	sub	r3, r3, lr, lsl #3
	mov	sp, r3
	add	ip, ip, #7
	mov	r3, r2
	bic	ip, ip, #7
	ldr	r2, .L18+8
	subs	r7, r1, #0
	add	r9, sp, #16
	sub	sp, sp, ip
	mov	r4, r0
	ldr	r2, [r2]
	str	r2, [fp, #-40]
	mov	r2,#0
	ldreq	r10, .L18+12
	add	r5, sp, #16
	beq	.L2
	ldr	r8, .L18+16
	mov	r2, r7
	ldr	r1, .L18+20
	ldr	r0, [r8]
	str	r3, [fp, #-48]
	bl	wpa_hexdump_key
	ldr	r2, [r6]
	ldr	r1, [r4, #44]
	mov	r0, r9
	bl	os_memcpy
	ldr	r2, [r6]
	ldr	r1, [r4, #48]
	add	r0, r9, r2, lsl #2
	ldr	r10, .L18+12
	bl	os_memcpy
	ldr	r0, [r6]
	ldr	lr, [r10]
	ldr	ip, [r4, #40]
	lsl	r0, r0, #1
	str	r9, [sp]
	ldr	r3, [fp, #-48]
	stmib	sp, {r0, ip, lr}
	mov	r2, r3
	mov	r1, r7
	ldr	r3, .L18+24
	ldr	r0, [r4]
	bl	tls_prf
	cmp	r0, #0
	bne	.L14
	ldr	r0, [r8]
	ldr	r3, [r10]
	ldr	r2, [r4, #40]
	ldr	r1, .L18+28
	bl	wpa_hexdump_key
	ldr	lr, [r6]
.L2:
	mov	r2, lr
	ldr	r1, [r4, #48]
	mov	r0, r9
	bl	os_memcpy
	ldr	r2, [r6]
	ldr	r7, .L18+32
	ldr	r1, [r4, #44]
	add	r0, r9, r2, lsl #2
	bl	os_memcpy
	ldm	r4, {r0, r8}
	ldr	r2, [r7]
	ldr	r3, [r4, #8]
	cmp	r0, r2
	add	r8, r8, r3
	ldreq	r3, [r4, #12]
	lsl	r8, r8, #1
	addeq	r8, r8, r3, lsl #1
	ldr	r3, [r6]
	str	r8, [sp, #12]
	lsl	r3, r3, #1
	stmib	sp, {r3, r5}
	str	r9, [sp]
	ldr	r2, [r10]
	ldr	r3, .L18+36
	ldr	r1, [r4, #40]
	bl	tls_prf
	subs	r6, r0, #0
	bne	.L15
	ldr	r2, .L18+16
	mov	r3, r8
	ldr	r0, [r2]
	ldr	r1, .L18+40
	mov	r2, r5
	bl	wpa_hexdump_key
	mov	r1, r5
	ldr	r2, [r4, #4]
	ldr	r0, [r4, #36]
	bl	os_memcpy
	ldr	r2, [r4, #4]
	ldr	r0, [r4, #32]
	add	r5, r5, r2, lsl #2
	mov	r1, r5
	bl	os_memcpy
	ldmib	r4, {r1, r2}
	add	r5, r5, r1, lsl #2
	mov	r1, r5
	ldr	r0, [r4, #28]
	bl	os_memcpy
	ldr	r2, [r4, #8]
	ldr	r0, [r4, #24]
	add	r5, r5, r2, lsl #2
	mov	r1, r5
	bl	os_memcpy
	ldr	r3, [r7]
	ldr	r2, [r4]
	cmp	r2, r3
	beq	.L16
	mov	r1, r6
	ldr	r2, [r4, #12]
	ldr	r0, [r4, #16]
	bl	os_memset
.L1:
	ldr	r3, .L18+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L17
	mov	r0, r6
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	ldr	r1, [r4, #8]
	ldr	r2, [r4, #12]
	add	r5, r5, r1, lsl #2
	mov	r1, r5
	ldr	r0, [r4, #16]
	bl	os_memcpy
	ldr	r2, [r4, #12]
	ldr	r0, [r4, #20]
	add	r1, r5, r2, lsl #2
	bl	os_memcpy
	b	.L1
.L15:
	ldr	r3, .L18+44
	ldr	r1, .L18+48
	ldr	r0, [r3]
	bl	wpa_printf
	mvn	r6, #0
	b	.L1
.L14:
	ldr	r3, .L18+44
	ldr	r1, .L18+52
	ldr	r0, [r3]
	bl	wpa_printf
	mvn	r6, #0
	b	.L1
.L17:
	bl	__stack_chk_fail
.L19:
	.align	2
.L18:
	.word	TLS_MAX_KEY_BLOCK_LEN
	.word	TLS_RANDOM_LEN
	.word	.LC7
	.word	TLS_MASTER_SECRET_LEN
	.word	MSG_MSGDUMP
	.word	.LC0
	.word	.LC1
	.word	.LC3
	.word	TLS_VERSION_1
	.word	.LC4
	.word	.LC6
	.word	MSG_DEBUG
	.word	.LC5
	.word	.LC2
	.size	tls_derive_keys, .-tls_derive_keys
	.comm	TLS_VERSION_1,4,4
	.comm	TLS_RANDOM_LEN,4,4
	.comm	TLS_MAX_KEY_BLOCK_LEN,4,4
	.comm	TLS_MASTER_SECRET_LEN,4,4
	.comm	MSG_MSGDUMP,4,4
	.comm	MSG_DEBUG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
