	.file	"extr_cms_kari.c_cms_wrap_init.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	cms_wrap_init, @function
cms_wrap_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	r12, QWORD PTR [rdi]
	mov	rdi, rsi
	call	EVP_CIPHER_key_length@PLT
	mov	rdi, r12
	mov	ebx, eax
	call	EVP_CIPHER_CTX_cipher@PLT
	test	rax, rax
	je	.L2
	mov	rdi, r12
	call	EVP_CIPHER_CTX_mode@PLT
	cmp	QWORD PTR EVP_CIPH_WRAP_MODE[rip], rax
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	sete	al
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	movzx	eax, al
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rdi, rbp
	call	EVP_CIPHER_type@PLT
	cmp	rax, QWORD PTR NID_des_ede3_cbc[rip]
	mov	eax, 0
	je	.L11
	cmp	ebx, 16
	jle	.L12
	cmp	ebx, 24
	jg	.L7
	call	EVP_aes_192_wrap@PLT
	mov	rsi, rax
.L5:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, r12
	pop	rbp
	.cfi_def_cfa_offset 16
	xor	r8d, r8d
	xor	ecx, ecx
	xor	edx, edx
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	EVP_EncryptInit_ex@PLT
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	call	EVP_aes_128_wrap@PLT
	mov	rsi, rax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L7:
	call	EVP_aes_256_wrap@PLT
	mov	rsi, rax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L11:
	call	EVP_des_ede3_wrap@PLT
	mov	rsi, rax
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	cms_wrap_init, .-cms_wrap_init
	.comm	NID_des_ede3_cbc,8,8
	.comm	EVP_CIPH_WRAP_MODE,8,8
	.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_cms_kari.c_cms_wrap_init.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cms_wrap_init, %function
cms_wrap_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, r0
	push	{r4, r5, r6, lr}
	mov	r0, r1
	sub	sp, sp, #8
	ldr	r6, [r3]
	mov	r4, r1
	bl	EVP_CIPHER_key_length
	mov	r5, r0
	mov	r0, r6
	bl	EVP_CIPHER_CTX_cipher
	cmp	r0, #0
	beq	.L2
	mov	r0, r6
	bl	EVP_CIPHER_CTX_mode
	ldr	r3, .L12
	ldr	r3, [r3]
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L2:
	mov	r0, r4
	bl	EVP_CIPHER_type
	ldr	r3, .L12+4
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L10
	cmp	r5, #16
	ble	.L11
	cmp	r5, #24
	bgt	.L7
	bl	EVP_aes_192_wrap
	mov	r1, r0
.L5:
	mov	r3, #0
	mov	r0, r6
	mov	r2, r3
	str	r3, [sp]
	bl	EVP_EncryptInit_ex
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L11:
	bl	EVP_aes_128_wrap
	mov	r1, r0
	b	.L5
.L7:
	bl	EVP_aes_256_wrap
	mov	r1, r0
	b	.L5
.L10:
	bl	EVP_des_ede3_wrap
	mov	r1, r0
	b	.L5
.L13:
	.align	2
.L12:
	.word	EVP_CIPH_WRAP_MODE
	.word	NID_des_ede3_cbc
	.size	cms_wrap_init, .-cms_wrap_init
	.comm	NID_des_ede3_cbc,4,4
	.comm	EVP_CIPH_WRAP_MODE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
