// File: bowbowbow[P]CollaborativeFiltering/recommender.cpp
// Function: CF::buildItemToItemC()
void buildItemToItemC() {
        itemToItem = vector<vector<double> > (itemSize+1, vector<double> (itemSize+1));
        for(int i=1; i<= itemSize; i++) {
            for(int j=1; j <= itemSize; j++) {
                double top = 0, bleft =0, bright = 0;
                
                int cnt = 0;
                for(int k=1; k<= userSize; k++) {
                    if(userToItem[k][i] == EMPTY) continue;
                    if(userToItem[k][j] == EMPTY) continue;
                    
                    cnt++;
                    top += userToItem[k][i]*userToItem[k][j];
                    
                    bleft += userToItem[k][i]*userToItem[k][i];
                    bright += userToItem[k][j]*userToItem[k][j];
                }
                
                if(cnt < 1) {
                    itemToItem[i][j] = 0;
                } else {
                    itemToItem[i][j] = top/(sqrt(bleft)*sqrt(bright));
                }
            }
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movl 0x48(%rax), %eax
incl %eax
cltq
movq %rax, -0x88(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x3740
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x7370
jmp 0x6fdb
leaq -0x4d(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x37e0
movq -0x88(%rbp), %rsi
movq -0x98(%rbp), %rcx
leaq -0x20(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x3800
jmp 0x7008
movq -0x90(%rbp), %rdi
addq $0x18, %rdi
leaq -0x20(%rbp), %rsi
callq 0x3880
leaq -0x20(%rbp), %rdi
callq 0x2d40
leaq -0x4d(%rbp), %rdi
callq 0x38b0
leaq -0x38(%rbp), %rdi
callq 0x38d0
leaq -0x39(%rbp), %rdi
callq 0x3930
movl $0x1, -0x54(%rbp)
movq -0x90(%rbp), %rcx
movl -0x54(%rbp), %eax
cmpl 0x48(%rcx), %eax
jg 0x7355
movl $0x1, -0x58(%rbp)
movq -0x90(%rbp), %rcx
movl -0x58(%rbp), %eax
cmpl 0x48(%rcx), %eax
jg 0x7345
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x68(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x70(%rbp)
movl $0x0, -0x74(%rbp)
movl $0x1, -0x78(%rbp)
movq -0x90(%rbp), %rcx
movl -0x78(%rbp), %eax
cmpl 0x4c(%rcx), %eax
jg 0x728e
movq -0x90(%rbp), %rdi
movslq -0x78(%rbp), %rsi
callq 0x3950
movq %rax, %rdi
movslq -0x54(%rbp), %rsi
callq 0x3970
movsd (%rax), %xmm0
movsd 0xf73(%rip), %xmm1      # 0x8048
ucomisd %xmm1, %xmm0
jne 0x711c
jp 0x711c
jmp 0x7280
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x710e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x4d(%rbp), %rdi
callq 0x38b0
leaq -0x38(%rbp), %rdi
callq 0x38d0
leaq -0x39(%rbp), %rdi
callq 0x3930
jmp 0x735e
movq -0x90(%rbp), %rdi
movslq -0x78(%rbp), %rsi
callq 0x3950
movq %rax, %rdi
movslq -0x58(%rbp), %rsi
callq 0x3970
movsd (%rax), %xmm0
movsd 0xf04(%rip), %xmm1      # 0x8048
ucomisd %xmm1, %xmm0
jne 0x7151
jp 0x7151
jmp 0x7280
movq -0x90(%rbp), %rdi
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
movslq -0x78(%rbp), %rsi
callq 0x3950
movq %rax, %rdi
movslq -0x54(%rbp), %rsi
callq 0x3970
movq -0x90(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0xb0(%rbp)
movslq -0x78(%rbp), %rsi
callq 0x3950
movq %rax, %rdi
movslq -0x58(%rbp), %rsi
callq 0x3970
movsd -0xb0(%rbp), %xmm0
movq -0x90(%rbp), %rdi
movsd (%rax), %xmm2
movsd -0x60(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movslq -0x78(%rbp), %rsi
callq 0x3950
movq %rax, %rdi
movslq -0x54(%rbp), %rsi
callq 0x3970
movq -0x90(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0xa8(%rbp)
movslq -0x78(%rbp), %rsi
callq 0x3950
movq %rax, %rdi
movslq -0x54(%rbp), %rsi
callq 0x3970
movsd -0xa8(%rbp), %xmm0
movq -0x90(%rbp), %rdi
movsd (%rax), %xmm2
movsd -0x68(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movslq -0x78(%rbp), %rsi
callq 0x3950
movq %rax, %rdi
movslq -0x58(%rbp), %rsi
callq 0x3970
movq -0x90(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
movslq -0x78(%rbp), %rsi
callq 0x3950
movq %rax, %rdi
movslq -0x58(%rbp), %rsi
callq 0x3970
movsd -0xa0(%rbp), %xmm0
movsd (%rax), %xmm2
movsd -0x70(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x709a
cmpl $0x1, -0x74(%rbp)
jge 0x72bd
movq -0x90(%rbp), %rdi
addq $0x18, %rdi
movslq -0x54(%rbp), %rsi
callq 0x3950
movq %rax, %rdi
movslq -0x58(%rbp), %rsi
callq 0x3970
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
jmp 0x7335
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0x68(%rbp), %xmm0
callq 0x2100
movsd %xmm0, -0xc8(%rbp)
movsd -0x70(%rbp), %xmm0
callq 0x2100
movsd -0xc8(%rbp), %xmm1
movq -0x90(%rbp), %rdi
movaps %xmm0, %xmm2
movsd -0xc0(%rbp), %xmm0
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0xb8(%rbp)
addq $0x18, %rdi
movslq -0x54(%rbp), %rsi
callq 0x3950
movq %rax, %rdi
movslq -0x58(%rbp), %rsi
callq 0x3970
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0x7337
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x7061
jmp 0x7347
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x7047
addq $0xd0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x2250
nopw (%rax,%rax)