#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 */
int rand();
void preencheMatriz(int iMapaGeografico[][11]) {
  int iContador1 = 0;
  int iContador2 = 0;
  for (iContador1 = 0; iContador1 < 6; iContador1++) {
    for (iContador2 = 0; iContador2 < 11; iContador2++) {
      iMapaGeografico[iContador1][iContador2] = rand() % 1000;
    }
  }
}


x86 assembly (clang, -O0):
<preencheMatriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    1192 <preencheMatriz+0x82>
movl   $0x0,-0x10(%rbp)
cmpl   $0xb,-0x10(%rbp)
jge    117f <preencheMatriz+0x6f>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x2c,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <preencheMatriz+0x32>
jmp    1184 <preencheMatriz+0x74>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <preencheMatriz+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preencheMatriz>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x28,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x28(%r14,%rbx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x24(%r14,%rbx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x20(%r14,%rbx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%r14,%rbx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x18(%r14,%rbx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%r14,%rbx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%r14,%rbx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%r14,%rbx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%r14,%rbx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%r14,%rbx,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,1)
add    $0x2c,%rbx
cmp    $0x130,%rbx
jne    1120 <preencheMatriz+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @preencheMatriz([11 x i32]* %0) {
%2 = alloca [11 x i32]*
%3 = alloca i32
%4 = alloca i32
store [11 x i32]* %0, [11 x i32]** %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %26, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 6
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, 11
br i1 %11, label %12, label %25
12: ; preds = %9
%13 = call i32 (...) @rand()
%14 = srem i32 %13, 1000
%15 = load [11 x i32]*, [11 x i32]** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [11 x i32], [11 x i32]* %15, i64 %17
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [11 x i32], [11 x i32]* %18, i64 0, i64 %20
store i32 %14, 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 @preencheMatriz([11 x i32]* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %37, %2 ]
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 1000
%6 = getelementptr inbounds [11 x i32], [11 x i32]* %0, i64 %3, i64 0
store i32 %5, i32* %6
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 1000
%9 = getelementptr inbounds [11 x i32], [11 x i32]* %0, i64 %3, i64 1
store i32 %8, i32* %9
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, 1000
%12 = getelementptr inbounds [11 x i32], [11 x i32]* %0, i64 %3, i64 2
store i32 %11, i32* %12
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 1000
%15 = getelementptr inbounds [11 x i32], [11 x i32]* %0, i64 %3, i64 3
store i32 %14, i32* %15
%16 = tail call i32 (...) @rand()
%17 = srem i32 %16, 1000
%18 = getelementptr inbounds [11 x i32], [11 x i32]* %0, i64 %3, i64 4
store i32 %17, i32* %18
%19 = tail call i32 (...) @rand()
%20 = srem i32 %19, 1000
%21 = getelementptr inbounds [11 x i32], [11 x i32]* %0, i64 %3, i64 5
store i32 %20, i32* %21
%22 = tail call i32 (...) @rand()
%23 = srem i32 %22, 1000
%24 = getelementptr inbounds [11 x i32], [11 x i32]* %0, i64 %3, i64 6
store i32 %23, i32* %24
%25 = tail call i32 (...) @rand()
%26 = srem i32 %25, 1000
%27 = getelementptr inbounds [11 x i32], [11 x i32]* %0, i64 %3, i64 7
store i32 %26, i32* %27
%28 = tail call i32 (...) @rand()
%29 = srem i32 %28, 1000
%30 = getelementptr inbounds [11 x i32], [11 x i32]* %0, i64 %3, i64 8
store i32 %29, i32* %30
%31 = tail call i32 (...) @rand()
%32 = srem i32 %31, 1000
%33 = getelementptr inbounds [11 x i32], [11 x i32]* %0, i64 %3, i64 9
store i32 %32, i32* %33
%34 = tail call i32 (...) @rand()
%35 = srem i32 %34, 1000
%36 = getelementptr inbounds [11 x i32], [11 x i32]* %0, i64 %3, i64 10
store i32 %35, i32* %36
%37 = add nuw nsw i64 %3, 1
%38 = icmp eq i64 %37, 6
br i1 %38, label %39, label %2
39: ; preds = %2
ret void
}