#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*/ ledOff(int, int);
void desligarTodosLeds() {
  int i, j;
  for (i = 0; i < 5; i++)
    for (j = 0; j < 30; j++)
      ledOff(i, j);
}


x86 assembly (clang, -O0):
<desligarTodosLeds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1166 <desligarTodosLeds+0x56>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jge    1153 <desligarTodosLeds+0x43>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ledOff@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <desligarTodosLeds+0x20>
jmp    1158 <desligarTodosLeds+0x48>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <desligarTodosLeds+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<desligarTodosLeds>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x3,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x4,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x5,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x6,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x7,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x9,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0xa,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0xb,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0xc,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0xd,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0xe,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0xf,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x10,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x11,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x12,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x13,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x14,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x15,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x16,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x17,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x18,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x19,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x1a,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x1b,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x1c,%esi
call   1030 <ledOff@plt>
mov    %ebx,%edi
mov    $0x1d,%esi
call   1030 <ledOff@plt>
add    $0x1,%ebx
cmp    $0x5,%ebx
jne    1120 <desligarTodosLeds+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @desligarTodosLeds() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %18, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %21
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %14, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 30
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 @ledOff(i32 %11, i32 %12)
br label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %7
17: ; preds = %7
br label %18
18: ; preds = %17
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %3
21: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @desligarTodosLeds() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %33, %1 ]
%3 = tail call i32 @ledOff(i32 %2, i32 0)
%4 = tail call i32 @ledOff(i32 %2, i32 1)
%5 = tail call i32 @ledOff(i32 %2, i32 2)
%6 = tail call i32 @ledOff(i32 %2, i32 3)
%7 = tail call i32 @ledOff(i32 %2, i32 4)
%8 = tail call i32 @ledOff(i32 %2, i32 5)
%9 = tail call i32 @ledOff(i32 %2, i32 6)
%10 = tail call i32 @ledOff(i32 %2, i32 7)
%11 = tail call i32 @ledOff(i32 %2, i32 8)
%12 = tail call i32 @ledOff(i32 %2, i32 9)
%13 = tail call i32 @ledOff(i32 %2, i32 10)
%14 = tail call i32 @ledOff(i32 %2, i32 11)
%15 = tail call i32 @ledOff(i32 %2, i32 12)
%16 = tail call i32 @ledOff(i32 %2, i32 13)
%17 = tail call i32 @ledOff(i32 %2, i32 14)
%18 = tail call i32 @ledOff(i32 %2, i32 15)
%19 = tail call i32 @ledOff(i32 %2, i32 16)
%20 = tail call i32 @ledOff(i32 %2, i32 17)
%21 = tail call i32 @ledOff(i32 %2, i32 18)
%22 = tail call i32 @ledOff(i32 %2, i32 19)
%23 = tail call i32 @ledOff(i32 %2, i32 20)
%24 = tail call i32 @ledOff(i32 %2, i32 21)
%25 = tail call i32 @ledOff(i32 %2, i32 22)
%26 = tail call i32 @ledOff(i32 %2, i32 23)
%27 = tail call i32 @ledOff(i32 %2, i32 24)
%28 = tail call i32 @ledOff(i32 %2, i32 25)
%29 = tail call i32 @ledOff(i32 %2, i32 26)
%30 = tail call i32 @ledOff(i32 %2, i32 27)
%31 = tail call i32 @ledOff(i32 %2, i32 28)
%32 = tail call i32 @ledOff(i32 %2, i32 29)
%33 = add nuw nsw i32 %2, 1
%34 = icmp eq i32 %33, 5
br i1 %34, label %35, label %1
35: ; preds = %1
ret void
}