	.file	"extr_seafile-crypt.c_seafile_decrypt.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Invalid param(s).\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"failed to allocate the output buffer.\n"
	.text
	.p2align 4
	.globl	seafile_decrypt
	.type	seafile_decrypt, @function
seafile_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, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	QWORD PTR [rdi], 0
	mov	DWORD PTR [rsi], -1
	test	rdx, rdx
	je	.L2
	mov	r12d, ecx
	test	ecx, ecx
	jle	.L2
	mov	eax, ecx
	mov	r14, rdx
	cdq
	idiv	DWORD PTR BLK_SIZE[rip]
	test	edx, edx
	jne	.L2
	mov	rbx, r8
	test	r8, r8
	je	.L2
	xor	eax, eax
	mov	rbp, rdi
	mov	r13, rsi
	call	EVP_CIPHER_CTX_new@PLT
	mov	r8d, DWORD PTR 4[rbx]
	mov	r15, rax
	mov	eax, DWORD PTR [rbx]
	cmp	eax, 2
	je	.L21
	cmp	eax, 1
	mov	DWORD PTR 12[rsp], r8d
	mov	ebx, DWORD PTR 8[rbx]
	mov	eax, 0
	je	.L22
	call	EVP_aes_128_ecb@PLT
.L19:
	mov	r8d, DWORD PTR 12[rsp]
	xor	edx, edx
	mov	esi, eax
	mov	ecx, ebx
	mov	rdi, r15
	call	EVP_DecryptInit_ex@PLT
	cmp	DWORD PTR DEC_FAILURE[rip], eax
	je	.L23
	mov	edi, r12d
	call	g_malloc@PLT
	mov	QWORD PTR 0[rbp], rax
	mov	rsi, rax
	test	rax, rax
	je	.L24
	lea	rdx, 16[rsp]
	mov	r8d, r12d
	mov	rcx, r14
	mov	rdi, r15
	call	EVP_DecryptUpdate@PLT
	cmp	DWORD PTR DEC_FAILURE[rip], eax
	je	.L11
	movsx	rsi, DWORD PTR 16[rsp]
	lea	rdx, 20[rsp]
	add	rsi, QWORD PTR 0[rbp]
	mov	rdi, r15
	call	EVP_DecryptFinal_ex@PLT
	mov	r8d, eax
	mov	eax, DWORD PTR 20[rsp]
	add	eax, DWORD PTR 16[rsp]
	mov	DWORD PTR 0[r13], eax
	cmp	DWORD PTR DEC_FAILURE[rip], r8d
	je	.L11
	cmp	eax, r12d
	jg	.L11
	mov	rdi, r15
	call	EVP_CIPHER_CTX_free@PLT
	xor	eax, eax
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L25
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L22:
	.cfi_restore_state
	call	EVP_aes_128_cbc@PLT
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L21:
	xor	eax, eax
	mov	DWORD PTR 12[rsp], r8d
	mov	ebx, DWORD PTR 8[rbx]
	call	EVP_aes_256_cbc@PLT
	jmp	.L19
.L24:
	lea	rdi, .LC1[rip]
	call	seaf_warning@PLT
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rdi, r15
	call	EVP_CIPHER_CTX_free@PLT
	mov	rdi, QWORD PTR 0[rbp]
	mov	DWORD PTR 0[r13], -1
	test	rdi, rdi
	je	.L13
	call	g_free@PLT
.L13:
	mov	QWORD PTR 0[rbp], 0
	mov	eax, -1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L2:
	lea	rdi, .LC0[rip]
	call	seaf_warning@PLT
	mov	eax, -1
	jmp	.L1
.L23:
	mov	rdi, r15
	call	EVP_CIPHER_CTX_free@PLT
	mov	eax, -1
	jmp	.L1
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	seafile_decrypt, .-seafile_decrypt
	.comm	DEC_FAILURE,4,4
	.comm	BLK_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_seafile-crypt.c_seafile_decrypt.c"
	.text
	.global	__aeabi_idivmod
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Invalid param(s).\012\000"
	.align	2
