#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
float drand48();
void initialize_matrix(float *m) {
  int i, j;
  for (i = 0; i < 8; i++) {
    for (j = 0; j < 8; j++) {
      m[i + j * 8] = drand48();
    }
  }
}


x86 assembly (clang, -O0):
<initialize_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    117d <initialize_matrix+0x6d>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    116a <initialize_matrix+0x5a>
mov    $0x0,%al
call   1030 <drand48@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%edx
shl    $0x3,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <initialize_matrix+0x24>
jmp    116f <initialize_matrix+0x5f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <initialize_matrix+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xfffffffffffffff8,%rbx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <drand48@plt>
movss  %xmm0,0x20(%r14,%rbx,4)
xor    %eax,%eax
call   1030 <drand48@plt>
movss  %xmm0,0x40(%r14,%rbx,4)
xor    %eax,%eax
call   1030 <drand48@plt>
movss  %xmm0,0x60(%r14,%rbx,4)
xor    %eax,%eax
call   1030 <drand48@plt>
movss  %xmm0,0x80(%r14,%rbx,4)
xor    %eax,%eax
call   1030 <drand48@plt>
movss  %xmm0,0xa0(%r14,%rbx,4)
xor    %eax,%eax
call   1030 <drand48@plt>
movss  %xmm0,0xc0(%r14,%rbx,4)
xor    %eax,%eax
call   1030 <drand48@plt>
movss  %xmm0,0xe0(%r14,%rbx,4)
xor    %eax,%eax
call   1030 <drand48@plt>
movss  %xmm0,0x100(%r14,%rbx,4)
inc    %rbx
jne    1120 <initialize_matrix+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @initialize_matrix(float* %0) {
%2 = alloca float*
%3 = alloca i32
%4 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
br label %5
5: ; preds = %25, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %28
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %21, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 8
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = call float (...) @drand48()
%14 = load float*, float** %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = mul nsw i32 %16, 8
%18 = add nsw i32 %15, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds float, float* %14, i64 %19
store float %13, float* %20
br label %21
21: ; preds = %12
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %9
24: ; preds = %9
br label %25
25: ; preds = %24
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %5
28: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @initialize_matrix(float* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %27, %2 ]
%4 = tail call float (...) @drand48()
%5 = getelementptr inbounds float, float* %0, i64 %3
store float %4, float* %5
%6 = tail call float (...) @drand48()
%7 = add nuw nsw i64 %3, 8
%8 = getelementptr inbounds float, float* %0, i64 %7
store float %6, float* %8
%9 = tail call float (...) @drand48()
%10 = add nuw nsw i64 %3, 16
%11 = getelementptr inbounds float, float* %0, i64 %10
store float %9, float* %11
%12 = tail call float (...) @drand48()
%13 = add nuw nsw i64 %3, 24
%14 = getelementptr inbounds float, float* %0, i64 %13
store float %12, float* %14
%15 = tail call float (...) @drand48()
%16 = add nuw nsw i64 %3, 32
%17 = getelementptr inbounds float, float* %0, i64 %16
store float %15, float* %17
%18 = tail call float (...) @drand48()
%19 = add nuw nsw i64 %3, 40
%20 = getelementptr inbounds float, float* %0, i64 %19
store float %18, float* %20
%21 = tail call float (...) @drand48()
%22 = add nuw nsw i64 %3, 48
%23 = getelementptr inbounds float, float* %0, i64 %22
store float %21, float* %23
%24 = tail call float (...) @drand48()
%25 = add nuw nsw i64 %3, 56
%26 = getelementptr inbounds float, float* %0, i64 %25
store float %24, float* %26
%27 = add nuw nsw i64 %3, 1
%28 = icmp eq i64 %27, 8
br i1 %28, label %29, label %2
29: ; preds = %2
ret void
}