// File: /workspace/github_c_makefile_star2_O1/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 $0x88, %rsp
movq %rsi, 0x60(%rsp)
movl %edi, %ebx
movl $0x1, %edi
callq 0x20d0
cmpl $0x2, %ebx
jl 0x5cfd
je 0x5d0b
callq 0x3294
movl $0x30, %edi
callq 0x21d0
movq %rax, 0x58(%rsp)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x58(%rsp), %rdi
callq 0x482e
xorl %edi, %edi
callq 0x2f10
movq %rax, %r14
movq 0x60(%rax), %rax
movq 0x40(%rax), %rsi
leaq 0x20(%rsp), %rdi
callq 0x3034
leaq 0x20(%rsp), %rdi
movl $0x49, %esi
callq 0x2986
leaq 0x20(%rsp), %rdi
movl $0x61, %esi
callq 0x2986
leaq 0x20(%rsp), %rdi
callq 0x3042
leaq 0x1ead(%rip), %rcx      # 0x7398
movq %rcx, 0x18(%rsp)
cmpb $0x60, %al
jne 0x5d43
leaq 0x20(%rsp), %rdi
callq 0x528c
testb %al, %al
je 0x5d4d
movq 0x70(%r14), %rax
movl 0xc(%rax), %edi
callq 0x2ea2
cvttsd2si %xmm0, %eax
movw %ax, 0x54c3(%rip)       # 0xa9e4
xorl %edi, %edi
callq 0x2f10
movq %rax, %r14
movq %rax, %rdi
callq 0x37f4
movl 0x68(%r14), %eax
testq %rax, %rax
je 0x558d
movq 0x70(%r14), %rbx
shlq $0x3, %rax
leaq (%rax,%rax,2), %r13
xorl %ebp, %ebp
leaq 0x1f24(%rip), %r14      # 0x7475
xorl %r12d, %r12d
cmpb $0x1, 0x8(%rbx,%rbp)
jne 0x5582
movl 0xc(%rbx,%rbp), %edi
callq 0x2efa
movq %rax, %r15
cmpl $0x0, (%rax)
jne 0x5582
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 0x5554
jmp 0x5590
xorl %r12d, %r12d
testq %r12, %r12
je 0x5d63
movq 0x40(%r12), %rsi
leaq 0x20(%rsp), %rdi
callq 0x3034
leaq 0x20(%rsp), %rdi
callq 0x2804
cmpb $-0x30, %al
jne 0x5d79
leaq 0x20(%rsp), %rdi
callq 0x2804
cmpb $0x30, %al
jne 0x5d83
leaq 0x20(%rsp), %rdi
callq 0x2804
cmpb $-0x30, %al
jne 0x5d8d
leaq 0x20(%rsp), %rdi
callq 0x2804
cmpb $0x66, %al
jne 0x5d97
leaq 0x20(%rsp), %rdi
callq 0x2804
cmpb $0x73, %al
jne 0x5da1
leaq 0x20(%rsp), %rdi
callq 0x2804
cmpb $-0x2b, %al
jne 0x56a7
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x2804
cmpb $-0x2f, %al
jne 0x5ccb
movq %r14, %rdi
callq 0x3042
cmpb $0x60, %al
jne 0x569b
movq %r14, %rdi
callq 0x50c4
movl %eax, %ebp
movq %r14, %rdi
callq 0x3042
cmpb $-0x56, %al
je 0x5687
movzbl %al, %eax
cmpl $0x60, %eax
jne 0x5cf3
movq %r14, %rdi
callq 0x50c4
movl %eax, %r15d
movq %r14, %rdi
callq 0x2804
cmpb $-0x5b, %al
jne 0x5cdf
movq %r14, %rdi
callq 0x2804
cmpb $-0x56, %al
jne 0x5ce9
movl %r15d, %ecx
shll %cl, %ebp
xorl %ebp, 0x535b(%rip)      # 0xa9e8
movq %r14, %rdi
callq 0x2804
cmpb $-0x2b, %al
je 0x5619
jmp 0x56a7
movzbl %al, %eax
cmpl $0x48, %eax
jne 0x5cd5
xorl %edi, %edi
callq 0x2f10
movq %rax, %r14
movq %rax, %rdi
callq 0x37f4
movl 0x68(%r14), %eax
testq %rax, %rax
je 0x57a7
movq 0x70(%r14), %rbx
shlq $0x3, %rax
leaq (%rax,%rax,2), %rbp
xorl %r15d, %r15d
leaq 0x20(%rsp), %r12
xorl %r14d, %r14d
cmpb $0x1, 0x8(%rbx,%r15)
jne 0x5798
movl 0xc(%rbx,%r15), %edi
callq 0x2efa
movq %rax, %r13
cmpl $0x1, (%rax)
jne 0x5798
cmpl $0x33, 0x38(%r13)
jb 0x5798
movq 0x8(%r13), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x1d76(%rip), %rsi      # 0x7492
callq 0x2270
testl %eax, %eax
jne 0x5798
movq 0x40(%r13), %rsi
movq %r12, %rdi
callq 0x3034
movq %r12, %rdi
callq 0x2804
cmpb $-0x30, %al
jne 0x5798
movq %r12, %rdi
callq 0x2804
cmpb $0x30, %al
jne 0x5798
movq %r12, %rdi
callq 0x2804
cmpb $0x20, %al
jne 0x5798
movq %r12, %rdi
callq 0x3042
negb %al
jno 0x5798
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0x3098
movl 0x8(%rsp), %edi
callq 0x2eb6
movq 0x10(%rax), %rdi
leaq 0x1d16(%rip), %rsi      # 0x7498
callq 0x2270
testl %eax, %eax
jne 0x5798
testq %r14, %r14
jne 0x5e14
movq 0x40(%r13), %r14
addq $0x18, %r15
cmpq %r15, %rbp
jne 0x56dd
jmp 0x57aa
xorl %r14d, %r14d
testq %r14, %r14
je 0x5dab
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x3034
leaq 0x20(%rsp), %rdi
movl $0xc2, %esi
callq 0x2986
leaq 0x20(%rsp), %rdi
movl $0x63, %esi
callq 0x2986
leaq 0x20(%rsp), %rdi
movl $0x66, %esi
callq 0x2986
leaq 0x20(%rsp), %rdi
movl $0x66, %esi
callq 0x2986
leaq 0x20(%rsp), %rdi
movl $0x66, %esi
callq 0x2986
xorl %ebx, %ebx
leaq 0x51ec(%rip), %r12      # 0xaa00
leaq 0x20(%rsp), %r14
cmpl $0x2, %ebx
jb 0x582a
movq %r14, %rdi
callq 0x2804
cmpb $-0x60, %al
jne 0x586d
movq %r14, %rdi
callq 0x3042
cmpb $0x60, %al
jne 0x5c39
movq %r14, %rdi
callq 0x5390
movq %rax, %r15
movq %rax, %rdi
callq 0x20e0
testq %rax, %rax
je 0x5869
xorl %ecx, %ecx
movb (%r15,%rcx), %dl
movb %dl, (%r12,%rcx)
incq %rcx
movl %ecx, %edx
cmpq %rdx, %rax
ja 0x5854
addq %rcx, %r12
incl %ebx
jmp 0x5819
leaq 0x5178(%rip), %rax      # 0xa9ec
movq %rax, 0x519d(%rip)      # 0xaa18
xorl %edi, %edi
callq 0x2f10
movq 0x60(%rax), %rcx
movq %rcx, 0x68(%rsp)
movq %rcx, 0x20(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x38(%rsp)
movupd %xmm0, 0x28(%rsp)
movl 0x68(%rax), %ecx
movq 0x38(%rsp), %rdx
movq %rdx, 0x50(%rsp)
movq 0x40(%rsp), %rdx
movq %rdx, 0x48(%rsp)
movq 0x30(%rsp), %r13
testq %rcx, %rcx
je 0x5a86
movq 0x70(%rax), %rbp
leaq (%rcx,%rcx,2), %rax
leaq (,%rax,8), %r15
addq %rbp, %r15
movq $0x0, (%rsp)
leaq 0x1bfb(%rip), %rax      # 0x74e2
movq %rax, 0x18(%rsp)
movq %r13, %rbx
cmpb $0x1, 0x8(%rbp)
jne 0x59ed
movq (%rbp), %r13
movl 0xc(%rbp), %edi
callq 0x2efa
movq %rax, %r14
movl (%rax), %r12d
testl %r12d, %r12d
je 0x594f
cmpl $0x1, %r12d
jne 0x599c
cmpl $0x1e, 0x38(%r14)
jb 0x5940
movq 0x8(%r14), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x1b5f(%rip), %rsi      # 0x7492
callq 0x2270
testl %eax, %eax
je 0x5a05
movq (%rsp), %rcx
testl %r12d, %r12d
je 0x5953
movq %rcx, (%rsp)
jmp 0x599c
movq (%rsp), %rcx
movq %rcx, (%rsp)
movq 0x10(%r14), %rax
movq 0x10(%rax), %rdi
leaq 0x1b8d(%rip), %rsi      # 0x74f3
callq 0x2270
testl %eax, %eax
jne 0x599c
movq 0x10(%r13), %rdi
leaq 0x1b7e(%rip), %rsi      # 0x74f8
callq 0x2270
testl %eax, %eax
jne 0x599c
cmpq $0x0, 0x50(%rsp)
movq (%rsp), %rax
jne 0x5dc1
movq %r14, 0x50(%rsp)
movq %rax, (%rsp)
movl 0x38(%r14), %eax
addl $-0x65, %eax
cmpl $0x76, %eax
ja 0x59ed
movq 0x40(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x3034
leaq 0x8(%rsp), %rdi
callq 0x2804
cmpb $-0x30, %al
jne 0x59ed
leaq 0x8(%rsp), %rdi
callq 0x2804
cmpb $0x30, %al
jne 0x59ed
leaq 0x8(%rsp), %rdi
callq 0x2804
cmpb $0x5d, %al
jne 0x5a3c
movq %r14, %r13
testq %rbx, %rbx
je 0x5a3f
jmp 0x5dd2
movq %rbx, %r13
addq $0x18, %rbp
movq %r13, %rbx
cmpq %r15, %rbp
jne 0x58ef
jmp 0x5a8e
movq 0x40(%r14), %rax
xorl %ecx, %ecx
movb (%rax,%rcx), %dl
leaq 0x1b4d(%rip), %rsi      # 0x7562
cmpb (%rcx,%rsi), %dl
jne 0x5940
incq %rcx
cmpq $0x9, %rcx
jne 0x5a0b
movq (%rsp), %rax
movq %r14, %rcx
testq %rax, %rax
je 0x5944
jmp 0x5e0a
movq %rbx, %r13
cmpl $0x6, 0x24(%r14)
jne 0x5a5d
cmpl $0x4, 0x28(%r14)
movq 0x48(%rsp), %rax
jne 0x5a58
cmpl $0x0, (%r14)
je 0x5a69
movq %rax, %r14
jmp 0x5a62
movq 0x48(%rsp), %r14
movq %r14, 0x48(%rsp)
jmp 0x59f0
testq %rax, %rax
je 0x5a62
movq (%rsp), %r15
movl $0xcb, %ebp
movq %r13, %rbx
leaq 0x1aa8(%rip), %rax      # 0x7529
jmp 0x5de2
movq $0x0, (%rsp)
movq (%rsp), %rax
movq %rax, %r12
movq %rax, 0x28(%rsp)
movq 0x50(%rsp), %r15
movq %r15, 0x38(%rsp)
movq %r13, 0x30(%rsp)
movq 0x48(%rsp), %rbx
movq %rbx, 0x40(%rsp)
xorl %r14d, %r14d
cmpq $0x0, 0x20(%rsp,%r14,8)
je 0x5c6f
incq %r14
cmpq $0x5, %r14
jne 0x5ab6
movq 0x68(%rsp), %rax
movq 0x40(%rax), %rsi
leaq 0x8(%rsp), %rdi
callq 0x3034
leaq 0x8(%rsp), %rdi
movl $0x11, %esi
callq 0x2986
leaq 0x8(%rsp), %rdi
movl $0x62, %esi
callq 0x2986
leaq 0x8(%rsp), %rdi
callq 0x5eee
movq 0x40(%r12), %rsi
leaq 0x8(%rsp), %rdi
callq 0x3034
leaq 0x8(%rsp), %rdi
movl $0x20, %esi
callq 0x2986
leaq 0x8(%rsp), %rdi
movl $0x20, %esi
callq 0x2986
leaq 0x8(%rsp), %rdi
movl $0x20, %esi
callq 0x2986
leaq 0x8(%rsp), %rdi
movl $0xd3, %esi
callq 0x2986
leaq 0x8(%rsp), %rdi
callq 0x5eee
movq 0x40(%r13), %rsi
leaq 0x8(%rsp), %rdi
callq 0x3034
leaq 0x8(%rsp), %rdi
movl $0xd1, %esi
callq 0x2986
leaq 0x8(%rsp), %rdi
callq 0x5eee
movq 0x40(%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x3034
leaq 0x8(%rsp), %rdi
movl $0xd1, %esi
callq 0x2986
leaq 0x8(%rsp), %rdi
callq 0x5eee
movq 0x40(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x3034
leaq 0x8(%rsp), %rdi
movl $0xd3, %esi
callq 0x2986
leaq 0x8(%rsp), %rdi
callq 0x5eee
leaq 0x4e0d(%rip), %rdi      # 0xa9e4
callq 0x4ef6
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x1815(%rip), %rsi      # 0x7401
callq 0x2240
movq %rax, %r14
leaq 0x4de9(%rip), %rdi      # 0xa9e4
movq %rax, %rsi
callq 0x505c
movq %r14, %rdi
callq 0x21c0
movq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x4ba4
movl $0x30, %esi
movq %rbx, %rdi
callq 0x21e0
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x105, %ebp            # imm = 0x105
movl $0x18, %edi
callq 0x2100
movl %ebp, (%rax)
leaq 0x1732(%rip), %rcx      # 0x7383
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x412b(%rip), %rsi      # 0x9d90
movq %rax, %rdi
xorl %edx, %edx
callq 0x22c0
movq 0x435a(%rip), %rdi      # 0x9fd0
leaq 0x18bd(%rip), %rsi      # 0x753a
movl $0x4, %edx
callq 0x2220
movq 0x4342(%rip), %rdi      # 0x9fd0
movq %r14, %rsi
callq 0x2140
movq %rax, %rbx
leaq 0x189f(%rip), %rsi      # 0x753f
movl $0x8, %edx
movq %rax, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x20f0
leaq 0x188c(%rip), %rax      # 0x7548
movq %rax, 0x18(%rsp)
movl $0xd4, %ebp
jmp 0x5c3e
movl $0x124, %ebp            # imm = 0x124
jmp 0x5c3e
movl $0x128, %ebp            # imm = 0x128
jmp 0x5c3e
movl $0x131, %ebp            # imm = 0x131
jmp 0x5c3e
movl $0x132, %ebp            # imm = 0x132
jmp 0x5c3e
movl $0x12f, %ebp            # imm = 0x12F
jmp 0x5c3e
leaq 0x16d0(%rip), %rbx      # 0x73d4
movl $0x147, %ebp            # imm = 0x147
jmp 0x5d17
leaq 0x16d8(%rip), %rbx      # 0x73ea
movl $0x14a, %ebp            # imm = 0x14A
movl $0x18, %edi
callq 0x2100
movl %ebp, (%rax)
leaq 0x1659(%rip), %rcx      # 0x7383
movq %rcx, 0x8(%rax)
movq %rbx, 0x10(%rax)
leaq 0x4057(%rip), %rsi      # 0x9d90
movq %rax, %rdi
xorl %edx, %edx
callq 0x22c0
movl $0x13c, %ebp            # imm = 0x13C
jmp 0x5c3e
leaq 0x16ef(%rip), %rax      # 0x7443
movq %rax, 0x18(%rsp)
movl $0x13e, %ebp            # imm = 0x13E
jmp 0x5c3e
leaq 0x170f(%rip), %rax      # 0x7479
movq %rax, 0x18(%rsp)
movl $0x11c, %ebp            # imm = 0x11C
jmp 0x5c3e
movl $0x11e, %ebp            # imm = 0x11E
jmp 0x5c3e
movl $0x11f, %ebp            # imm = 0x11F
jmp 0x5c3e
movl $0x120, %ebp            # imm = 0x120
jmp 0x5c3e
movl $0x121, %ebp            # imm = 0x121
jmp 0x5c3e
movl $0x122, %ebp            # imm = 0x122
jmp 0x5c3e
leaq 0x1707(%rip), %rax      # 0x74b9
movq %rax, 0x18(%rsp)
movl $0xfc, %ebp
jmp 0x5c3e
movl $0xba, %ebp
movq %rax, %r15
leaq 0x1737(%rip), %rax      # 0x7507
jmp 0x5de2
movq (%rsp), %r15
movl $0xc6, %ebp
leaq 0x1736(%rip), %rax      # 0x7518
movq %rax, 0x18(%rsp)
movq %r15, 0x28(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x38(%rsp)
movq %rbx, 0x30(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x5c3e
movq %rax, %r15
movl $0xb3, %ebp
jmp 0x5de7
movl $0xf5, %ebp
leaq 0x167d(%rip), %rax      # 0x749d
movq %rax, 0x18(%rsp)
jmp 0x5c3e
movq %rdx, %r15
movq %rax, %r14
movl $0x30, %esi
movq 0x58(%rsp), %rdi
callq 0x21e0
jmp 0x5e53
jmp 0x5e4d
jmp 0x5e4d
jmp 0x5e4d
jmp 0x5e4d
jmp 0x5e4d
jmp 0x5e4d
movq %rdx, %r15
movq %rax, %r14
cmpl $0x2, %r15d
jne 0x5e85
movq %r14, %rdi
callq 0x20c0
movupd (%rax), %xmm0
leaq 0x70(%rsp), %rdi
movapd %xmm0, (%rdi)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rdi)
callq 0x5f62
callq 0x22a0
jmp 0x5c25
cmpl $0x1, %r15d
jne 0x5ee6
movq %r14, %rdi
callq 0x20c0
movq %rax, %rbx
movq 0x4133(%rip), %rdi      # 0x9fd0
leaq 0x1560(%rip), %rsi      # 0x7404
movl $0x33, %edx
callq 0x2220
movq 0x411b(%rip), %rdi      # 0x9fd0
callq 0x20f0
movq %rbx, %rdi
callq 0x2331
movl $0x1, %eax
jmp 0x5c27
movq %rax, %r14
callq 0x22a0
jmp 0x5ee6
movq %rax, %rdi
callq 0x608a
movq %rax, %r14
callq 0x22a0
movq %r14, %rdi
callq 0x22f0