.LC1:
	.ascii	"failed to allocate the output buffer.\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	seafile_decrypt
	.syntax unified
	.arm
	.fpu softvfp
	.type	seafile_decrypt, %function
seafile_decrypt:
	@ args = 4, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	cmp	r2, #0
	cmpne	r3, #0
	mov	r6, r0
	mov	r7, r1
	mov	r0, #0
	mvn	r1, #0
	ldr	ip, .L25
	sub	sp, sp, #24
	ldr	ip, [ip]
	str	ip, [sp, #20]
	mov	ip,#0
	ldr	r10, [sp, #56]
	str	r0, [r6]
	str	r1, [r7]
	ble	.L2
	mov	r4, r3
	ldr	r3, .L25+4
	mov	r0, r4
	ldr	r1, [r3]
	mov	r9, r2
	bl	__aeabi_idivmod
	clz	r2, r10
	cmp	r1, #0
	lsr	r2, r2, #5
	moveq	r8, r2
	movne	r8, #1
	cmp	r8, #0
	bne	.L2
	bl	EVP_CIPHER_CTX_new
	ldr	r3, [r10]
	mov	r5, r0
	cmp	r3, #2
	beq	.L20
	cmp	r3, #1
	beq	.L21
	bl	EVP_aes_128_ecb
.L18:
	ldr	r3, [r10, #4]
	mov	r1, r0
	str	r3, [sp]
	mov	r2, r8
	ldr	r3, [r10, #8]
	mov	r0, r5
	bl	EVP_DecryptInit_ex
	ldr	r8, .L25+8
	ldr	r3, [r8]
	cmp	r3, r0
	beq	.L22
	mov	r0, r4
	bl	g_malloc
	cmp	r0, #0
	mov	r1, r0
	str	r0, [r6]
	beq	.L23
	mov	r3, r9
	mov	r0, r5
	str	r4, [sp]
	add	r2, sp, #12
	bl	EVP_DecryptUpdate
	ldr	r3, [r8]
	cmp	r3, r0
	beq	.L10
	ldr	r3, [sp, #12]
	ldr	r1, [r6]
	add	r2, sp, #16
	add	r1, r1, r3
	mov	r0, r5
	bl	EVP_DecryptFinal_ex
	ldr	r3, [sp, #12]
	ldr	r2, [sp, #16]
	add	r3, r3, r2
	cmp	r3, r4
	movle	r4, #0
	movgt	r4, #1
	str	r3, [r7]
	ldr	r3, [r8]
	cmp	r3, r0
	orreq	r4, r4, #1
	cmp	r4, #0
	bne	.L10
	mov	r0, r5
	bl	EVP_CIPHER_CTX_free
	mov	r0, r4
.L1:
	ldr	r3, .L25
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L24
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L21:
	bl	EVP_aes_128_cbc
	b	.L18
.L20:
	bl	EVP_aes_256_cbc
	b	.L18
.L23:
	ldr	r0, .L25+12
	bl	seaf_warning
.L10:
	mov	r0, r5
	bl	EVP_CIPHER_CTX_free
	mvn	r3, #0
	ldr	r0, [r6]
	str	r3, [r7]
	cmp	r0, #0
	beq	.L12
	bl	g_free
.L12:
	mov	r3, #0
	mvn	r0, #0
	str	r3, [r6]
	b	.L1
.L2:
	ldr	r0, .L25+16
	bl	seaf_warning
	mvn	r0, #0
	b	.L1
.L22:
	mov	r0, r5
	bl	EVP_CIPHER_CTX_free
	mvn	r0, #0
	b	.L1
.L24:
	bl	__stack_chk_fail
.L26:
	.align	2
.L25:
	.word	.LC2
	.word	BLK_SIZE
	.word	DEC_FAILURE
	.word	.LC1
	.word	.LC0
	.size	seafile_decrypt, .-seafile_decrypt
	.comm	DEC_FAILURE,4,4
	.comm	BLK_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
