// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movslq 0x48(%rdi), %r14
incq %r14
leaq -0x58(%rbp), %r15
leaq -0x2a(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3858
leaq -0x70(%rbp), %rdi
leaq -0x29(%rbp), %rcx
movq %r14, %rsi
movq %r15, %rdx
callq 0x2d4e
leaq 0x18(%rbx), %r14
leaq -0x70(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x31f2
movq %r15, %rdi
callq 0x28f0
leaq -0x58(%rbp), %rdi
callq 0x2f82
movl 0x48(%rbx), %eax
pushq $0x1
popq %r12
xorpd %xmm4, %xmm4
movsd 0x8f0(%rip), %xmm5      # 0x4008
movslq %eax, %rcx
cmpq %rcx, %r12
jg 0x3834
imulq $0x18, %r12, %r13
pushq $0x1
popq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jg 0x382c
movl 0x4c(%rbx), %esi
movq (%rbx), %rcx
xorl %edx, %edx
testl %esi, %esi
cmovlel %edx, %esi
imulq $0x18, %rsi, %rsi
xorpd %xmm6, %xmm6
xorpd %xmm0, %xmm0
xorpd %xmm7, %xmm7
xorl %edi, %edi
cmpq %rdx, %rsi
je 0x37a1
movq 0x18(%rcx,%rdx), %r8
movsd (%r8,%r12,8), %xmm1
ucomisd %xmm5, %xmm1
jne 0x376f
jnp 0x379b
movsd (%r8,%r15,8), %xmm2
ucomisd %xmm5, %xmm2
jne 0x377d
jnp 0x379b
incl %edi
movapd %xmm1, %xmm3
mulsd %xmm2, %xmm3
addsd %xmm3, %xmm6
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm2, %xmm7
addq $0x18, %rdx
jmp 0x3757
testl %edi, %edi
jle 0x37b6
ucomisd %xmm4, %xmm0
movsd %xmm6, -0x40(%rbp)
jb 0x37c4
sqrtsd %xmm0, %xmm2
jmp 0x37db
movq (%r14), %rcx
movq (%rcx,%r13), %rcx
andq $0x0, (%rcx,%r15,8)
jmp 0x3824
movsd %xmm7, -0x38(%rbp)
callq 0x20f0
movsd -0x38(%rbp), %xmm7
xorpd %xmm4, %xmm4
movapd %xmm0, %xmm2
ucomisd %xmm4, %xmm7
jb 0x37e7
sqrtsd %xmm7, %xmm0
jmp 0x37fe
movapd %xmm7, %xmm0
movsd %xmm2, -0x38(%rbp)
callq 0x20f0
movsd -0x38(%rbp), %xmm2
xorpd %xmm4, %xmm4
movsd 0x802(%rip), %xmm5      # 0x4008
movsd -0x40(%rbp), %xmm1
mulsd %xmm0, %xmm2
divsd %xmm2, %xmm1
movq 0x18(%rbx), %rax
movq (%rax,%r13), %rax
movsd %xmm1, (%rax,%r15,8)
movl 0x48(%rbx), %eax
incq %r15
jmp 0x372c
incq %r12
jmp 0x3718
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x2f82
movq %rbx, %rdi
callq 0x2230
nop