	.file	"extr_http.c_create_cache_entry.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"INTERNET_FLAG_NEED_FILE is not supported correctly\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"Could not get URL\n"
	.section	.rodata.str1.8
	.align 8
.LC2:
	.string	"Could not create cache entry: %08x\n"
	.section	.rodata.str1.1
.LC3:
	.string	"Could not create file: %u\n"
.LC4:
	.string	"WriteFile failed: %u\n"
	.text
	.p2align 4
	.type	create_cache_entry, @function
create_cache_entry:
.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, rdi
	push	rbx
	sub	rsp, 40
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR MAX_PATH[rip]
	mov	rcx, rsp
	mov	r13, rsp
	add	eax, 1
	cdqe
	add	rax, 15
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L70:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L70
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L71
.L4:
	mov	rdi, QWORD PTR 48[r12]
	mov	rbx, QWORD PTR TRUE[rip]
	mov	QWORD PTR -72[rbp], rsp
	test	rdi, rdi
	je	.L5
	call	req_file_release@PLT
	mov	QWORD PTR 48[r12], 0
.L5:
	mov	rdi, QWORD PTR 40[r12]
	test	rdi, rdi
	je	.L6
	call	CloseHandle@PLT
	mov	QWORD PTR 40[r12], 0
.L6:
	mov	eax, DWORD PTR 56[r12]
	test	DWORD PTR INTERNET_FLAG_NO_CACHE_WRITE[rip], eax
	cmovne	rbx, QWORD PTR FALSE[rip]
	test	rbx, rbx
	jne	.L72
.L8:
	test	DWORD PTR INTERNET_FLAG_NEED_FILE[rip], eax
	je	.L20
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	FIXME@PLT
.L15:
	mov	rdi, r12
	call	compose_request_url@PLT
	mov	rbx, rax
	test	rax, rax
	je	.L73
	mov	esi, DWORD PTR [r12]
	mov	eax, 0
	mov	rcx, QWORD PTR -72[rbp]
	mov	rdi, rbx
	cmp	esi, -1
	cmove	esi, eax
	xor	r8d, r8d
	xor	edx, edx
	call	CreateUrlCacheEntryW@PLT
	test	rax, rax
	je	.L74
	mov	r14, QWORD PTR -72[rbp]
	lea	rsi, 48[r12]
	mov	rdi, r14
	call	create_req_file@PLT
	mov	rax, QWORD PTR 48[r12]
	sub	rsp, 8
	xor	ecx, ecx
	mov	edx, DWORD PTR FILE_SHARE_READ[rip]
	mov	r9d, DWORD PTR FILE_ATTRIBUTE_NORMAL[rip]
	mov	rdi, r14
	or	edx, DWORD PTR FILE_SHARE_WRITE[rip]
	mov	r8d, DWORD PTR CREATE_ALWAYS[rip]
	mov	QWORD PTR [rax], rbx
	mov	esi, DWORD PTR GENERIC_WRITE[rip]
	push	0
	call	CreateFileW@PLT
	cmp	rax, QWORD PTR INVALID_HANDLE_VALUE[rip]
	mov	QWORD PTR 40[r12], rax
	pop	rdx
	pop	rcx
	je	.L75
	mov	rdx, QWORD PTR 16[r12]
	test	rdx, rdx
	jne	.L76
.L20:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	mov	rsp, r13
	jne	.L77
	lea	rsp, -40[rbp]
	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
.L72:
	.cfi_restore_state
	lea	rax, 60[r12]
	mov	rdi, rax
	mov	QWORD PTR -80[rbp], rax
	call	EnterCriticalSection@PLT
	mov	esi, DWORD PTR szCache_Control[rip]
	xor	edx, edx
	mov	rdi, r12
	mov	rcx, QWORD PTR FALSE[rip]
	call	HTTP_GetCustomHeaderIndex@PLT
	cmp	eax, -1
	je	.L9
	mov	rdx, QWORD PTR 64[r12]
	cdqe
	lea	rbx, no_cacheW.2022[rip]
	mov	r15, QWORD PTR [rdx+rax*8]
	movzx	eax, BYTE PTR [r15]
	test	al, al
	je	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	cmp	al, 9
	je	.L56
	cmp	al, 32
	jne	.L19
	.p2align 4,,10
	.p2align 3
