// File: epfml[P]Bi-Sent2Vec/src/main.cc
// Function: test(int, char**)
void test(int argc, char** argv) {
  if (argc < 4 || argc > 5) {
    printTestUsage();
    exit(EXIT_FAILURE);
  }
  int32_t k = 1;
  if (argc >= 5) {
    k = atoi(argv[4]);
  }

  FastText fasttext;
  fasttext.loadModel(std::string(argv[2]));

  std::string infile(argv[3]);
  if (infile == "-") {
    fasttext.test(std::cin, k);
  } else {
    std::ifstream ifs(infile);
    if (!ifs.is_open()) {
      std::cerr << "Test file cannot be opened!" << std::endl;
      exit(EXIT_FAILURE);
    }
    fasttext.test(ifs, k);
    ifs.close();
  }
  exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x340, %rsp            # imm = 0x340
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x4, -0x4(%rbp)
jl 0x3fe4e
cmpl $0x5, -0x4(%rbp)
jle 0x3fe5d
callq 0x3f970
movl $0x1, %edi
callq 0x54f0
movl $0x1, -0x14(%rbp)
cmpl $0x5, -0x4(%rbp)
jl 0x3fe7a
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x5680
movl %eax, -0x14(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x27dc0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x318(%rbp)
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x57b0
movq -0x318(%rbp), %rsi
movq -0x310(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0x7c10
jmp 0x3fec4
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
xorl %edx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x295b0
jmp 0x3fee0
leaq -0xc0(%rbp), %rdi
callq 0x58d8
leaq -0xc1(%rbp), %rdi
callq 0x5480
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x328(%rbp)
leaq -0xf9(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x57b0
movq -0x328(%rbp), %rsi
movq -0x320(%rbp), %rdx
leaq -0xf8(%rbp), %rdi
callq 0x7c10
jmp 0x3ff36
leaq -0xf9(%rbp), %rdi
callq 0x5480
leaq 0x3a0f(%rip), %rsi      # 0x43958
leaq -0xf8(%rbp), %rdi
callq 0x7cc0
movb %al, -0x329(%rbp)
jmp 0x3ff5d
movb -0x329(%rbp), %al
testb $0x1, %al
jne 0x3ff6c
jmp 0x40006
movl -0x14(%rbp), %edx
movq 0x1f062(%rip), %rsi     # 0x5efd8
leaq -0xa0(%rbp), %rdi
callq 0x2be10
jmp 0x3ff84
jmp 0x400cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x3ffbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x58d8
leaq -0xc1(%rbp), %rdi
callq 0x5480
jmp 0x400e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0xf9(%rbp), %rdi
callq 0x5480
jmp 0x400e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x400d4
leaq -0x308(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
movl $0x8, %edx
callq 0x56d0
jmp 0x40020
leaq -0x308(%rbp), %rdi
callq 0x56c0
movb %al, -0x32a(%rbp)
jmp 0x40034
movb -0x32a(%rbp), %al
testb $0x1, %al
jne 0x4009b
jmp 0x40040
movq 0x1efa9(%rip), %rdi     # 0x5eff0
leaq 0x45cf(%rip), %rsi      # 0x4461d
callq 0x5420
movq %rax, -0x338(%rbp)
jmp 0x4005c
movq -0x338(%rbp), %rdi
movq 0x1ef26(%rip), %rsi     # 0x5ef90
callq 0x5460
jmp 0x40071
movl $0x1, %edi
callq 0x54f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0x308(%rbp), %rdi
callq 0x5130
jmp 0x400d4
movl -0x14(%rbp), %edx
leaq -0xa0(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x2be10
jmp 0x400b3
leaq -0x308(%rbp), %rdi
callq 0x50f0
jmp 0x400c1
leaq -0x308(%rbp), %rdi
callq 0x5130
xorl %edi, %edi
callq 0x54f0
leaq -0xf8(%rbp), %rdi
callq 0x58d8
leaq -0xa0(%rbp), %rdi
callq 0x41a10
movq -0xd0(%rbp), %rdi
callq 0x57a0
nopl (%rax,%rax)