#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*/ assert(int);
int main() {
  int a = 1;
  int b = 2;
  int c = 3;
  int d = 4;
  int e = 0;
  while (d < 9) {
    b = 2 * a;
    d = d + 4;
    e = e - 4 * a;
    a = b - a;
    c = e + d;
  }
  a = d / 2;
  b = d % 2;
  assert(c == 4);
  assert(d != 1);
  assert(d != 2);
  assert(d != 3);
  assert(d == 12);
  assert(a == 6);
  assert(e == -8);
  assert(b == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x9,-0x14(%rbp)
jge    1183 <main+0x73>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <main+0x32>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x4,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x1,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x2,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x3,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0xc,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x6,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0xfffffff8,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
%5 = tail call i32 @assert(i32 1)
%6 = tail call i32 @assert(i32 1)
%7 = tail call i32 @assert(i32 1)
%8 = tail call i32 @assert(i32 1)
ret i32 0
}