	.file	"extr_pk7_smime.c_PKCS7_decrypt.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	PKCS7_decrypt
	.type	PKCS7_decrypt, @function
PKCS7_decrypt:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	test	rdi, rdi
	je	.L22
	mov	rbp, rdi
	mov	r15, rsi
	mov	r14, rdx
	mov	r13, rcx
	mov	ebx, r8d
	call	PKCS7_type_is_enveloped@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L23
	test	r14, r14
	je	.L5
	mov	rsi, r15
	mov	rdi, r14
	call	X509_check_private_key@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L24
.L5:
	mov	rcx, r14
	xor	edx, edx
	mov	rsi, r15
	mov	rdi, rbp
	call	PKCS7_dataDecode@PLT
	mov	r14, rax
	test	rax, rax
	je	.L25
	and	ebx, DWORD PTR PKCS7_TEXT[rip]
	mov	r12d, ebx
	jne	.L26
	mov	edi, DWORD PTR BUFFERSIZE[rip]
	call	OPENSSL_malloc@PLT
	mov	rbp, rax
	test	rax, rax
	jne	.L11
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L13:
	mov	edx, eax
	mov	rsi, rbp
	mov	rdi, r13
	call	BIO_write@PLT
	cmp	eax, ebx
	jne	.L12
.L11:
	mov	edx, DWORD PTR BUFFERSIZE[rip]
	mov	rsi, rbp
	mov	rdi, r14
	call	BIO_read@PLT
	mov	ebx, eax
	test	eax, eax
	jg	.L13
	mov	rdi, r14
	mov	r12d, 1
	call	BIO_method_type@PLT
	cmp	rax, QWORD PTR BIO_TYPE_CIPHER[rip]
	je	.L28
.L12:
	mov	rdi, rbp
	call	OPENSSL_free@PLT
	mov	rdi, r14
	call	BIO_free_all@PLT
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	xor	eax, eax
	call	BIO_f_buffer@PLT
	mov	edi, eax
	call	BIO_new@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L29
	mov	rsi, r14
	mov	rdi, rax
	call	BIO_push@PLT
	mov	r15, rax
	test	rax, rax
	je	.L30
	mov	rsi, r13
	mov	rdi, rax
	call	SMIME_text@PLT
	mov	r12d, eax
	test	eax, eax
	jg	.L31
.L10:
	mov	rdi, r15
	call	BIO_free_all@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L24:
	mov	esi, DWORD PTR PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE[rip]
	mov	edi, DWORD PTR PKCS7_F_PKCS7_DECRYPT[rip]
	call	PKCS7err@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L30:
	mov	esi, DWORD PTR ERR_R_MALLOC_FAILURE[rip]
	mov	edi, DWORD PTR PKCS7_F_PKCS7_DECRYPT[rip]
	xor	r12d, r12d
	call	PKCS7err@PLT
	mov	rdi, rbp
	call	BIO_free_all@PLT
	mov	rdi, r14
	call	BIO_free_all@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L22:
	mov	esi, DWORD PTR PKCS7_R_INVALID_NULL_POINTER[rip]
	mov	edi, DWORD PTR PKCS7_F_PKCS7_DECRYPT[rip]
	xor	r12d, r12d
	call	PKCS7err@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L23:
	mov	esi, DWORD PTR PKCS7_R_WRONG_CONTENT_TYPE[rip]
	mov	edi, DWORD PTR PKCS7_F_PKCS7_DECRYPT[rip]
	call	PKCS7err@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L31:
	mov	rdi, r14
	call	BIO_method_type@PLT
	cmp	rax, QWORD PTR BIO_TYPE_CIPHER[rip]
	jne	.L10
	mov	rdi, r14
	call	BIO_get_cipher_status@PLT
	test	eax, eax
	mov	eax, 0
	cmove	r12d, eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L25:
	mov	esi, DWORD PTR PKCS7_R_DECRYPT_ERROR[rip]
	mov	edi, DWORD PTR PKCS7_F_PKCS7_DECRYPT[rip]
	xor	r12d, r12d
	call	PKCS7err@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L28:
	mov	rdi, r14
	xor	r12d, r12d
	call	BIO_get_cipher_status@PLT
	test	eax, eax
	setne	r12b
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L29:
	mov	esi, DWORD PTR ERR_R_MALLOC_FAILURE[rip]
	mov	edi, DWORD PTR PKCS7_F_PKCS7_DECRYPT[rip]
	xor	r12d, r12d
	call	PKCS7err@PLT
	mov	rdi, r14
	call	BIO_free_all@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L27:
	mov	esi, DWORD PTR ERR_R_MALLOC_FAILURE[rip]
	mov	edi, DWORD PTR PKCS7_F_PKCS7_DECRYPT[rip]
	call	PKCS7err@PLT
	jmp	.L12
	.cfi_endproc
