#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*/ getc_unlocked(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int main(int argc, char *argv[]) {
  int a, c;
  double b;
  int i;
  char ch;
  long f = 122L;
  const unsigned short g = 1;
  printf("a + b = c\n");
  printf("%d\n", sizeof(int));
  b = 12.3E2;
  b = 12.3 + 345 - 1. * 0.9999;
  c = 345;
  if (1) {
    a = b;
  } else if (0) {
    c = 1;
  } else {
    b = a * c;
  }
  for (i = 0; i < 10; i++) {
    a += c ? 1 : 2;
  }
  do {
    a >>= 1;
    if (a < 0) {
      break;
    } else {
      continue;
    }
  } while (1);
  while (a) {
    a--;
    getc_unlocked(a);
  }
  switch (ch) {
  case 'a':
  case 'b':
    break;
  case 'c':
    putchar(ch);
  case 'd':
  default:
    break;
  }
  a = 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x7a,-0x30(%rbp)
movw   $0x1,-0x32(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  0xe8b(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe76(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x159,-0x18(%rbp)
cvttsd2si -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    11d6 <main+0xa6>
mov    -0x18(%rbp),%edx
mov    $0x2,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a5 <main+0x75>
jmp    11db <main+0xab>
mov    -0x14(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    11f3 <main+0xc3>
jmp    1207 <main+0xd7>
jmp    11f8 <main+0xc8>
mov    $0x1,%al
test   $0x1,%al
jne    11db <main+0xab>
jmp    1207 <main+0xd7>
jmp    120c <main+0xdc>
cmpl   $0x0,-0x14(%rbp)
je     122c <main+0xfc>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <getc_unlocked@plt>
jmp    120c <main+0xdc>
movsbl -0x25(%rbp),%eax
mov    %eax,-0x38(%rbp)
add    $0xffffff9f,%eax
sub    $0x2,%eax
jb     1266 <main+0x136>
jmp    1244 <main+0x114>
mov    -0x38(%rbp),%eax
sub    $0x63,%eax
je     126b <main+0x13b>
jmp    1255 <main+0x125>
mov    -0x38(%rbp),%eax
sub    $0x64,%eax
je     1274 <main+0x144>
jmp    1279 <main+0x149>
jmp    127e <main+0x14e>
movsbl -0x25(%rbp),%edi
call   1030 <putchar@plt>
jmp    1279 <main+0x149>
jmp    127e <main+0x14e>
movl   $0x1,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [11 x i8] c"a + b = c\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca i8
%11 = alloca i64
%12 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 122, i64* %11
store i16 1, i16* %12
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 4)
store double 1.230000e+03, double* %8
store double 0x407644CD35A85879, double* %8
store i32 345, i32* %7
%15 = load double, double* %8
%16 = fptosi double %15 to i32
store i32 %16, i32* %6
store i32 0, i32* %9
br label %17
17: ; preds = %27, %2
%18 = load i32, i32* %9
%19 = icmp slt i32 %18, 10
br i1 %19, label %20, label %30
20: ; preds = %17
%21 = load i32, i32* %7
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 1, i32 2
%25 = load i32, i32* %6
%26 = add nsw i32 %25, %24
store i32 %26, i32* %6
br label %27
27: ; preds = %20
%28 = load i32, i32* %9
%29 = add nsw i32 %28, 1
store i32 %29, i32* %9
br label %17
30: ; preds = %17
br label %31
31: ; preds = %38, %30
%32 = load i32, i32* %6
%33 = ashr i32 %32, 1
store i32 %33, i32* %6
%34 = load i32, i32* %6
%35 = icmp slt i32 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %31
br label %39
37: ; preds = %31
br label %38
38: ; preds = %37
br i1 true, label %31, label %39
39: ; preds = %38, %36
br label %40
40: ; preds = %43, %39
%41 = load i32, i32* %6
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %48
43: ; preds = %40
%44 = load i32, i32* %6
%45 = add nsw i32 %44, -1
store i32 %45, i32* %6
%46 = load i32, i32* %6
%47 = call i32 @getc_unlocked(i32 %46)
br label %40
48: ; preds = %40
%49 = load i8, i8* %10
%50 = sext i8 %49 to i32
switch i32 %50, label %56 [
i32 97, label %51
i32 98, label %51
i32 99, label %52
i32 100, label %55
]
51: ; preds = %48, %48
br label %57
52: ; preds = %48
%53 = load i8, i8* %10
%54 = call i32 @putchar(i8 signext %53)
br label %55
55: ; preds = %48, %52
br label %56
56: ; preds = %48, %55
br label %57
57: ; preds = %56, %51
store i32 1, i32* %6
%58 = load i32, i32* %3
ret i32 %58
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [10 x i8] c"a + b = c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 4)
br label %5
5: ; preds = %2, %5
br label %5
}