#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*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int gfbyte();
int main(void) {
  int i, j, k;
  i = gfbyte();
  i = i + 1;
  if (i == 0)
    k = -0;
  else
    k = i + 0;
  if (i != 1)
    abort();
  k = 1;
  if (k <= i)
    do
      j = gfbyte();
    while (k++ < i);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <gfbyte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1168 <main+0x38>
movl   $0x0,-0x10(%rbp)
jmp    1171 <main+0x41>
mov    -0x8(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1182 <main+0x52>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11bd <main+0x8d>
jmp    119a <main+0x6a>
mov    $0x0,%al
call   1050 <gfbyte@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0x8(%rbp),%eax
jl     119a <main+0x6a>
jmp    11bd <main+0x8d>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <gfbyte@plt>
test   %eax,%eax
jne    114a <main+0x1a>
xor    %eax,%eax
call   1050 <gfbyte@plt>
xor    %edi,%edi
call   1040 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @gfbyte()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 0, i32* %4
br label %14
11: ; preds = %0
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 0
store i32 %13, i32* %4
br label %14
14: ; preds = %11, %10
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, 1
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %14
store i32 1, i32* %4
%20 = load i32, i32* %4
%21 = load i32, i32* %2
%22 = icmp sle i32 %20, %21
br i1 %22, label %23, label %32
23: ; preds = %19
br label %24
24: ; preds = %26, %23
%25 = call i32 (...) @gfbyte()
store i32 %25, i32* %3
br label %26
26: ; preds = %24
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
%29 = load i32, i32* %2
%30 = icmp slt i32 %27, %29
br i1 %30, label %24, label %31
31: ; preds = %26
br label %32
32: ; preds = %31, %19
%33 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gfbyte()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @gfbyte()
%7 = tail call i32 @exit(i32 0)
unreachable
}