.L56:
	movzx	eax, BYTE PTR 1[r15]
	add	r15, 1
	cmp	al, 32
	je	.L56
	cmp	al, 9
	je	.L56
.L19:
	mov	esi, 44
	mov	rdi, r15
	call	strchrW@PLT
	mov	r14, rax
	test	rax, rax
	je	.L78
.L12:
	mov	edx, 8
	mov	rsi, rbx
	mov	rdi, r15
	call	strncmpiW@PLT
	test	eax, eax
	je	.L16
	mov	edx, 8
	lea	rsi, no_storeW.2023[rip]
	mov	rdi, r15
	call	strncmpiW@PLT
	test	eax, eax
	je	.L16
	movzx	eax, BYTE PTR [r14]
	mov	r15, r14
	cmp	al, 44
	jne	.L18
	movzx	eax, BYTE PTR 1[r14]
	add	r15, 1
.L18:
	test	al, al
	jne	.L10
.L9:
	mov	rdi, QWORD PTR -80[rbp]
	call	LeaveCriticalSection@PLT
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L78:
	mov	rdi, r15
	call	strlenW@PLT
	movsx	rcx, eax
	lea	r14, [r15+rcx]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L74:
	call	GetLastError@PLT
	lea	rdi, .LC2[rip]
	mov	esi, eax
	xor	eax, eax
	call	WARN@PLT
	jmp	.L20
.L71:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
.L16:
	mov	rbx, QWORD PTR FALSE[rip]
	mov	rdi, QWORD PTR -80[rbp]
	call	LeaveCriticalSection@PLT
	test	rbx, rbx
	jne	.L15
	mov	eax, DWORD PTR 56[r12]
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L76:
	mov	rsi, QWORD PTR 24[r12]
	xor	r8d, r8d
	add	rsi, QWORD PTR 32[r12]
	mov	rdi, rax
	lea	rcx, -60[rbp]
	call	WriteFile@PLT
	test	rax, rax
	je	.L79
.L26:
	mov	rdi, QWORD PTR 8[r12]
	mov	rsi, r12
	mov	rax, QWORD PTR [rdi]
	call	[QWORD PTR [rax]]
	test	rax, rax
	je	.L20
	mov	rdi, r12
	call	commit_cache_entry@PLT
	jmp	.L20
.L73:
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	WARN@PLT
	jmp	.L20
.L79:
	call	GetLastError@PLT
	lea	rdi, .LC4[rip]
	mov	esi, eax
	xor	eax, eax
	call	FIXME@PLT
	jmp	.L26
.L75:
	xor	eax, eax
	call	GetLastError@PLT
	lea	rdi, .LC3[rip]
	mov	esi, eax
	xor	eax, eax
	call	WARN@PLT
	mov	QWORD PTR 40[r12], 0
	jmp	.L20
.L77:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	create_cache_entry, .-create_cache_entry
	.section	.rodata
	.align 8
	.type	no_storeW.2023, @object
	.size	no_storeW.2023, 9
no_storeW.2023:
	.string	"no-store"
	.align 8
	.type	no_cacheW.2022, @object
	.size	no_cacheW.2022, 9
no_cacheW.2022:
	.string	"no-cache"
	.comm	szCache_Control,4,4
	.comm	TRUE,8,8
	.comm	MAX_PATH,4,4
	.comm	INVALID_HANDLE_VALUE,8,8
	.comm	INTERNET_FLAG_NO_CACHE_WRITE,4,4
	.comm	INTERNET_FLAG_NEED_FILE,4,4
	.comm	GENERIC_WRITE,4,4
	.comm	FILE_SHARE_WRITE,4,4
	.comm	FILE_SHARE_READ,4,4
	.comm	FILE_ATTRIBUTE_NORMAL,4,4
	.comm	FALSE,8,8
	.comm	CREATE_ALWAYS,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_http.c_create_cache_entry.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"INTERNET_FLAG_NEED_FILE is not supported correctly\012"
	.ascii	"\000"
	.align	2
