	.file	"125139484.c"
	.intel_syntax noprefix
	.text
	.globl	get_substr
	.type	get_substr, @function
get_substr:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -36[rbp], edx
	mov	DWORD PTR -40[rbp], ecx
	mov	eax, DWORD PTR -36[rbp]
	mov	DWORD PTR -4[rbp], eax
	jmp	.L2
.L4:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	movzx	eax, BYTE PTR [rcx]
	mov	BYTE PTR [rdx], al
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 10
	jne	.L3
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
.L3:
	add	DWORD PTR -4[rbp], 1
.L2:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -40[rbp]
	jl	.L4
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_substr, .-get_substr
	.section	.rodata
.LC0:
	.string	"bags"
	.text
	.globl	get_bag
	.type	get_bag, @function
get_bag:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 272
	mov	QWORD PTR -264[rbp], rdi
	mov	QWORD PTR -272[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -208[rbp], 0
	mov	QWORD PTR -200[rbp], 0
	mov	QWORD PTR -192[rbp], 0
	mov	QWORD PTR -184[rbp], 0
	mov	QWORD PTR -176[rbp], 0
	mov	QWORD PTR -168[rbp], 0
	mov	QWORD PTR -160[rbp], 0
	mov	QWORD PTR -152[rbp], 0
	mov	QWORD PTR -144[rbp], 0
	mov	QWORD PTR -136[rbp], 0
	mov	QWORD PTR -128[rbp], 0
	mov	QWORD PTR -120[rbp], 0
	mov	QWORD PTR -112[rbp], 0
	mov	QWORD PTR -104[rbp], 0
	mov	QWORD PTR -96[rbp], 0
	mov	QWORD PTR -88[rbp], 0
	mov	QWORD PTR -80[rbp], 0
	mov	QWORD PTR -72[rbp], 0
	mov	QWORD PTR -64[rbp], 0
	mov	QWORD PTR -56[rbp], 0
	mov	QWORD PTR -48[rbp], 0
	mov	QWORD PTR -40[rbp], 0
	mov	QWORD PTR -32[rbp], 0
	mov	QWORD PTR -24[rbp], 0
	mov	QWORD PTR -16[rbp], 0
	mov	rdx, QWORD PTR -264[rbp]
	lea	rax, -208[rbp]
	mov	esi, 200
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	jne	.L6
	mov	eax, 0
	jmp	.L8
.L6:
	lea	rax, -208[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	strstr@PLT
	mov	QWORD PTR -248[rbp], rax
	mov	QWORD PTR -240[rbp], 0
	mov	QWORD PTR -232[rbp], 0
	mov	QWORD PTR -224[rbp], 0
	mov	DWORD PTR -216[rbp], 0
	mov	WORD PTR -212[rbp], 0
	lea	rdx, -208[rbp]
	mov	rax, QWORD PTR -248[rbp]
	sub	rax, rdx
	mov	DWORD PTR -256[rbp], eax
	mov	edx, DWORD PTR -256[rbp]
	lea	rsi, -208[rbp]
	lea	rax, -240[rbp]
	mov	ecx, edx
	mov	edx, 0
	mov	rdi, rax
	call	get_substr
	mov	eax, DWORD PTR -256[rbp]
	add	eax, 13
	mov	DWORD PTR -252[rbp], eax
	lea	rax, -208[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	ecx, eax
	mov	edx, DWORD PTR -252[rbp]
	lea	rsi, -208[rbp]
	lea	rax, -208[rbp]
	mov	rdi, rax
	call	get_substr
	mov	rax, QWORD PTR -272[rbp]
	lea	rdx, -240[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	rax, QWORD PTR -272[rbp]
	lea	rdx, 30[rax]
	lea	rax, -208[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	strcpy@PLT
	mov	eax, 1
.L8:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_bag, .-get_bag
	.globl	in_valid
	.type	in_valid, @function
in_valid:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -4[rbp], 0
	jmp	.L11
.L14:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rax, 16[rax]
	lea	rdx, [rax+rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L12
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L13
.L12:
	add	DWORD PTR -4[rbp], 1
.L11:
	mov	eax, DWORD PTR 21616[rbp]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L14
	mov	eax, -1
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	in_valid, .-in_valid
	.section	.rodata
.LC1:
	.string	","
.LC2:
	.string	"bag"
	.text
	.globl	get_bag_info
	.type	get_bag_info, @function
get_bag_info:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 72
	.cfi_offset 3, -24
	mov	QWORD PTR -72[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -72[rbp]
	lea	rsi, 16[rbp]
	mov	rdi, rax
	call	strcpy@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	DWORD PTR 32[rax], 1
	lea	rax, 46[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	strtok@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	DWORD PTR -60[rbp], 0
	mov	DWORD PTR -56[rbp], 0
	jmp	.L16
.L22:
	mov	QWORD PTR -48[rbp], 0
	lea	rcx, -48[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 10
	mov	rsi, rcx
	mov	rdi, rax
	call	strtol@PLT
	mov	DWORD PTR -52[rbp], eax
	mov	rax, QWORD PTR -48[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	strstr@PLT
	mov	QWORD PTR -32[rbp], rax
	cmp	DWORD PTR -52[rbp], 0
	jne	.L17
	mov	eax, 1
	jmp	.L21
.L17:
	mov	rdx, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -32[rbp]
	sub	rax, rdx
	sub	eax, 1
	mov	edx, eax
	mov	rsi, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	ecx, edx
	mov	edx, 1
	mov	rdi, rax
	call	get_substr
	mov	rbx, QWORD PTR -48[rbp]
	sub	rsp, 8
	sub	rsp, 21608
	mov	rax, rsp
	mov	rcx, rax
	lea	rax, 248[rbp]
	mov	edx, 21604
	mov	rsi, rax
	mov	rdi, rcx
	call	memcpy@PLT
	mov	rdi, rbx
	call	in_valid
	add	rsp, 21616
	mov	DWORD PTR -56[rbp], eax
	cmp	DWORD PTR -56[rbp], 0
	js	.L19
	mov	eax, DWORD PTR -56[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rax, 16[rax]
	add	rax, rbp
	add	rax, 264
	mov	eax, DWORD PTR [rax]
	imul	eax, DWORD PTR -52[rbp]
	add	DWORD PTR -60[rbp], eax
	jmp	.L24
.L19:
	mov	eax, 0
	jmp	.L21
.L24:
	lea	rsi, .LC1[rip]
	mov	edi, 0
	call	strtok@PLT
	mov	QWORD PTR -40[rbp], rax
.L16:
	cmp	QWORD PTR -40[rbp], 0
	jne	.L22
	mov	rax, QWORD PTR -72[rbp]
	mov	edx, DWORD PTR 32[rax]
	mov	eax, DWORD PTR -60[rbp]
	add	edx, eax
	mov	rax, QWORD PTR -72[rbp]
	mov	DWORD PTR 32[rax], edx
	mov	eax, 1
.L21:
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	get_bag_info, .-get_bag_info
	.section	.rodata
.LC3:
	.string	"r"
.LC4:
	.string	"./day7.dat"
.LC5:
	.string	"File could not be opened!\n"
.LC6:
	.string	"shiny gold"
.LC7:
	.string	"Contains bags: %d\n"
	.align 8
.LC8:
	.string	"Could not get to shiny gold bag, was the input correct?\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	lea	r11, -20480[rsp]
.LPSRL0:
	sub	rsp, 4096
	or	DWORD PTR [rsp], 0
	cmp	rsp, r11
	jne	.LPSRL0
	sub	rsp, 1440
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	lea	rsi, .LC3[rip]
	lea	rdi, .LC4[rip]
	call	fopen@PLT
	mov	QWORD PTR -21928[rbp], rax
	cmp	QWORD PTR -21928[rbp], 0
	jne	.L26
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L33
.L26:
	lea	rax, -21632[rbp]
	mov	edx, 21604
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -21932[rbp], 0
.L32:
	mov	eax, DWORD PTR -32[rbp]
	mov	DWORD PTR -21932[rbp], eax
	mov	rax, QWORD PTR -21928[rbp]
	mov	rdi, rax
	call	rewind@PLT
	mov	QWORD PTR -21872[rbp], 0
	mov	QWORD PTR -21864[rbp], 0
	mov	QWORD PTR -21856[rbp], 0
	mov	DWORD PTR -21848[rbp], 0
	mov	WORD PTR -21844[rbp], 0
	mov	QWORD PTR -21842[rbp], 0
	mov	QWORD PTR -21834[rbp], 0
	mov	QWORD PTR -21826[rbp], 0
	mov	QWORD PTR -21818[rbp], 0
	mov	QWORD PTR -21810[rbp], 0
	mov	QWORD PTR -21802[rbp], 0
	mov	QWORD PTR -21794[rbp], 0
	mov	QWORD PTR -21786[rbp], 0
	mov	QWORD PTR -21778[rbp], 0
	mov	QWORD PTR -21770[rbp], 0
	mov	QWORD PTR -21762[rbp], 0
	mov	QWORD PTR -21754[rbp], 0
	mov	QWORD PTR -21746[rbp], 0
	mov	QWORD PTR -21738[rbp], 0
	mov	QWORD PTR -21730[rbp], 0
	mov	QWORD PTR -21722[rbp], 0
	mov	QWORD PTR -21714[rbp], 0
	mov	QWORD PTR -21706[rbp], 0
	mov	QWORD PTR -21698[rbp], 0
	mov	QWORD PTR -21690[rbp], 0
	mov	QWORD PTR -21682[rbp], 0
	mov	QWORD PTR -21674[rbp], 0
	mov	QWORD PTR -21666[rbp], 0
	mov	QWORD PTR -21658[rbp], 0
	mov	QWORD PTR -21650[rbp], 0
	jmp	.L28
.L31:
	lea	r12, -21920[rbp]
	sub	rsp, 21608
	mov	rax, rsp
	mov	rcx, rax
	lea	rax, -21632[rbp]
	mov	edx, 21604
	sub	rsp, 8
	mov	rsi, rax
	mov	rdi, rcx
	call	memcpy@PLT
	add	rsp, 8
	sub	rsp, 232
	mov	rax, rsp
	mov	rcx, QWORD PTR -21872[rbp]
	mov	rbx, QWORD PTR -21864[rbp]
	mov	QWORD PTR [rax], rcx
	mov	QWORD PTR 8[rax], rbx
	mov	rcx, QWORD PTR -21856[rbp]
	mov	rbx, QWORD PTR -21848[rbp]
	mov	QWORD PTR 16[rax], rcx
	mov	QWORD PTR 24[rax], rbx
	mov	rcx, QWORD PTR -21840[rbp]
	mov	rbx, QWORD PTR -21832[rbp]
	mov	QWORD PTR 32[rax], rcx
	mov	QWORD PTR 40[rax], rbx
	mov	rcx, QWORD PTR -21824[rbp]
	mov	rbx, QWORD PTR -21816[rbp]
	mov	QWORD PTR 48[rax], rcx
	mov	QWORD PTR 56[rax], rbx
	mov	rcx, QWORD PTR -21808[rbp]
	mov	rbx, QWORD PTR -21800[rbp]
	mov	QWORD PTR 64[rax], rcx
	mov	QWORD PTR 72[rax], rbx
	mov	rcx, QWORD PTR -21792[rbp]
	mov	rbx, QWORD PTR -21784[rbp]
	mov	QWORD PTR 80[rax], rcx
	mov	QWORD PTR 88[rax], rbx
	mov	rcx, QWORD PTR -21776[rbp]
	mov	rbx, QWORD PTR -21768[rbp]
	mov	QWORD PTR 96[rax], rcx
	mov	QWORD PTR 104[rax], rbx
	mov	rcx, QWORD PTR -21760[rbp]
	mov	rbx, QWORD PTR -21752[rbp]
	mov	QWORD PTR 112[rax], rcx
	mov	QWORD PTR 120[rax], rbx
	mov	rcx, QWORD PTR -21744[rbp]
	mov	rbx, QWORD PTR -21736[rbp]
	mov	QWORD PTR 128[rax], rcx
	mov	QWORD PTR 136[rax], rbx
	mov	rcx, QWORD PTR -21728[rbp]
	mov	rbx, QWORD PTR -21720[rbp]
	mov	QWORD PTR 144[rax], rcx
	mov	QWORD PTR 152[rax], rbx
	mov	rcx, QWORD PTR -21712[rbp]
	mov	rbx, QWORD PTR -21704[rbp]
	mov	QWORD PTR 160[rax], rcx
	mov	QWORD PTR 168[rax], rbx
	mov	rcx, QWORD PTR -21696[rbp]
	mov	rbx, QWORD PTR -21688[rbp]
	mov	QWORD PTR 176[rax], rcx
	mov	QWORD PTR 184[rax], rbx
	mov	rcx, QWORD PTR -21680[rbp]
	mov	rbx, QWORD PTR -21672[rbp]
	mov	QWORD PTR 192[rax], rcx
	mov	QWORD PTR 200[rax], rbx
	mov	rcx, QWORD PTR -21664[rbp]
	mov	rbx, QWORD PTR -21656[rbp]
	mov	QWORD PTR 208[rax], rcx
	mov	QWORD PTR 216[rax], rbx
	mov	edx, DWORD PTR -21648[rbp]
	mov	DWORD PTR 224[rax], edx
	movzx	edx, WORD PTR -21644[rbp]
	mov	WORD PTR 228[rax], dx
	mov	rdi, r12
	call	get_bag_info
	add	rsp, 21840
	test	al, al
	je	.L28
	lea	rbx, -21920[rbp]
	sub	rsp, 8
	sub	rsp, 21608
	mov	rax, rsp
	mov	rcx, rax
	lea	rax, -21632[rbp]
	mov	edx, 21604
	mov	rsi, rax
	mov	rdi, rcx
	call	memcpy@PLT
	mov	rdi, rbx
	call	in_valid
	add	rsp, 21616
	cmp	eax, -1
	jne	.L28
	lea	rax, -21920[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L30
	mov	eax, DWORD PTR -21888[rbp]
	sub	eax, 1
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -21928[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
	jmp	.L33
.L30:
	mov	eax, DWORD PTR -32[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -32[rbp], edx
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 2
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 21616
	mov	rcx, QWORD PTR -21920[rbp]
	mov	rbx, QWORD PTR -21912[rbp]
	mov	QWORD PTR [rax], rcx
	mov	QWORD PTR 8[rax], rbx
	mov	rcx, QWORD PTR -21904[rbp]
	mov	rbx, QWORD PTR -21896[rbp]
	mov	QWORD PTR 16[rax], rcx
	mov	QWORD PTR 24[rax], rbx
	mov	edx, DWORD PTR -21888[rbp]
	mov	DWORD PTR 32[rax], edx
.L28:
	lea	rdx, -21872[rbp]
	mov	rax, QWORD PTR -21928[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	get_bag
	test	al, al
	jne	.L31
	mov	eax, DWORD PTR -32[rbp]
	cmp	DWORD PTR -21932[rbp], eax
	jne	.L32
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 56
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -21928[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 1
.L33:
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	lea	rsp, -16[rbp]
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"125139484.c"
	.text
	.align	2
	.global	get_substr
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_substr, %function
get_substr:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-8]
	b	.L2
.L4:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-20]
	add	r2, r2, r3
	ldr	r1, [fp, #-8]
	ldr	r3, [fp, #-24]
	sub	r3, r1, r3
	mov	r1, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, r1
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L3
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-24]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, r2
	mov	r2, #0
	strb	r2, [r3]
.L3:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	blt	.L4
	ldr	r3, [fp, #-28]
	sub	r3, r3, #1
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	get_substr, .-get_substr
	.section	.rodata
	.align	2
.LC1:
	.ascii	"bags\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	get_bag
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_bag, %function
get_bag:
	@ args = 0, pretend = 0, frame = 256
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #256
	str	r0, [fp, #-256]
	str	r1, [fp, #-260]
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-208]
	sub	r3, fp, #204
	mov	r2, #196
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #208
	ldr	r2, [fp, #-256]
	mov	r1, #200
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L6
	mov	r3, #0
	b	.L8
.L6:
	sub	r3, fp, #208
	ldr	r1, .L10+4
	mov	r0, r3
	bl	strstr
	str	r0, [fp, #-252]
	mov	r3, #0
	str	r3, [fp, #-240]
	sub	r3, fp, #236
	mov	r2, #0
	str	r2, [r3]
	str	r2, [r3, #4]
	str	r2, [r3, #8]
	str	r2, [r3, #12]
	str	r2, [r3, #16]
	str	r2, [r3, #20]
	strh	r2, [r3, #24]	@ movhi
	sub	r3, fp, #208
	ldr	r2, [fp, #-252]
	sub	r3, r2, r3
	str	r3, [fp, #-248]
	sub	r1, fp, #208
	sub	r0, fp, #240
	ldr	r3, [fp, #-248]
	mov	r2, #0
	bl	get_substr
	ldr	r3, [fp, #-248]
	add	r3, r3, #13
	str	r3, [fp, #-244]
	sub	r3, fp, #208
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r1, fp, #208
	sub	r0, fp, #208
	ldr	r2, [fp, #-244]
	bl	get_substr
	ldr	r3, [fp, #-260]
	sub	r2, fp, #240
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	ldr	r3, [fp, #-260]
	add	r3, r3, #30
	sub	r2, fp, #208
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	mov	r3, #1
.L8:
	ldr	r2, .L10
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC2
	.word	.LC1
	.size	get_bag, .-get_bag
	.align	2
	.global	in_valid
	.syntax unified
	.arm
	.fpu softvfp
	.type	in_valid, %function
in_valid:
	@ args = 21608, pretend = 16, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	sub	sp, sp, #16
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	add	r0, fp, #8
	stm	r0, {r1, r2, r3}
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L13
.L16:
	add	r1, fp, #8
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L14
	ldr	r3, [fp, #-8]
	b	.L15
.L14:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L13:
	add	r3, fp, #20480
	add	r3, r3, #4
	ldr	r3, [r3, #1124]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L16
	mvn	r3, #0
.L15:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, lr}
	add	sp, sp, #16
	bx	lr
	.size	in_valid, .-in_valid
	.section	.rodata
	.align	2
.LC3:
	.ascii	",\000"
	.align	2
.LC4:
	.ascii	"bag\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	get_bag_info
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_bag_info, %function
get_bag_info:
	@ args = 21840, pretend = 16, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	sub	sp, sp, #16
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #21504
	sub	sp, sp, #132
	add	ip, fp, #4
	stm	ip, {r0, r1, r2, r3}
	ldr	r3, [fp, #236]
	str	r3, [fp, #-48]
	ldr	r3, .L27
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-48]
	add	r2, fp, #4
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	ldr	r3, [fp, #-48]
	mov	r2, #1
	str	r2, [r3, #32]
	add	r3, fp, #34
	ldr	r1, .L27+4
	mov	r0, r3
	bl	strtok
	str	r0, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L18
.L24:
	mov	r3, #0
	str	r3, [fp, #-40]
	sub	r3, fp, #40
	mov	r2, #10
	mov	r1, r3
	ldr	r0, [fp, #-36]
	bl	strtol
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-40]
	ldr	r1, .L27+8
	mov	r0, r3
	bl	strstr
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L19
	mov	r3, #1
	b	.L23
.L19:
	ldr	r0, [fp, #-40]
	ldr	r1, [fp, #-40]
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-20]
	sub	r3, r2, r3
	sub	r3, r3, #1
	mov	r2, #1
	bl	get_substr
	ldr	r4, [fp, #-40]
	mov	r0, sp
	add	r3, fp, #252
	ldr	r2, .L27+12
	mov	r1, r3
	bl	memcpy
	add	r3, fp, #240
	ldm	r3, {r1, r2, r3}
	mov	r0, r4
	bl	in_valid
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	blt	.L21
	ldr	r2, [fp, #-28]
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r2, fp, #4
	add	r3, r2, r3
	add	r3, r3, #268
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	mul	r3, r2, r3
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	str	r3, [fp, #-32]
	b	.L26
.L21:
	mov	r3, #0
	b	.L23
.L26:
	ldr	r1, .L27+4
	mov	r0, #0
	bl	strtok
	str	r0, [fp, #-36]
.L18:
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bne	.L24
	ldr	r3, [fp, #-48]
	ldr	r2, [r3, #32]
	ldr	r3, [fp, #-32]
	add	r2, r2, r3
	ldr	r3, [fp, #-48]
	str	r2, [r3, #32]
	mov	r3, #1
.L23:
	ldr	r2, .L27
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L25
	bl	__stack_chk_fail
.L25:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, lr}
	add	sp, sp, #16
	bx	lr
.L28:
	.align	2
.L27:
	.word	.LC5
	.word	.LC3
	.word	.LC4
	.word	21592
	.size	get_bag_info, .-get_bag_info
	.section	.rodata
	.align	2
.LC6:
	.ascii	"r\000"
	.align	2
.LC7:
	.ascii	"./day7.dat\000"
	.align	2
.LC8:
	.ascii	"File could not be opened!\012\000"
	.align	2
.LC9:
	.ascii	"shiny gold\000"
	.align	2
.LC10:
	.ascii	"Contains bags: %d\012\000"
	.align	2
.LC11:
	.ascii	"Could not get to shiny gold bag, was the input corr"
	.ascii	"ect?\012\000"
	.align	2
.LC0:
	.ascii	"\000"
	.space	29
	.ascii	"\000"
	.space	199
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 21888
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #43520
	sub	sp, sp, #192
	ldr	r3, .L39
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #20480
	sub	r3, r3, #12
	mov	r4, r3
	ldr	r1, .L39+4
	ldr	r0, .L39+8
	bl	fopen
	str	r0, [r4, #-1404]
	sub	r3, fp, #20480
	sub	r3, r3, #12
	ldr	r3, [r3, #-1404]
	cmp	r3, #0
	bne	.L30
	ldr	r3, .L39+12
	ldr	r3, [r3]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L39+16
	bl	fwrite
	mov	r3, #1
	b	.L37
.L30:
	sub	r3, fp, #20480
	sub	r3, r3, #12
	sub	r3, r3, #1120
	sub	r3, r3, #8
	ldr	r2, .L39+20
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #20480
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1400]
.L36:
	sub	r3, fp, #20480
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #20480
	sub	r3, r3, #12
	add	r3, r3, #16384
	ldr	r3, [r3, #4088]
	str	r3, [r2, #-1400]
	sub	r3, fp, #20480
	sub	r3, r3, #12
	ldr	r0, [r3, #-1404]
	bl	rewind
	sub	r3, fp, #20480
	sub	r3, r3, #12
	ldr	r2, .L39+24
	sub	r3, r3, #1360
	mov	r1, r2
	mov	r2, #230
	mov	r0, r3
	bl	memcpy
	b	.L32
.L35:
	sub	r3, fp, #20480
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #20480
	sub	r3, r3, #12
	add	r0, sp, #220
	sub	r3, r3, #1120
	sub	r3, r3, #8
	ldr	r2, .L39+20
	mov	r1, r3
	bl	memcpy
	sub	r3, fp, #21760
	sub	r3, r3, #12
	sub	r3, r3, #116
	str	r3, [sp, #216]
	mov	r0, sp
	sub	r3, r4, #1344
	mov	r2, #214
	mov	r1, r3
	bl	memcpy
	sub	r3, r4, #1360
	ldm	r3, {r0, r1, r2, r3}
	bl	get_bag_info
	mov	r3, r0
	cmp	r3, #0
	beq	.L32
	sub	r3, fp, #20480
	sub	r3, r3, #12
	mov	r5, r3
	sub	r4, fp, #21760
	sub	r4, r4, #12
	sub	r4, r4, #116
	mov	r0, sp
	sub	r3, r5, #1104
	sub	r3, r3, #12
	ldr	r2, .L39+28
	mov	r1, r3
	bl	memcpy
	sub	r3, r5, #1120
	sub	r3, r3, #8
	ldm	r3, {r1, r2, r3}
	mov	r0, r4
	bl	in_valid
	mov	r3, r0
	cmn	r3, #1
	bne	.L32
	sub	r3, fp, #21760
	sub	r3, r3, #12
	sub	r3, r3, #116
	ldr	r1, .L39+32
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L34
	sub	r3, fp, #20480
	sub	r3, r3, #12
	ldr	r3, [r3, #-1364]
	sub	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L39+36
	bl	printf
	sub	r3, fp, #20480
	sub	r3, r3, #12
	ldr	r0, [r3, #-1404]
	bl	fclose
	mov	r3, #0
	b	.L37
.L34:
	sub	r3, fp, #20480
	sub	r3, r3, #12
	add	r3, r3, #16384
	ldr	r2, [r3, #4088]
	add	r3, r2, #1
	sub	r1, fp, #20480
	sub	r1, r1, #12
	add	r1, r1, #16384
	str	r3, [r1, #4088]
	sub	r3, fp, #20480
	sub	r3, r3, #12
	mov	r1, r3
	mov	r3, r2
	lsl	r3, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	sub	r3, r3, #1120
	sub	r3, r3, #8
	sub	r2, fp, #20480
	sub	r2, r2, #12
	mov	lr, r3
	sub	ip, r2, #1392
	sub	ip, ip, #4
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldr	r3, [ip]
	str	r3, [lr]
.L32:
	sub	r3, fp, #21760
	sub	r3, r3, #12
	sub	r3, r3, #80
	sub	r2, fp, #20480
	sub	r2, r2, #12
	mov	r1, r3
	ldr	r0, [r2, #-1404]
	bl	get_bag
	mov	r3, r0
	cmp	r3, #0
	bne	.L35
	sub	r3, fp, #20480
	sub	r3, r3, #12
	add	r3, r3, #16384
	ldr	r3, [r3, #4088]
	sub	r2, fp, #20480
	sub	r2, r2, #12
	ldr	r2, [r2, #-1400]
	cmp	r2, r3
	bne	.L36
	ldr	r3, .L39+12
	ldr	r3, [r3]
	mov	r2, #56
	mov	r1, #1
	ldr	r0, .L39+40
	bl	fwrite
	sub	r3, fp, #20480
	sub	r3, r3, #12
	ldr	r0, [r3, #-1404]
	bl	fclose
	mov	r3, #1
.L37:
	ldr	r2, .L39
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L38
	bl	__stack_chk_fail
.L38:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L40:
	.align	2
.L39:
	.word	.LC12
	.word	.LC6
	.word	.LC7
	.word	stderr
	.word	.LC8
	.word	21604
	.word	.LC0
	.word	21592
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
