#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*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int prodColuna(int **, int, int);
int prodDiagDir(int **, int, int);
int prodDiagEsq(int **, int, int);
int prodLinha(int **, int, int);
int main(void) {
  int i, j, prodMax = 90, prod;
  int matriz[20][20] = {
      {8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8},
      {49, 49, 99, 40, 17, 81, 18, 57, 60, 87,
       17, 40, 98, 43, 69, 48, 4,  56, 62, 0},
      {81, 49, 31, 73, 55, 79, 14, 29, 93, 71,
       40, 67, 53, 88, 30, 3,  49, 13, 36, 65},
      {52, 70, 95, 23, 4,  60, 11, 42, 69, 24,
       68, 56, 1,  32, 56, 71, 37, 2,  36, 91},
      {22, 31, 16, 71, 51, 67, 63, 89, 41, 92,
       36, 54, 22, 40, 40, 28, 66, 33, 13, 80},
      {24, 47, 32, 60, 99, 3,  45, 2,  44, 75,
       33, 53, 78, 36, 84, 20, 35, 17, 12, 50},
      {32, 98, 81, 28, 64, 23, 67, 10, 26, 38,
       40, 67, 59, 54, 70, 66, 18, 38, 64, 70},
      {67, 26, 20, 68, 2,  62, 12, 20, 95, 63,
       94, 39, 63, 8,  40, 91, 66, 49, 94, 21},
      {24, 55, 58, 5,  66, 73, 99, 26, 97, 17,
       78, 78, 96, 83, 14, 88, 34, 89, 63, 72},
      {21, 36, 23, 9,  75, 0,  76, 44, 20, 45,
       35, 14, 0,  61, 33, 97, 34, 31, 33, 95},
      {78, 17, 53, 28, 22, 75, 31, 67, 15, 94,
       3,  80, 4,  62, 16, 14, 9,  53, 56, 92},
      {16, 39, 5, 42, 96, 35, 31, 47, 55, 58,
       88, 24, 0, 17, 54, 24, 36, 29, 85, 57},
      {86, 56, 0,  48, 35, 71, 89, 7,  5,  44,
       44, 37, 44, 60, 21, 58, 51, 54, 17, 58},
      {19, 80, 81, 68, 5,  94, 47, 69, 28, 73,
       92, 13, 86, 52, 17, 77, 4,  89, 55, 40},
      {4,  52, 8,  83, 97, 35, 99, 16, 7,  97,
       57, 32, 16, 26, 26, 79, 33, 27, 98, 66},
      {88, 36, 68, 87, 57, 62, 20, 72, 3,  46,
       33, 67, 46, 55, 12, 32, 63, 93, 53, 69},
      {4,  42, 16, 73, 38, 25, 39, 11, 24, 94,
       72, 18, 8,  46, 29, 32, 40, 62, 76, 36},
      {20, 69, 36, 41, 72, 30, 23, 88, 34, 62,
       99, 69, 82, 67, 59, 85, 74, 4,  36, 16},
      {20, 73, 35, 29, 78, 31, 90, 1,  74, 31,
       49, 71, 48, 86, 81, 16, 23, 57, 5,  54},
      {1,  70, 54, 71, 83, 51, 54, 69, 16, 92,
       33, 48, 61, 43, 52, 1,  89, 19, 67, 48}};
  for (i = 0; i <= 16; i++) {
    for (j = 0; j <= 16; j++) {
      prod = prodColuna(matriz, i, j);
      if (prod > prodMax) {
        prodMax = prod;
        printf("Max: %d (coluna)\n", prodMax);
      }
      prod = prodLinha(matriz, i, j);
      if (prod > prodMax) {
        prodMax = prod;
        printf("Max: %d (linha)\n", prodMax);
      }
      prod = prodDiagDir(matriz, i, j);
      if (prod > prodMax) {
        prodMax = prod;
        printf("Max: %d (diagonal direita)\n", prodMax);
      }
      prod = prodDiagEsq(matriz, i, j);
      if (prod > prodMax) {
        prodMax = prod;
        printf("Max: %d (diagonal esquerda)\n", prodMax);
      }
    }
  }
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x660,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5a,-0x10(%rbp)
lea    -0x660(%rbp),%rdi
lea    0xe69(%rip),%rsi
mov    $0x640,%edx
call   1060 <memcpy@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jg     12c1 <main+0x151>
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jg     12ae <main+0x13e>
lea    -0x660(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <prodColuna@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11f9 <main+0x89>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0x144c(%rip),%rdi
call   1040 <printf@plt>
lea    -0x660(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1090 <prodLinha@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    122f <main+0xbf>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0x1428(%rip),%rdi
call   1040 <printf@plt>
lea    -0x660(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1080 <prodDiagDir@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1265 <main+0xf5>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0x1403(%rip),%rdi
call   1040 <printf@plt>
lea    -0x660(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1070 <prodDiagEsq@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    129b <main+0x12b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0x13e9(%rip),%rdi
call   1040 <printf@plt>
jmp    12a0 <main+0x130>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b9 <main+0x49>
jmp    12b3 <main+0x143>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a8 <main+0x38>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x660,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x648,%rsp
lea    0xe78(%rip),%rsi
mov    %rsp,%r12
mov    $0x640,%edx
mov    %r12,%rdi
call   1060 <memcpy@plt>
xor    %ebp,%ebp
mov    $0x5a,%r13d
jmp    11bc <main+0x4c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebp
cmp    $0x11,%ebp
je     1278 <main+0x108>
xor    %r14d,%r14d
jmp    11da <main+0x6a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14d
cmp    $0x11,%r14d
je     11b0 <main+0x40>
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <prodColuna@plt>
cmp    %r13d,%eax
jle    1200 <main+0x90>
mov    %eax,%r15d
lea    0x144a(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r15d,%r13d
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1090 <prodLinha@plt>
cmp    %r13d,%eax
jle    1225 <main+0xb5>
mov    %eax,%ebx
lea    0x1437(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebx,%r13d
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1080 <prodDiagDir@plt>
cmp    %r13d,%eax
jle    124a <main+0xda>
mov    %eax,%ebx
lea    0x1423(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebx,%r13d
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1070 <prodDiagEsq@plt>
cmp    %r13d,%eax
jle    11d0 <main+0x60>
mov    %eax,%ebx
lea    0x1416(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebx,%r13d
jmp    11d0 <main+0x60>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x648,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.matriz = [20 x [20 x i32]] [[20 x i32] [i32 8, i32 2, i32 22, i32 97, i32 38, i32 15, i32 0, i32 40, i32 0, i32 75, i32 4, i32 5, i32 7, i32 78, i32 52, i32 12, i32 50, i32 77, i32 91, i32 8], [20 x i32] [i32 49, i32 49, i32 99, i32 40, i32 17, i32 81, i32 18, i32 57, i32 60, i32 87, i32 17, i32 40, i32 98, i32 43, i32 69, i32 48, i32 4, i32 56, i32 62, i32 0], [20 x i32] [i32 81, i32 49, i32 31, i32 73, i32 55, i32 79, i32 14, i32 29, i32 93, i32 71, i32 40, i32 67, i32 53, i32 88, i32 30, i32 3, i32 49, i32 13, i32 36, i32 65], [20 x i32] [i32 52, i32 70, i32 95, i32 23, i32 4, i32 60, i32 11, i32 42, i32 69, i32 24, i32 68, i32 56, i32 1, i32 32, i32 56, i32 71, i32 37, i32 2, i32 36, i32 91], [20 x i32] [i32 22, i32 31, i32 16, i32 71, i32 51, i32 67, i32 63, i32 89, i32 41, i32 92, i32 36, i32 54, i32 22, i32 40, i32 40, i32 28, i32 66, i32 33, i32 13, i32 80], [20 x i32] [i32 24, i32 47, i32 32, i32 60, i32 99, i32 3, i32 45, i32 2, i32 44, i32 75, i32 33, i32 53, i32 78, i32 36, i32 84, i32 20, i32 35, i32 17, i32 12, i32 50], [20 x i32] [i32 32, i32 98, i32 81, i32 28, i32 64, i32 23, i32 67, i32 10, i32 26, i32 38, i32 40, i32 67, i32 59, i32 54, i32 70, i32 66, i32 18, i32 38, i32 64, i32 70], [20 x i32] [i32 67, i32 26, i32 20, i32 68, i32 2, i32 62, i32 12, i32 20, i32 95, i32 63, i32 94, i32 39, i32 63, i32 8, i32 40, i32 91, i32 66, i32 49, i32 94, i32 21], [20 x i32] [i32 24, i32 55, i32 58, i32 5, i32 66, i32 73, i32 99, i32 26, i32 97, i32 17, i32 78, i32 78, i32 96, i32 83, i32 14, i32 88, i32 34, i32 89, i32 63, i32 72], [20 x i32] [i32 21, i32 36, i32 23, i32 9, i32 75, i32 0, i32 76, i32 44, i32 20, i32 45, i32 35, i32 14, i32 0, i32 61, i32 33, i32 97, i32 34, i32 31, i32 33, i32 95], [20 x i32] [i32 78, i32 17, i32 53, i32 28, i32 22, i32 75, i32 31, i32 67, i32 15, i32 94, i32 3, i32 80, i32 4, i32 62, i32 16, i32 14, i32 9, i32 53, i32 56, i32 92], [20 x i32] [i32 16, i32 39, i32 5, i32 42, i32 96, i32 35, i32 31, i32 47, i32 55, i32 58, i32 88, i32 24, i32 0, i32 17, i32 54, i32 24, i32 36, i32 29, i32 85, i32 57], [20 x i32] [i32 86, i32 56, i32 0, i32 48, i32 35, i32 71, i32 89, i32 7, i32 5, i32 44, i32 44, i32 37, i32 44, i32 60, i32 21, i32 58, i32 51, i32 54, i32 17, i32 58], [20 x i32] [i32 19, i32 80, i32 81, i32 68, i32 5, i32 94, i32 47, i32 69, i32 28, i32 73, i32 92, i32 13, i32 86, i32 52, i32 17, i32 77, i32 4, i32 89, i32 55, i32 40], [20 x i32] [i32 4, i32 52, i32 8, i32 83, i32 97, i32 35, i32 99, i32 16, i32 7, i32 97, i32 57, i32 32, i32 16, i32 26, i32 26, i32 79, i32 33, i32 27, i32 98, i32 66], [20 x i32] [i32 88, i32 36, i32 68, i32 87, i32 57, i32 62, i32 20, i32 72, i32 3, i32 46, i32 33, i32 67, i32 46, i32 55, i32 12, i32 32, i32 63, i32 93, i32 53, i32 69], [20 x i32] [i32 4, i32 42, i32 16, i32 73, i32 38, i32 25, i32 39, i32 11, i32 24, i32 94, i32 72, i32 18, i32 8, i32 46, i32 29, i32 32, i32 40, i32 62, i32 76, i32 36], [20 x i32] [i32 20, i32 69, i32 36, i32 41, i32 72, i32 30, i32 23, i32 88, i32 34, i32 62, i32 99, i32 69, i32 82, i32 67, i32 59, i32 85, i32 74, i32 4, i32 36, i32 16], [20 x i32] [i32 20, i32 73, i32 35, i32 29, i32 78, i32 31, i32 90, i32 1, i32 74, i32 31, i32 49, i32 71, i32 48, i32 86, i32 81, i32 16, i32 23, i32 57, i32 5, i32 54], [20 x i32] [i32 1, i32 70, i32 54, i32 71, i32 83, i32 51, i32 54, i32 69, i32 16, i32 92, i32 33, i32 48, i32 61, i32 43, i32 52, i32 1, i32 89, i32 19, i32 67, i32 48]]
@.str = [18 x i8] c"Max: %d (coluna)\0A\00"
@.str.1 = [17 x i8] c"Max: %d (linha)\0A\00"
@.str.2 = [28 x i8] c"Max: %d (diagonal direita)\0A\00"
@.str.3 = [29 x i8] c"Max: %d (diagonal esquerda)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [20 x [20 x i32]]
store i32 0, i32* %1
store i32 90, i32* %4
%7 = bitcast [20 x [20 x i32]]* %6 to i8*
store i32 0, i32* %2
br label %8
8: ; preds = %72, %0
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 16
br i1 %10, label %11, label %75
11: ; preds = %8
store i32 0, i32* %3
br label %12
12: ; preds = %68, %11
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 16
br i1 %14, label %15, label %71
15: ; preds = %12
%16 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %6, i64 0, i64 0
%17 = bitcast [20 x i32]* %16 to i32**
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = call i32 @prodColuna(i32** %17, i32 %18, i32 %19)
store i32 %20, i32* %5
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %28
24: ; preds = %15
%25 = load i32, i32* %5
store i32 %25, i32* %4
%26 = load i32, i32* %4
%27 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %24, %15
%29 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %6, i64 0, i64 0
%30 = bitcast [20 x i32]* %29 to i32**
%31 = load i32, i32* %2
%32 = load i32, i32* %3
%33 = call i32 @prodLinha(i32** %30, i32 %31, i32 %32)
store i32 %33, i32* %5
%34 = load i32, i32* %5
%35 = load i32, i32* %4
%36 = icmp sgt i32 %34, %35
br i1 %36, label %37, label %41
37: ; preds = %28
%38 = load i32, i32* %5
store i32 %38, i32* %4
%39 = load i32, i32* %4
%40 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %37, %28
%42 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %6, i64 0, i64 0
%43 = bitcast [20 x i32]* %42 to i32**
%44 = load i32, i32* %2
%45 = load i32, i32* %3
%46 = call i32 @prodDiagDir(i32** %43, i32 %44, i32 %45)
store i32 %46, i32* %5
%47 = load i32, i32* %5
%48 = load i32, i32* %4
%49 = icmp sgt i32 %47, %48
br i1 %49, label %50, label %54
50: ; preds = %41
%51 = load i32, i32* %5
store i32 %51, i32* %4
%52 = load i32, i32* %4
%53 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %50, %41
%55 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %6, i64 0, i64 0
%56 = bitcast [20 x i32]* %55 to i32**
%57 = load i32, i32* %2
%58 = load i32, i32* %3
%59 = call i32 @prodDiagEsq(i32** %56, i32 %57, i32 %58)
store i32 %59, i32* %5
%60 = load i32, i32* %5
%61 = load i32, i32* %4
%62 = icmp sgt i32 %60, %61
br i1 %62, label %63, label %67
63: ; preds = %54
%64 = load i32, i32* %5
store i32 %64, i32* %4
%65 = load i32, i32* %4
%66 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %65)
br label %67
67: ; preds = %63, %54
br label %68
68: ; preds = %67
%69 = load i32, i32* %3
%70 = add nsw i32 %69, 1
store i32 %70, i32* %3
br label %12
71: ; preds = %12
br label %72
72: ; preds = %71
%73 = load i32, i32* %2
%74 = add nsw i32 %73, 1
store i32 %74, i32* %2
br label %8
75: ; preds = %8
%76 = call i32 (...) @getchar()
ret i32 0
}

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