#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 BUFSIZ;
int /*<<< orphan*/ generateCode(int /*<<< orphan*/ *);
scalar_t__ parseRule(char *);
scalar_t__ readLine(char *, int /*<<< orphan*/ *);
void processInput(FILE *stream, FILE *outstream) {
  char buffer[BUFSIZ];
  while (readLine(buffer, stream)) {
    if (parseRule(buffer)) {
      generateCode(outstream);
    }
  }
}


x86 assembly (clang, -O0):
<processInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
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    -0x8(%rbp),%rsi
call   1040 <readLine@plt>
cmp    $0x0,%rax
je     11a4 <processInput+0x74>
mov    -0x28(%rbp),%rdi
call   1030 <parseRule@plt>
cmp    $0x0,%rax
je     119f <processInput+0x6f>
mov    -0x10(%rbp),%rdi
call   1050 <generateCode@plt>
jmp    116c <processInput+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processInput>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <readLine@plt>
test   %rax,%rax
je     1187 <processInput+0x57>
mov    %rbx,%rdi
call   1030 <parseRule@plt>
test   %rax,%rax
je     1160 <processInput+0x30>
mov    %r14,%rdi
call   1050 <generateCode@plt>
jmp    1160 <processInput+0x30>
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
define void @processInput(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32, i32* @BUFSIZ
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
br label %11
11: ; preds = %21, %2
%12 = load i32*, i32** %3
%13 = call i64 @readLine(i8* %10, i32* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = call i64 @parseRule(i8* %10)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32*, i32** %4
%20 = call i32 @generateCode(i32* %19)
br label %21
21: ; preds = %18, %15
br label %11
22: ; preds = %11
%23 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
define void @processInput(i32* %0, i32* %1) {
%3 = load i32, i32* @BUFSIZ
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i64 @readLine(i8* %5, i32* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %2, %13
%9 = call i64 @parseRule(i8* %5)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 @generateCode(i32* %1)
br label %13
13: ; preds = %11, %8
%14 = call i64 @readLine(i8* %5, i32* %0)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %13, %2
ret void
}