#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 f(int);
int main(int argc, char **argv) {
  int x;
  int y;
  x = argc;
  y = 2;
  x = x * x;
  do {
    x = x + 2;
  } while (x < 100);
  if (x > y) {
    int k;
    k = 8;
    x = 4 + x * 2 - 1;
  } else {
    x = x + 1 - f(y);
  };
  return x + 3;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jl     113d <main+0x2d>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1177 <main+0x67>
movl   $0x8,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
add    $0x4,%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1192 <main+0x82>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
imul   %edi,%edi
xor    %eax,%eax
mov    $0x62,%ecx
sub    %edi,%ecx
cmovb  %eax,%ecx
add    $0x1,%ecx
and    $0x7ffffffe,%ecx
add    %edi,%ecx
lea    (%rcx,%rcx,1),%eax
add    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
store i32 2, i32* %7
%10 = load i32, i32* %6
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %6
br label %13
13: ; preds = %16, %2
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 2
store i32 %15, i32* %6
br label %16
16: ; preds = %13
%17 = load i32, i32* %6
%18 = icmp slt i32 %17, 100
br i1 %18, label %13, label %19
19: ; preds = %16
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %28
23: ; preds = %19
store i32 8, i32* %8
%24 = load i32, i32* %6
%25 = mul nsw i32 %24, 2
%26 = add nsw i32 4, %25
%27 = sub nsw i32 %26, 1
store i32 %27, i32* %6
br label %34
28: ; preds = %19
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
%31 = load i32, i32* %7
%32 = call i32 @f(i32 %31)
%33 = sub nsw i32 %30, %32
store i32 %33, i32* %6
br label %34
34: ; preds = %28, %23
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 3
ret i32 %36
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = mul i32 %0, %0
%4 = call i32 @llvm.umax.i32(i32 %3, i32 98)
%5 = add i32 %4, 1
%6 = sub i32 %5, %3
%7 = and i32 %6, 2147483646
%8 = add i32 %3, %7
%9 = shl i32 %8, 1
%10 = add i32 %9, 10
ret i32 %10
}