	.file	"extr_urlcache.c_cache_container_open_index.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Could not open or create cache index file \"%s\"\n"
	.align 8
.LC1:
	.string	"detected old or broken index.dat file\n"
	.align 8
.LC2:
	.string	"Couldn't create file mapping (error is %d)\n"
	.text
	.p2align 4
	.type	cache_container_open_index, @function
cache_container_open_index:
.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
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	r12, rsi
	push	rbx
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR MAX_PATH[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
.L30:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L30
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L31
.L4:
	mov	edi, DWORD PTR 8[rbx]
	mov	esi, DWORD PTR INFINITE[rip]
	mov	r14, rsp
	call	WaitForSingleObject@PLT
	cmp	QWORD PTR [rbx], 0
	jne	.L13
	mov	esi, DWORD PTR 12[rbx]
	mov	rdi, rsp
	call	strcpyW@PLT
	mov	rdi, rsp
	lea	rsi, index_dat.2008[rip]
	call	strcatW@PLT
	sub	rsp, 8
	xor	ecx, ecx
	xor	r9d, r9d
	push	0
	mov	r8d, DWORD PTR OPEN_ALWAYS[rip]
	mov	rdi, r14
	mov	edx, DWORD PTR FILE_SHARE_READ[rip]
	mov	esi, DWORD PTR GENERIC_READ[rip]
	or	edx, DWORD PTR FILE_SHARE_WRITE[rip]
	or	esi, DWORD PTR GENERIC_WRITE[rip]
	call	CreateFileW@PLT
	cmp	QWORD PTR INVALID_HANDLE_VALUE[rip], rax
	pop	rcx
	mov	r13, rax
	pop	rsi
	je	.L32
.L7:
	xor	esi, esi
	mov	rdi, r13
	call	GetFileSize@PLT
	cmp	QWORD PTR INVALID_FILE_SIZE[rip], rax
	mov	r14, rax
	je	.L33
	mov	r15, QWORD PTR MIN_BLOCK_NO[rip]
	cmp	r15, r12
	jg	.L10
	cmp	QWORD PTR MAX_BLOCK_NO[rip], r12
	mov	r15, r12
	cmovle	r15, QWORD PTR MAX_BLOCK_NO[rip]
.L10:
	mov	rdi, r15
	call	FILE_SIZE@PLT
	cmp	rax, r14
	jg	.L34
	mov	QWORD PTR 16[rbx], r14
	mov	esi, DWORD PTR 12[rbx]
	lea	rcx, -64[rbp]
	mov	rdx, r14
	mov	rdi, r13
	call	cache_container_map_index@PLT
	mov	rdi, r13
	mov	QWORD PTR [rbx], rax
	call	CloseHandle@PLT
	mov	rdi, QWORD PTR [rbx]
	test	rdi, rdi
	je	.L12
	cmp	QWORD PTR -64[rbp], 0
	je	.L13
	mov	esi, DWORD PTR FILE_MAP_WRITE[rip]
	xor	r8d, r8d
	xor	ecx, ecx
	xor	edx, edx
	call	MapViewOfFile@PLT
	mov	r12, rax
	test	rax, rax
	je	.L14
	mov	rsi, r14
	mov	rdi, rax
	call	cache_container_is_valid@PLT
	test	eax, eax
	je	.L35
	mov	rdi, r12
	call	UnmapViewOfFile@PLT
.L16:
	cmp	QWORD PTR [rbx], 0
	je	.L12
.L13:
	mov	edi, DWORD PTR 8[rbx]
	call	ReleaseMutex@PLT
	mov	r12, QWORD PTR ERROR_SUCCESS[rip]
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L36
	lea	rsp, -40[rbp]
	mov	rax, r12
	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
.L14:
	.cfi_restore_state
	mov	rdi, QWORD PTR [rbx]
	call	CloseHandle@PLT
	mov	QWORD PTR [rbx], 0
	.p2align 4,,10
	.p2align 3
.L12:
	xor	eax, eax
	call	GetLastError@PLT
	lea	rdi, .LC2[rip]
	mov	rsi, rax
	call	ERR@PLT
.L28:
	mov	edi, DWORD PTR 8[rbx]
	call	ReleaseMutex@PLT
	xor	eax, eax
	call	GetLastError@PLT
	mov	r12, rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L31:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L34:
	mov	rdx, r15
	mov	rsi, r13
	mov	rdi, rbx
	call	cache_container_set_size@PLT
	mov	rdi, r13
	mov	r12, rax
	call	CloseHandle@PLT
	mov	edi, DWORD PTR 8[rbx]
	call	ReleaseMutex@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L32:
	mov	edi, DWORD PTR 12[rbx]
	xor	esi, esi
	call	CreateDirectoryW@PLT
	test	rax, rax
	jne	.L37
.L8:
	cmp	r13, QWORD PTR INVALID_HANDLE_VALUE[rip]
	jne	.L7
	mov	rdi, r14
	call	debugstr_w@PLT
	lea	rdi, .LC0[rip]
	mov	esi, eax
	call	TRACE@PLT
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L33:
	mov	rdi, r13
	call	CloseHandle@PLT
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L37:
	sub	rsp, 8
	mov	r8d, DWORD PTR OPEN_ALWAYS[rip]
	xor	r9d, r9d
	xor	ecx, ecx
	push	0
	mov	edx, DWORD PTR FILE_SHARE_READ[rip]
	mov	rdi, r14
	mov	esi, DWORD PTR GENERIC_READ[rip]
	or	edx, DWORD PTR FILE_SHARE_WRITE[rip]
	or	esi, DWORD PTR GENERIC_WRITE[rip]
	call	CreateFileW@PLT
	mov	r13, rax
	pop	rax
	pop	rdx
	jmp	.L8
.L35:
	lea	rdi, .LC1[rip]
	call	WARN@PLT
	mov	rdi, r12
	call	UnmapViewOfFile@PLT
	mov	edi, DWORD PTR 12[rbx]
	xor	edx, edx
	mov	esi, 100
	call	FreeUrlCacheSpaceW@PLT
	jmp	.L16
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	cache_container_open_index, .-cache_container_open_index
	.section	.rodata
	.align 8
	.type	index_dat.2008, @object
	.size	index_dat.2008, 10
index_dat.2008:
	.string	"index.dat"
	.comm	OPEN_ALWAYS,4,4
	.comm	MIN_BLOCK_NO,8,8
	.comm	MAX_PATH,4,4
	.comm	MAX_BLOCK_NO,8,8
	.comm	INVALID_HANDLE_VALUE,8,8
	.comm	INVALID_FILE_SIZE,8,8
	.comm	INFINITE,4,4
	.comm	GENERIC_WRITE,4,4
	.comm	GENERIC_READ,4,4
	.comm	FILE_SHARE_WRITE,4,4
	.comm	FILE_SHARE_READ,4,4
	.comm	FILE_MAP_WRITE,4,4
	.comm	ERROR_SUCCESS,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_urlcache.c_cache_container_open_index.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Could not open or create cache index file \"%s\"\012"
	.ascii	"\000"
	.align	2
.LC1:
	.ascii	"detected old or broken index.dat file\012\000"
	.align	2
.LC2:
	.ascii	"Couldn't create file mapping (error is %d)\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cache_container_open_index, %function
cache_container_open_index:
	@ 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, #36
	mov	r2, r1
	mov	r4, r0
	ldr	r3, .L35
	ldr	r1, .L35+4
	ldr	r3, [r3]
	str	r2, [fp, #-48]
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	ldr	r3, .L35+8
	ldr	r0, [r0, #4]
	ldr	r1, [r1]
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bl	WaitForSingleObject
	ldr	r9, [r4]
	cmp	r9, #0
	bne	.L10
	add	r6, sp, #16
	ldr	r1, [r4, #8]
	mov	r0, r6
	bl	strcpyW
	ldr	r1, .L35+12
	mov	r0, r6
	bl	strcatW
	ldr	r3, .L35+16
	ldr	r10, .L35+20
	ldr	r2, [r3]
	ldr	r3, .L35+24
	ldr	r8, .L35+28
	ldr	ip, [r3]
	ldr	r3, .L35+32
	ldr	r0, [r8]
	ldr	r1, [r3]
	ldr	lr, [r10]
	str	r0, [sp]
	orr	r2, lr, r2
	mov	r3, r9
	mov	r0, r6
	str	r9, [sp, #8]
	str	r9, [sp, #4]
	orr	r1, ip, r1
	bl	CreateFileW
	ldr	r7, .L35+36
	mov	r5, r0
	ldr	r2, [r7]
	cmp	r2, r0
	beq	.L29
.L4:
	mov	r1, #0
	mov	r0, r5
	bl	GetFileSize
	ldr	r3, .L35+40
	mov	r6, r0
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L30
	ldr	r3, .L35+44
	ldr	r2, [fp, #-48]
	ldr	r7, [r3]
	cmp	r7, r2
	bgt	.L7
	ldr	r3, .L35+48
	ldr	r7, [r3]
	cmp	r2, r7
	movlt	r7, r2
.L7:
	mov	r0, r7
	bl	FILE_SIZE
	cmp	r0, r6
	bgt	.L31
	mov	r2, r6
	ldr	r1, [r4, #8]
	sub	r3, fp, #44
	mov	r0, r5
	str	r6, [r4, #12]
	bl	cache_container_map_index
	mov	r3, r0
	mov	r0, r5
	str	r3, [r4]
	bl	CloseHandle
	ldr	r0, [r4]
	cmp	r0, #0
	beq	.L9
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	beq	.L10
	mov	r3, #0
	ldr	r1, .L35+52
	str	r3, [sp]
	mov	r2, r3
	ldr	r1, [r1]
	bl	MapViewOfFile
	subs	r5, r0, #0
	beq	.L11
	mov	r1, r6
	bl	cache_container_is_valid
	subs	r6, r0, #0
	beq	.L32
	mov	r0, r5
	bl	UnmapViewOfFile
.L13:
	ldr	r3, [r4]
	cmp	r3, #0
	beq	.L9
.L10:
	ldr	r0, [r4, #4]
	bl	ReleaseMutex
	ldr	r3, .L35+56
	ldr	r5, [r3]
.L1:
	ldr	r3, .L35+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L33
	mov	r0, r5
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L11:
	ldr	r0, [r4]
	bl	CloseHandle
	str	r5, [r4]
.L9:
	bl	GetLastError
	mov	r1, r0
	ldr	r0, .L35+60
	bl	ERR
	ldr	r0, [r4, #4]
	bl	ReleaseMutex
	bl	GetLastError
	mov	r5, r0
	b	.L1
.L30:
	mov	r0, r5
	bl	CloseHandle
	ldr	r0, [r4, #4]
	bl	ReleaseMutex
	bl	GetLastError
	mov	r5, r0
	b	.L1
.L31:
	mov	r1, r5
	mov	r2, r7
	mov	r0, r4
	bl	cache_container_set_size
	mov	r3, r0
	mov	r0, r5
	mov	r5, r3
	bl	CloseHandle
	ldr	r0, [r4, #4]
	bl	ReleaseMutex
	b	.L1
.L29:
	mov	r1, r9
	ldr	r0, [r4, #8]
	bl	CreateDirectoryW
	cmp	r0, #0
	bne	.L34
.L5:
	ldr	r3, [r7]
	cmp	r5, r3
	bne	.L4
	mov	r0, r6
	bl	debugstr_w
	mov	r1, r0
	ldr	r0, .L35+64
	bl	TRACE
	ldr	r0, [r4, #4]
	bl	ReleaseMutex
	bl	GetLastError
	mov	r5, r0
	b	.L1
.L34:
	ldr	r3, .L35+16
	ldr	r0, [r8]
	ldr	r2, [r3]
	ldr	r3, .L35+24
	ldr	lr, [r10]
	ldr	ip, [r3]
	ldr	r3, .L35+32
	orr	r2, lr, r2
	ldr	r1, [r3]
	str	r0, [sp]
	mov	r3, r9
	mov	r0, r6
	orr	r1, ip, r1
	str	r9, [sp, #8]
	str	r9, [sp, #4]
	bl	CreateFileW
	mov	r5, r0
	b	.L5
.L32:
	ldr	r0, .L35+68
	bl	WARN
	mov	r0, r5
	bl	UnmapViewOfFile
	mov	r2, r6
	mov	r1, #100
	ldr	r0, [r4, #8]
	bl	FreeUrlCacheSpaceW
	b	.L13
.L33:
	bl	__stack_chk_fail
.L36:
	.align	2
.L35:
	.word	MAX_PATH
	.word	INFINITE
	.word	.LC3
	.word	.LANCHOR0
	.word	FILE_SHARE_WRITE
	.word	FILE_SHARE_READ
	.word	GENERIC_READ
	.word	OPEN_ALWAYS
	.word	GENERIC_WRITE
	.word	INVALID_HANDLE_VALUE
	.word	INVALID_FILE_SIZE
	.word	MIN_BLOCK_NO
	.word	MAX_BLOCK_NO
	.word	FILE_MAP_WRITE
	.word	ERROR_SUCCESS
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.size	cache_container_open_index, .-cache_container_open_index
	.comm	OPEN_ALWAYS,4,4
	.comm	MIN_BLOCK_NO,4,4
	.comm	MAX_PATH,4,4
	.comm	MAX_BLOCK_NO,4,4
	.comm	INVALID_HANDLE_VALUE,4,4
	.comm	INVALID_FILE_SIZE,4,4
	.comm	INFINITE,4,4
	.comm	GENERIC_WRITE,4,4
	.comm	GENERIC_READ,4,4
	.comm	FILE_SHARE_WRITE,4,4
	.comm	FILE_SHARE_READ,4,4
	.comm	FILE_MAP_WRITE,4,4
	.comm	ERROR_SUCCESS,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	index_dat.4292, %object
	.size	index_dat.4292, 10
index_dat.4292:
	.ascii	"index.dat\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
