// File: /workspace/github_cpp_makefile_star2_O1/shengzh-oOoO[P]CodeSim/src/text_moss.cpp
// Function: main
int main(int argc, char ** argv){
    if (argc <=2 || argc >= 5){
        assert(false);
    }
    if (argc == 4){
        if(strcmp(argv[3],"-v")==0 || strcmp(argv[3],"--verbose")==0){
            debug_option = 1;
        }
        else{
            assert(false);
        }
    }
    CodeFile cfile1,cfile2;
    cfile1.init(argv[1]);
    cfile2.init(argv[2]);
    cfile1.CreateHashList();
    cfile2.CreateHashList();
    cfile1.Winnowing();
    cfile2.Winnowing();

    sort(cfile1.result.begin(), cfile1.result.end());
    sort(cfile2.result.begin(), cfile2.result.end());

    int i = 0, j = 0;
    int same_cnt = 0;
    while(i < cfile1.result.size() && j < cfile2.result.size()){
        if(cfile1.result[i] == cfile2.result[j]){
            i++;
            j++;
            same_cnt ++;
        }
        else if(cfile1.result[i] > cfile2.result[j]){
            j++;
        }
        else if(cfile1.result[i] < cfile2.result[j]){
            i++;
        }
    }
    double IoU = (double)same_cnt/(double)(cfile1.result.size() + cfile2.result.size() - same_cnt);
    printf("%0.1f\n",IoU * 100);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x160, %rsp            # imm = 0x160
leal -0x5(%rdi), %eax
cmpl $-0x3, %eax
jbe 0x1576
movq %rsi, %rbx
cmpl $0x4, %edi
jne 0x12e7
movq 0x18(%rbx), %r14
leaq 0xdaa(%rip), %rsi       # 0x2067
movq %r14, %rdi
callq 0x10e0
testl %eax, %eax
je 0x12e0
leaq 0xd9a(%rip), %rsi       # 0x206a
movq %r14, %rdi
callq 0x10e0
testl %eax, %eax
jne 0x1595
movb $0x1, 0x2dd3(%rip)      # 0x40ba
leaq -0x118(%rbp), %r15
movq %r15, 0x8(%r15)
movq %r15, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
movups %xmm0, 0x20(%r15)
movups %xmm0, 0x30(%r15)
xorl %eax, %eax
movq %rax, 0x40(%r15)
leaq -0x68(%rbp), %r12
movq %r12, 0x8(%r12)
movq %r12, (%r12)
movups %xmm0, 0x10(%r12)
movups %xmm0, 0x20(%r12)
movups %xmm0, 0x30(%r12)
movq %rax, 0x40(%r12)
movq 0x8(%rbx), %rsi
leaq -0x180(%rbp), %r14
movq %r14, %rdi
callq 0x10a0
movq 0x10(%rbx), %rsi
leaq -0xd0(%rbp), %rdi
callq 0x10a0
movq %r14, %rdi
callq 0x15d8
leaq -0xd0(%rbp), %rdi
callq 0x15d8
leaq -0x180(%rbp), %rdi
callq 0x170a
leaq -0xd0(%rbp), %rdi
callq 0x170a
movq -0xe8(%rbp), %rbx
movq -0xe0(%rbp), %r14
cmpq %r14, %rbx
je 0x13c0
movq %r14, %rax
subq %rbx, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1b6e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c52
movq -0x38(%rbp), %rbx
movq -0x30(%rbp), %r14
cmpq %r14, %rbx
je 0x13fa
movq %r14, %rax
subq %rbx, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1b6e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c52
movq -0xe8(%rbp), %rcx
movq -0xe0(%rbp), %rdx
movq %rdx, %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq %rcx, %rdx
je 0x146c
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdi
subq %rsi, %rdi
sarq $0x3, %rdi
xorl %r10d, %r10d
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
movslq %r8d, %r11
cmpq %r11, %rdi
jbe 0x146e
movq (%rcx,%r10,8), %r10
movq (%rsi,%r11,8), %r11
cmpq %r11, %r10
jne 0x1450
incl %r9d
incl %r8d
incl %edx
jmp 0x1462
jle 0x1457
incl %r8d
jmp 0x1462
setl %r10b
movzbl %r10b, %r10d
addl %r10d, %r9d
movslq %r9d, %r10
cmpq %r10, %rax
ja 0x1431
jmp 0x146e
xorl %edx, %edx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movq -0x30(%rbp), %rcx
subq -0x38(%rbp), %rcx
sarq $0x3, %rcx
movslq %edx, %rdx
subq %rdx, %rax
addq %rcx, %rax
movq %rax, %xmm1
punpckldq 0xb79(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xb81(%rip), %xmm1      # 0x2020
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
mulsd 0xb79(%rip), %xmm0      # 0x2030
leaq 0xbb6(%rip), %rdi       # 0x2074
movb $0x1, %al
callq 0x1030
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x14da
movq -0x28(%rbp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x14ef
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x150d
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x10c0
movq %rbx, %rdi
cmpq %r12, %rbx
jne 0x14f8
movq -0xe8(%rbp), %rdi
testq %rdi, %rdi
je 0x1528
movq -0xd8(%rbp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq -0x100(%rbp), %rdi
testq %rdi, %rdi
je 0x1543
movq -0xf0(%rbp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq -0x118(%rbp), %rdi
cmpq %r15, %rdi
je 0x1564
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x10c0
movq %rbx, %rdi
cmpq %r15, %rbx
jne 0x154f
xorl %eax, %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xabb(%rip), %rdi       # 0x2038
leaq 0xaba(%rip), %rsi       # 0x203e
leaq 0xac5(%rip), %rcx       # 0x2050
movl $0x5b, %edx
callq 0x1070
leaq 0xa9c(%rip), %rdi       # 0x2038
leaq 0xa9b(%rip), %rsi       # 0x203e
leaq 0xaa6(%rip), %rcx       # 0x2050
movl $0x62, %edx
callq 0x1070
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x188c
leaq -0x180(%rbp), %rdi
callq 0x188c
movq %rbx, %rdi
callq 0x1130
nop