// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x340, %rsp            # imm = 0x340
cmpl $0x3, %edi
jle 0x2716
movq %rsi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
xorl %eax, %eax
movq %rax, 0x30(%rsp)
movq %rax, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0x50(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb $0x0, (%r13)
leaq 0x138(%rsp), %rdi
callq 0x2200
movq 0x8(%rbx), %rsi
leaq 0x138(%rsp), %rdi
movl $0x8, %edx
callq 0x2110
movq 0x138(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x158(%rsp,%rax)
jne 0x273b
leaq (%rsp,%rax), %rdi
addq $0x138, %rdi            # imm = 0x138
movl $0xa, %esi
callq 0x21b0
movsbl %al, %edx
leaq 0x138(%rsp), %r14
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0x22f0
leaq 0x40(%rsp), %r15
leaq 0x20(%rsp), %r12
movq 0x138(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x22f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x25b8
movq %r12, %rdi
movq %r15, %rsi
callq 0x2838
jmp 0x2576
leaq 0x138(%rsp), %rdi
callq 0x2060
movq 0x10(%rbx), %rsi
leaq 0x138(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x2110
movq 0x138(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x158(%rsp,%rax)
jne 0x278c
leaq 0x40(%rsp), %r15
movq %rsp, %r12
movq 0x138(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x22f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2642
movq %r12, %rdi
movq %r15, %rsi
callq 0x2838
jmp 0x2600
leaq 0x138(%rsp), %rdi
callq 0x2060
movq 0x18(%rbx), %rdi
callq 0x2270
leaq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %rsp, %rcx
movl %eax, %edx
callq 0x2876
leaq 0x60(%rsp), %rdi
callq 0x28be
leaq 0x100(%rsp), %rdi
callq 0x5674
leaq 0xd0(%rsp), %rdi
callq 0x56c2
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
callq 0x5626
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x26b9
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
leaq 0x78(%rsp), %rdi
callq 0x39f4
leaq 0x60(%rsp), %rdi
callq 0x39f4
leaq 0x138(%rsp), %rdi
callq 0x2070
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x26f1
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21e0
movq %rsp, %rdi
callq 0x2ab0
leaq 0x20(%rsp), %rdi
callq 0x2ab0
xorl %eax, %eax
addq $0x340, %rsp            # imm = 0x340
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x68d3(%rip), %rdi      # 0x8ff0
leaq 0x395c(%rip), %rsi      # 0x6080
callq 0x21c0
movq %rax, %rdi
callq 0x20d0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2220
movq 0x68ae(%rip), %rdi      # 0x8ff0
leaq 0x3960(%rip), %rsi      # 0x60a9
movl $0xc, %edx
callq 0x2210
movq 0x8(%rbx), %rsi
movq 0x6892(%rip), %rdi      # 0x8ff0
callq 0x21c0
movq %rax, %rbx
leaq 0x3949(%rip), %rsi      # 0x60b6
movl $0xf, %edx
movq %rax, %rdi
callq 0x2210
movq %rbx, %rdi
callq 0x20d0
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
callq 0x2220
movq 0x685d(%rip), %rdi      # 0x8ff0
leaq 0x392c(%rip), %rsi      # 0x60c6
movl $0x11, %edx
callq 0x2210
movq 0x10(%rbx), %rsi
movq 0x6841(%rip), %rdi      # 0x8ff0
callq 0x21c0
movq %rax, %rbx
leaq 0x38f8(%rip), %rsi      # 0x60b6
movl $0xf, %edx
movq %rax, %rdi
callq 0x2210
movq %rbx, %rdi
callq 0x20d0
movl $0xfffffffd, %edi       # imm = 0xFFFFFFFD
callq 0x2220
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2a66
jmp 0x27fa
jmp 0x27f7
movq %rax, %rbx
jmp 0x2807
jmp 0x27f7
jmp 0x27f7
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
callq 0x2070
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x281e
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21e0
movq %rsp, %rdi
callq 0x2ab0
leaq 0x20(%rsp), %rdi
callq 0x2ab0
movq %rbx, %rdi
callq 0x22d0