#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*/ buff;

/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ process(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  char buff[BUFSIZ];
  while (fgets(buff, sizeof(buff), stdin) != NULL) {
    if (buff[0] == '%' && buff[1] == '#') {
      process(buff);
    } else {
      fprintf(stdout, "%s", buff);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x30(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    %eax,%esi
mov    0x2e61(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     11e5 <main+0xb5>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
jne    11c7 <main+0x97>
mov    -0x28(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x23,%eax
jne    11c7 <main+0x97>
mov    -0x28(%rbp),%rdi
call   1030 <process@plt>
jmp    11e0 <main+0xb0>
mov    -0x28(%rbp),%rdx
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
lea    0xe25(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1176 <main+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2e93(%rip),%rax
mov    (%rax),%r14d
mov    %rsp,%rbx
mov    %r14,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x2e85(%rip),%r12
mov    (%r12),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     11c8 <main+0x98>
mov    0x2e52(%rip),%r13
lea    0xe7b(%rip),%r15
jmp    11b3 <main+0x83>
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     11c8 <main+0x98>
cmpb   $0x25,(%rbx)
jne    1190 <main+0x60>
cmpb   $0x23,0x1(%rbx)
jne    1190 <main+0x60>
mov    %rbx,%rdi
call   1030 <process@plt>
jmp    119f <main+0x6f>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@stdin = global i32 0
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* @BUFSIZ
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %6
%11 = alloca i8, i64 %9
store i64 %9, i64* %7
br label %12
12: ; preds = %32, %2
%13 = trunc i64 %9 to i32
%14 = load i32, i32* @stdin
%15 = call i32* @fgets(i8* %11, i32 %13, i32 %14)
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %33
17: ; preds = %12
%18 = getelementptr inbounds i8, i8* %11, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 37
br i1 %21, label %22, label %29
22: ; preds = %17
%23 = getelementptr inbounds i8, i8* %11, i64 1
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 35
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 @process(i8* %11)
br label %32
29: ; preds = %22, %17
%30 = load i32, i32* @stdout
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %32
32: ; preds = %29, %27
br label %12
33: ; preds = %12
store i32 0, i32* %3
%34 = load i8*, i8** %6
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@stdin = global i32 0
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @BUFSIZ
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = load i32, i32* @stdin
%7 = call i32* @fgets(i8* %5, i32 %3, i32 %6)
%8 = icmp eq i32* %7, null
br i1 %8, label %26, label %9
9: ; preds = %2
%10 = getelementptr inbounds i8, i8* %5, i64 1
br label %11
11: ; preds = %9, %22
%12 = load i8, i8* %5
%13 = icmp eq i8 %12, 37
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i8, i8* %10
%16 = icmp eq i8 %15, 35
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @process(i8* %5)
br label %22
19: ; preds = %14, %11
%20 = load i32, i32* @stdout
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %22
22: ; preds = %19, %17
%23 = load i32, i32* @stdin
%24 = call i32* @fgets(i8* %5, i32 %3, i32 %23)
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %11
26: ; preds = %22, %2
ret i32 0
}