#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 main(void) {
  int i;
  int a = 50;
  if (a == 40)
    printf("Something wrong with the compiler\n");
  else if (a == 30)
    printf("Something serious wrong with this compiler\n");
  else
    printf("This is the way\n");
  if (a == 40) {
    printf("Something wrong with the compiler\n");
    printf("You should fix your compiler\n");
  } else if (a == 30) {
    printf("Something seriously went wrong with your compiler\n");
  } else {
    printf("This is the correct way\n");
  }
  switch (a) {
  case 10:
  case 20:
    break;
  case 30:
    break;
  default:
    break;
  }
  for (i = 0; i < 10; i++) {
  }
  for (i = 0; i < 10; i += 2) {
  }
  while (i < 50) {
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x32,-0xc(%rbp)
cmpl   $0x28,-0xc(%rbp)
jne    1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    116d <main+0x5d>
cmpl   $0x1e,-0xc(%rbp)
jne    115c <main+0x4c>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <main+0x58>
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
jmp    116d <main+0x5d>
cmpl   $0x28,-0xc(%rbp)
jne    1194 <main+0x84>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
jmp    11c0 <main+0xb0>
cmpl   $0x1e,-0xc(%rbp)
jne    11af <main+0x9f>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
jmp    11bb <main+0xab>
lea    0xefb(%rip),%rdi
call   1030 <printf@plt>
jmp    11c0 <main+0xb0>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xa,%eax
je     11f6 <main+0xe6>
jmp    11d4 <main+0xc4>
mov    -0x10(%rbp),%eax
sub    $0x14,%eax
je     11f6 <main+0xe6>
jmp    11e5 <main+0xd5>
mov    -0x10(%rbp),%eax
sub    $0x1e,%eax
je     11fb <main+0xeb>
jmp    1200 <main+0xf0>
jmp    1205 <main+0xf5>
jmp    1205 <main+0xf5>
jmp    1205 <main+0xf5>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1229 <main+0x119>
jmp    121b <main+0x10b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    120c <main+0xfc>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    124d <main+0x13d>
jmp    123f <main+0x12f>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1230 <main+0x120>
jmp    1252 <main+0x142>
cmpl   $0x32,-0x8(%rbp)
jge    126a <main+0x15a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1252 <main+0x142>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Something wrong with the compiler\0A\00"
@.str.1 = [44 x i8] c"Something serious wrong with this compiler\0A\00"
@.str.2 = [17 x i8] c"This is the way\0A\00"
@.str.3 = [30 x i8] c"You should fix your compiler\0A\00"
@.str.4 = [51 x i8] c"Something seriously went wrong with your compiler\0A\00"
@.str.5 = [25 x i8] c"This is the correct way\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 50, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 40
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %16
8: ; preds = %0
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 30
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %15
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
br label %16
16: ; preds = %15, %6
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 40
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %30
22: ; preds = %16
%23 = load i32, i32* %3
%24 = icmp eq i32 %23, 30
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
br label %29
27: ; preds = %22
%28 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
br label %29
29: ; preds = %27, %25
br label %30
30: ; preds = %29, %19
%31 = load i32, i32* %3
switch i32 %31, label %34 [
i32 10, label %32
i32 20, label %32
i32 30, label %33
]
32: ; preds = %30, %30
br label %35
33: ; preds = %30
br label %35
34: ; preds = %30
br label %35
35: ; preds = %34, %33, %32
store i32 0, i32* %2
br label %36
36: ; preds = %40, %35
%37 = load i32, i32* %2
%38 = icmp slt i32 %37, 10
br i1 %38, label %39, label %43
39: ; preds = %36
br label %40
40: ; preds = %39
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
br label %36
43: ; preds = %36
store i32 0, i32* %2
br label %44
44: ; preds = %48, %43
%45 = load i32, i32* %2
%46 = icmp slt i32 %45, 10
br i1 %46, label %47, label %51
47: ; preds = %44
br label %48
48: ; preds = %47
%49 = load i32, i32* %2
%50 = add nsw i32 %49, 2
store i32 %50, i32* %2
br label %44
51: ; preds = %44
br label %52
52: ; preds = %55, %51
%53 = load i32, i32* %2
%54 = icmp slt i32 %53, 50
br i1 %54, label %55, label %58
55: ; preds = %52
%56 = load i32, i32* %2
%57 = add nsw i32 %56, 1
store i32 %57, i32* %2
br label %52
58: ; preds = %52
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"This is the way\00"
@str.6 = [24 x i8] c"This is the correct way\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}