#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*/ ler_matriz(int **, int *);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  int matriz[20][20], soma[20];
  int i, j;
  ler_matriz(matriz, soma);
  for (i = 0; i < 20; i++) {
    for (j = 0; j < 20; j++) {
      matriz[i][j] *= soma[i];
    }
  }
  for (i = 0; i < 20; i++) {
    for (j = 0; j < 20; j++) {
      printf("%d ", matriz[i][j]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x6a0,%rsp
lea    -0x640(%rbp),%rdi
lea    -0x690(%rbp),%rsi
call   1040 <ler_matriz@plt>
movl   $0x0,-0x694(%rbp)
cmpl   $0x14,-0x694(%rbp)
jge    11ca <main+0xaa>
movl   $0x0,-0x698(%rbp)
cmpl   $0x14,-0x698(%rbp)
jge    11b1 <main+0x91>
movslq -0x694(%rbp),%rax
mov    -0x690(%rbp,%rax,4),%edx
movslq -0x694(%rbp),%rcx
lea    -0x640(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x698(%rbp),%rcx
imul   (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x698(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x698(%rbp)
jmp    115f <main+0x3f>
jmp    11b6 <main+0x96>
mov    -0x694(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x694(%rbp)
jmp    1148 <main+0x28>
movl   $0x0,-0x694(%rbp)
cmpl   $0x14,-0x694(%rbp)
jge    125b <main+0x13b>
movl   $0x0,-0x698(%rbp)
cmpl   $0x14,-0x698(%rbp)
jge    1239 <main+0x119>
movslq -0x694(%rbp),%rcx
lea    -0x640(%rbp),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x698(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x698(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x698(%rbp)
jmp    11eb <main+0xcb>
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x694(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x694(%rbp)
jmp    11d4 <main+0xb4>
add    $0x6a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x698,%rsp
lea    0x50(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <ler_matriz@plt>
lea    0x90(%rsp),%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movd   (%rsp,%rcx,4),%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa -0x40(%rax),%xmm2
movdqa -0x30(%rax),%xmm3
movdqa -0x20(%rax),%xmm4
movdqa -0x10(%rax),%xmm1
pshufd $0xf5,%xmm2,%xmm5
pmuludq %xmm0,%xmm5
pshufd $0xe8,%xmm5,%xmm5
pmuludq %xmm0,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm5,%xmm2
movdqa %xmm2,-0x40(%rax)
pshufd $0xf5,%xmm3,%xmm2
pmuludq %xmm0,%xmm2
pshufd $0xe8,%xmm2,%xmm2
pmuludq %xmm0,%xmm3
pshufd $0xe8,%xmm3,%xmm3
punpckldq %xmm2,%xmm3
movdqa %xmm3,-0x30(%rax)
pshufd $0xf5,%xmm4,%xmm2
pmuludq %xmm0,%xmm2
pshufd $0xe8,%xmm2,%xmm2
pmuludq %xmm0,%xmm4
pshufd $0xe8,%xmm4,%xmm3
punpckldq %xmm2,%xmm3
movdqa %xmm3,-0x20(%rax)
pshufd $0xf5,%xmm1,%xmm2
pmuludq %xmm0,%xmm2
pshufd $0xe8,%xmm2,%xmm2
pmuludq %xmm0,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm2,%xmm1
movdqa %xmm1,-0x10(%rax)
movdqa (%rax),%xmm1
pshufd $0xf5,%xmm1,%xmm2
pmuludq %xmm0,%xmm2
pshufd $0xe8,%xmm2,%xmm2
pmuludq %xmm0,%xmm1
pshufd $0xe8,%xmm1,%xmm0
punpckldq %xmm2,%xmm0
movdqa %xmm0,(%rax)
add    $0x1,%rcx
add    $0x50,%rax
cmp    $0x14,%rcx
jne    1160 <main+0x30>
mov    $0x4c,%ebx
lea    0xdc1(%rip),%r14
nop
mov    0x4(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2c(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x30(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x34(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x3c(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x40(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x44(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x48(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4c(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x50(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x50,%rbx
cmp    $0x68c,%rbx
jne    1240 <main+0x110>
add    $0x698,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca [20 x [20 x i32]]
%2 = alloca [20 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 0
%6 = bitcast [20 x i32]* %5 to i32**
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%8 = call i32 @ler_matriz(i32** %6, i32* %7)
store i32 0, i32* %3
br label %9
9: ; preds = %33, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 20
br i1 %11, label %12, label %36
12: ; preds = %9
store i32 0, i32* %4
br label %13
13: ; preds = %29, %12
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 20
br i1 %15, label %16, label %32
16: ; preds = %13
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %22
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [20 x i32], [20 x i32]* %23, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = mul nsw i32 %27, %20
store i32 %28, i32* %26
br label %29
29: ; preds = %16
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %13
32: ; preds = %13
br label %33
33: ; preds = %32
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %9
36: ; preds = %9
store i32 0, i32* %3
br label %37
37: ; preds = %58, %36
%38 = load i32, i32* %3
%39 = icmp slt i32 %38, 20
br i1 %39, label %40, label %61
40: ; preds = %37
store i32 0, i32* %4
br label %41
41: ; preds = %53, %40
%42 = load i32, i32* %4
%43 = icmp slt i32 %42, 20
br i1 %43, label %44, label %56
44: ; preds = %41
%45 = load i32, i32* %3
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %46
%48 = load i32, i32* %4
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [20 x i32], [20 x i32]* %47, i64 0, i64 %49
%51 = load i32, i32* %50
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %51)
br label %53
53: ; preds = %44
%54 = load i32, i32* %4
%55 = add nsw i32 %54, 1
store i32 %55, i32* %4
br label %41
56: ; preds = %41
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %58
58: ; preds = %56
%59 = load i32, i32* %3
%60 = add nsw i32 %59, 1
store i32 %60, i32* %3
br label %37
61: ; preds = %37
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @main() {
%1 = alloca [20 x [20 x i32]]
%2 = alloca [20 x i32]
%3 = bitcast [20 x [20 x i32]]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = bitcast [20 x [20 x i32]]* %1 to i32**
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%7 = call i32 @ler_matriz(i32** %5, i32* %6)
br label %8
8: ; preds = %0, %8
%9 = phi i64 [ 0, %0 ], [ %39, %8 ]
%10 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %9, i64 0
%13 = bitcast i32* %12 to <4 x i32>*
%14 = load <4 x i32>, <4 x i32>* %13
%15 = insertelement <4 x i32> poison, i32 %11, i64 0
%16 = shufflevector <4 x i32> %15, <4 x i32> poison, <4 x i32> zeroinitializer
%17 = mul nsw <4 x i32> %14, %16
%18 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> %17, <4 x i32>* %18
%19 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %9, i64 4
%20 = bitcast i32* %19 to <4 x i32>*
%21 = load <4 x i32>, <4 x i32>* %20
%22 = mul nsw <4 x i32> %21, %16
%23 = bitcast i32* %19 to <4 x i32>*
store <4 x i32> %22, <4 x i32>* %23
%24 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %9, i64 8
%25 = bitcast i32* %24 to <4 x i32>*
%26 = load <4 x i32>, <4 x i32>* %25
%27 = mul nsw <4 x i32> %26, %16
%28 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> %27, <4 x i32>* %28
%29 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %9, i64 12
%30 = bitcast i32* %29 to <4 x i32>*
%31 = load <4 x i32>, <4 x i32>* %30
%32 = mul nsw <4 x i32> %31, %16
%33 = bitcast i32* %29 to <4 x i32>*
store <4 x i32> %32, <4 x i32>* %33
%34 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %9, i64 16
%35 = bitcast i32* %34 to <4 x i32>*
%36 = load <4 x i32>, <4 x i32>* %35
%37 = mul nsw <4 x i32> %36, %16
%38 = bitcast i32* %34 to <4 x i32>*
store <4 x i32> %37, <4 x i32>* %38
%39 = add nuw nsw i64 %9, 1
%40 = icmp eq i64 %39, 20
br i1 %40, label %41, label %8
41: ; preds = %8, %41
%42 = phi i64 [ %104, %41 ], [ 0, %8 ]
%43 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 0
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %44)
%46 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 1
%47 = load i32, i32* %46
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %47)
%49 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 2
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %50)
%52 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 3
%53 = load i32, i32* %52
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %53)
%55 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 4
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %56)
%58 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 5
%59 = load i32, i32* %58
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %59)
%61 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 6
%62 = load i32, i32* %61
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %62)
%64 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 7
%65 = load i32, i32* %64
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %65)
%67 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 8
%68 = load i32, i32* %67
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %68)
%70 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 9
%71 = load i32, i32* %70
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %71)
%73 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 10
%74 = load i32, i32* %73
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %74)
%76 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 11
%77 = load i32, i32* %76
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %77)
%79 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 12
%80 = load i32, i32* %79
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %80)
%82 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 13
%83 = load i32, i32* %82
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %83)
%85 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 14
%86 = load i32, i32* %85
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %86)
%88 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 15
%89 = load i32, i32* %88
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %89)
%91 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 16
%92 = load i32, i32* %91
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %92)
%94 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 17
%95 = load i32, i32* %94
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %95)
%97 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 18
%98 = load i32, i32* %97
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %98)
%100 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %1, i64 0, i64 %42, i64 19
%101 = load i32, i32* %100
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %101)
%103 = call i32 @putchar(i32 10)
%104 = add nuw nsw i64 %42, 1
%105 = icmp eq i64 %104, 20
br i1 %105, label %106, label %41
106: ; preds = %41
ret void
}