// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %edi
callq 0x20d0
cmpl $0x2, %ebx
jl 0x5cd6
je 0x5ce4
callq 0x32b4
movl $0x30, %edi
callq 0x21d0
movq %rax, 0x68(%rsp)
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x68(%rsp), %rdi
callq 0x4856
xorl %edi, %edi
callq 0x2f28
movq %rax, %r14
movq 0x60(%rax), %rax
movq 0x40(%rax), %rsi
leaq 0x20(%rsp), %rdi
callq 0x304c
leaq 0x20(%rsp), %rdi
movl $0x49, %esi
callq 0x2990
leaq 0x20(%rsp), %rdi
movl $0x61, %esi
callq 0x2990
leaq 0x20(%rsp), %rdi
callq 0x305a
cmpb $0x60, %al
jne 0x5d1c
leaq 0x20(%rsp), %rdi
callq 0x526c
testb %al, %al
je 0x5d28
movq 0x70(%r14), %rax
movl 0xc(%rax), %edi
callq 0x2eba
cvttsd2si %xmm0, %eax
movw %ax, 0x54ef(%rip)       # 0xa9e4
xorl %edi, %edi
callq 0x2f28
movq %rax, %r14
movq %rax, %rdi
callq 0x3822
movl 0x68(%r14), %eax
leaq 0x1f67(%rip), %rcx      # 0x7479
movq %rcx, 0x8(%rsp)
movl $0x11c, (%rsp)          # imm = 0x11C
testq %rax, %rax
je 0x5c08
movq 0x70(%r14), %rbx
shlq $0x3, %rax
leaq (%rax,%rax,2), %r13
xorl %ebp, %ebp
leaq 0x1f39(%rip), %r14      # 0x7475
xorl %r12d, %r12d
cmpb $0x1, 0x8(%rbx,%rbp)
jne 0x556d
movl 0xc(%rbx,%rbp), %edi
callq 0x2f12
movq %rax, %r15
cmpl $0x0, (%rax)
jne 0x556d
movq 0x10(%r15), %rax
movq 0x10(%rax), %rdi
movq %r14, %rsi
callq 0x2270
testl %eax, %eax
cmoveq %r15, %r12
addq $0x18, %rbp
cmpq %rbp, %r13
jne 0x553f
testq %r12, %r12
je 0x5c08
movq 0x40(%r12), %rsi
leaq 0x20(%rsp), %rdi
callq 0x304c
leaq 0x20(%rsp), %rdi
callq 0x2808
cmpb $-0x30, %al
jne 0x5d40
leaq 0x20(%rsp), %rdi
callq 0x2808
cmpb $0x30, %al
jne 0x5d4c
leaq 0x20(%rsp), %rdi
callq 0x2808
cmpb $-0x30, %al
jne 0x5d58
leaq 0x20(%rsp), %rdi
callq 0x2808
cmpb $0x66, %al
jne 0x5d64
leaq 0x20(%rsp), %rdi
callq 0x2808
cmpb $0x73, %al
jne 0x5d70
leaq 0x20(%rsp), %rdi
callq 0x2808
cmpb $-0x2b, %al
jne 0x568d
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x2808
cmpb $-0x2f, %al
jne 0x5c9a
movq %r14, %rdi
callq 0x305a
cmpb $0x60, %al
jne 0x5681
movq %r14, %rdi
callq 0x50a4
movl %eax, %ebp
movq %r14, %rdi
callq 0x305a
cmpb $-0x56, %al
je 0x566d
movzbl %al, %eax
cmpl $0x60, %eax
jne 0x5cca
movq %r14, %rdi
callq 0x50a4
movl %eax, %r15d
movq %r14, %rdi
callq 0x2808
cmpb $-0x5b, %al
jne 0x5cb2
movq %r14, %rdi
callq 0x2808
cmpb $-0x56, %al
jne 0x5cbe
movl %r15d, %ecx
shll %cl, %ebp
xorl %ebp, 0x5375(%rip)      # 0xa9e8
movq %r14, %rdi
callq 0x2808
cmpb $-0x2b, %al
je 0x55ff
jmp 0x568d
movzbl %al, %eax
cmpl $0x48, %eax
jne 0x5ca6
xorl %edi, %edi
callq 0x2f28
movq %rax, %r14
movq %rax, %rdi
callq 0x3822
movl 0x68(%r14), %eax
leaq 0x1e0f(%rip), %rcx      # 0x74b9
movq %rcx, 0x8(%rsp)
movl $0xfc, (%rsp)
testq %rax, %rax
je 0x5c08
movq 0x70(%r14), %rbp
shlq $0x3, %rax
leaq (%rax,%rax,2), %rbx
xorl %r15d, %r15d
leaq 0x20(%rsp), %r12
xorl %r14d, %r14d
cmpb $0x1, 0x8(%rbp,%r15)
jne 0x5791
movl 0xc(%rbp,%r15), %edi
callq 0x2f12
movq %rax, %r13
cmpl $0x1, (%rax)
jne 0x5791
cmpl $0x33, 0x38(%r13)
jb 0x5791
movq 0x8(%r13), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x1d7d(%rip), %rsi      # 0x7492
callq 0x2270
testl %eax, %eax
jne 0x5791
movq 0x40(%r13), %rsi
movq %r12, %rdi
callq 0x304c
movq %r12, %rdi
callq 0x2808
cmpb $-0x30, %al
jne 0x5791
movq %r12, %rdi
callq 0x2808
cmpb $0x30, %al
jne 0x5791
movq %r12, %rdi
callq 0x2808
cmpb $0x20, %al
jne 0x5791
movq %r12, %rdi
callq 0x305a
negb %al
jno 0x5791
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x30b0
movl 0x10(%rsp), %edi
callq 0x2ece
movq 0x10(%rax), %rdi
leaq 0x1d1d(%rip), %rsi      # 0x7498
callq 0x2270
testl %eax, %eax
jne 0x5791
testq %r14, %r14
jne 0x5dae
movq 0x40(%r13), %r14
addq $0x18, %r15
cmpq %r15, %rbx
jne 0x56d6
testq %r14, %r14
je 0x5c08
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x304c
leaq 0x20(%rsp), %rdi
movl $0xc2, %esi
callq 0x2990
leaq 0x20(%rsp), %rdi
movl $0x63, %esi
callq 0x2990
leaq 0x20(%rsp), %rdi
movl $0x66, %esi
callq 0x2990
leaq 0x20(%rsp), %rdi
movl $0x66, %esi
callq 0x2990
leaq 0x20(%rsp), %rdi
movl $0x66, %esi
callq 0x2990
xorl %ebx, %ebx
leaq 0x51f8(%rip), %r12      # 0xaa00
leaq 0x20(%rsp), %r14
cmpl $0x2, %ebx
jb 0x581e
movq %r14, %rdi
callq 0x2808
cmpb $-0x60, %al
jne 0x5861
movq %r14, %rdi
callq 0x305a
cmpb $0x60, %al
jne 0x5bf5
movq %r14, %rdi
callq 0x5370
movq %rax, %r15
movq %rax, %rdi
callq 0x20e0
testq %rax, %rax
je 0x585d
xorl %ecx, %ecx
movb (%r15,%rcx), %dl
movb %dl, (%r12,%rcx)
incq %rcx
movl %ecx, %edx
cmpq %rdx, %rax
ja 0x5848
addq %rcx, %r12
incl %ebx
jmp 0x580d
leaq 0x5184(%rip), %rax      # 0xa9ec
movq %rax, 0x51a9(%rip)      # 0xaa18
xorl %edi, %edi
callq 0x2f28
movq 0x60(%rax), %rcx
movq %rcx, 0x78(%rsp)
movq %rcx, 0x20(%rsp)
movl 0x68(%rax), %ecx
testq %rcx, %rcx
je 0x5a25
movq 0x70(%rax), %rbp
leaq (%rcx,%rcx,2), %rax
leaq (,%rax,8), %r15
addq %rbp, %r15
movq $0x0, 0x50(%rsp)
leaq 0x10(%rsp), %r13
leaq 0x1caa(%rip), %r12      # 0x7562
leaq 0x1c23(%rip), %rax      # 0x74e2
movq %rax, 0x8(%rsp)
movq $0x0, 0x58(%rsp)
movq $0x0, 0x60(%rsp)
movq $0x0, (%rsp)
cmpb $0x1, 0x8(%rbp)
jne 0x59fc
movq (%rbp), %rbx
movl 0xc(%rbp), %edi
callq 0x2f12
movq %rax, %r14
movl (%rax), %eax
testl %eax, %eax
je 0x5956
cmpl $0x1, %eax
jne 0x5993
cmpl $0x1e, 0x38(%r14)
jb 0x5993
movq 0x8(%r14), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x1b6f(%rip), %rsi      # 0x7492
callq 0x2270
testl %eax, %eax
jne 0x5993
movq 0x40(%r14), %rax
xorl %ecx, %ecx
movb (%rax,%rcx), %dl
cmpb (%rcx,%r12), %dl
jne 0x5993
incq %rcx
cmpq $0x9, %rcx
jne 0x5932
cmpq $0x0, 0x50(%rsp)
movq %r14, 0x50(%rsp)
je 0x5993
jmp 0x5da2
movq 0x10(%r14), %rax
movq 0x10(%rax), %rdi
leaq 0x1b8e(%rip), %rsi      # 0x74f3
callq 0x2270
testl %eax, %eax
jne 0x5993
movq 0x10(%rbx), %rdi
leaq 0x1b7f(%rip), %rsi      # 0x74f8
callq 0x2270
testl %eax, %eax
jne 0x5993
cmpq $0x0, 0x58(%rsp)
movq %r14, 0x58(%rsp)
jne 0x5d8f
movl 0x38(%r14), %eax
addl $-0x65, %eax
cmpl $0x76, %eax
ja 0x59fc
movq 0x40(%r14), %rsi
movq %r13, %rdi
callq 0x304c
movq %r13, %rdi
callq 0x2808
cmpb $-0x30, %al
jne 0x59fc
movq %r13, %rdi
callq 0x2808
cmpb $0x30, %al
jne 0x59fc
movq %r13, %rdi
callq 0x2808
cmpb $0x5d, %al
jne 0x59e0
cmpq $0x0, 0x60(%rsp)
movq %r14, 0x60(%rsp)
jne 0x5d7c
cmpl $0x6, 0x24(%r14)
jne 0x59f4
cmpl $0x4, 0x28(%r14)
jne 0x59f4
cmpl $0x0, (%r14)
je 0x5a0b
movq (%rsp), %r14
movq %r14, (%rsp)
addq $0x18, %rbp
cmpq %r15, %rbp
jne 0x58de
jmp 0x5a48
cmpq $0x0, (%rsp)
je 0x59f8
movl $0xcb, (%rsp)
leaq 0x1b09(%rip), %rax      # 0x7529
jmp 0x5c03
movq $0x0, (%rsp)
movq $0x0, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %r13
movq %r13, 0x28(%rsp)
movq 0x58(%rsp), %r15
movq %r15, 0x38(%rsp)
movq 0x60(%rsp), %r12
movq %r12, 0x30(%rsp)
movq (%rsp), %rbx
movq %rbx, 0x40(%rsp)
xorl %r14d, %r14d
cmpq $0x0, 0x20(%rsp,%r14,8)
je 0x5c3c
incq %r14
cmpq $0x5, %r14
jne 0x5a72
movq 0x78(%rsp), %rax
movq 0x40(%rax), %rsi
leaq 0x10(%rsp), %rdi
callq 0x304c
leaq 0x10(%rsp), %rdi
movl $0x11, %esi
callq 0x2990
leaq 0x10(%rsp), %rdi
movl $0x62, %esi
callq 0x2990
leaq 0x10(%rsp), %rdi
callq 0x5e88
movq 0x40(%r13), %rsi
leaq 0x10(%rsp), %rdi
callq 0x304c
leaq 0x10(%rsp), %rdi
movl $0x20, %esi
callq 0x2990
leaq 0x10(%rsp), %rdi
movl $0x20, %esi
callq 0x2990
leaq 0x10(%rsp), %rdi
movl $0x20, %esi
callq 0x2990
leaq 0x10(%rsp), %rdi
movl $0xd3, %esi
callq 0x2990
leaq 0x10(%rsp), %rdi
callq 0x5e88
movq 0x40(%r12), %rsi
leaq 0x10(%rsp), %rdi
callq 0x304c
leaq 0x10(%rsp), %rdi
movl $0xd1, %esi
callq 0x2990
leaq 0x10(%rsp), %rdi
callq 0x5e88
movq 0x40(%r15), %rsi
leaq 0x10(%rsp), %rdi
callq 0x304c
leaq 0x10(%rsp), %rdi
movl $0xd1, %esi
callq 0x2990
leaq 0x10(%rsp), %rdi
callq 0x5e88
movq 0x40(%rbx), %rsi
leaq 0x10(%rsp), %rdi
callq 0x304c
leaq 0x10(%rsp), %rdi
movl $0xd3, %esi
callq 0x2990
leaq 0x10(%rsp), %rdi
callq 0x5e88
leaq 0x4e51(%rip), %rdi      # 0xa9e4
callq 0x4ed6
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x1859(%rip), %rsi      # 0x7401
callq 0x2240
movq %rax, %r14
leaq 0x4e2d(%rip), %rdi      # 0xa9e4
movq %rax, %rsi
callq 0x503c
movq %r14, %rdi
callq 0x21c0
movq 0x68(%rsp), %rbx
movq %rbx, %rdi
callq 0x4b86
movl $0x30, %esi
movq %rbx, %rdi
callq 0x21e0
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x105, (%rsp)          # imm = 0x105
leaq 0x1795(%rip), %rax      # 0x7398
movq %rax, 0x8(%rsp)
movl $0x18, %edi
callq 0x2100
movl (%rsp), %ecx
movl %ecx, (%rax)
leaq 0x1765(%rip), %rcx      # 0x7383
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x415e(%rip), %rsi      # 0x9d90
movq %rax, %rdi
xorl %edx, %edx
callq 0x22c0
movq 0x438d(%rip), %rdi      # 0x9fd0
leaq 0x18f0(%rip), %rsi      # 0x753a
movl $0x4, %edx
callq 0x2220
movq 0x4375(%rip), %rdi      # 0x9fd0
movq %r14, %rsi
callq 0x2140
movq %rax, %rbx
leaq 0x18d2(%rip), %rsi      # 0x753f
movl $0x8, %edx
movq %rax, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x20f0
leaq 0x18bf(%rip), %rax      # 0x7548
movq %rax, 0x8(%rsp)
movl $0xd4, (%rsp)
jmp 0x5c08
movl $0x124, (%rsp)          # imm = 0x124
jmp 0x5bfc
movl $0x128, (%rsp)          # imm = 0x128
jmp 0x5bfc
movl $0x131, (%rsp)          # imm = 0x131
jmp 0x5bfc
movl $0x132, (%rsp)          # imm = 0x132
jmp 0x5bfc
movl $0x12f, (%rsp)          # imm = 0x12F
jmp 0x5bfc
leaq 0x16f7(%rip), %rbx      # 0x73d4
movl $0x147, %ebp            # imm = 0x147
jmp 0x5cf0
leaq 0x16ff(%rip), %rbx      # 0x73ea
movl $0x14a, %ebp            # imm = 0x14A
movl $0x18, %edi
callq 0x2100
movl %ebp, (%rax)
leaq 0x1680(%rip), %rcx      # 0x7383
movq %rcx, 0x8(%rax)
movq %rbx, 0x10(%rax)
leaq 0x407e(%rip), %rsi      # 0x9d90
movq %rax, %rdi
xorl %edx, %edx
callq 0x22c0
movl $0x13c, (%rsp)          # imm = 0x13C
jmp 0x5bfc
leaq 0x1714(%rip), %rax      # 0x7443
movq %rax, 0x8(%rsp)
movl $0x13e, (%rsp)          # imm = 0x13E
jmp 0x5c08
movl $0x11e, (%rsp)          # imm = 0x11E
jmp 0x5bfc
movl $0x11f, (%rsp)          # imm = 0x11F
jmp 0x5bfc
movl $0x120, (%rsp)          # imm = 0x120
jmp 0x5bfc
movl $0x121, (%rsp)          # imm = 0x121
jmp 0x5bfc
movl $0x122, (%rsp)          # imm = 0x122
jmp 0x5bfc
movl $0xc6, (%rsp)
leaq 0x178e(%rip), %rax      # 0x7518
jmp 0x5c03
movl $0xba, (%rsp)
leaq 0x176a(%rip), %rax      # 0x7507
jmp 0x5c03
movl $0xb3, (%rsp)
jmp 0x5c08
movl $0xf5, (%rsp)
leaq 0x16e1(%rip), %rax      # 0x749d
jmp 0x5c03
movq %rdx, %r15
movq %rax, %r14
movl $0x30, %esi
movq 0x68(%rsp), %rdi
callq 0x21e0
jmp 0x5dea
jmp 0x5de4
jmp 0x5de4
jmp 0x5de4
jmp 0x5de4
jmp 0x5de4
jmp 0x5de4
movq %rdx, %r15
movq %rax, %r14
cmpl $0x2, %r15d
jne 0x5e1f
movq %r14, %rdi
callq 0x20c0
movupd (%rax), %xmm0
leaq 0x80(%rsp), %rdi
movapd %xmm0, (%rdi)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rdi)
callq 0x5efc
callq 0x22a0
jmp 0x5be1
cmpl $0x1, %r15d
jne 0x5e80
movq %r14, %rdi
callq 0x20c0
movq %rax, %rbx
movq 0x4199(%rip), %rdi      # 0x9fd0
leaq 0x15c6(%rip), %rsi      # 0x7404
movl $0x33, %edx
callq 0x2220
movq 0x4181(%rip), %rdi      # 0x9fd0
callq 0x20f0
movq %rbx, %rdi
callq 0x2331
movl $0x1, %eax
jmp 0x5be3
movq %rax, %r14
callq 0x22a0
jmp 0x5e80
movq %rax, %rdi
callq 0x6024
movq %rax, %r14
callq 0x22a0
movq %r14, %rdi
callq 0x22f0