// File: /workspace/github_c_makefile_star2_O0/FirestonnneTFM[P]tfm_key_parser/src/main_dumper.cpp
// Function: main
int main(int argc, char **argv) {
	std::ios_base::sync_with_stdio(true);
	try {
		if (argc < 2) {
			fatal("Needs input file name");
		}
		if (argc < 3) {
			fatal("Needs output file name");
		}
		init_as3_op();
		swf_file *swf = new swf_file(argv[1]);
		swf_tag tags[12];
		swf_tag_DefineBinaryData btags[12];
		swf->get_tags(87, tags, 12);
		for (int i = 0; i < 12; ++i) {
			btags[i] = swf_tag_DefineBinaryData(tags + i);
			if (btags[i].ch_id != i + 1)
				fatal("Tag and position mismatch");
		}
		swf->get_tags(76, tags, 1);
		swf_tag_SymbolClass sym(tags);
		char *order[12];
		go(order);
		char *unorder[12];
		for (int i = 0; i < 12; ++i) {
			unorder[sym.ch_ids[i] - 1] = prune(sym.names[i]);
		}
		FILE *out_file = fopen(argv[2], "wb");
		for (int i = 0; i < 12; ++i) {
			for (int j = 0; j < 12; ++j) {
				if (strcmp(order[i], unorder[j]) == 0) {
					fwrite(btags[j].binary_data, 1, btags[j].length, out_file);
				}
			}
		}
		fclose(out_file);
		for (int i = 0; i < 12; ++i) {
			delete [] order[i];
		}
		delete swf;
		return 0;
	} catch (fatal_error e) {
		e.print();
	} catch (const char *e) {
		std::cout << "DEPRECATED -- instead of throwing string, use macro"<< std::endl;
		fprintf(stderr, "Fatal: %s\n", e);
		return 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3d0, %rsp            # imm = 0x3D0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, %edi
callq 0x20c0
cmpl $0x2, -0x8(%rbp)
jge 0x92c4
movl $0x18, %edi
callq 0x20e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x358(%rbp)
leaq 0x144a(%rip), %rsi      # 0xa6b1
leaq 0x142f(%rip), %rdx      # 0xa69d
movl $0x5f, %ecx
callq 0x2f30
jmp 0x927a
movq -0x358(%rbp), %rdi
leaq 0x5b00(%rip), %rsi      # 0xed88
xorl %eax, %eax
movl %eax, %edx
callq 0x22b0
jmp 0x98af
movq -0x358(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2110
jmp 0x962a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x962a
cmpl $0x3, -0x8(%rbp)
jge 0x9334
movl $0x18, %edi
callq 0x20e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x360(%rbp)
leaq 0x13df(%rip), %rsi      # 0xa6c7
leaq 0x13ae(%rip), %rdx      # 0xa69d
movl $0x62, %ecx
callq 0x2f30
jmp 0x92fb
movq -0x360(%rbp), %rdi
leaq 0x5a7f(%rip), %rsi      # 0xed88
xorl %eax, %eax
movl %eax, %edx
callq 0x22b0
jmp 0x98af
movq -0x360(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2110
jmp 0x962a
callq 0x4770
jmp 0x933b
movl $0x30, %edi
callq 0x2190
movq %rax, -0x368(%rbp)
jmp 0x934e
movq -0x368(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x7740
jmp 0x9364
movq -0x368(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0xf0(%rbp), %rax
movq %rax, %rcx
addq $0xc0, %rcx
movq %rcx, -0x378(%rbp)
movq %rax, -0x370(%rbp)
movq -0x370(%rbp), %rdi
movq %rdi, -0x380(%rbp)
callq 0x89d0
jmp 0x93a3
movq -0x378(%rbp), %rcx
movq -0x380(%rbp), %rax
addq $0x10, %rax
cmpq %rcx, %rax
movq %rax, -0x370(%rbp)
jne 0x938e
leaq -0x210(%rbp), %rax
movq %rax, %rcx
addq $0x120, %rcx            # imm = 0x120
movq %rcx, -0x390(%rbp)
movq %rax, -0x388(%rbp)
movq -0x388(%rbp), %rdi
movq %rdi, -0x398(%rbp)
callq 0x2890
jmp 0x93f5
movq -0x390(%rbp), %rcx
movq -0x398(%rbp), %rax
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x388(%rbp)
jne 0x93e0
movq -0x28(%rbp), %rdi
movl $0x57, %esi
leaq -0xf0(%rbp), %rdx
movl $0xc, %ecx
callq 0x7c80
jmp 0x942f
movl $0x0, -0x214(%rbp)
cmpl $0xc, -0x214(%rbp)
jge 0x9565
movslq -0x214(%rbp), %rax
shlq $0x4, %rax
leaq -0xf0(%rbp,%rax), %rsi
leaq -0x230(%rbp), %rdi
callq 0x28c0
jmp 0x9467
movslq -0x214(%rbp), %rcx
leaq -0x210(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x230(%rbp), %rcx
movq %rcx, (%rax)
movq -0x228(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl -0x220(%rbp), %ecx
movl %ecx, 0x10(%rax)
movslq -0x214(%rbp), %rcx
leaq -0x210(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzwl (%rax), %eax
movl -0x214(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
je 0x954f
movl $0x18, %edi
callq 0x20e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x3a0(%rbp)
leaq 0x11fd(%rip), %rsi      # 0xa6de
leaq 0x11b5(%rip), %rdx      # 0xa69d
movl $0x6c, %ecx
callq 0x2f30
jmp 0x94f4
movq -0x3a0(%rbp), %rdi
leaq 0x5886(%rip), %rsi      # 0xed88
xorl %eax, %eax
movl %eax, %edx
callq 0x22b0
jmp 0x98af
movq -0x368(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x30, %esi
callq 0x21a0
jmp 0x962a
movq -0x3a0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2110
jmp 0x962a
jmp 0x9551
movl -0x214(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x214(%rbp)
jmp 0x9439
movq -0x28(%rbp), %rdi
movl $0x4c, %esi
leaq -0xf0(%rbp), %rdx
movl $0x1, %ecx
callq 0x7c80
jmp 0x9581
leaq -0x248(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x2970
jmp 0x9596
leaq -0x2b0(%rbp), %rdi
callq 0x8fe0
jmp 0x95a4
movl $0x0, -0x314(%rbp)
cmpl $0xc, -0x314(%rbp)
jge 0x96fd
movq -0x238(%rbp), %rax
movslq -0x314(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x98b0
movq %rax, -0x3a8(%rbp)
jmp 0x95db
movq -0x3a8(%rbp), %rcx
movq -0x240(%rbp), %rax
movslq -0x314(%rbp), %rdx
movzwl (%rax,%rdx,2), %eax
subl $0x1, %eax
cltq
movq %rcx, -0x310(%rbp,%rax,8)
movl -0x314(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x314(%rbp)
jmp 0x95ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x2ab0
movl -0x1c(%rbp), %eax
movl %eax, -0x3ac(%rbp)
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x9679
movq -0x18(%rbp), %rdi
callq 0x20b0
movq 0x10(%rax), %rcx
movq %rcx, -0x340(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x350(%rbp)
leaq -0x350(%rbp), %rdi
callq 0x9910
jmp 0x9668
callq 0x2290
movl -0x4(%rbp), %eax
addq $0x3d0, %rsp            # imm = 0x3D0
popq %rbp
retq
movl -0x3ac(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x989e
movq -0x18(%rbp), %rdi
callq 0x20b0
movq %rax, -0x338(%rbp)
movq 0x592d(%rip), %rdi      # 0xefd0
leaq 0x1051(%rip), %rsi      # 0xa6fb
callq 0x2170
movq %rax, -0x3b8(%rbp)
jmp 0x96b8
movq -0x3b8(%rbp), %rdi
movq 0x58fa(%rip), %rsi      # 0xefc0
callq 0x21c0
jmp 0x96cd
movq 0x5904(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq -0x338(%rbp), %rdx
leaq 0x104a(%rip), %rsi      # 0xa72f
movb $0x0, %al
callq 0x2250
movl $0x1, -0x4(%rbp)
callq 0x2290
jmp 0x966d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xfec(%rip), %rsi       # 0xa6f8
callq 0x2200
movq %rax, -0x3c0(%rbp)
jmp 0x971a
movq -0x3c0(%rbp), %rax
movq %rax, -0x320(%rbp)
movl $0x0, -0x324(%rbp)
cmpl $0xc, -0x324(%rbp)
jge 0x97d4
movl $0x0, -0x328(%rbp)
cmpl $0xc, -0x328(%rbp)
jge 0x97be
movslq -0x324(%rbp), %rax
movq -0x2b0(%rbp,%rax,8), %rdi
movslq -0x328(%rbp), %rax
movq -0x310(%rbp,%rax,8), %rsi
callq 0x2240
cmpl $0x0, %eax
jne 0x97ab
movslq -0x328(%rbp), %rax
leaq (%rax,%rax,2), %rax
movq -0x208(%rbp,%rax,8), %rdi
movl -0x200(%rbp,%rax,8), %eax
movl %eax, %edx
movq -0x320(%rbp), %rcx
movl $0x1, %esi
callq 0x22f0
jmp 0x97a9
jmp 0x97ab
jmp 0x97ad
movl -0x328(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x328(%rbp)
jmp 0x9749
jmp 0x97c0
movl -0x324(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x324(%rbp)
jmp 0x9732
movq -0x320(%rbp), %rdi
callq 0x2180
jmp 0x97e2
movl $0x0, -0x32c(%rbp)
cmpl $0xc, -0x32c(%rbp)
jge 0x9830
movslq -0x32c(%rbp), %rax
movq -0x2b0(%rbp,%rax,8), %rax
movq %rax, -0x3c8(%rbp)
cmpq $0x0, %rax
je 0x981d
movq -0x3c8(%rbp), %rdi
callq 0x2220
jmp 0x981f
movl -0x32c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x32c(%rbp)
jmp 0x97ec
movq -0x28(%rbp), %rax
movq %rax, -0x3d0(%rbp)
cmpq $0x0, %rax
je 0x985e
movq -0x3d0(%rbp), %rdi
callq 0x7d50
movq -0x3d0(%rbp), %rdi
movl $0x30, %esi
callq 0x21a0
movl $0x0, -0x4(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x2ab0
jmp 0x966d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2290
jmp 0x989e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2290
jmp 0x989c
jmp 0x989e
movq -0x18(%rbp), %rdi
callq 0x22e0
movq %rax, %rdi
callq 0x3ef0
nop