#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*/ bar();
int toto() {
  int i, j, b;
  int a[100];
  if (i == 20) {
    for (j = 0; j <= 20; j++)
      a[j] = b + i;
    b = 3;
    bar();
  } else {
    if (i == 30) {
      for (j = 0; j <= 20; j++)
        a[j] = b + i;
      b = 5;
    }
  }
  for (j = 0; j <= 20; j++)
    a[j] = b + i;
  return a[b];
}


x86 assembly (clang, -O0):
<toto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
cmpl   $0x14,-0x4(%rbp)
jne    1168 <toto+0x58>
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jg     1155 <toto+0x45>
mov    -0xc(%rbp),%ecx
add    -0x4(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112c <toto+0x1c>
movl   $0x3,-0xc(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
jmp    11ae <toto+0x9e>
cmpl   $0x1e,-0x4(%rbp)
jne    11a9 <toto+0x99>
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jg     11a2 <toto+0x92>
mov    -0xc(%rbp),%ecx
add    -0x4(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1179 <toto+0x69>
movl   $0x5,-0xc(%rbp)
jmp    11ae <toto+0x9e>
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jg     11de <toto+0xce>
mov    -0xc(%rbp),%ecx
add    -0x4(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b5 <toto+0xa5>
movslq -0xc(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toto>:
ret

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

LLVM IR (-O2):
define i32 @toto() {
ret i32 undef
}