// File: 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
subq $0x210, %rsp            # imm = 0x210
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jle 0x12c5
cmpl $0x5, -0x8(%rbp)
jl 0x12e4
leaq 0x3d6c(%rip), %rdi      # 0x5038
leaq 0x3d6b(%rip), %rsi      # 0x503e
movl $0x5b, %edx
leaq 0x3d71(%rip), %rcx      # 0x5050
callq 0x1090
cmpl $0x4, -0x8(%rbp)
jne 0x1346
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x3d6e(%rip), %rsi      # 0x5067
callq 0x1100
cmpl $0x0, %eax
je 0x131c
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x3d58(%rip), %rsi      # 0x506a
callq 0x1100
cmpl $0x0, %eax
jne 0x1325
movb $0x1, 0x7da7(%rip)      # 0x90ca
jmp 0x1344
leaq 0x3d0c(%rip), %rdi      # 0x5038
leaq 0x3d0b(%rip), %rsi      # 0x503e
movl $0x62, %edx
leaq 0x3d11(%rip), %rcx      # 0x5050
callq 0x1090
jmp 0x1346
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x1c0(%rbp)
callq 0x1730
leaq -0x170(%rbp), %rdi
callq 0x1730
movq -0x1c0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x1780
jmp 0x137b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x170(%rbp), %rdi
callq 0x1780
jmp 0x1391
leaq -0xc0(%rbp), %rdi
callq 0x17b0
jmp 0x139f
leaq -0x170(%rbp), %rdi
callq 0x17b0
jmp 0x13ad
leaq -0xc0(%rbp), %rdi
callq 0x18e0
jmp 0x13bb
leaq -0x170(%rbp), %rdi
callq 0x18e0
jmp 0x13c9
leaq -0x28(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x1b00
movq -0x1c8(%rbp), %rdi
movq %rax, -0x188(%rbp)
callq 0x1b30
movq %rax, -0x190(%rbp)
movq -0x188(%rbp), %rdi
movq -0x190(%rbp), %rsi
callq 0x1ac0
jmp 0x1408
leaq -0xd8(%rbp), %rdi
movq %rdi, -0x1d0(%rbp)
callq 0x1b00
movq -0x1d0(%rbp), %rdi
movq %rax, -0x198(%rbp)
callq 0x1b30
movq %rax, -0x1a0(%rbp)
movq -0x198(%rbp), %rdi
movq -0x1a0(%rbp), %rsi
callq 0x1ac0
jmp 0x144a
movl $0x0, -0x1a4(%rbp)
movl $0x0, -0x1a8(%rbp)
movl $0x0, -0x1ac(%rbp)
movslq -0x1a4(%rbp), %rax
movq %rax, -0x1e0(%rbp)
leaq -0xc0(%rbp), %rdi
addq $0x98, %rdi
callq 0x1b60
movq -0x1e0(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x1d1(%rbp)
jae 0x14d7
movslq -0x1a8(%rbp), %rax
movq %rax, -0x1e8(%rbp)
leaq -0x170(%rbp), %rdi
addq $0x98, %rdi
callq 0x1b60
movq %rax, %rcx
movq -0x1e8(%rbp), %rax
cmpq %rcx, %rax
setb %al
movb %al, -0x1d1(%rbp)
movb -0x1d1(%rbp), %al
testb $0x1, %al
jne 0x14e6
jmp 0x1657
leaq -0xc0(%rbp), %rdi
addq $0x98, %rdi
movslq -0x1a4(%rbp), %rsi
callq 0x1b80
movq (%rax), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x170(%rbp), %rdi
addq $0x98, %rdi
movslq -0x1a8(%rbp), %rsi
callq 0x1b80
movq %rax, %rcx
movq -0x1f0(%rbp), %rax
cmpq (%rcx), %rax
jne 0x1594
movl -0x1a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a4(%rbp)
movl -0x1a8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a8(%rbp)
movl -0x1ac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1ac(%rbp)
jmp 0x1652
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x178(%rbp)
movl %eax, -0x17c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x1ba0
leaq -0xc0(%rbp), %rdi
callq 0x1ba0
jmp 0x1724
leaq -0xc0(%rbp), %rdi
addq $0x98, %rdi
movslq -0x1a4(%rbp), %rsi
callq 0x1b80
movq (%rax), %rax
movq %rax, -0x1f8(%rbp)
leaq -0x170(%rbp), %rdi
addq $0x98, %rdi
movslq -0x1a8(%rbp), %rsi
callq 0x1b80
movq %rax, %rcx
movq -0x1f8(%rbp), %rax
cmpq (%rcx), %rax
jle 0x15f2
movl -0x1a8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a8(%rbp)
jmp 0x1650
leaq -0xc0(%rbp), %rdi
addq $0x98, %rdi
movslq -0x1a4(%rbp), %rsi
callq 0x1b80
movq (%rax), %rax
movq %rax, -0x200(%rbp)
leaq -0x170(%rbp), %rdi
addq $0x98, %rdi
movslq -0x1a8(%rbp), %rsi
callq 0x1b80
movq %rax, %rcx
movq -0x200(%rbp), %rax
cmpq (%rcx), %rax
jge 0x164e
movl -0x1a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a4(%rbp)
jmp 0x1650
jmp 0x1652
jmp 0x1468
cvtsi2sdl -0x1ac(%rbp), %xmm0
movsd %xmm0, -0x210(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x1b60
movq %rax, -0x208(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x1b60
movsd -0x210(%rbp), %xmm0
movq %rax, %rcx
movq -0x208(%rbp), %rax
addq %rcx, %rax
movslq -0x1ac(%rbp), %rcx
subq %rcx, %rax
movq %rax, %xmm1
movaps 0x3962(%rip), %xmm2     # 0x5010
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x3966(%rip), %xmm2     # 0x5020
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x1b8(%rbp)
movsd -0x1b8(%rbp), %xmm0
movsd 0x394b(%rip), %xmm1     # 0x5030
mulsd %xmm1, %xmm0
leaq 0x3984(%rip), %rdi      # 0x5074
movb $0x1, %al
callq 0x1030
jmp 0x16f9
movl $0x0, -0x4(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x1ba0
leaq -0xc0(%rbp), %rdi
callq 0x1ba0
movl -0x4(%rbp), %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
movq -0x178(%rbp), %rdi
callq 0x1150