// File: /workspace/github_cpp_makefile_star2_O3/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 0x1567
movq %rsi, %rbx
cmpl $0x4, %edi
jne 0x12e2
movq 0x18(%rbx), %rdi
cmpb $0x2d, (%rdi)
jne 0x12c7
cmpb $0x76, 0x1(%rdi)
jne 0x12c7
cmpb $0x0, 0x2(%rdi)
je 0x12db
leaq 0xd99(%rip), %rsi       # 0x2067
callq 0x10e0
testl %eax, %eax
jne 0x1586
movb $0x1, 0x2dd8(%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 0x15c8
leaq -0xd0(%rbp), %rdi
callq 0x15c8
leaq -0x180(%rbp), %rdi
callq 0x1700
leaq -0xd0(%rbp), %rdi
callq 0x1700
movq -0xe8(%rbp), %rbx
movq -0xe0(%rbp), %r14
cmpq %r14, %rbx
je 0x13bb
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 0x1b8e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c72
movq -0x38(%rbp), %rbx
movq -0x30(%rbp), %r14
cmpq %r14, %rbx
je 0x13ff
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 0x1b8e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c72
movq -0x38(%rbp), %rbx
movq -0x30(%rbp), %rax
jmp 0x1402
movq %rbx, %rax
movq -0xe8(%rbp), %rdx
movq -0xe0(%rbp), %rsi
movq %rsi, %rcx
subq %rdx, %rcx
sarq $0x3, %rcx
subq %rbx, %rax
sarq $0x3, %rax
cmpq %rdx, %rsi
je 0x1469
xorl %r9d, %r9d
xorl %esi, %esi
xorl %edi, %edi
xorl %r8d, %r8d
movslq %edi, %r10
cmpq %r10, %rax
jbe 0x146b
movq (%rdx,%r9,8), %r9
movq (%rbx,%r10,8), %r10
cmpq %r10, %r9
jne 0x144e
incl %r8d
incl %edi
incl %esi
jmp 0x145f
jle 0x1454
incl %edi
jmp 0x145f
setl %r9b
movzbl %r9b, %r9d
addl %r9d, %r8d
movslq %r8d, %r9
cmpq %r9, %rcx
ja 0x1430
jmp 0x146b
xorl %esi, %esi
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movslq %esi, %rdx
subq %rdx, %rcx
addq %rax, %rcx
movq %rcx, %xmm1
punpckldq 0xb88(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xb90(%rip), %xmm1      # 0x2020
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
mulsd 0xb88(%rip), %xmm0      # 0x2030
leaq 0xbc2(%rip), %rdi       # 0x2071
movb $0x1, %al
callq 0x1030
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x14cb
movq -0x28(%rbp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x14e0
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x14fe
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x10c0
movq %rbx, %rdi
cmpq %r12, %rbx
jne 0x14e9
movq -0xe8(%rbp), %rdi
testq %rdi, %rdi
je 0x1519
movq -0xd8(%rbp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq -0x100(%rbp), %rdi
testq %rdi, %rdi
je 0x1534
movq -0xf0(%rbp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq -0x118(%rbp), %rdi
cmpq %r15, %rdi
je 0x1555
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x10c0
movq %rbx, %rdi
cmpq %r15, %rbx
jne 0x1540
xorl %eax, %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xaca(%rip), %rdi       # 0x2038
leaq 0xac9(%rip), %rsi       # 0x203e
leaq 0xad4(%rip), %rcx       # 0x2050
movl $0x5b, %edx
callq 0x1070
leaq 0xaab(%rip), %rdi       # 0x2038
leaq 0xaaa(%rip), %rsi       # 0x203e
leaq 0xab5(%rip), %rcx       # 0x2050
movl $0x62, %edx
callq 0x1070
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x18ac
leaq -0x180(%rbp), %rdi
callq 0x18ac
movq %rbx, %rdi
callq 0x1130