.LFE0:
	.size	PKCS7_decrypt, .-PKCS7_decrypt
	.comm	PKCS7_TEXT,4,4
	.comm	PKCS7_R_WRONG_CONTENT_TYPE,4,4
	.comm	PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE,4,4
	.comm	PKCS7_R_INVALID_NULL_POINTER,4,4
	.comm	PKCS7_R_DECRYPT_ERROR,4,4
	.comm	PKCS7_F_PKCS7_DECRYPT,4,4
	.comm	ERR_R_MALLOC_FAILURE,4,4
	.comm	BUFFERSIZE,4,4
	.comm	BIO_TYPE_CIPHER,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_pk7_smime.c_PKCS7_decrypt.c"
	.text
	.align	2
	.global	PKCS7_decrypt
	.syntax unified
	.arm
	.fpu softvfp
	.type	PKCS7_decrypt, %function
PKCS7_decrypt:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	subs	r7, r0, #0
	ldreq	r2, .L32
	beq	.L21
	mov	r6, r1
	mov	r4, r2
	mov	r8, r3
	bl	PKCS7_type_is_enveloped
	subs	r5, r0, #0
	beq	.L23
	cmp	r4, #0
	beq	.L5
	mov	r1, r6
	mov	r0, r4
	bl	X509_check_private_key
	subs	r5, r0, #0
	beq	.L24
.L5:
	mov	r0, r7
	mov	r3, r4
	mov	r1, r6
	mov	r2, #0
	bl	PKCS7_dataDecode
	subs	r7, r0, #0
	beq	.L25
	ldr	r3, .L32+4
	ldr	r5, [r3]
	ldr	r3, [sp, #32]
	ands	r5, r3, r5
	bne	.L26
	ldr	r9, .L32+8
	ldr	r0, [r9]
	bl	OPENSSL_malloc
	subs	r6, r0, #0
	bne	.L11
	b	.L27
.L13:
	mov	r2, r4
	mov	r1, r6
	mov	r0, r8
	bl	BIO_write
	cmp	r0, r4
	bne	.L12
.L11:
	mov	r1, r6
	mov	r0, r7
	ldr	r2, [r9]
	bl	BIO_read
	subs	r4, r0, #0
	bgt	.L13
	mov	r0, r7
	bl	BIO_method_type
	ldr	r3, .L32+12
	ldr	r3, [r3]
	cmp	r0, r3
	movne	r5, #1
	beq	.L28
.L12:
	mov	r0, r6
	bl	OPENSSL_free
	mov	r0, r7
	bl	BIO_free_all
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L26:
	bl	BIO_f_buffer
	bl	BIO_new
	subs	r5, r0, #0
	beq	.L29
	mov	r1, r7
	bl	BIO_push
	subs	r4, r0, #0
	beq	.L30
	mov	r1, r8
	bl	SMIME_text
	subs	r5, r0, #0
	bgt	.L31
.L10:
	mov	r0, r4
	bl	BIO_free_all
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L25:
	ldr	r2, .L32+16
.L21:
	mov	r5, r7
	ldr	r3, .L32+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	PKCS7err
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L24:
	ldr	r2, .L32+24
	ldr	r3, .L32+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	PKCS7err
	b	.L1
.L30:
	ldr	r2, .L32+28
	ldr	r3, .L32+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	PKCS7err
	mov	r0, r5
	bl	BIO_free_all
	mov	r0, r7
	mov	r5, r4
	bl	BIO_free_all
	b	.L1
.L23:
	ldr	r2, .L32+32
	ldr	r3, .L32+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	PKCS7err
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L31:
	mov	r0, r7
	bl	BIO_method_type
	ldr	r3, .L32+12
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L10
	mov	r0, r7
	bl	BIO_get_cipher_status
	cmp	r0, #0
	moveq	r5, #0
	b	.L10
.L28:
	mov	r0, r7
	bl	BIO_get_cipher_status
	subs	r5, r0, #0
	movne	r5, #1
	b	.L12
.L29:
	ldr	r2, .L32+28
	ldr	r3, .L32+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	PKCS7err
	mov	r0, r7
	bl	BIO_free_all
	b	.L1
.L27:
	ldr	r2, .L32+28
	ldr	r3, .L32+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	PKCS7err
	b	.L12
.L33:
	.align	2
.L32:
	.word	PKCS7_R_INVALID_NULL_POINTER
	.word	PKCS7_TEXT
	.word	BUFFERSIZE
	.word	BIO_TYPE_CIPHER
	.word	PKCS7_R_DECRYPT_ERROR
	.word	PKCS7_F_PKCS7_DECRYPT
	.word	PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
	.word	ERR_R_MALLOC_FAILURE
	.word	PKCS7_R_WRONG_CONTENT_TYPE
	.size	PKCS7_decrypt, .-PKCS7_decrypt
	.comm	PKCS7_TEXT,4,4
	.comm	PKCS7_R_WRONG_CONTENT_TYPE,4,4
	.comm	PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE,4,4
	.comm	PKCS7_R_INVALID_NULL_POINTER,4,4
	.comm	PKCS7_R_DECRYPT_ERROR,4,4
	.comm	PKCS7_F_PKCS7_DECRYPT,4,4
	.comm	ERR_R_MALLOC_FAILURE,4,4
	.comm	BUFFERSIZE,4,4
	.comm	BIO_TYPE_CIPHER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
