	.file	"extr_cms_enc.c_cms_EncryptedContent_init_bio.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	cms_EncryptedContent_init_bio
	.type	cms_EncryptedContent_init_bio, @function
cms_EncryptedContent_init_bio:
.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
	push	rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 40
	mov	r15, QWORD PTR 32[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR EVP_MAX_IV_LENGTH[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
.L52:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L52
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L53
.L4:
	mov	rax, QWORD PTR 24[rbx]
	mov	QWORD PTR -80[rbp], rsp
	mov	QWORD PTR -72[rbp], rax
	xor	eax, eax
	call	BIO_f_cipher@PLT
	mov	edi, eax
	call	BIO_new@PLT
	mov	r14, rax
	test	rax, rax
	je	.L54
	lea	rsi, -64[rbp]
	mov	rdi, rax
	call	BIO_get_cipher_ctx@PLT
	cmp	QWORD PTR -72[rbp], 0
	je	.L7
	cmp	QWORD PTR [rbx], 0
	mov	rsi, QWORD PTR 24[rbx]
	je	.L8
	mov	QWORD PTR 24[rbx], 0
.L8:
	mov	rdi, QWORD PTR -64[rbp]
	xor	r8d, r8d
	xor	ecx, ecx
	xor	edx, edx
	mov	r9d, 1
	call	EVP_CipherInit_ex@PLT
	test	rax, rax
	jle	.L30
	mov	rdi, QWORD PTR -64[rbp]
	call	EVP_CIPHER_CTX_type@PLT
	mov	edi, eax
	call	OBJ_nid2obj@PLT
	mov	rdi, QWORD PTR -64[rbp]
	mov	DWORD PTR 8[r15], eax
	call	EVP_CIPHER_CTX_iv_length@PLT
	mov	esi, eax
	test	eax, eax
	jg	.L55
	mov	QWORD PTR -80[rbp], 0
.L11:
	mov	rdi, QWORD PTR -64[rbp]
	call	EVP_CIPHER_CTX_key_length@PLT
	cmp	QWORD PTR [rbx], 0
	mov	r12, rax
	je	.L29
.L48:
	xor	r13d, r13d
.L14:
	mov	rsi, QWORD PTR 8[rbx]
	mov	rdi, QWORD PTR -64[rbp]
	cmp	rsi, r12
	je	.L56
	call	EVP_CIPHER_CTX_set_key_length@PLT
	test	rax, rax
	jle	.L20
	mov	rcx, QWORD PTR [rbx]
	mov	rdi, QWORD PTR -64[rbp]
.L19:
	xor	r9d, r9d
	mov	r8, QWORD PTR -80[rbp]
	cmp	QWORD PTR -72[rbp], 0
	setne	r9b
	xor	edx, edx
	xor	esi, esi
	call	EVP_CipherInit_ex@PLT
	test	rax, rax
	jle	.L16
	cmp	QWORD PTR -72[rbp], 0
	je	.L23
	mov	DWORD PTR -72[rbp], 0
.L17:
	xor	eax, eax
	call	ASN1_TYPE_new@PLT
	mov	QWORD PTR [r15], rax
	mov	rsi, rax
	test	rax, rax
	je	.L49
	mov	rdi, QWORD PTR -64[rbp]
	call	EVP_CIPHER_param_to_asn1@PLT
	test	rax, rax
	jle	.L57
	mov	rdi, QWORD PTR [r15]
	mov	rax, QWORD PTR V_ASN1_UNDEF[rip]
	cmp	QWORD PTR [rdi], rax
	je	.L58
.L27:
	cmp	DWORD PTR -72[rbp], 1
	jne	.L23
.L50:
	mov	rsi, r12
	mov	rdi, r13
	call	OPENSSL_clear_free@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	mov	edi, DWORD PTR 8[r15]
	call	EVP_get_cipherbyobj@PLT
	mov	r13, rax
	test	rax, rax
	je	.L59
	mov	rdi, QWORD PTR -64[rbp]
	xor	r9d, r9d
	xor	r8d, r8d
	xor	ecx, ecx
	xor	edx, edx
	mov	rsi, rax
	call	EVP_CipherInit_ex@PLT
	test	rax, rax
	jle	.L30
	mov	rsi, QWORD PTR [r15]
	mov	rdi, QWORD PTR -64[rbp]
	call	EVP_CIPHER_asn1_to_param@PLT
	test	rax, rax
	jle	.L60
	mov	rdi, QWORD PTR -64[rbp]
	call	EVP_CIPHER_CTX_key_length@PLT
	mov	QWORD PTR -80[rbp], 0
	mov	r12, rax
.L29:
	mov	rdi, r12
	call	OPENSSL_malloc@PLT
	mov	r13, rax
	test	rax, rax
	je	.L49
	mov	rdi, QWORD PTR -64[rbp]
	mov	rsi, rax
	call	EVP_CIPHER_CTX_rand_key@PLT
	test	rax, rax
	jle	.L10
	cmp	QWORD PTR [rbx], 0
	jne	.L14
	cmp	QWORD PTR -72[rbp], 0
	mov	QWORD PTR [rbx], r13
	mov	QWORD PTR 8[rbx], r12
	jne	.L61
	xor	eax, eax
	call	ERR_clear_error@PLT
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L20:
	cmp	QWORD PTR -72[rbp], 0
	jne	.L21
	cmp	QWORD PTR 16[rbx], 0
	je	.L22
.L21:
	mov	esi, DWORD PTR CMS_R_INVALID_KEY_LENGTH[rip]
	mov	edi, DWORD PTR CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO[rip]
	call	CMSerr@PLT
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rsi, QWORD PTR 8[rbx]
	mov	rdi, QWORD PTR [rbx]
	call	OPENSSL_clear_free@PLT
	mov	QWORD PTR [rbx], 0
	mov	rsi, r12
	mov	rdi, r13
	call	OPENSSL_clear_free@PLT
	mov	rdi, r14
	xor	r14d, r14d
	call	BIO_free@PLT
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L62
	lea	rsp, -40[rbp]
	mov	rax, r14
	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
.L55:
	.cfi_restore_state
	mov	rdi, QWORD PTR -80[rbp]
	call	RAND_bytes@PLT
	test	rax, rax
	jg	.L11
	xor	r12d, r12d
	xor	r13d, r13d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L30:
	mov	esi, DWORD PTR CMS_R_CIPHER_INITIALISATION_ERROR[rip]
	mov	edi, DWORD PTR CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO[rip]
	xor	r12d, r12d
	xor	r13d, r13d
	call	CMSerr@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L53:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L56:
	mov	rcx, QWORD PTR [rbx]
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L49:
	mov	esi, DWORD PTR ERR_R_MALLOC_FAILURE[rip]
	mov	edi, DWORD PTR CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO[rip]
	call	CMSerr@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L54:
	mov	esi, DWORD PTR ERR_R_MALLOC_FAILURE[rip]
	mov	edi, DWORD PTR CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO[rip]
	call	CMSerr@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L22:
	mov	rsi, QWORD PTR 8[rbx]
	mov	rdi, QWORD PTR [rbx]
	call	OPENSSL_clear_free@PLT
	mov	QWORD PTR [rbx], r13
	xor	eax, eax
	xor	r13d, r13d
	mov	QWORD PTR 8[rbx], r12
	call	ERR_clear_error@PLT
	mov	r8, QWORD PTR -80[rbp]
	mov	rcx, QWORD PTR [rbx]
	xor	r9d, r9d
	mov	rdi, QWORD PTR -64[rbp]
	xor	edx, edx
	xor	esi, esi
	call	EVP_CipherInit_ex@PLT
	test	rax, rax
	jg	.L23
	.p2align 4,,10
	.p2align 3
.L16:
	mov	esi, DWORD PTR CMS_R_CIPHER_INITIALISATION_ERROR[rip]
	mov	edi, DWORD PTR CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO[rip]
	call	CMSerr@PLT
	jmp	.L10
.L23:
	mov	rsi, QWORD PTR 8[rbx]
	mov	rdi, QWORD PTR [rbx]
	call	OPENSSL_clear_free@PLT
	mov	QWORD PTR [rbx], 0
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L61:
	mov	r8, QWORD PTR -80[rbp]
	mov	rdi, QWORD PTR -64[rbp]
	mov	rcx, r13
	xor	edx, edx
	mov	r9d, 1
	xor	esi, esi
	xor	r13d, r13d
	call	EVP_CipherInit_ex@PLT
	test	rax, rax
	jle	.L16
	mov	DWORD PTR -72[rbp], 1
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L60:
	mov	esi, DWORD PTR CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR[rip]
	mov	edi, DWORD PTR CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO[rip]
	xor	r13d, r13d
	xor	r12d, r12d
	call	CMSerr@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L58:
	call	ASN1_TYPE_free@PLT
	mov	QWORD PTR [r15], 0
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L57:
	mov	esi, DWORD PTR CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR[rip]
	mov	edi, DWORD PTR CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO[rip]
	call	CMSerr@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L59:
	mov	esi, DWORD PTR CMS_R_UNKNOWN_CIPHER[rip]
	mov	edi, DWORD PTR CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO[rip]
	xor	r12d, r12d
	call	CMSerr@PLT
	jmp	.L10
.L62:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	cms_EncryptedContent_init_bio, .-cms_EncryptedContent_init_bio
	.comm	V_ASN1_UNDEF,8,8
	.comm	EVP_MAX_IV_LENGTH,4,4
	.comm	ERR_R_MALLOC_FAILURE,4,4
	.comm	CMS_R_UNKNOWN_CIPHER,4,4
	.comm	CMS_R_INVALID_KEY_LENGTH,4,4
	.comm	CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR,4,4
	.comm	CMS_R_CIPHER_INITIALISATION_ERROR,4,4
	.comm	CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO,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_cms_enc.c_cms_EncryptedContent_init_bio.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	cms_EncryptedContent_init_bio
	.syntax unified
	.arm
	.fpu softvfp
	.type	cms_EncryptedContent_init_bio, %function
cms_EncryptedContent_init_bio:
	@ 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, #28
	ldr	r3, .L58
	ldr	r2, .L58+4
	ldr	r3, [r3]
	ldr	r2, [r2]
	str	r2, [fp, #-40]
	mov	r2,#0
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	mov	r4, r0
	ldr	r6, [r0, #16]
	ldr	r8, [r0, #12]
	bl	BIO_f_cipher
	bl	BIO_new
	subs	r7, r0, #0
	beq	.L51
	sub	r1, fp, #44
	bl	BIO_get_cipher_ctx
	cmp	r8, #0
	beq	.L4
	ldr	r3, [r4]
	add	r9, sp, #8
	cmp	r3, #0
	mov	r10, r9
	ldr	r1, [r4, #12]
	movne	r3, #0
	strne	r3, [r4, #12]
.L5:
	mov	r5, #0
	mov	r3, #1
	mov	r2, r5
	str	r3, [sp, #4]
	ldr	r0, [fp, #-44]
	mov	r3, r5
	str	r5, [sp]
	bl	EVP_CipherInit_ex
	cmp	r0, r5
	ble	.L27
	ldr	r0, [fp, #-44]
	bl	EVP_CIPHER_CTX_type
	bl	OBJ_nid2obj
	str	r0, [r6, #4]
	ldr	r0, [fp, #-44]
	bl	EVP_CIPHER_CTX_iv_length
	subs	r1, r0, #0
	movle	r9, r5
	bgt	.L52
.L8:
	ldr	r0, [fp, #-44]
	bl	EVP_CIPHER_CTX_key_length
	ldr	r1, [r4]
	mov	r5, r0
	cmp	r1, #0
	movne	r10, #0
	beq	.L26
.L11:
	ldr	r1, [r4, #4]
	ldr	r0, [fp, #-44]
	cmp	r1, r5
	ldreq	r3, [r4]
	beq	.L16
	bl	EVP_CIPHER_CTX_set_key_length
	cmp	r0, #0
	ble	.L17
	ldr	r3, [r4]
	ldr	r0, [fp, #-44]
.L16:
	subs	r1, r8, #0
	movne	r1, #1
	mov	r2, #0
	str	r1, [sp, #4]
	str	r9, [sp]
	mov	r1, r2
	bl	EVP_CipherInit_ex
	cmp	r0, #0
	ble	.L13
	cmp	r8, #0
	beq	.L20
	mov	r8, #0
.L14:
	bl	ASN1_TYPE_new
	cmp	r0, #0
	mov	r1, r0
	str	r0, [r6]
	beq	.L48
	ldr	r0, [fp, #-44]
	bl	EVP_CIPHER_param_to_asn1
	cmp	r0, #0
	ble	.L53
	ldr	r0, [r6]
	ldr	r3, .L58+8
	ldr	r2, [r0]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L54
.L24:
	cmp	r8, #1
	bne	.L20
	mov	r1, r5
	mov	r0, r10
	bl	OPENSSL_clear_free
	b	.L1
.L52:
	mov	r0, r10
	bl	RAND_bytes
	cmp	r0, #0
	bgt	.L8
	mov	r10, r5
.L7:
	ldm	r4, {r0, r1}
	mov	r6, #0
	bl	OPENSSL_clear_free
	mov	r1, r5
	mov	r0, r10
	str	r6, [r4]
	bl	OPENSSL_clear_free
	mov	r0, r7
	bl	BIO_free
	mov	r7, r6
.L1:
	ldr	r3, .L58+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L55
	mov	r0, r7
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	r0, [r6, #4]
	bl	EVP_get_cipherbyobj
	subs	r10, r0, #0
	ldreq	r2, .L58+12
	beq	.L49
	mov	r1, r10
	mov	r3, r8
	mov	r2, r8
	ldr	r0, [fp, #-44]
	str	r8, [sp, #4]
	str	r8, [sp]
	bl	EVP_CipherInit_ex
	cmp	r0, #0
	ble	.L27
	ldr	r1, [r6]
	ldr	r0, [fp, #-44]
	bl	EVP_CIPHER_asn1_to_param
	cmp	r0, #0
	ble	.L56
	ldr	r0, [fp, #-44]
	bl	EVP_CIPHER_CTX_key_length
	mov	r9, r8
	mov	r5, r0
.L26:
	mov	r0, r5
	bl	OPENSSL_malloc
	subs	r10, r0, #0
	beq	.L48
	mov	r1, r10
	ldr	r0, [fp, #-44]
	bl	EVP_CIPHER_CTX_rand_key
	cmp	r0, #0
	ble	.L7
	ldr	r2, [r4]
	cmp	r2, #0
	bne	.L11
	cmp	r8, #0
	str	r10, [r4]
	str	r5, [r4, #4]
	bne	.L57
	bl	ERR_clear_error
	mov	r10, r8
	b	.L11
.L27:
	mov	r5, #0
	ldr	r2, .L58+16
	ldr	r3, .L58+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	CMSerr
	mov	r10, r5
	b	.L7
.L17:
	cmp	r8, #0
	bne	.L18
	ldr	r3, [r4, #8]
	cmp	r3, #0
	beq	.L19
.L18:
	ldr	r2, .L58+24
	ldr	r3, .L58+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	CMSerr
	b	.L7
.L48:
	ldr	r2, .L58+28
	ldr	r3, .L58+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	CMSerr
	b	.L7
.L51:
	ldr	r2, .L58+28
	ldr	r3, .L58+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	CMSerr
	b	.L1
.L57:
	mov	r8, #1
	mov	r3, r10
	mov	r1, r2
	ldr	r0, [fp, #-44]
	str	r9, [sp]
	str	r8, [sp, #4]
	str	r2, [fp, #-48]
	bl	EVP_CipherInit_ex
	ldr	r2, [fp, #-48]
	cmp	r0, #0
	mov	r10, r2
	bgt	.L14
.L13:
	ldr	r2, .L58+16
	ldr	r3, .L58+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	CMSerr
	b	.L7
.L56:
	mov	r10, r8
	ldr	r2, .L58+32
.L49:
	ldr	r3, .L58+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	CMSerr
	mov	r5, r10
	b	.L7
.L19:
	ldm	r4, {r0, r1}
	bl	OPENSSL_clear_free
	str	r10, [r4]
	str	r5, [r4, #4]
	bl	ERR_clear_error
	str	r8, [sp, #4]
	str	r9, [sp]
	mov	r2, r8
	mov	r1, r8
	ldr	r3, [r4]
	ldr	r0, [fp, #-44]
	bl	EVP_CipherInit_ex
	cmp	r0, #0
	mov	r10, r8
	ble	.L13
.L20:
	ldm	r4, {r0, r1}
	bl	OPENSSL_clear_free
	mov	r3, #0
	mov	r1, r5
	mov	r0, r10
	str	r3, [r4]
	bl	OPENSSL_clear_free
	b	.L1
.L54:
	bl	ASN1_TYPE_free
	mov	r3, #0
	str	r3, [r6]
	b	.L24
.L53:
	ldr	r2, .L58+32
	ldr	r3, .L58+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	CMSerr
	b	.L7
.L55:
	bl	__stack_chk_fail
.L59:
	.align	2
.L58:
	.word	EVP_MAX_IV_LENGTH
	.word	.LC0
	.word	V_ASN1_UNDEF
	.word	CMS_R_UNKNOWN_CIPHER
	.word	CMS_R_CIPHER_INITIALISATION_ERROR
	.word	CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO
	.word	CMS_R_INVALID_KEY_LENGTH
	.word	ERR_R_MALLOC_FAILURE
	.word	CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR
	.size	cms_EncryptedContent_init_bio, .-cms_EncryptedContent_init_bio
	.comm	V_ASN1_UNDEF,4,4
	.comm	EVP_MAX_IV_LENGTH,4,4
	.comm	ERR_R_MALLOC_FAILURE,4,4
	.comm	CMS_R_UNKNOWN_CIPHER,4,4
	.comm	CMS_R_INVALID_KEY_LENGTH,4,4
	.comm	CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR,4,4
	.comm	CMS_R_CIPHER_INITIALISATION_ERROR,4,4
	.comm	CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
