	.file	"extr_citrus_db.c__citrus_db_open.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	_citrus_db_open
	.type	_citrus_db_open, @function
_citrus_db_open:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, ecx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, r8
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	QWORD PTR [rsp], rdi
	lea	r12, 20[rsp]
	mov	rdi, r12
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	_memstream_bind@PLT
	xor	esi, esi
	mov	edx, 12
	mov	rdi, r12
	call	_memstream_getregion@PLT
	test	rax, rax
	je	.L10
	mov	edi, DWORD PTR 8[rax]
	mov	edx, DWORD PTR _CITRUS_DB_MAGIC_SIZE[rip]
	mov	rsi, r13
	mov	rbx, rax
	call	strncmp@PLT
	test	rax, rax
	je	.L4
.L10:
	mov	eax, DWORD PTR EFTYPE[rip]
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L12
	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
.L4:
	.cfi_restore_state
	mov	edx, DWORD PTR SEEK_SET[rip]
	mov	edi, DWORD PTR 4[rbx]
	mov	DWORD PTR 12[rsp], edx
	call	be32toh@PLT
	mov	edx, DWORD PTR 12[rsp]
	mov	rdi, r12
	mov	esi, eax
	call	_memstream_seek@PLT
	test	rax, rax
	jne	.L10
	mov	edi, DWORD PTR [rbx]
	call	be32toh@PLT
	imul	eax, DWORD PTR _CITRUS_DB_ENTRY_SIZE[rip]
	mov	rdi, r12
	mov	ebx, eax
	call	_memstream_remainder@PLT
	cmp	ebx, eax
	jg	.L10
	mov	edi, 16
	call	malloc@PLT
	test	rax, rax
	je	.L13
	mov	edx, DWORD PTR 0[rbp]
	mov	rbx, QWORD PTR [rsp]
	mov	DWORD PTR 8[rax], r15d
	mov	QWORD PTR [rax], r14
	mov	DWORD PTR 12[rax], edx
	mov	QWORD PTR [rbx], rax
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	eax, DWORD PTR errno[rip]
	jmp	.L1
.L12:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	_citrus_db_open, .-_citrus_db_open
	.comm	errno,4,4
	.comm	_CITRUS_DB_MAGIC_SIZE,4,4
	.comm	_CITRUS_DB_ENTRY_SIZE,4,4
	.comm	SEEK_SET,4,4
	.comm	EFTYPE,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_citrus_db.c__citrus_db_open.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	_citrus_db_open
	.syntax unified
	.arm
	.fpu softvfp
	.type	_citrus_db_open, %function
_citrus_db_open:
	@ args = 4, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r7, r3
	sub	sp, sp, #12
	ldr	r3, .L13
	mov	r6, r0
	mov	r0, sp
	mov	r4, r2
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	mov	r8, r1
	ldr	r9, [sp, #40]
	bl	_memstream_bind
	mov	r0, sp
	mov	r2, #12
	mov	r1, #0
	bl	_memstream_getregion
	subs	r5, r0, #0
	beq	.L10
	ldr	r3, .L13+4
	mov	r1, r4
	ldr	r2, [r3]
	ldr	r0, [r5, #8]
	bl	strncmp
	cmp	r0, #0
	beq	.L4
.L10:
	ldr	r3, .L13+8
	ldr	r4, [r3]
.L1:
	ldr	r3, .L13
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L12
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L4:
	ldr	r0, [r5, #4]
	bl	be32toh
	ldr	r3, .L13+12
	mov	r1, r0
	ldr	r2, [r3]
	mov	r0, sp
	bl	_memstream_seek
	subs	r4, r0, #0
	bne	.L10
	ldr	r0, [r5]
	bl	be32toh
	mov	r5, r0
	ldr	r3, .L13+16
	mov	r0, sp
	ldr	r3, [r3]
	mul	r5, r3, r5
	bl	_memstream_remainder
	cmp	r5, r0
	bgt	.L10
	mov	r0, #12
	bl	malloc
	cmp	r0, #0
	ldrne	r3, [r8]
	ldreq	r3, .L13+20
	strne	r7, [r0, #4]
	ldreq	r4, [r3]
	strne	r3, [r0, #8]
	strne	r9, [r0]
	strne	r0, [r6]
	b	.L1
.L12:
	bl	__stack_chk_fail
.L14:
	.align	2
.L13:
	.word	.LC0
	.word	_CITRUS_DB_MAGIC_SIZE
	.word	EFTYPE
	.word	SEEK_SET
	.word	_CITRUS_DB_ENTRY_SIZE
	.word	errno
	.size	_citrus_db_open, .-_citrus_db_open
	.comm	errno,4,4
	.comm	_CITRUS_DB_MAGIC_SIZE,4,4
	.comm	_CITRUS_DB_ENTRY_SIZE,4,4
	.comm	SEEK_SET,4,4
	.comm	EFTYPE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
