#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 fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
scalar_t__ is_escaped_newline(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ skip_space(int /*<<< orphan*/ *);
int is_preprocessor_statements(FILE *input, FILE *output, int c) {
  if (c == '#') {
    fputc('#', output);
    while ((c = fgetc(input)) != EOF) {
      fputc(c, output);
      if (is_escaped_newline(input, output, c)) {
        continue;
      }
      if (c == '\n') {
        skip_space(input);
        break;
      }
    }
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_preprocessor_statements>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x23,-0x1c(%rbp)
jne    11da <is_preprocessor_statements+0x9a>
mov    -0x18(%rbp),%rsi
mov    $0x23,%edi
call   1050 <fputc@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2e6a(%rip),%rcx
cmp    (%rcx),%eax
je     11ce <is_preprocessor_statements+0x8e>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1050 <fputc@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1060 <is_escaped_newline@plt>
cmp    $0x0,%rax
je     11b1 <is_preprocessor_statements+0x71>
jmp    116b <is_preprocessor_statements+0x2b>
cmpl   $0xa,-0x1c(%rbp)
jne    11c9 <is_preprocessor_statements+0x89>
mov    -0x10(%rbp),%rdi
call   1030 <skip_space@plt>
jmp    11ce <is_preprocessor_statements+0x8e>
jmp    116b <is_preprocessor_statements+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    11e1 <is_preprocessor_statements+0xa1>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_preprocessor_statements>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %ebp,%ebp
cmp    $0x23,%edx
jne    11a9 <is_preprocessor_statements+0x69>
mov    %rsi,%r15
mov    %rdi,%r14
mov    $0x23,%edi
call   1050 <fputc@plt>
mov    0x2e82(%rip),%r12
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <fgetc@plt>
cmp    (%r12),%eax
je     11a9 <is_preprocessor_statements+0x69>
mov    %eax,%ebx
mov    %eax,%edi
mov    %r15,%rsi
call   1050 <fputc@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1060 <is_escaped_newline@plt>
cmp    $0xa,%ebx
jne    1170 <is_preprocessor_statements+0x30>
test   %rax,%rax
jne    1170 <is_preprocessor_statements+0x30>
mov    %r14,%rdi
call   1030 <skip_space@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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