// File: matengyue[P]Similar_test_demo/./src/main_.cpp
// Function: main
int main(int argc, char **argv){
    string path_x = "../src/read_x";
    string path_y = "../src/read_y";
    string str_x;
    string str_y;

    if (argc == 4 && string(argv[1]) == "-w"){
        str_x = "python ../src/jiebaCutW.py " + string(argv[2]) + " > ../src/result_x";
        str_y = "python ../src/jiebaCutW.py " + string(argv[3]) + " > ../src/result_y";
    }
    else if (argc == 4 && string(argv[1]) == "-t"){
        path_x = argv[2];
        path_y = argv[3];
        str_x = "python ../src/jiebaCut.py " + path_x + " > ../src/result_x";
        str_y = "python ../src/jiebaCut.py " + path_y + " > ../src/result_y";
    }
    else {
        str_x = "python ../src/jiebaCut.py " + path_x + " > ../src/result_x";
        str_y = "python ../src/jiebaCut.py " + path_y + " > ../src/result_y";
    }

    system(str_x.c_str());
    system(str_y.c_str());
    
    vector<string> x = ReadAllLinesFromFile("../src/result_x");
    vector<string> y = ReadAllLinesFromFile("../src/result_y");

    x = deleteStopWords(x);
    y = deleteStopWords(y);

    int **a = vectorConstruct(x, y);
    double score = cosSimilar(a[2][0], a[0], a[1]);

    //cout << score << endl;

    if (score <= 0.31){
        cout << "不相关。" << endl;
    }
    else if (score <= 0.69){
        cout << "相关。" << endl;
    }
    else if (score <= 0.95){
        cout << "比较相似。" << endl;
    }
    else {
        cout << "非常相似。" << endl;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4c0, %rsp            # imm = 0x4C0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x3f8(%rbp)
callq 0x2390
movq -0x3f8(%rbp), %rdx
leaq 0x2fff(%rip), %rsi      # 0x6046
leaq -0x30(%rbp), %rdi
callq 0x3f50
jmp 0x3052
leaq -0x31(%rbp), %rdi
callq 0x2280
leaq -0x69(%rbp), %rdi
movq %rdi, -0x400(%rbp)
callq 0x2390
movq -0x400(%rbp), %rdx
leaq 0x2fdb(%rip), %rsi      # 0x6054
leaq -0x68(%rbp), %rdi
callq 0x3f50
jmp 0x3084
leaq -0x69(%rbp), %rdi
callq 0x2280
leaq -0x90(%rbp), %rdi
callq 0x2300
leaq -0xb0(%rbp), %rdi
callq 0x2300
movl -0x8(%rbp), %ecx
movb $0x0, -0xd2(%rbp)
movb $0x0, -0xd3(%rbp)
xorl %eax, %eax
cmpl $0x4, %ecx
movb %al, -0x401(%rbp)
jne 0x3138
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x418(%rbp)
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x410(%rbp)
callq 0x2390
movq -0x418(%rbp), %rsi
movq -0x410(%rbp), %rdx
movb $0x1, -0xd2(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x3f50
jmp 0x3108
movb $0x1, -0xd3(%rbp)
leaq 0x2f4c(%rip), %rsi      # 0x6062
leaq -0xd0(%rbp), %rdi
callq 0x4000
movb %al, -0x419(%rbp)
jmp 0x312a
movb -0x419(%rbp), %al
movb %al, -0x401(%rbp)
jmp 0x3138
movb -0x401(%rbp), %al
movb %al, -0x41a(%rbp)
testb $0x1, -0xd3(%rbp)
jne 0x314f
jmp 0x315b
leaq -0xd0(%rbp), %rdi
callq 0x2180
testb $0x1, -0xd2(%rbp)
jne 0x3166
jmp 0x3172
leaq -0xd1(%rbp), %rdi
callq 0x2280
movb -0x41a(%rbp), %al
testb $0x1, %al
jne 0x3181
jmp 0x3424
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x430(%rbp)
leaq -0x139(%rbp), %rdi
movq %rdi, -0x428(%rbp)
callq 0x2390
movq -0x430(%rbp), %rsi
movq -0x428(%rbp), %rdx
leaq -0x138(%rbp), %rdi
callq 0x3f50
jmp 0x31bf
leaq 0x2e9f(%rip), %rsi      # 0x6065
leaq -0x118(%rbp), %rdi
leaq -0x138(%rbp), %rdx
callq 0x4080
jmp 0x31db
leaq 0x2e9f(%rip), %rdx      # 0x6081
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x4030
jmp 0x31f7
leaq -0x90(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
movq %rsi, -0x448(%rbp)
callq 0x22b0
movq -0x448(%rbp), %rdi
callq 0x2180
leaq -0x118(%rbp), %rdi
callq 0x2180
leaq -0x138(%rbp), %rdi
callq 0x2180
leaq -0x139(%rbp), %rdi
callq 0x2280
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x440(%rbp)
leaq -0x1a1(%rbp), %rdi
movq %rdi, -0x438(%rbp)
callq 0x2390
movq -0x440(%rbp), %rsi
movq -0x438(%rbp), %rdx
leaq -0x1a0(%rbp), %rdi
callq 0x3f50
jmp 0x327f
leaq 0x2ddf(%rip), %rsi      # 0x6065
leaq -0x180(%rbp), %rdi
leaq -0x1a0(%rbp), %rdx
callq 0x4080
jmp 0x329b
leaq 0x2df2(%rip), %rdx      # 0x6094
leaq -0x160(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x4030
jmp 0x32b7
leaq -0xb0(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x22b0
leaq -0x160(%rbp), %rdi
callq 0x2180
leaq -0x180(%rbp), %rdi
callq 0x2180
leaq -0x1a0(%rbp), %rdi
callq 0x2180
leaq -0x1a1(%rbp), %rdi
callq 0x2280
jmp 0x3791
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x2280
jmp 0x3c5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x2280
jmp 0x3c53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3366
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0xd3(%rbp)
jne 0x3358
jmp 0x3364
leaq -0xd0(%rbp), %rdi
callq 0x2180
jmp 0x3366
testb $0x1, -0xd2(%rbp)
jne 0x3371
jmp 0x337d
leaq -0xd1(%rbp), %rdi
callq 0x2280
jmp 0x3c32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x33c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x33b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x2180
leaq -0x138(%rbp), %rdi
callq 0x2180
leaq -0x139(%rbp), %rdi
callq 0x2280
jmp 0x3c32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3413
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3407
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x2180
leaq -0x1a0(%rbp), %rdi
callq 0x2180
leaq -0x1a1(%rbp), %rdi
callq 0x2280
jmp 0x3c32
movl -0x8(%rbp), %ecx
movb $0x0, -0x1ca(%rbp)
movb $0x0, -0x1cb(%rbp)
xorl %eax, %eax
cmpl $0x4, %ecx
movb %al, -0x449(%rbp)
jne 0x34b7
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x460(%rbp)
leaq -0x1c9(%rbp), %rdi
movq %rdi, -0x458(%rbp)
callq 0x2390
movq -0x460(%rbp), %rsi
movq -0x458(%rbp), %rdx
movb $0x1, -0x1ca(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x3f50
jmp 0x3487
movb $0x1, -0x1cb(%rbp)
leaq 0x2c12(%rip), %rsi      # 0x60a7
leaq -0x1c8(%rbp), %rdi
callq 0x4000
movb %al, -0x461(%rbp)
jmp 0x34a9
movb -0x461(%rbp), %al
movb %al, -0x449(%rbp)
jmp 0x34b7
movb -0x449(%rbp), %al
movb %al, -0x462(%rbp)
testb $0x1, -0x1cb(%rbp)
jne 0x34ce
jmp 0x34da
leaq -0x1c8(%rbp), %rdi
callq 0x2180
testb $0x1, -0x1ca(%rbp)
jne 0x34e5
jmp 0x34f1
leaq -0x1c9(%rbp), %rdi
callq 0x2280
movb -0x462(%rbp), %al
testb $0x1, %al
jne 0x3500
jmp 0x368c
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x30(%rbp), %rdi
callq 0x22f0
jmp 0x3513
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x68(%rbp), %rdi
callq 0x22f0
jmp 0x3526
leaq 0x2b7d(%rip), %rsi      # 0x60aa
leaq -0x210(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x40d0
jmp 0x353f
leaq 0x2b3b(%rip), %rdx      # 0x6081
leaq -0x1f0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x4030
jmp 0x355b
leaq -0x90(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
movq %rsi, -0x470(%rbp)
callq 0x22b0
movq -0x470(%rbp), %rdi
callq 0x2180
leaq -0x210(%rbp), %rdi
callq 0x2180
leaq 0x2b16(%rip), %rsi      # 0x60aa
leaq -0x250(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x40d0
jmp 0x35a6
leaq 0x2ae7(%rip), %rdx      # 0x6094
leaq -0x230(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x4030
jmp 0x35c2
leaq -0xb0(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x22b0
leaq -0x230(%rbp), %rdi
callq 0x2180
leaq -0x250(%rbp), %rdi
callq 0x2180
jmp 0x378f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3625
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0x1cb(%rbp)
jne 0x3617
jmp 0x3623
leaq -0x1c8(%rbp), %rdi
callq 0x2180
jmp 0x3625
testb $0x1, -0x1ca(%rbp)
jne 0x3630
jmp 0x363c
leaq -0x1c9(%rbp), %rdi
callq 0x2280
jmp 0x3c32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3c32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x2180
jmp 0x3c32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x2180
jmp 0x3c32
leaq 0x2a17(%rip), %rsi      # 0x60aa
leaq -0x290(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x40d0
jmp 0x36a5
leaq 0x29d5(%rip), %rdx      # 0x6081
leaq -0x270(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x4030
jmp 0x36c1
leaq -0x90(%rbp), %rdi
leaq -0x270(%rbp), %rsi
movq %rsi, -0x478(%rbp)
callq 0x22b0
movq -0x478(%rbp), %rdi
callq 0x2180
leaq -0x290(%rbp), %rdi
callq 0x2180
leaq 0x29b0(%rip), %rsi      # 0x60aa
leaq -0x2d0(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x40d0
jmp 0x370c
leaq 0x2981(%rip), %rdx      # 0x6094
leaq -0x2b0(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x4030
jmp 0x3728
leaq -0xb0(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x22b0
leaq -0x2b0(%rbp), %rdi
callq 0x2180
leaq -0x2d0(%rbp), %rdi
callq 0x2180
jmp 0x378f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x2180
jmp 0x3c32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x2180
jmp 0x3c32
jmp 0x3791
leaq -0x90(%rbp), %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x2210
jmp 0x37a7
leaq -0xb0(%rbp), %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x2210
jmp 0x37bd
leaq -0x309(%rbp), %rdi
movq %rdi, -0x480(%rbp)
callq 0x2390
movq -0x480(%rbp), %rdx
leaq 0x28a6(%rip), %rsi      # 0x6084
leaq -0x308(%rbp), %rdi
callq 0x3f50
jmp 0x37ec
leaq -0x2e8(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x2b70
jmp 0x3801
leaq -0x308(%rbp), %rdi
callq 0x2180
leaq -0x309(%rbp), %rdi
callq 0x2280
leaq -0x349(%rbp), %rdi
movq %rdi, -0x488(%rbp)
callq 0x2390
movq -0x488(%rbp), %rdx
leaq 0x285d(%rip), %rsi      # 0x6097
leaq -0x348(%rbp), %rdi
callq 0x3f50
jmp 0x3848
leaq -0x328(%rbp), %rdi
leaq -0x348(%rbp), %rsi
callq 0x2b70
jmp 0x385d
leaq -0x348(%rbp), %rdi
callq 0x2180
leaq -0x349(%rbp), %rdi
callq 0x2280
leaq -0x380(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x41e0
jmp 0x388a
leaq -0x368(%rbp), %rdi
leaq -0x380(%rbp), %rsi
callq 0x2dd0
jmp 0x389f
leaq -0x2e8(%rbp), %rdi
leaq -0x368(%rbp), %rsi
movq %rsi, -0x490(%rbp)
callq 0x42d0
movq -0x490(%rbp), %rdi
callq 0x3dd0
leaq -0x380(%rbp), %rdi
callq 0x3dd0
leaq -0x3b0(%rbp), %rdi
leaq -0x328(%rbp), %rsi
callq 0x41e0
jmp 0x38e6
leaq -0x398(%rbp), %rdi
leaq -0x3b0(%rbp), %rsi
callq 0x2dd0
jmp 0x38fb
leaq -0x328(%rbp), %rdi
leaq -0x398(%rbp), %rsi
movq %rsi, -0x498(%rbp)
callq 0x42d0
movq -0x498(%rbp), %rdi
callq 0x3dd0
leaq -0x3b0(%rbp), %rdi
callq 0x3dd0
leaq -0x3d0(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x41e0
jmp 0x3942
leaq -0x3e8(%rbp), %rdi
leaq -0x328(%rbp), %rsi
callq 0x41e0
jmp 0x3957
leaq -0x3d0(%rbp), %rdi
leaq -0x3e8(%rbp), %rsi
callq 0x2630
movq %rax, -0x4a0(%rbp)
jmp 0x3973
leaq -0x3e8(%rbp), %rdi
callq 0x3dd0
leaq -0x3d0(%rbp), %rdi
callq 0x3dd0
movq -0x4a0(%rbp), %rax
movq %rax, -0x3b8(%rbp)
movq -0x3b8(%rbp), %rax
movq 0x10(%rax), %rax
movl (%rax), %edi
movq -0x3b8(%rbp), %rax
movq (%rax), %rsi
movq -0x3b8(%rbp), %rax
movq 0x8(%rax), %rdx
callq 0x2520
movsd %xmm0, -0x3f0(%rbp)
movsd 0x2638(%rip), %xmm0     # 0x6008
ucomisd -0x3f0(%rbp), %xmm0
jb 0x3b04
movq 0x55eb(%rip), %rdi      # 0x8fd0
leaq 0x26d9(%rip), %rsi      # 0x60c5
callq 0x2230
movq %rax, -0x4a8(%rbp)
jmp 0x39fa
movq -0x4a8(%rbp), %rdi
movq 0x55b0(%rip), %rsi      # 0x8fb8
callq 0x2260
jmp 0x3a0f
jmp 0x3bc5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3a3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x308(%rbp), %rdi
callq 0x2180
leaq -0x309(%rbp), %rdi
callq 0x2280
jmp 0x3c32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3a71
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x348(%rbp), %rdi
callq 0x2180
leaq -0x349(%rbp), %rdi
callq 0x2280
jmp 0x3c26
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3c1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x380(%rbp), %rdi
callq 0x3dd0
jmp 0x3c1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x3b0(%rbp), %rdi
callq 0x3dd0
jmp 0x3c1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3af3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x3e8(%rbp), %rdi
callq 0x3dd0
leaq -0x3d0(%rbp), %rdi
callq 0x3dd0
jmp 0x3c1a
movsd 0x2504(%rip), %xmm0     # 0x6010
ucomisd -0x3f0(%rbp), %xmm0
jb 0x3b49
movq 0x54b3(%rip), %rdi      # 0x8fd0
leaq 0x25a4(%rip), %rsi      # 0x60c8
callq 0x2230
movq %rax, -0x4b0(%rbp)
jmp 0x3b32
movq -0x4b0(%rbp), %rdi
movq 0x5478(%rip), %rsi      # 0x8fb8
callq 0x2260
jmp 0x3b47
jmp 0x3bc3
movsd 0x24c7(%rip), %xmm0     # 0x6018
ucomisd -0x3f0(%rbp), %xmm0
jb 0x3b8e
movq 0x546e(%rip), %rdi      # 0x8fd0
leaq 0x2569(%rip), %rsi      # 0x60d2
callq 0x2230
movq %rax, -0x4b8(%rbp)
jmp 0x3b77
movq -0x4b8(%rbp), %rdi
movq 0x5433(%rip), %rsi      # 0x8fb8
callq 0x2260
jmp 0x3b8c
jmp 0x3bc1
movq 0x543b(%rip), %rdi      # 0x8fd0
leaq 0x2546(%rip), %rsi      # 0x60e2
callq 0x2230
movq %rax, -0x4c0(%rbp)
jmp 0x3baa
movq -0x4c0(%rbp), %rdi
movq 0x5400(%rip), %rsi      # 0x8fb8
callq 0x2260
jmp 0x3bbf
jmp 0x3bc1
jmp 0x3bc3
jmp 0x3bc5
movl $0x0, -0x4(%rbp)
leaq -0x328(%rbp), %rdi
callq 0x3dd0
leaq -0x2e8(%rbp), %rdi
callq 0x3dd0
leaq -0xb0(%rbp), %rdi
callq 0x2180
leaq -0x90(%rbp), %rdi
callq 0x2180
leaq -0x68(%rbp), %rdi
callq 0x2180
leaq -0x30(%rbp), %rdi
callq 0x2180
movl -0x4(%rbp), %eax
addq $0x4c0, %rsp            # imm = 0x4C0
popq %rbp
retq
leaq -0x328(%rbp), %rdi
callq 0x3dd0
leaq -0x2e8(%rbp), %rdi
callq 0x3dd0
leaq -0xb0(%rbp), %rdi
callq 0x2180
leaq -0x90(%rbp), %rdi
callq 0x2180
leaq -0x68(%rbp), %rdi
callq 0x2180
leaq -0x30(%rbp), %rdi
callq 0x2180
movq -0x40(%rbp), %rdi
callq 0x2380
nopw %cs:(%rax,%rax)
nop