#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*/ printf(char *, int);
int main1() {
  int matrix[4][5] = {
      {1, 0, 0, 1, 0}, {1, 1, 0, 1, 0}, {0, 0, 0, 0, 0}, {1, 1, 0, 1, 0}};
  int i, j;
  char foundNotNull;
  int linesNotNullQtt = 0;
  for (i = 0; i < 4; i++) {
    foundNotNull = 0;
    for (j = 0; j < 5; j++) {
      if (matrix[i][j]) {
        foundNotNull = 1;
        break;
      }
    }
    if (!foundNotNull) {
      linesNotNullQtt++;
    }
  }
  for (i = 0; i < 5; i++) {
    foundNotNull = 0;
    for (j = 0; j < 4; j++) {
      if (matrix[j][i]) {
        foundNotNull = 1;
        break;
      }
    }
    if (!foundNotNull) {
      linesNotNullQtt++;
    }
  }
  printf("Há %d fileiras não nulas\n.", linesNotNullQtt);
  return 0;
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x60(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x4,-0x54(%rbp)
jge    11c9 <main1+0xa9>
movb   $0x0,-0x59(%rbp)
movl   $0x0,-0x58(%rbp)
cmpl   $0x5,-0x58(%rbp)
jge    11a3 <main1+0x83>
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x58(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1190 <main1+0x70>
movb   $0x1,-0x59(%rbp)
jmp    11a3 <main1+0x83>
jmp    1195 <main1+0x75>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1160 <main1+0x40>
cmpb   $0x0,-0x59(%rbp)
jne    11b6 <main1+0x96>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    11bb <main1+0x9b>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    114b <main1+0x2b>
movl   $0x0,-0x54(%rbp)
cmpl   $0x5,-0x54(%rbp)
jge    124e <main1+0x12e>
movb   $0x0,-0x59(%rbp)
movl   $0x0,-0x58(%rbp)
cmpl   $0x4,-0x58(%rbp)
jge    1228 <main1+0x108>
movslq -0x58(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x54(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1215 <main1+0xf5>
movb   $0x1,-0x59(%rbp)
jmp    1228 <main1+0x108>
jmp    121a <main1+0xfa>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    11e5 <main1+0xc5>
cmpb   $0x0,-0x59(%rbp)
jne    123b <main1+0x11b>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    1240 <main1+0x120>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11d0 <main1+0xb0>
mov    -0x60(%rbp),%esi
lea    0xdf8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main1>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [29 x i8] c"H\C3\A1 %d fileiras n\C3\A3o nulas\0A.\00"
define i32 @main1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}