#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 /*<<< orphan*/ scanf(char *, double *);
void preencherMatriz(double matriz[][12]) {
  size_t i, j;
  for (i = 0; i < 12; i++) {
    for (j = 0; j < 12; j++) {
      scanf("%lf", &matriz[i][j]);
    }
  }
}


x86 assembly (clang, -O0):
<preencherMatriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0xc,-0x10(%rbp)
jae    118c <preencherMatriz+0x7c>
movq   $0x0,-0x18(%rbp)
cmpq   $0xc,-0x18(%rbp)
jae    1176 <preencherMatriz+0x66>
mov    -0x8(%rbp),%rsi
imul   $0x60,-0x10(%rbp),%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
lea    0xea0(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <preencherMatriz+0x27>
jmp    117b <preencherMatriz+0x6b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <preencherMatriz+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preencherMatriz>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%r15,%rbx,1),%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    (%r15,%rbx,1),%rsi
add    $0x8,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    (%r15,%rbx,1),%rsi
add    $0x10,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    (%r15,%rbx,1),%rsi
add    $0x18,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    (%r15,%rbx,1),%rsi
add    $0x20,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    (%r15,%rbx,1),%rsi
add    $0x28,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    (%r15,%rbx,1),%rsi
add    $0x30,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    (%r15,%rbx,1),%rsi
add    $0x38,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    (%r15,%rbx,1),%rsi
add    $0x40,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    (%r15,%rbx,1),%rsi
add    $0x48,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    (%r15,%rbx,1),%rsi
add    $0x50,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
lea    (%r15,%rbx,1),%rsi
add    $0x58,%rsi
mov    %r14,%rdi
call   1030 <scanf@plt>
add    $0x60,%rbx
cmp    $0x480,%rbx
jne    1130 <preencherMatriz+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define void @preencherMatriz([12 x double]* %0) {
%2 = alloca [12 x double]*
%3 = alloca i64
%4 = alloca i64
store [12 x double]* %0, [12 x double]** %2
store i64 0, i64* %3
br label %5
5: ; preds = %23, %1
%6 = load i64, i64* %3
%7 = icmp ult i64 %6, 12
br i1 %7, label %8, label %26
8: ; preds = %5
store i64 0, i64* %4
br label %9
9: ; preds = %19, %8
%10 = load i64, i64* %4
%11 = icmp ult i64 %10, 12
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load [12 x double]*, [12 x double]** %2
%14 = load i64, i64* %3
%15 = getelementptr inbounds [12 x double], [12 x double]* %13, i64 %14
%16 = load i64, i64* %4
%17 = getelementptr inbounds [12 x double], [12 x double]* %15, i64 0, i64 %16
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %17)
br label %19
19: ; preds = %12
%20 = load i64, i64* %4
%21 = add i64 %20, 1
store i64 %21, i64* %4
br label %9
22: ; preds = %9
br label %23
23: ; preds = %22
%24 = load i64, i64* %3
%25 = add i64 %24, 1
store i64 %25, i64* %3
br label %5
26: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define void @preencherMatriz([12 x double]* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %28, %2 ]
%4 = getelementptr inbounds [12 x double], [12 x double]* %0, i64 %3, i64 0
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%6 = getelementptr inbounds [12 x double], [12 x double]* %0, i64 %3, i64 1
%7 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%8 = getelementptr inbounds [12 x double], [12 x double]* %0, i64 %3, i64 2
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %8)
%10 = getelementptr inbounds [12 x double], [12 x double]* %0, i64 %3, i64 3
%11 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %10)
%12 = getelementptr inbounds [12 x double], [12 x double]* %0, i64 %3, i64 4
%13 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %12)
%14 = getelementptr inbounds [12 x double], [12 x double]* %0, i64 %3, i64 5
%15 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %14)
%16 = getelementptr inbounds [12 x double], [12 x double]* %0, i64 %3, i64 6
%17 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %16)
%18 = getelementptr inbounds [12 x double], [12 x double]* %0, i64 %3, i64 7
%19 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %18)
%20 = getelementptr inbounds [12 x double], [12 x double]* %0, i64 %3, i64 8
%21 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %20)
%22 = getelementptr inbounds [12 x double], [12 x double]* %0, i64 %3, i64 9
%23 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %22)
%24 = getelementptr inbounds [12 x double], [12 x double]* %0, i64 %3, i64 10
%25 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %24)
%26 = getelementptr inbounds [12 x double], [12 x double]* %0, i64 %3, i64 11
%27 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %26)
%28 = add nuw nsw i64 %3, 1
%29 = icmp eq i64 %28, 12
br i1 %29, label %30, label %2
30: ; preds = %2
ret void
}