#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*/ foo(char *);
int CamelCase(int id) {
  int val;
  if (id == 0)
    val = 1;
  if (id == 0)
    val = id + val;
  if (id == 0)
    if (val == 0) {
      val;
    }
  if (id == 0)
    if (val == 0)
      val;
  for (id = 0; id < 3; id++)
    val = id + val;
  foo("too many spaces");
  return val;
}


x86 assembly (clang, -O0):
<CamelCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112c <CamelCase+0x1c>
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113f <CamelCase+0x2f>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1158 <CamelCase+0x48>
cmpl   $0x0,-0x8(%rbp)
jne    1153 <CamelCase+0x43>
jmp    1158 <CamelCase+0x48>
cmpl   $0x0,-0x4(%rbp)
jne    1171 <CamelCase+0x61>
cmpl   $0x0,-0x8(%rbp)
jne    116c <CamelCase+0x5c>
jmp    1171 <CamelCase+0x61>
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1199 <CamelCase+0x89>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <CamelCase+0x68>
lea    0xe60(%rip),%rdi
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CamelCase>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <foo@plt>
mov    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"too many spaces\00"
define i32 @CamelCase(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %3
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
store i32 %13, i32* %3
br label %14
14: ; preds = %10, %7
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = load i32, i32* %3
br label %22
22: ; preds = %20, %17
br label %23
23: ; preds = %22, %14
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %23
%27 = load i32, i32* %3
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = load i32, i32* %3
br label %31
31: ; preds = %29, %26
br label %32
32: ; preds = %31, %23
store i32 0, i32* %2
br label %33
33: ; preds = %40, %32
%34 = load i32, i32* %2
%35 = icmp slt i32 %34, 3
br i1 %35, label %36, label %43
36: ; preds = %33
%37 = load i32, i32* %2
%38 = load i32, i32* %3
%39 = add nsw i32 %37, %38
store i32 %39, i32* %3
br label %40
40: ; preds = %36
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
br label %33
43: ; preds = %33
%44 = call i32 @foo(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%45 = load i32, i32* %3
ret i32 %45
}

LLVM IR (-O2):
@.str = [16 x i8] c"too many spaces\00"
define i32 @CamelCase(i32 %0) {
%2 = tail call i32 @foo(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 4
}