// File: hanhwi[P]SimPoint/analysiscode/Utilities.cpp
// Function: Utilities::randomProjectionMatrix(int, Dataset*)
void Utilities::randomProjectionMatrix(int randSeed, Dataset *projection) {
    check(NULL != projection, "Utilities::randomProjectionMatrix() projection is null");
    unsigned int rows = projection->size();
    check(rows > 0, "Utilities::randomProjectionMatrix() rows <= 0");
    unsigned int cols = (*projection)[0].size();
    check(cols > 0, "Utilities::randomProjectionMatrix() cols <= 0");

    Random rand(randSeed);

    for (unsigned int r = 0; r < rows; r++) {
        for (unsigned int c = 0; c < cols; c++) {
            (*projection)[r][c] = rand.randFloat() * 2.0 - 1.0;
        }
    }
}

// Assembly:
subq $0x1f8, %rsp            # imm = 0x1F8
movl %edi, 0x1f4(%rsp)
movq %rsi, 0x1e8(%rsp)
movq 0x1e8(%rsp), %rax
testq %rax, %rax
setne %al
movb %al, 0x37(%rsp)
leaq 0x1c7(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x56a0
movq 0x38(%rsp), %rdx
leaq 0x64b2(%rip), %rsi      # 0x36658
leaq 0x1c8(%rsp), %rdi
callq 0x74e0
jmp 0x301b5
movb 0x37(%rsp), %al
movzbl %al, %edi
andl $0x1, %edi
leaq 0x1c8(%rsp), %rsi
callq 0x7480
jmp 0x301ce
leaq 0x1c8(%rsp), %rdi
callq 0x5788
leaq 0x1c7(%rsp), %rdi
callq 0x53e0
movq 0x1e8(%rsp), %rdi
callq 0xc110
movl %eax, 0x1b0(%rsp)
movl 0x1b0(%rsp), %eax
testl %eax, %eax
setne %al
movb %al, 0x27(%rsp)
leaq 0x18f(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x56a0
movq 0x28(%rsp), %rdx
leaq 0x6465(%rip), %rsi      # 0x3668f
leaq 0x190(%rsp), %rdi
callq 0x74e0
jmp 0x30239
movb 0x27(%rsp), %al
movzbl %al, %edi
andl $0x1, %edi
leaq 0x190(%rsp), %rsi
callq 0x7480
jmp 0x30252
leaq 0x190(%rsp), %rdi
callq 0x5788
leaq 0x18f(%rsp), %rdi
callq 0x53e0
movq 0x1e8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xc130
movq %rax, %rdi
callq 0x9b60
movl %eax, 0x188(%rsp)
movl 0x188(%rsp), %eax
testl %eax, %eax
setne %al
movb %al, 0x17(%rsp)
leaq 0x167(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x56a0
movq 0x18(%rsp), %rdx
leaq 0x6403(%rip), %rsi      # 0x366bd
leaq 0x168(%rsp), %rdi
callq 0x74e0
jmp 0x302c9
movb 0x17(%rsp), %al
movzbl %al, %edi
andl $0x1, %edi
leaq 0x168(%rsp), %rsi
callq 0x7480
jmp 0x302e2
leaq 0x168(%rsp), %rdi
callq 0x5788
leaq 0x167(%rsp), %rdi
callq 0x53e0
movslq 0x1f4(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x10cb0
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
cmpl 0x1b0(%rsp), %eax
jae 0x30483
movl $0x0, 0x40(%rsp)
movl 0x40(%rsp), %eax
cmpl 0x188(%rsp), %eax
jae 0x30471
leaq 0x48(%rsp), %rdi
callq 0x304a0
cvtss2sd %xmm0, %xmm0
addsd %xmm0, %xmm0
movsd 0x304e(%rip), %xmm1     # 0x333a8
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x1e8(%rsp), %rdi
movl 0x44(%rsp), %eax
movl %eax, %esi
callq 0xc130
movq %rax, %rdi
movl 0x40(%rsp), %eax
movl %eax, %esi
callq 0x9ba0
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40(%rsp)
jmp 0x3032f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x303d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x1c8(%rsp), %rdi
callq 0x5788
leaq 0x1c7(%rsp), %rdi
callq 0x53e0
jmp 0x3048b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x3041c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x5788
leaq 0x18f(%rsp), %rdi
callq 0x53e0
jmp 0x3048b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x30462
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x5788
leaq 0x167(%rsp), %rdi
callq 0x53e0
jmp 0x3048b
jmp 0x30473
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x30316
addq $0x1f8, %rsp            # imm = 0x1F8
retq
movq 0x1b8(%rsp), %rdi
callq 0x5690
nopl (%rax,%rax)