#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
scalar_t__ isblank(int);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int plan_file_next_entry(FILE *planfile) {
  int c;
  do {
    while ((c = getc(planfile)) != '\n')
      if (c == EOF)
        return 1;
  } while (isblank(c = getc(planfile)));
  if (c == EOF)
    return 1;
  ungetc(c, planfile);
  return 0;
}


x86 assembly (clang, -O0):
<plan_file_next_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
jmp    1141 <plan_file_next_entry+0x11>
mov    -0x10(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xa,%eax
je     1179 <plan_file_next_entry+0x49>
mov    -0x14(%rbp),%eax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%eax
jne    1174 <plan_file_next_entry+0x44>
movl   $0x1,-0x4(%rbp)
jmp    11cc <plan_file_next_entry+0x9c>
jmp    1141 <plan_file_next_entry+0x11>
jmp    117e <plan_file_next_entry+0x4e>
mov    -0x10(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,%edi
mov    %edi,-0x14(%rbp)
call   1030 <isblank@plt>
cmp    $0x0,%rax
jne    113c <plan_file_next_entry+0xc>
mov    -0x14(%rbp),%eax
mov    0x2e43(%rip),%rcx
cmp    (%rcx),%eax
jne    11b9 <plan_file_next_entry+0x89>
movl   $0x1,-0x4(%rbp)
jmp    11cc <plan_file_next_entry+0x9c>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <ungetc@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plan_file_next_entry>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eaa(%rip),%r14
jmp    1145 <plan_file_next_entry+0x15>
cmp    (%r14),%eax
je     1180 <plan_file_next_entry+0x50>
mov    %rbx,%rdi
call   1050 <getc@plt>
cmp    $0xa,%eax
jne    1140 <plan_file_next_entry+0x10>
mov    %rbx,%rdi
call   1050 <getc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <isblank@plt>
test   %rax,%rax
jne    1145 <plan_file_next_entry+0x15>
mov    $0x1,%eax
cmp    (%r14),%ebp
je     1185 <plan_file_next_entry+0x55>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
xor    %eax,%eax
jmp    1185 <plan_file_next_entry+0x55>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @plan_file_next_entry(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
br label %5
5: ; preds = %17, %1
br label %6
6: ; preds = %15, %5
%7 = load i32*, i32** %3
%8 = call i32 @getc(i32* %7)
store i32 %8, i32* %4
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %4
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %2
br label %31
15: ; preds = %10
br label %6
16: ; preds = %6
br label %17
17: ; preds = %16
%18 = load i32*, i32** %3
%19 = call i32 @getc(i32* %18)
store i32 %19, i32* %4
%20 = call i64 @isblank(i32 %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %5, label %22
22: ; preds = %17
%23 = load i32, i32* %4
%24 = load i32, i32* @EOF
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 1, i32* %2
br label %31
27: ; preds = %22
%28 = load i32, i32* %4
%29 = load i32*, i32** %3
%30 = call i32 @ungetc(i32 %28, i32* %29)
store i32 0, i32* %2
br label %31
31: ; preds = %27, %26, %14
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @plan_file_next_entry(i32* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = tail call i32 @getc(i32* %0)
%4 = icmp eq i32 %3, 10
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %3, %6
br i1 %7, label %18, label %8
8: ; preds = %5, %9
br label %2
9: ; preds = %2
%10 = tail call i32 @getc(i32* %0)
%11 = tail call i64 @isblank(i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %9
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %10, %14
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = tail call i32 @ungetc(i32 %10, i32* %0)
br label %18
18: ; preds = %5, %13, %16
%19 = phi i32 [ 0, %16 ], [ 1, %13 ], [ 1, %5 ]
ret i32 %19
}