// File: /workspace/github_cpp_makefile_star2_O2/fei3189[P]PLSI/main.cpp
// Function: main
int main(int argc, char **argv) {
    if (argc < 4) {
        cerr << "usage: ./plsa train stopwords num_topics" << endl;
        exit(-1);
    }
    vector<string> docs, w_stop;
    string line;

    ifstream fin;
    fin.open(argv[1], ios_base::in);
    if (!fin) {
        cerr << "Train file: " << argv[1] << " does not exist" << endl;
        exit(-2);
    }
    getline(fin, line); // Ignore the first line
    for (; getline(fin, line); ) {
        docs.push_back(line);
    }
    fin.close();
    
    fin.open(argv[2], ios_base::in);
    if (!fin) {
        cerr << "Stop words file: " << argv[2] << " does not exist" << endl;
        exit(-3);
    }
    for (; getline(fin, line); ) {
        w_stop.push_back(line);
    }
    fin.close();

    PLSI plsa = PLSI::train(docs, atoi(argv[3]), w_stop);
    plsa.output();
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x338, %rsp            # imm = 0x338
cmpl $0x3, %edi
jle 0x259f
movq %rsi, %rbx
andq $0x0, 0x30(%rsp)
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, (%rsp)
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x58(%rsp), %rdi
callq 0x21e0
movq 0x8(%rbx), %rsi
leaq 0x58(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x2110
movq 0x58(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x78(%rsp,%rax)
jne 0x25c2
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x2050
leaq 0x58(%rsp), %r14
leaq 0x38(%rsp), %r15
leaq 0x20(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x2050
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x24c2
movq %r12, %rdi
movq %r15, %rsi
callq 0x2684
jmp 0x249c
leaq 0x58(%rsp), %rdi
callq 0x2060
movq 0x10(%rbx), %rsi
leaq 0x58(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x2110
movq 0x58(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x78(%rsp,%rax)
jne 0x25fc
leaq 0x58(%rsp), %r14
leaq 0x38(%rsp), %r15
movq %rsp, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x2050
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2524
movq %r12, %rdi
movq %r15, %rsi
callq 0x2684
jmp 0x24fe
leaq 0x58(%rsp), %rdi
callq 0x2060
movq 0x18(%rbx), %rdi
callq 0x2250
leaq 0x260(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %rsp, %rcx
movl %eax, %edx
callq 0x26b0
leaq 0x260(%rsp), %rdi
callq 0x26f8
leaq 0x260(%rsp), %rdi
callq 0x284e
leaq 0x58(%rsp), %rdi
callq 0x2070
leaq 0x38(%rsp), %rdi
callq 0x20c0
movq %rsp, %rdi
callq 0x288c
leaq 0x20(%rsp), %rdi
callq 0x288c
xorl %eax, %eax
addq $0x338, %rsp            # imm = 0x338
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x7a4a(%rip), %rdi      # 0x9ff0
leaq 0x3aa3(%rip), %rsi      # 0x6050
callq 0x21a0
movq %rax, %rdi
callq 0x20e0
pushq $-0x1
popq %rdi
callq 0x21f0
movq 0x7a27(%rip), %rdi      # 0x9ff0
leaq 0x3aa9(%rip), %rsi      # 0x6079
callq 0x21a0
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x21a0
leaq 0x3a9e(%rip), %rsi      # 0x6086
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20e0
pushq $-0x2
jmp 0x25bc
movq 0x79ed(%rip), %rdi      # 0x9ff0
leaq 0x3a8c(%rip), %rsi      # 0x6096
callq 0x21a0
movq 0x10(%rbx), %rsi
movq %rax, %rdi
callq 0x21a0
leaq 0x3a64(%rip), %rsi      # 0x6086
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20e0
pushq $-0x3
jmp 0x25bc
movq %rax, %rbx
leaq 0x260(%rsp), %rdi
callq 0x284e
jmp 0x2656
jmp 0x2653
movq %rax, %rbx
jmp 0x2660
jmp 0x2653
jmp 0x2653
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x2070
leaq 0x38(%rsp), %rdi
callq 0x20c0
movq %rsp, %rdi
callq 0x288c
leaq 0x20(%rsp), %rdi
callq 0x288c
movq %rbx, %rdi
callq 0x22b0