#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*/ putchar(char);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int plan_file_print_entry(FILE *planfile) {
  int c;
  while ((c = getc(planfile)) != '\n')
    if (c == EOF) {
      putchar('\n');
      return 1;
    } else {
      putchar(c);
    }
  putchar('\n');
  while (isblank(c = getc(planfile))) {
    while (isblank(c = getc(planfile)))
      ;
    ungetc(c, planfile);
    putchar('\t');
    while ((c = getc(planfile)) != '\n')
      if (c == EOF) {
        putchar('\n');
        return 1;
      } else {
        putchar(c);
      }
    putchar('\n');
  }
  if (c == EOF)
    return 1;
  ungetc(c, planfile);
  return 0;
}


x86 assembly (clang, -O0):
<plan_file_print_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xa,%eax
je     1199 <plan_file_print_entry+0x59>
mov    -0x14(%rbp),%eax
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%eax
jne    1189 <plan_file_print_entry+0x49>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x1,-0x4(%rbp)
jmp    128a <plan_file_print_entry+0x14a>
mov    -0x14(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    114c <plan_file_print_entry+0xc>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,%edi
mov    %edi,-0x14(%rbp)
call   1040 <isblank@plt>
cmp    $0x0,%rax
je     1259 <plan_file_print_entry+0x119>
jmp    11c5 <plan_file_print_entry+0x85>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,%edi
mov    %edi,-0x14(%rbp)
call   1040 <isblank@plt>
cmp    $0x0,%rax
je     11e7 <plan_file_print_entry+0xa7>
jmp    11c5 <plan_file_print_entry+0x85>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <ungetc@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xa,%eax
je     124a <plan_file_print_entry+0x10a>
mov    -0x14(%rbp),%eax
mov    0x2dcc(%rip),%rcx
cmp    (%rcx),%eax
jne    123a <plan_file_print_entry+0xfa>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x1,-0x4(%rbp)
jmp    128a <plan_file_print_entry+0x14a>
mov    -0x14(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    11fd <plan_file_print_entry+0xbd>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11a3 <plan_file_print_entry+0x63>
mov    -0x14(%rbp),%eax
mov    0x2d85(%rip),%rcx
cmp    (%rcx),%eax
jne    1277 <plan_file_print_entry+0x137>
movl   $0x1,-0x4(%rbp)
jmp    128a <plan_file_print_entry+0x14a>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <ungetc@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plan_file_print_entry>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1060 <getc@plt>
cmp    $0xa,%eax
je     117e <plan_file_print_entry+0x3e>
mov    0x2e90(%rip),%rbp
nopl   0x0(%rax,%rax,1)
cmp    0x0(%rbp),%eax
je     121c <plan_file_print_entry+0xdc>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
cmp    $0xa,%eax
jne    1160 <plan_file_print_entry+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <isblank@plt>
test   %rax,%rax
je     122d <plan_file_print_entry+0xed>
mov    0x2e3f(%rip),%r14
jmp    11d0 <plan_file_print_entry+0x90>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <isblank@plt>
test   %rax,%rax
je     122d <plan_file_print_entry+0xed>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <isblank@plt>
test   %rax,%rax
jne    11d0 <plan_file_print_entry+0x90>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <ungetc@plt>
mov    $0x9,%edi
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
cmp    $0xa,%eax
je     11b0 <plan_file_print_entry+0x70>
cmp    (%r14),%eax
je     121c <plan_file_print_entry+0xdc>
movsbl %al,%edi
jmp    1200 <plan_file_print_entry+0xc0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
jmp    1249 <plan_file_print_entry+0x109>
mov    0x2db4(%rip),%rcx
mov    $0x1,%eax
cmp    (%rcx),%ebp
je     1249 <plan_file_print_entry+0x109>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <ungetc@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @plan_file_print_entry(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
br label %5
5: ; preds = %19, %1
%6 = load i32*, i32** %3
%7 = call i32 @getc(i32* %6)
store i32 %7, i32* %4
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %20
9: ; preds = %5
%10 = load i32, i32* %4
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @putchar(i8 signext 10)
store i32 1, i32* %2
br label %65
15: ; preds = %9
%16 = load i32, i32* %4
%17 = trunc i32 %16 to i8
%18 = call i32 @putchar(i8 signext %17)
br label %19
19: ; preds = %15
br label %5
20: ; preds = %5
%21 = call i32 @putchar(i8 signext 10)
br label %22
22: ; preds = %54, %20
%23 = load i32*, i32** %3
%24 = call i32 @getc(i32* %23)
store i32 %24, i32* %4
%25 = call i64 @isblank(i32 %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %56
27: ; preds = %22
br label %28
28: ; preds = %33, %27
%29 = load i32*, i32** %3
%30 = call i32 @getc(i32* %29)
store i32 %30, i32* %4
%31 = call i64 @isblank(i32 %30)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %28
br label %28
34: ; preds = %28
%35 = load i32, i32* %4
%36 = load i32*, i32** %3
%37 = call i32 @ungetc(i32 %35, i32* %36)
%38 = call i32 @putchar(i8 signext 9)
br label %39
39: ; preds = %53, %34
%40 = load i32*, i32** %3
%41 = call i32 @getc(i32* %40)
store i32 %41, i32* %4
%42 = icmp ne i32 %41, 10
br i1 %42, label %43, label %54
43: ; preds = %39
%44 = load i32, i32* %4
%45 = load i32, i32* @EOF
%46 = icmp eq i32 %44, %45
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = call i32 @putchar(i8 signext 10)
store i32 1, i32* %2
br label %65
49: ; preds = %43
%50 = load i32, i32* %4
%51 = trunc i32 %50 to i8
%52 = call i32 @putchar(i8 signext %51)
br label %53
53: ; preds = %49
br label %39
54: ; preds = %39
%55 = call i32 @putchar(i8 signext 10)
br label %22
56: ; preds = %22
%57 = load i32, i32* %4
%58 = load i32, i32* @EOF
%59 = icmp eq i32 %57, %58
br i1 %59, label %60, label %61
60: ; preds = %56
store i32 1, i32* %2
br label %65
61: ; preds = %56
%62 = load i32, i32* %4
%63 = load i32*, i32** %3
%64 = call i32 @ungetc(i32 %62, i32* %63)
store i32 0, i32* %2
br label %65
65: ; preds = %61, %60, %47, %13
%66 = load i32, i32* %2
ret i32 %66
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @plan_file_print_entry(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = icmp eq i32 %2, 10
br i1 %3, label %15, label %4
4: ; preds = %1, %10
%5 = phi i32 [ %13, %10 ], [ %2, %1 ]
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @putchar(i8 signext 10)
br label %52
10: ; preds = %4
%11 = trunc i32 %5 to i8
%12 = tail call i32 @putchar(i8 signext %11)
%13 = tail call i32 @getc(i32* %0)
%14 = icmp eq i32 %13, 10
br i1 %14, label %15, label %4
15: ; preds = %10, %1
%16 = tail call i32 @putchar(i8 signext 10)
%17 = tail call i32 @getc(i32* %0)
%18 = tail call i64 @isblank(i32 %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %46, label %20
20: ; preds = %15, %24
%21 = tail call i32 @getc(i32* %0)
%22 = tail call i64 @isblank(i32 %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %20, %41
br label %20
25: ; preds = %20
%26 = tail call i32 @ungetc(i32 %21, i32* %0)
%27 = tail call i32 @putchar(i8 signext 9)
%28 = tail call i32 @getc(i32* %0)
%29 = icmp eq i32 %28, 10
br i1 %29, label %41, label %30
30: ; preds = %25, %36
%31 = phi i32 [ %39, %36 ], [ %28, %25 ]
%32 = load i32, i32* @EOF
%33 = icmp eq i32 %31, %32
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = tail call i32 @putchar(i8 signext 10)
br label %52
36: ; preds = %30
%37 = trunc i32 %31 to i8
%38 = tail call i32 @putchar(i8 signext %37)
%39 = tail call i32 @getc(i32* %0)
%40 = icmp eq i32 %39, 10
br i1 %40, label %41, label %30
41: ; preds = %36, %25
%42 = tail call i32 @putchar(i8 signext 10)
%43 = tail call i32 @getc(i32* %0)
%44 = tail call i64 @isblank(i32 %43)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %24
46: ; preds = %41, %15
%47 = phi i32 [ %17, %15 ], [ %43, %41 ]
%48 = load i32, i32* @EOF
%49 = icmp eq i32 %47, %48
br i1 %49, label %52, label %50
50: ; preds = %46
%51 = tail call i32 @ungetc(i32 %47, i32* %0)
br label %52
52: ; preds = %46, %50, %34, %8
%53 = phi i32 [ 1, %8 ], [ 1, %34 ], [ 0, %50 ], [ 1, %46 ]
ret i32 %53
}