// File: /workspace/github_c_makefile_star2_O2/FirestonnneTFM[P]tfm_key_parser/src/main_sniffer.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]);
		find_version();
		find_login();
		find_handshake();
		find_hash();
		key.print();
		FILE *out_file = fopen(argv[2], "wb");
		key.write_to(out_file);
		fclose(out_file);
		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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, 0x70(%rsp)
movl %edi, %ebx
pushq $0x1
popq %rdi
callq 0x20c0
cmpl $0x2, %ebx
jl 0x59bf
je 0x59cd
callq 0x31e8
pushq $0x30
popq %rdi
callq 0x2190
movq %rax, 0x58(%rsp)
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x58(%rsp), %rdi
callq 0x46d2
xorl %edi, %edi
callq 0x2daa
movq %rax, %rbx
movq 0x60(%rax), %rsi
leaq 0x20(%rsp), %rdi
callq 0x5bfe
leaq 0x20(%rsp), %rdi
pushq $0x49
popq %rsi
callq 0x28de
leaq 0x20(%rsp), %rdi
pushq $0x61
popq %rsi
callq 0x28de
leaq 0x20(%rsp), %rdi
callq 0x3006
leaq 0x1147(%rip), %rcx      # 0x6398
movq %rcx, (%rsp)
cmpb $0x60, %al
jne 0x5a03
leaq 0x20(%rsp), %rdi
callq 0x5006
testb %al, %al
je 0x5a0d
movq 0x70(%rbx), %rax
movl 0xc(%rax), %edi
callq 0x2d40
cvttsd2si %xmm0, %eax
movw %ax, 0x573e(%rip)       # 0xa9c4
xorl %edi, %edi
callq 0x2daa
movq %rax, %rbx
movq %rax, %rdi
callq 0x36a4
movq 0x70(%rbx), %r14
movl 0x68(%rbx), %eax
imulq $0x18, %rax, %r13
xorl %ebp, %ebp
movq %r14, %r12
xorl %ebx, %ebx
cmpq %rbp, %r13
je 0x52ed
cmpb $0x1, 0x8(%r12)
jne 0x52e3
movl 0xc(%r14,%rbp), %edi
callq 0x2d94
movq %rax, %r15
cmpl $0x0, (%rax)
jne 0x52e3
movq 0x10(%r15), %rax
movq 0x10(%rax), %rdi
leaq 0x119d(%rip), %rsi      # 0x6475
callq 0x2220
testl %eax, %eax
cmoveq %r15, %rbx
addq $0x18, %r12
addq $0x18, %rbp
jmp 0x52aa
testq %rbx, %rbx
je 0x5a22
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x5bfe
leaq 0x20(%rsp), %rdi
callq 0x2770
cmpb $-0x30, %al
jne 0x5a37
leaq 0x20(%rsp), %rdi
callq 0x2770
cmpb $0x30, %al
jne 0x5a41
leaq 0x20(%rsp), %rdi
callq 0x2770
cmpb $-0x30, %al
jne 0x5a4b
leaq 0x20(%rsp), %rdi
callq 0x2770
cmpb $0x66, %al
jne 0x5a55
leaq 0x20(%rsp), %rdi
callq 0x2770
cmpb $0x73, %al
jne 0x5a5f
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x2770
cmpb $-0x2b, %al
jne 0x53f7
movq %rbx, %rdi
callq 0x2770
cmpb $-0x2f, %al
jne 0x5990
movq %rbx, %rdi
callq 0x3006
cmpb $0x60, %al
jne 0x53eb
movq %rbx, %rdi
callq 0x4e4c
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3006
cmpb $-0x56, %al
je 0x53e0
movzbl %al, %eax
cmpl $0x60, %eax
jne 0x59b5
movq %rbx, %rdi
callq 0x4e4c
movl %eax, %r14d
movq %rbx, %rdi
callq 0x2770
cmpb $-0x5b, %al
jne 0x59a1
movq %rbx, %rdi
callq 0x2770
cmpb $-0x56, %al
jne 0x59ab
movl %r14d, %ecx
shll %cl, %ebp
xorl %ebp, 0x55e2(%rip)      # 0xa9c8
jmp 0x5362
movzbl %al, %eax
cmpl $0x48, %eax
jne 0x5997
xorl %edi, %edi
callq 0x2daa
movq %rax, %rbx
movq %rax, %rdi
callq 0x36a4
movq 0x70(%rbx), %r14
movl 0x68(%rbx), %eax
imulq $0x18, %rax, %r13
xorl %ebx, %ebx
movq %r14, %r12
xorl %r15d, %r15d
cmpq %rbx, %r13
je 0x54f7
cmpb $0x1, 0x8(%r12)
jne 0x54ea
movl 0xc(%r14,%rbx), %edi
callq 0x2d94
movq %rax, %rbp
cmpl $0x1, (%rax)
jne 0x54ea
cmpl $0x33, 0x38(%rbp)
jb 0x54ea
movq 0x8(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x102f(%rip), %rsi      # 0x6492
callq 0x2220
testl %eax, %eax
jne 0x54ea
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x5bfe
leaq 0x20(%rsp), %rdi
callq 0x2770
cmpb $-0x30, %al
jne 0x54ea
leaq 0x20(%rsp), %rdi
callq 0x2770
cmpb $0x30, %al
jne 0x54ea
leaq 0x20(%rsp), %rdi
callq 0x2770
cmpb $0x20, %al
jne 0x54ea
leaq 0x20(%rsp), %rdi
callq 0x3006
negb %al
jno 0x54ea
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x305c
movl 0x8(%rsp), %edi
callq 0x2d54
movq 0x10(%rax), %rdi
leaq 0xfc4(%rip), %rsi       # 0x6498
callq 0x2220
testl %eax, %eax
jne 0x54ea
testq %r15, %r15
jne 0x5aab
movq 0x40(%rbp), %r15
addq $0x18, %r12
addq $0x18, %rbx
jmp 0x541c
testq %r15, %r15
je 0x5a69
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x2ff8
leaq 0x20(%rsp), %rdi
movl $0xc2, %esi
callq 0x28de
leaq 0x20(%rsp), %rdi
pushq $0x63
popq %rsi
callq 0x28de
leaq 0x20(%rsp), %rdi
pushq $0x66
popq %rsi
callq 0x28de
leaq 0x20(%rsp), %rdi
pushq $0x66
popq %rsi
callq 0x28de
leaq 0x20(%rsp), %rdi
pushq $0x66
popq %rsi
callq 0x28de
xorl %r15d, %r15d
leaq 0x5486(%rip), %r12      # 0xa9e0
leaq 0x20(%rsp), %rbx
cmpl $0x2, %r15d
jb 0x5571
movq %rbx, %rdi
callq 0x2770
cmpb $-0x60, %al
jne 0x55b2
movq %rbx, %rdi
callq 0x3006
cmpb $0x60, %al
jne 0x5916
movq %rbx, %rdi
callq 0x5104
movq %rax, %r14
movq %rax, %rdi
callq 0x20d0
xorl %ecx, %ecx
movl %ecx, %edx
cmpq %rdx, %rax
jbe 0x55aa
movb (%r14,%rdx), %dl
movb %dl, (%r12,%rcx)
incq %rcx
jmp 0x5596
incl %r15d
addq %rcx, %r12
jmp 0x555f
leaq 0x5413(%rip), %rax      # 0xa9cc
movq %rax, 0x5438(%rip)      # 0xa9f8
xorl %edi, %edi
callq 0x2daa
movq 0x60(%rax), %rcx
movq %rcx, 0x78(%rsp)
movq %rcx, 0x20(%rsp)
movq 0x70(%rax), %r14
movl 0x68(%rax), %eax
imulq $0x18, %rax, %r13
addq %r14, %r13
movq $0x0, 0x18(%rsp)
leaq 0x8(%rsp), %rbx
leaq 0xeea(%rip), %rax       # 0x64e2
movq %rax, (%rsp)
leaq 0xf5f(%rip), %rbp       # 0x6562
movq $0x0, 0x68(%rsp)
movq $0x0, 0x60(%rsp)
movq $0x0, 0x50(%rsp)
cmpq %r13, %r14
je 0x5776
cmpb $0x1, 0x8(%r14)
jne 0x5754
movq (%r14), %r15
movl 0xc(%r14), %edi
callq 0x2d94
movq %rax, %r12
movl (%rax), %eax
testl %eax, %eax
je 0x5696
cmpl $0x1, %eax
jne 0x56e6
cmpl $0x1e, 0x38(%r12)
jb 0x56e6
movq 0x8(%r12), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
leaq 0xe23(%rip), %rsi       # 0x6492
callq 0x2220
testl %eax, %eax
jne 0x56e6
movq 0x40(%r12), %rax
xorl %ecx, %ecx
cmpq $0x9, %rcx
je 0x56d5
movb (%rax,%rcx), %dl
leaq 0x1(%rcx), %rsi
cmpb (%rcx,%rbp), %dl
movq %rsi, %rcx
je 0x567f
jmp 0x56e6
movq 0x10(%r12), %rax
movq 0x10(%rax), %rdi
leaq 0xe4d(%rip), %rsi       # 0x64f3
callq 0x2220
testl %eax, %eax
jne 0x56e6
movq 0x10(%r15), %rdi
leaq 0xe3e(%rip), %rsi       # 0x64f8
callq 0x2220
testl %eax, %eax
jne 0x56e6
cmpq $0x0, 0x60(%rsp)
movq %r12, 0x60(%rsp)
je 0x56e6
jmp 0x5a8c
cmpq $0x0, 0x50(%rsp)
movq %r12, 0x50(%rsp)
jne 0x5aa1
movl 0x38(%r12), %eax
addl $-0x65, %eax
cmpl $0x76, %eax
ja 0x5754
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5bfe
movq %rbx, %rdi
callq 0x2770
cmpb $-0x30, %al
jne 0x5754
movq %rbx, %rdi
callq 0x2770
cmpb $0x30, %al
jne 0x5754
movq %rbx, %rdi
callq 0x2770
cmpb $0x5d, %al
jne 0x5733
cmpq $0x0, 0x68(%rsp)
movq %r12, 0x68(%rsp)
jne 0x5a7e
cmpl $0x6, 0x24(%r12)
jne 0x574a
cmpl $0x4, 0x28(%r12)
jne 0x574a
cmpl $0x0, (%r12)
je 0x575d
movq 0x18(%rsp), %r12
movq %r12, 0x18(%rsp)
addq $0x18, %r14
jmp 0x561e
cmpq $0x0, 0x18(%rsp)
je 0x574f
movl $0xcb, %ebx
leaq 0xdb8(%rip), %rax       # 0x6529
jmp 0x5a98
movq 0x50(%rsp), %r14
movq %r14, 0x28(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
xorl %ebx, %ebx
cmpq $0x5, %rbx
je 0x57b7
cmpq $0x0, 0x20(%rsp,%rbx,8)
je 0x5949
incq %rbx
jmp 0x57a0
leaq 0x8(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x5bfe
leaq 0x8(%rsp), %rdi
pushq $0x11
popq %rsi
callq 0x28de
leaq 0x8(%rsp), %rdi
pushq $0x62
popq %rsi
callq 0x28de
leaq 0x8(%rsp), %rdi
callq 0x5b8b
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x5bfe
leaq 0x8(%rsp), %rdi
pushq $0x20
popq %rsi
callq 0x28de
leaq 0x8(%rsp), %rdi
pushq $0x20
popq %rsi
callq 0x28de
leaq 0x8(%rsp), %rdi
pushq $0x20
popq %rsi
callq 0x28de
leaq 0x8(%rsp), %rdi
movl $0xd3, %esi
callq 0x28de
leaq 0x8(%rsp), %rdi
callq 0x5b8b
movq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x5bfe
leaq 0x8(%rsp), %rdi
movl $0xd1, %esi
callq 0x28de
leaq 0x8(%rsp), %rdi
callq 0x5b8b
movq 0x38(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x5bfe
leaq 0x8(%rsp), %rdi
movl $0xd1, %esi
callq 0x28de
leaq 0x8(%rsp), %rdi
callq 0x5b8b
movq 0x40(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x5bfe
leaq 0x8(%rsp), %rdi
movl $0xd3, %esi
callq 0x28de
leaq 0x8(%rsp), %rdi
callq 0x5b8b
leaq 0x510e(%rip), %rdi      # 0xa9c4
callq 0x4d28
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0xb36(%rip), %rsi       # 0x6401
callq 0x21f0
movq %rax, %rbx
leaq 0x50ea(%rip), %rdi      # 0xa9c4
movq %rax, %rsi
callq 0x4de4
movq %rbx, %rdi
callq 0x2180
movq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x4990
pushq $0x30
popq %rsi
movq %rbx, %rdi
callq 0x21a0
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x105, %ebx            # imm = 0x105
pushq $0x18
popq %rdi
callq 0x20f0
movl %ebx, (%rax)
leaq 0xa57(%rip), %rcx       # 0x6383
movq %rcx, 0x8(%rax)
movq (%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x4451(%rip), %rsi      # 0x9d90
movq %rax, %rdi
xorl %edx, %edx
callq 0x2270
movq 0x4680(%rip), %rdi      # 0x9fd0
leaq 0xbe3(%rip), %rsi       # 0x653a
callq 0x2170
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2120
leaq 0xbd1(%rip), %rsi       # 0x653f
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20e0
leaq 0xbc3(%rip), %rax       # 0x6548
movq %rax, (%rsp)
movl $0xd4, %ebx
jmp 0x591b
movl $0x124, %ebx            # imm = 0x124
jmp 0x591b
movl $0x128, %ebx            # imm = 0x128
jmp 0x591b
movl $0x131, %ebx            # imm = 0x131
jmp 0x591b
movl $0x132, %ebx            # imm = 0x132
jmp 0x591b
movl $0x12f, %ebx            # imm = 0x12F
jmp 0x591b
leaq 0xa0e(%rip), %rbx       # 0x63d4
movl $0x147, %ebp            # imm = 0x147
jmp 0x59d9
leaq 0xa16(%rip), %rbx       # 0x63ea
movl $0x14a, %ebp            # imm = 0x14A
pushq $0x18
popq %rdi
callq 0x20f0
movl %ebp, (%rax)
leaq 0x999(%rip), %rcx       # 0x6383
movq %rcx, 0x8(%rax)
movq %rbx, 0x10(%rax)
leaq 0x4397(%rip), %rsi      # 0x9d90
movq %rax, %rdi
xorl %edx, %edx
callq 0x2270
movl $0x13c, %ebx            # imm = 0x13C
jmp 0x591b
leaq 0xa2f(%rip), %rax       # 0x6443
movq %rax, (%rsp)
movl $0x13e, %ebx            # imm = 0x13E
jmp 0x591b
leaq 0xa50(%rip), %rax       # 0x6479
movq %rax, (%rsp)
movl $0x11c, %ebx            # imm = 0x11C
jmp 0x591b
movl $0x11e, %ebx            # imm = 0x11E
jmp 0x591b
movl $0x11f, %ebx            # imm = 0x11F
jmp 0x591b
movl $0x120, %ebx            # imm = 0x120
jmp 0x591b
movl $0x121, %ebx            # imm = 0x121
jmp 0x591b
movl $0x122, %ebx            # imm = 0x122
jmp 0x591b
leaq 0xa49(%rip), %rax       # 0x64b9
movq %rax, (%rsp)
movl $0xfc, %ebx
jmp 0x591b
movl $0xc6, %ebx
leaq 0xa8e(%rip), %rax       # 0x6518
jmp 0x5a98
movl $0xba, %ebx
leaq 0xa6f(%rip), %rax       # 0x6507
movq %rax, (%rsp)
jmp 0x591b
movl $0xb3, %ebx
jmp 0x591b
movl $0xf5, %ebx
leaq 0x9e6(%rip), %rax       # 0x649d
jmp 0x5a98
movq %rdx, %r14
movq %rax, %rbx
pushq $0x30
popq %rsi
movq 0x58(%rsp), %rdi
callq 0x21a0
jmp 0x5ae0
jmp 0x5ada
jmp 0x5ada
jmp 0x5ada
jmp 0x5ada
jmp 0x5ada
jmp 0x5ada
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x2, %r14d
jne 0x5b15
movq %rbx, %rdi
callq 0x20b0
movupd (%rax), %xmm0
leaq 0x80(%rsp), %rdi
movapd %xmm0, (%rdi)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rdi)
callq 0x5c08
callq 0x2250
jmp 0x5902
cmpl $0x1, %r14d
jne 0x5b83
movq %rbx, %rdi
callq 0x20b0
movq %rax, %rbx
movq 0x44a3(%rip), %rdi      # 0x9fd0
leaq 0x8d0(%rip), %rsi       # 0x6404
callq 0x2170
movq %rax, %rdi
callq 0x20e0
movq 0x4490(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
leaq 0x8e6(%rip), %rsi       # 0x6438
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2230
callq 0x2250
pushq $0x1
popq %rax
jmp 0x5904
movq %rax, %rbx
callq 0x2250
jmp 0x5b83
movq %rax, %rdi
callq 0x2f8c
movq %rax, %rbx
callq 0x2250
movq %rbx, %rdi
callq 0x22a0