#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 sub(int, int);
int main() {
  int a;
  int b = 1;
  double c = 0;
  char d = 'x';
  a = 10 / 2;
  c = (b + 3) * 4 - 5;
  b = sub(10, 8);
  for (int i = 0; i <= 10; i++) {
  }
  for (int j = 0; j <= 100; j += 1) {
  }
  while (a >= 0) {
    a--;
  }
  while (a >= 0 && b == 2) {
    a--;
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movb   $0x78,-0x19(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x3,%eax
shl    $0x2,%eax
sub    $0x5,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0xa,%edi
mov    $0x8,%esi
call   1030 <sub@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0xa,-0x20(%rbp)
jg     1184 <main+0x74>
jmp    1176 <main+0x66>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1167 <main+0x57>
movl   $0x0,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
jg     11a8 <main+0x98>
jmp    119a <main+0x8a>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    118b <main+0x7b>
jmp    11ad <main+0x9d>
cmpl   $0x0,-0x8(%rbp)
jl     11c5 <main+0xb5>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    11ad <main+0x9d>
jmp    11ca <main+0xba>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x25(%rbp)
jl     11e3 <main+0xd3>
cmpl   $0x2,-0xc(%rbp)
sete   %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
test   $0x1,%al
jne    11f3 <main+0xe3>
jmp    1201 <main+0xf1>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    11ca <main+0xba>
mov    -0x8(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x8,%esi
call   1030 <sub@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
store double 0.000000e+00, double* %4
store i8 120, i8* %5
store i32 5, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 3
%10 = mul nsw i32 %9, 4
%11 = sub nsw i32 %10, 5
%12 = sitofp i32 %11 to double
store double %12, double* %4
%13 = call i32 @sub(i32 10, i32 8)
store i32 %13, i32* %3
store i32 0, i32* %6
br label %14
14: ; preds = %18, %0
%15 = load i32, i32* %6
%16 = icmp sle i32 %15, 10
br i1 %16, label %17, label %21
17: ; preds = %14
br label %18
18: ; preds = %17
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %14
21: ; preds = %14
store i32 0, i32* %7
br label %22
22: ; preds = %26, %21
%23 = load i32, i32* %7
%24 = icmp sle i32 %23, 100
br i1 %24, label %25, label %29
25: ; preds = %22
br label %26
26: ; preds = %25
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 1
store i32 %28, i32* %7
br label %22
29: ; preds = %22
br label %30
30: ; preds = %33, %29
%31 = load i32, i32* %2
%32 = icmp sge i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i32, i32* %2
%35 = add nsw i32 %34, -1
store i32 %35, i32* %2
br label %30
36: ; preds = %30
br label %37
37: ; preds = %45, %36
%38 = load i32, i32* %2
%39 = icmp sge i32 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = load i32, i32* %3
%42 = icmp eq i32 %41, 2
br label %43
43: ; preds = %40, %37
%44 = phi i1 [ false, %37 ], [ %42, %40 ]
br i1 %44, label %45, label %48
45: ; preds = %43
%46 = load i32, i32* %2
%47 = add nsw i32 %46, -1
store i32 %47, i32* %2
br label %37
48: ; preds = %43
%49 = load i32, i32* %2
ret i32 %49
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sub(i32 10, i32 8)
ret i32 -1
}