	.file	"extr_sskdf.c_SSKDF_hash_kdm.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	SSKDF_hash_kdm, @function
SSKDF_hash_kdm:
.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, r8
	push	rbx
	.cfi_offset 3, -56
	mov	rbx, rdx
	sub	rsp, 88
	mov	QWORD PTR -88[rbp], rcx
	mov	r15, QWORD PTR 16[rbp]
	mov	QWORD PTR -80[rbp], rsi
	mov	rcx, rsp
	mov	DWORD PTR -68[rbp], r9d
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR EVP_MAX_MD_SIZE[rip]
	mov	r14, rax
	add	rax, 15
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L60:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L60
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L61
.L4:
	cmp	rbx, r12
	mov	rax, r12
	mov	QWORD PTR -96[rbp], rsp
	cmovnb	rax, rbx
	cmp	rax, QWORD PTR 24[rbp]
	cmovb	rax, QWORD PTR 24[rbp]
	cmp	QWORD PTR SSKDF_MAX_INLEN[rip], rax
	jb	.L8
	cmp	QWORD PTR 24[rbp], 0
	jne	.L5
.L8:
	xor	r12d, r12d
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L62
	lea	rsp, -40[rbp]
	mov	eax, r12d
	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
.L61:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	mov	QWORD PTR -112[rbp], rdi
	call	EVP_MD_size@PLT
	test	eax, eax
	mov	DWORD PTR -120[rbp], eax
	jle	.L8
	xor	eax, eax
	call	EVP_MD_CTX_create@PLT
	mov	r13, rax
	xor	eax, eax
	call	EVP_MD_CTX_create@PLT
	mov	QWORD PTR -104[rbp], rax
	test	r13, r13
	je	.L9
	test	rax, rax
	je	.L9
	mov	rdi, QWORD PTR -112[rbp]
	mov	rsi, rdi
	mov	rdi, rax
	call	EVP_DigestInit@PLT
	test	eax, eax
	je	.L9
	movsx	rax, DWORD PTR -120[rbp]
	mov	ecx, 1
	lea	rsi, -60[rbp]
	mov	DWORD PTR -72[rbp], r14d
	mov	QWORD PTR -112[rbp], rbx
	mov	r14, rcx
	mov	QWORD PTR -128[rbp], r12
	mov	rbx, rax
	mov	r12, QWORD PTR 24[rbp]
	mov	QWORD PTR -120[rbp], rsi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L64:
	mov	rsi, QWORD PTR -120[rbp]
	mov	edx, 4
	mov	rdi, r13
	call	EVP_DigestUpdate@PLT
	test	rax, rax
	je	.L56
	mov	rdx, QWORD PTR -112[rbp]
	mov	rsi, QWORD PTR -80[rbp]
	mov	rdi, r13
	call	EVP_DigestUpdate@PLT
	test	rax, rax
	je	.L56
.L17:
	mov	rdx, QWORD PTR -128[rbp]
	mov	rsi, QWORD PTR -88[rbp]
	mov	rdi, r13
	call	EVP_DigestUpdate@PLT
	test	rax, rax
	je	.L56
	cmp	r12, rbx
	jb	.L12
	xor	edx, edx
	mov	rsi, r15
	mov	rdi, r13
	call	EVP_DigestFinal_ex@PLT
	test	eax, eax
	je	.L56
	add	r15, rbx
	sub	r12, rbx
	je	.L63
	add	r14, 1
.L15:
	mov	rsi, QWORD PTR -104[rbp]
	mov	eax, r14d
	mov	rdi, r13
	bswap	eax
	mov	DWORD PTR -60[rbp], eax
	call	EVP_MD_CTX_copy_ex@PLT
	test	rax, rax
	je	.L56
	mov	eax, DWORD PTR -68[rbp]
	test	eax, eax
	je	.L64
	mov	rdx, QWORD PTR -112[rbp]
	mov	rsi, QWORD PTR -80[rbp]
	mov	rdi, r13
	call	EVP_DigestUpdate@PLT
	test	rax, rax
	je	.L56
	mov	rsi, QWORD PTR -120[rbp]
	mov	edx, 4
	mov	rdi, r13
	call	EVP_DigestUpdate@PLT
	test	rax, rax
	jne	.L17
	.p2align 4,,10
	.p2align 3
.L56:
	mov	r14d, DWORD PTR -72[rbp]
.L9:
	xor	r12d, r12d
.L13:
	mov	rdi, r13
	call	EVP_MD_CTX_destroy@PLT
	mov	rdi, QWORD PTR -104[rbp]
	call	EVP_MD_CTX_destroy@PLT
	mov	rdi, QWORD PTR -96[rbp]
	mov	esi, r14d
	call	OPENSSL_cleanse@PLT
	jmp	.L1
.L12:
	mov	rbx, QWORD PTR -96[rbp]
	xor	edx, edx
	mov	rdi, r13
	mov	QWORD PTR 24[rbp], r12
	mov	r14d, DWORD PTR -72[rbp]
	mov	rsi, rbx
	call	EVP_DigestFinal_ex@PLT
	test	eax, eax
	je	.L9
	mov	rdx, QWORD PTR 24[rbp]
	mov	rsi, rbx
	mov	rdi, r15
	mov	r12d, 1
	call	memcpy@PLT
	jmp	.L13
