#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 getchar_skipping_comments();
int getchar_update_lineno();
scalar_t__ xisspace(int);
int /*<<< orphan*/ xputchar(int);
int /*<<< orphan*/ xungetc();
void read_preprocessor_lines(void) {
  while (1) {
    int c;
    do {
      c = getchar_skipping_comments();
    } while (xisspace(c));
    if (c != '#') {
      xungetc();
      break;
    }
    xputchar(c);
    do {
      c = getchar_update_lineno();
      xputchar(c);
    } while (c != '\n');
  }
}


x86 assembly (clang, -O0):
<read_preprocessor_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    115d <read_preprocessor_lines+0xd>
mov    $0x0,%al
call   1050 <getchar_skipping_comments@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1070 <xisspace@plt>
cmp    $0x0,%rax
jne    115d <read_preprocessor_lines+0xd>
cmpl   $0x23,-0x4(%rbp)
je     118f <read_preprocessor_lines+0x3f>
mov    $0x0,%al
call   1060 <xungetc@plt>
jmp    11b8 <read_preprocessor_lines+0x68>
mov    -0x4(%rbp),%edi
call   1030 <xputchar@plt>
mov    $0x0,%al
call   1040 <getchar_update_lineno@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <xputchar@plt>
cmpl   $0xa,-0x4(%rbp)
jne    1197 <read_preprocessor_lines+0x47>
jmp    1158 <read_preprocessor_lines+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_preprocessor_lines>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar_skipping_comments@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1070 <xisspace@plt>
test   %rax,%rax
jne    1160 <read_preprocessor_lines+0x10>
cmp    $0x23,%ebx
jne    11a7 <read_preprocessor_lines+0x57>
mov    $0x23,%edi
call   1030 <xputchar@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar_update_lineno@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <xputchar@plt>
cmp    $0xa,%ebx
jne    1190 <read_preprocessor_lines+0x40>
jmp    1160 <read_preprocessor_lines+0x10>
xor    %eax,%eax
pop    %rbx
jmp    1060 <xungetc@plt>

LLVM IR (-O0):
define void @read_preprocessor_lines() {
%1 = alloca i32
br label %2
2: ; preds = %0, %24
br label %3
3: ; preds = %5, %2
%4 = call i32 (...) @getchar_skipping_comments()
store i32 %4, i32* %1
br label %5
5: ; preds = %3
%6 = load i32, i32* %1
%7 = call i64 @xisspace(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %5
%10 = load i32, i32* %1
%11 = icmp ne i32 %10, 35
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 (...) @xungetc()
br label %25
14: ; preds = %9
%15 = load i32, i32* %1
%16 = call i32 @xputchar(i32 %15)
br label %17
17: ; preds = %21, %14
%18 = call i32 (...) @getchar_update_lineno()
store i32 %18, i32* %1
%19 = load i32, i32* %1
%20 = call i32 @xputchar(i32 %19)
br label %21
21: ; preds = %17
%22 = load i32, i32* %1
%23 = icmp ne i32 %22, 10
br i1 %23, label %17, label %24
24: ; preds = %21
br label %2
25: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @read_preprocessor_lines() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @getchar_skipping_comments()
%3 = tail call i64 @xisspace(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %10, %1
br label %1
6: ; preds = %1
%7 = icmp eq i32 %2, 35
br i1 %7, label %8, label %14
8: ; preds = %6
%9 = tail call i32 @xputchar(i32 35)
br label %10
10: ; preds = %10, %8
%11 = tail call i32 (...) @getchar_update_lineno()
%12 = tail call i32 @xputchar(i32 %11)
%13 = icmp eq i32 %11, 10
br i1 %13, label %5, label %10
14: ; preds = %6
%15 = tail call i32 (...) @xungetc()
ret void
}