// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x90, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, %edi
callq 0x20c0
cmpl $0x2, -0x8(%rbp)
jge 0x96ab
movl $0x18, %edi
callq 0x20e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x58(%rbp)
leaq 0x20d8(%rip), %rsi      # 0xb72c
leaq 0x2080(%rip), %rdx      # 0xb6db
movl $0x147, %ecx            # imm = 0x147
callq 0x2f40
jmp 0x9667
movq -0x58(%rbp), %rdi
leaq 0x7716(%rip), %rsi      # 0x10d88
xorl %eax, %eax
movl %eax, %edx
callq 0x22a0
jmp 0x98ec
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2110
jmp 0x97f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x97f5
cmpl $0x3, -0x8(%rbp)
jge 0x9712
movl $0x18, %edi
callq 0x20e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x60(%rbp)
leaq 0x2076(%rip), %rsi      # 0xb742
leaq 0x2008(%rip), %rdx      # 0xb6db
movl $0x14a, %ecx            # imm = 0x14A
callq 0x2f40
jmp 0x96df
movq -0x60(%rbp), %rdi
leaq 0x769e(%rip), %rsi      # 0x10d88
xorl %eax, %eax
movl %eax, %edx
callq 0x22a0
jmp 0x98ec
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2110
jmp 0x97f5
callq 0x4780
jmp 0x9719
movl $0x30, %edi
callq 0x2180
movq %rax, -0x68(%rbp)
jmp 0x9729
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x7750
jmp 0x973c
movq -0x68(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x98f0
jmp 0x974b
callq 0x9a40
jmp 0x9752
callq 0xa0e0
jmp 0x9759
callq 0xa520
jmp 0x9760
leaq 0x827d(%rip), %rdi      # 0x119e4
callq 0x8db0
jmp 0x976e
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x1fdc(%rip), %rsi      # 0xb759
callq 0x21f0
movq %rax, -0x70(%rbp)
jmp 0x9788
movq -0x70(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rsi
leaq 0x8249(%rip), %rdi      # 0x119e4
callq 0x8ec0
jmp 0x97a2
movq -0x30(%rbp), %rdi
callq 0x2170
jmp 0x97ad
movq -0x28(%rbp), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, %rax
je 0x97d2
movq -0x78(%rbp), %rdi
callq 0x7d60
movq -0x78(%rbp), %rdi
movl $0x30, %esi
callq 0x2190
movl $0x0, -0x4(%rbp)
jmp 0x982c
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x30, %esi
callq 0x2190
movl -0x1c(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x9838
movq -0x18(%rbp), %rdi
callq 0x20b0
movq 0x10(%rax), %rcx
movq %rcx, -0x40(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xad40
jmp 0x9827
callq 0x2280
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
movl -0x7c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x98db
movq -0x18(%rbp), %rdi
callq 0x20b0
movq %rax, -0x38(%rbp)
movq 0x7774(%rip), %rdi      # 0x10fd0
leaq 0x1ef9(%rip), %rsi      # 0xb75c
callq 0x2160
movq %rax, -0x88(%rbp)
jmp 0x9871
movq -0x88(%rbp), %rdi
movq 0x7741(%rip), %rsi      # 0x10fc0
callq 0x21b0
jmp 0x9886
movq 0x774b(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
leaq 0x1ef5(%rip), %rsi      # 0xb790
movb $0x0, %al
callq 0x2240
movl $0x1, -0x4(%rbp)
callq 0x2280
jmp 0x982c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2280
jmp 0x98db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2280
jmp 0x98d9
jmp 0x98db
movq -0x18(%rbp), %rdi
callq 0x22d0
movq %rax, %rdi
callq 0x3f00
nopl (%rax)