	.file	"extr_twitch.c_load_ingests.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"ingests"
.LC1:
	.string	"name"
.LC2:
	.string	"url_template"
.LC3:
	.string	"deprecated"
.LC4:
	.string	"depracated"
.LC5:
	.string	""
.LC6:
	.string	"/{stream_key}"
.LC7:
	.string	"twitch_ingests.json"
.LC8:
	.string	"twitch_ingests.new.json"
	.text
	.p2align 4
	.type	load_ingests, @function
load_ingests:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xor	edx, edx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xor	r13d, r13d
	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, 72
	.cfi_def_cfa_offset 128
	mov	DWORD PTR 12[rsp], esi
	xor	esi, esi
	mov	QWORD PTR 16[rsp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	call	json_loads@PLT
	test	rax, rax
	je	.L1
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	r12, rax
	call	json_object_get@PLT
	mov	rbx, rax
	test	rax, rax
	je	.L3
	mov	rdi, rax
	call	json_array_size@PLT
	mov	r13, rax
	cmp	rax, 1
	ja	.L4
	cmp	QWORD PTR cur_ingests[rip], 0
	jne	.L3
	xor	eax, eax
	call	free_ingests@PLT
	test	r13, r13
	je	.L5
.L10:
	lea	rax, 36[rsp]
	xor	r15d, r15d
	mov	QWORD PTR 24[rsp], rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	add	r15, 1
	cmp	r13, r15
	je	.L5
.L8:
	mov	rsi, r15
	mov	rdi, rbx
	call	json_array_get@PLT
	lea	rsi, .LC1[rip]
	mov	r14, rax
	mov	rdi, rax
	call	json_object_get@PLT
	mov	rdi, r14
	lea	rsi, .LC2[rip]
	mov	rbp, rax
	call	json_object_get@PLT
	mov	DWORD PTR 52[rsp], 0
	mov	QWORD PTR 44[rsp], 0
	mov	rdi, rax
	mov	QWORD PTR 36[rsp], 0
	test	rbp, rbp
	je	.L7
	test	rax, rax
	je	.L7
	call	json_string_value@PLT
	mov	rdi, rbp
	mov	r14, rax
	call	json_string_value@PLT
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	rbp, rax
	call	strstr@PLT
	test	rax, rax
	jne	.L7
	lea	rsi, .LC4[rip]
	mov	rdi, rbp
	call	strstr@PLT
	test	rax, rax
	jne	.L7
	mov	rsi, r14
	mov	r14, QWORD PTR 24[rsp]
	add	r15, 1
	mov	rdi, r14
	call	dstr_copy@PLT
	lea	rdx, .LC5[rip]
	lea	rsi, .LC6[rip]
	mov	rdi, r14
	call	dstr_replace@PLT
	mov	rdi, rbp
	call	bstrdup@PLT
	mov	rdi, QWORD PTR cur_ingests[rip]
	lea	rsi, 44[rsp]
	mov	DWORD PTR 48[rsp], eax
	mov	eax, DWORD PTR 36[rsp]
	mov	DWORD PTR 44[rsp], eax
	call	da_push_back@PLT
	cmp	r13, r15
	jne	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	QWORD PTR cur_ingests[rip], 0
	je	.L3
	mov	eax, DWORD PTR 12[rsp]
	mov	r13d, 1
	test	eax, eax
	je	.L9
	lea	rdi, .LC7[rip]
	call	obs_module_config_path@PLT
	lea	rdi, .LC8[rip]
	mov	r14, rax
	call	obs_module_config_path@PLT
	mov	rbx, QWORD PTR 16[rsp]
	mov	rbp, rax
	mov	rdi, rbx
	call	strlen@PLT
	xor	ecx, ecx
	mov	rsi, rbx
	mov	rdi, rbp
	mov	edx, eax
	call	os_quick_write_utf8_file@PLT
	xor	edx, edx
	mov	rsi, rbp
	mov	rdi, r14
	call	os_safe_replace@PLT
	mov	rdi, r14
	call	bfree@PLT
	mov	rdi, rbp
	call	bfree@PLT
	mov	rdi, r12
	call	json_decref@PLT
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR 56[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L26
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	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
.L3:
	.cfi_restore_state
	xor	r13d, r13d
.L9:
	mov	rdi, r12
	call	json_decref@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	xor	eax, eax
	call	free_ingests@PLT
	jmp	.L10
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	load_ingests, .-load_ingests
	.comm	cur_ingests,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_twitch.c_load_ingests.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"ingests\000"
	.align	2
.LC1:
	.ascii	"name\000"
	.align	2
.LC2:
	.ascii	"url_template\000"
	.align	2
.LC3:
	.ascii	"deprecated\000"
	.align	2
.LC4:
	.ascii	"depracated\000"
	.align	2
.LC5:
	.ascii	"\000"
	.align	2
.LC6:
	.ascii	"/{stream_key}\000"
	.align	2
.LC7:
	.ascii	"twitch_ingests.json\000"
	.align	2
.LC8:
	.ascii	"twitch_ingests.new.json\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	load_ingests, %function
load_ingests:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, r1
	mov	r2, #0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #44
	str	r3, [sp, #4]
	ldr	r3, .L27
	mov	r1, r2
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	str	r0, [sp, #8]
	bl	json_loads
	subs	r3, r0, #0
	str	r3, [sp]
	beq	.L12
	ldr	r1, .L27+4
	bl	json_object_get
	subs	r4, r0, #0
	beq	.L3
	bl	json_array_size
	cmp	r0, #1
	mov	r6, r0
	bhi	.L4
	ldr	r3, .L27+8
	str	r3, [sp, #12]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L3
	bl	free_ingests
	cmp	r6, #0
	beq	.L5
.L10:
	mov	r8, #0
	ldr	r10, .L27+12
	ldr	r9, .L27+16
	ldr	fp, .L27+20
	b	.L8
.L7:
	add	r8, r8, #1
	cmp	r6, r8
	beq	.L5
.L8:
	mov	r1, r8
	mov	r0, r4
	bl	json_array_get
	mov	r1, r10
	mov	r7, r0
	bl	json_object_get
	mov	r1, r9
	mov	r5, r0
	mov	r0, r7
	bl	json_object_get
	mov	r3, #0
	cmp	r0, #0
	cmpne	r5, #0
	str	r3, [sp, #24]
	str	r3, [sp, #28]
	str	r3, [sp, #32]
	str	r3, [sp, #16]
	str	r3, [sp, #20]
	beq	.L7
	bl	json_string_value
	mov	r7, r0
	mov	r0, r5
	bl	json_string_value
	mov	r1, fp
	mov	r5, r0
	bl	strstr
	cmp	r0, #0
	bne	.L7
	mov	r0, r5
	ldr	r1, .L27+24
	bl	strstr
	cmp	r0, #0
	bne	.L7
	mov	r1, r7
	add	r0, sp, #16
	bl	dstr_copy
	ldr	r2, .L27+28
	ldr	r1, .L27+32
	add	r0, sp, #16
	bl	dstr_replace
	mov	r0, r5
	bl	bstrdup
	mov	r2, r0
	ldr	r0, [sp, #12]
	ldr	r3, [sp, #16]
	ldr	r0, [r0]
	add	r1, sp, #24
	add	r8, r8, #1
	str	r2, [sp, #28]
	str	r3, [sp, #24]
	bl	da_push_back
	cmp	r6, r8
	bne	.L8
.L5:
	ldr	r3, [sp, #12]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L3
	ldr	r3, [sp, #4]
	cmp	r3, #0
	moveq	r4, #1
	beq	.L9
	ldr	r0, .L27+36
	bl	obs_module_config_path
	mov	r5, r0
	ldr	r0, .L27+40
	bl	obs_module_config_path
	ldr	r6, [sp, #8]
	mov	r4, r0
	mov	r0, r6
	bl	strlen
	mov	r3, #0
	mov	r2, r0
	mov	r1, r6
	mov	r0, r4
	bl	os_quick_write_utf8_file
	mov	r1, r4
	mov	r2, #0
	mov	r0, r5
	bl	os_safe_replace
	mov	r0, r5
	bl	bfree
	mov	r0, r4
	bl	bfree
	mov	r4, #1
	b	.L9
.L3:
	mov	r4, #0
.L9:
	ldr	r0, [sp]
	bl	json_decref
.L1:
	ldr	r3, .L27
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L26
	mov	r0, r4
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	ldr	r4, [sp]
	b	.L1
.L4:
	bl	free_ingests
	ldr	r3, .L27+8
	str	r3, [sp, #12]
	b	.L10
.L26:
	bl	__stack_chk_fail
.L28:
	.align	2
.L27:
	.word	.LC9
	.word	.LC0
	.word	cur_ingests
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	load_ingests, .-load_ingests
	.comm	cur_ingests,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
