#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 */
unsigned int rand();
void initialize_array(unsigned int **mat) {
  int i, j;
  for (i = 0; i < 200; i++) {
    for (j = 0; j < 200; j++) {
      mat[i][j] = rand();
    }
  }
  return;
}


x86 assembly (clang, -O0):
<initialize_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xc8,-0xc(%rbp)
jge    1181 <initialize_array+0x71>
movl   $0x0,-0x10(%rbp)
cmpl   $0xc8,-0x10(%rbp)
jge    116e <initialize_array+0x5e>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <initialize_array+0x27>
jmp    1173 <initialize_array+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <initialize_array+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_array>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
mov    (%r14,%r15,8),%rcx
mov    %eax,(%rcx,%rbx,4)
add    $0x1,%rbx
cmp    $0xc8,%rbx
jne    1130 <initialize_array+0x20>
add    $0x1,%r15
cmp    $0xc8,%r15
jne    1120 <initialize_array+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @initialize_array(i32** nocapture %0) {
br label %2
2: ; preds = %1, %12
%3 = phi i64 [ 0, %1 ], [ %13, %12 ]
%4 = getelementptr inbounds i32*, i32** %0, i64 %3
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %10, %5 ]
%7 = tail call i32 (...) @rand()
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 %6
store i32 %7, i32* %9
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, 200
br i1 %11, label %12, label %5
12: ; preds = %5
%13 = add nuw nsw i64 %3, 1
%14 = icmp eq i64 %13, 200
br i1 %14, label %15, label %2
15: ; preds = %12
ret void
}