.LC1:
	.ascii	"Could not get URL\012\000"
	.align	2
.LC2:
	.ascii	"Could not create cache entry: %08x\012\000"
	.align	2
.LC3:
	.ascii	"Could not create file: %u\012\000"
	.align	2
.LC4:
	.ascii	"WriteFile failed: %u\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	create_cache_entry, %function
create_cache_entry:
	@ 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
	ldr	r3, .L75
	mov	r5, r0
	ldr	r3, [r3]
	ldr	r0, [r0, #24]
	add	r3, r3, #8
	bic	r3, r3, #7
	mov	r9, sp
	ldr	r2, .L75+4
	sub	sp, sp, r3
	ldr	r3, .L75+8
	cmp	r0, #0
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	ldr	r4, [r2]
	add	r7, sp, #16
	beq	.L2
	bl	req_file_release
	mov	r3, #0
	str	r3, [r5, #24]
.L2:
	ldr	r0, [r5, #20]
	cmp	r0, #0
	beq	.L3
	bl	CloseHandle
	mov	r3, #0
	str	r3, [r5, #20]
.L3:
	ldr	r2, .L75+12
	ldr	r3, [r5, #28]
	ldr	r2, [r2]
	tst	r3, r2
	ldrne	r2, .L75+16
	ldrne	r4, [r2]
	cmp	r4, #0
	bne	.L67
.L5:
	ldr	r2, .L75+20
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L68
.L17:
	ldr	r3, .L75+8
	mov	sp, r9
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L69
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L68:
	ldr	r0, .L75+24
	bl	FIXME
.L12:
	mov	r0, r5
	bl	compose_request_url
	subs	r4, r0, #0
	beq	.L70
	mov	r6, #0
	ldr	r1, [r5]
	mov	r2, r6
	cmn	r1, #1
	moveq	r1, r6
	mov	r3, r7
	str	r6, [sp]
	bl	CreateUrlCacheEntryW
	cmp	r0, r6
	beq	.L71
	add	r1, r5, #24
	mov	r0, r7
	bl	create_req_file
	ldr	r3, [r5, #24]
	ldr	r0, .L75+28
	ldr	r2, .L75+32
	ldr	r1, .L75+36
	str	r4, [r3]
	ldr	r3, .L75+40
	ldr	ip, [r0]
	ldr	r2, [r2]
	ldr	r1, [r1]
	str	r6, [sp, #8]
	ldr	r3, [r3]
	orr	r2, ip, r2
	str	r3, [sp, #4]
	ldr	r3, .L75+44
	mov	r0, r7
	ldr	r3, [r3]
	str	r3, [sp]
	mov	r3, r6
	bl	CreateFileW
	ldr	r2, .L75+48
	str	r0, [r5, #20]
	ldr	r2, [r2]
	cmp	r0, r2
	beq	.L72
	ldr	r2, [r5, #8]
	cmp	r2, #0
	beq	.L17
	ldr	r3, [r5, #12]
	ldr	r1, [r5, #16]
	str	r6, [sp]
	add	r1, r1, r3
	sub	r3, fp, #44
	bl	WriteFile
	cmp	r0, #0
	beq	.L73
.L23:
	ldr	r0, [r5, #4]
	mov	r1, r5
	ldr	r3, [r0]
	ldr	r3, [r3]
	blx	r3
	cmp	r0, #0
	beq	.L17
	mov	r0, r5
	bl	commit_cache_entry
	b	.L17
.L67:
	add	r3, r5, #32
	mov	r0, r3
	str	r3, [fp, #-48]
	bl	EnterCriticalSection
	ldr	r2, .L75+52
	ldr	r3, .L75+16
	ldr	r1, [r2]
	mov	r0, r5
	mov	r2, #0
	ldr	r3, [r3]
	bl	HTTP_GetCustomHeaderIndex
	cmn	r0, #1
	beq	.L6
	ldr	r3, [r5, #36]
	ldr	r10, [r3, r0, lsl #2]
	ldrb	r2, [r10]	@ zero_extendqisi2
	cmp	r2, #0
	beq	.L6
	ldr	r6, .L75+56
	add	r8, r6, #12
.L65:
	cmp	r2, #9
	cmpne	r2, #32
	ldrbeq	r2, [r10, #1]!	@ zero_extendqisi2
	beq	.L65
	mov	r1, #44
	mov	r0, r10
	bl	strchrW
	subs	r4, r0, #0
	beq	.L74
.L9:
	mov	r2, #8
	mov	r1, r6
	mov	r0, r10
	bl	strncmpiW
	cmp	r0, #0
	beq	.L13
	mov	r0, r10
	mov	r2, #8
	mov	r1, r8
	bl	strncmpiW
	cmp	r0, #0
	beq	.L13
	ldrb	r2, [r4]	@ zero_extendqisi2
	cmp	r2, #44
	ldrbeq	r2, [r4, #1]	@ zero_extendqisi2
	movne	r10, r4
	addeq	r10, r4, #1
	cmp	r2, #0
	bne	.L65
.L6:
	ldr	r0, [fp, #-48]
	bl	LeaveCriticalSection
	b	.L12
.L74:
	mov	r0, r10
	bl	strlenW
	add	r4, r10, r0
	b	.L9
.L71:
	bl	GetLastError
	mov	r1, r0
	ldr	r0, .L75+60
	bl	WARN
	b	.L17
.L13:
	ldr	r3, .L75+16
	ldr	r0, [fp, #-48]
	ldr	r4, [r3]
	bl	LeaveCriticalSection
	cmp	r4, #0
	bne	.L12
	ldr	r3, [r5, #28]
	b	.L5
.L70:
	ldr	r0, .L75+64
	bl	WARN
	b	.L17
.L73:
	bl	GetLastError
	mov	r1, r0
	ldr	r0, .L75+68
	bl	FIXME
	b	.L23
.L72:
	bl	GetLastError
	mov	r1, r0
	ldr	r0, .L75+72
	bl	WARN
	str	r6, [r5, #20]
	b	.L17
.L69:
	bl	__stack_chk_fail
.L76:
	.align	2
.L75:
	.word	MAX_PATH
	.word	TRUE
	.word	.LC5
	.word	INTERNET_FLAG_NO_CACHE_WRITE
	.word	FALSE
	.word	INTERNET_FLAG_NEED_FILE
	.word	.LC0
	.word	FILE_SHARE_READ
	.word	FILE_SHARE_WRITE
	.word	GENERIC_WRITE
	.word	FILE_ATTRIBUTE_NORMAL
	.word	CREATE_ALWAYS
	.word	INVALID_HANDLE_VALUE
	.word	szCache_Control
	.word	.LANCHOR0
	.word	.LC2
	.word	.LC1
	.word	.LC4
	.word	.LC3
	.size	create_cache_entry, .-create_cache_entry
	.comm	szCache_Control,4,4
	.comm	TRUE,4,4
	.comm	MAX_PATH,4,4
	.comm	INVALID_HANDLE_VALUE,4,4
	.comm	INTERNET_FLAG_NO_CACHE_WRITE,4,4
	.comm	INTERNET_FLAG_NEED_FILE,4,4
	.comm	GENERIC_WRITE,4,4
	.comm	FILE_SHARE_WRITE,4,4
	.comm	FILE_SHARE_READ,4,4
	.comm	FILE_ATTRIBUTE_NORMAL,4,4
	.comm	FALSE,4,4
	.comm	CREATE_ALWAYS,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	no_cacheW.4306, %object
	.size	no_cacheW.4306, 9
no_cacheW.4306:
	.ascii	"no-cache\000"
	.space	3
	.type	no_storeW.4307, %object
	.size	no_storeW.4307, 9
no_storeW.4307:
	.ascii	"no-store\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