.L63:
	mov	r14d, DWORD PTR -72[rbp]
	mov	r12d, 1
	jmp	.L13
.L62:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	SSKDF_hash_kdm, .-SSKDF_hash_kdm
	.comm	SSKDF_MAX_INLEN,8,8
	.comm	EVP_MAX_MD_SIZE,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_sskdf.c_SSKDF_hash_kdm.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	SSKDF_hash_kdm, %function
SSKDF_hash_kdm:
	@ args = 16, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r2
	add	fp, sp, #32
	sub	sp, sp, #36
	ldr	r2, [fp, #4]
	ldr	r5, [fp, #16]
	cmp	r4, r2
	movcc	ip, r2
	movcs	ip, r4
	clz	r2, r5
	cmp	ip, r5
	movcc	ip, r5
	ldr	lr, .L57
	lsr	r2, r2, #5
	ldr	lr, [lr]
	str	r3, [fp, #-48]
	cmp	lr, ip
	orrcc	r2, r2, #1
	ldr	ip, .L57+4
	ldr	r3, .L57+8
	ldr	r7, [ip]
	cmp	r2, #0
	add	r2, r7, #7
	bic	r2, r2, #7
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	ldr	r8, [fp, #12]
	sub	sp, sp, r2
	beq	.L2
.L4:
	mov	r4, #0
.L1:
	ldr	r3, .L57+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L53
	mov	r0, r4
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	mov	r6, r1
	str	r0, [fp, #-56]
	bl	EVP_MD_size
	subs	r3, r0, #0
	str	r3, [fp, #-60]
	ble	.L4
	bl	EVP_MD_CTX_create
	mov	r9, r0
	bl	EVP_MD_CTX_create
	cmp	r0, #0
	cmpne	r9, #0
	mov	r10, sp
	str	r0, [fp, #-52]
	bne	.L54
.L5:
	mov	r4, #0
.L9:
	mov	r0, r9
	bl	EVP_MD_CTX_destroy
	ldr	r0, [fp, #-52]
	bl	EVP_MD_CTX_destroy
	mov	r1, r7
	mov	r0, r10
	bl	OPENSSL_cleanse
	b	.L1
.L54:
	ldr	r1, [fp, #-56]
	bl	EVP_DigestInit
	cmp	r0, #0
	beq	.L5
	mov	r2, #1
	str	r7, [fp, #-56]
	str	r10, [fp, #-64]
	mov	r7, r2
	ldr	r10, [fp, #-60]
	b	.L11
.L56:
	mov	r2, #4
	mov	r0, r9
	sub	r1, fp, #44
	bl	EVP_DigestUpdate
	cmp	r0, #0
	beq	.L49
	mov	r2, r4
	mov	r1, r6
	mov	r0, r9
	bl	EVP_DigestUpdate
	cmp	r0, #0
	beq	.L49
.L13:
	mov	r0, r9
	ldr	r2, [fp, #4]
	ldr	r1, [fp, #-48]
	bl	EVP_DigestUpdate
	cmp	r0, #0
	beq	.L49
	cmp	r5, r10
	bcc	.L8
	mov	r2, #0
	mov	r1, r8
	mov	r0, r9
	bl	EVP_DigestFinal_ex
	cmp	r0, #0
	beq	.L49
	subs	r5, r5, r10
	add	r8, r8, r10
	beq	.L55
	add	r7, r7, #1
.L11:
	eor	r3, r7, r7, ror #16
	lsr	r3, r3, #8
	bic	r3, r3, #65280
	eor	r3, r3, r7, ror #8
	mov	r0, r9
	ldr	r1, [fp, #-52]
	str	r3, [fp, #-44]
	bl	EVP_MD_CTX_copy_ex
	cmp	r0, #0
	beq	.L49
	ldr	r3, [fp, #8]
	cmp	r3, #0
	beq	.L56
	mov	r2, r4
	mov	r1, r6
	mov	r0, r9
	bl	EVP_DigestUpdate
	cmp	r0, #0
	beq	.L49
	mov	r2, #4
	mov	r0, r9
	sub	r1, fp, #44
	bl	EVP_DigestUpdate
	cmp	r0, #0
	bne	.L13
.L49:
	ldr	r7, [fp, #-56]
	ldr	r10, [fp, #-64]
	b	.L5
.L8:
	ldr	r10, [fp, #-64]
	mov	r2, #0
	mov	r1, r10
	mov	r0, r9
	ldr	r7, [fp, #-56]
	bl	EVP_DigestFinal_ex
	cmp	r0, #0
	beq	.L5
	mov	r2, r5
	mov	r0, r8
	mov	r1, r10
	bl	memcpy
	mov	r4, #1
	b	.L9
.L55:
	mov	r4, #1
	ldr	r7, [fp, #-56]
	ldr	r10, [fp, #-64]
	b	.L9
.L53:
	bl	__stack_chk_fail
.L58:
	.align	2
.L57:
	.word	SSKDF_MAX_INLEN
	.word	EVP_MAX_MD_SIZE
	.word	.LC0
	.size	SSKDF_hash_kdm, .-SSKDF_hash_kdm
	.comm	SSKDF_MAX_INLEN,4,4
	.comm	EVP_MAX_MD_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
