#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 /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ parses_to(char *, char *);
int main(void) {
  assert(parses_to("", ""));
  assert(parses_to("# comments, blank lines\n"
                   " #\n"
                   " ##\n"
                   "\n"
                   " \f \r\n",
                   ""));
  assert(parses_to("X=1\n"
                   "Y=\n"
                   "X := \n"
                   "X :=     # comment\n"
                   "X := a\n"
                   "X := b c   # comment\n"
                   "X += x\n"
                   "X ?= x\n"
                   "Y =# comment\n",
                   "DEFINE X = 1\n"
                   "DEFINE Y = \n"
                   "DEFINE X := \n"
                   "DEFINE X := \n"
                   "DEFINE X := a\n"
                   "DEFINE X := b c\n"
                   "DEFINE X += x\n"
                   "DEFINE X ?= x\n"
                   "DEFINE Y = \n"));
  assert(parses_to(".dir\n"
                   ".dir  with some \t text\n"
                   ".dir  ignore #blah\n"
                   ".dir  #blah\n",
                   ".dir\n"
                   ".dir with some \t text\n"
                   ".dir ignore \n"
                   ".dir\n"));
  assert(parses_to("ifdef a\n"
                   "X=0\n"
                   "endif # ignore\n"
                   "ifndef  b   # foo\n"
                   "X=1\n"
                   "endif \n"
                   "ifeq (a,b)\n"
                   "X=2\n"
                   "endif\n"
                   "ifneq   (c,d) \n"
                   "X=3\n"
                   "endif\n",
                   "IFDEF a\n"
                   "IFDEF b\n"
                   "DEFINE X = 1\n"
                   "IFEQ (a,b)\n"
                   "IFEQ (c,d)\n"
                   "DEFINE X = 3\n"));
  assert(parses_to("ifdef a\n"
                   "X=0\n"
                   "ifdef b\n"
                   "X=1\n"
                   "else\n"
                   "X=2\n"
                   "endif\n"
                   "X=3\n"
                   "else\n"
                   "X=4\n"
                   "ifdef c\n"
                   "X=5\n"
                   "else\n"
                   "X=6\n"
                   "endif\n"
                   "X=7\n"
                   "endif\n"
                   "X=8\n",
                   "IFDEF a\n"
                   "DEFINE X = 4\n"
                   "IFDEF c\n"
                   "DEFINE X = 6\n"
                   "DEFINE X = 7\n"
                   "DEFINE X = 8\n"));
  assert(parses_to("a:\n"
                   " a \t :   #comment\n"
                   " a b c\\:  :\n"
                   "b: c\n"
                   "x:y z  q\n"
                   "a:;foo\n"
                   "a:b;foo\n",
                   "RULE a : \n\n"
                   "RULE a : \n\n"
                   "RULE a b c\\: : \n\n"
                   "RULE b : c\n\n"
                   "RULE x : y z  q\n\n"
                   "RULE a : \n\tfoo\n\n"
                   "RULE a : b\n\tfoo\n\n"));
  assert(parses_to("A = ${B} $*\n"
                   "A = foo${B}bar\n"
                   "A = ${${B}}\n"
                   "A = ${x y,z,q}\n",
                   "DEFINE A = $(B) $(*)\n"
                   "DEFINE A = foo$(B)bar\n"
                   "DEFINE A = $($(B))\n"
                   "DEFINE A = $(x y,z,q)\n"));
  assert(parses_to("define E\n"
                   "endef\n"
                   "define A\n"
                   "  foo\n"
                   "  bar\n"
                   "endef\n"
                   "define N\n"
                   " define M\n"
                   "  foo\n"
                   " endef\n"
                   "endef\n",
                   "DEFINE E = \n"
                   "DEFINE A = foo\n"
                   "  bar\n"
                   "DEFINE N = define M\n  foo\n endef\n"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0x121b(%rip),%rsi
mov    %rsi,%rdi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xeb4(%rip),%rdi
lea    0x11fe(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xec0(%rip),%rdi
lea    0xf11(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xf78(%rip),%rdi
lea    0xfad(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xfc8(%rip),%rdi
lea    0x1028(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0x1056(%rip),%rdi
lea    0x10ad(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0x10df(%rip),%rdi
lea    0x1117(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0x116a(%rip),%rdi
lea    0x119a(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0x11dc(%rip),%rdi
lea    0x1226(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0x1229(%rip),%rbx
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xecf(%rip),%rdi
lea    0xf20(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xf87(%rip),%rdi
lea    0xfbc(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xfd7(%rip),%rdi
lea    0x1037(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0x1065(%rip),%rdi
lea    0x10bc(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0x10ee(%rip),%rdi
lea    0x1126(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0x1179(%rip),%rdi
lea    0x11a9(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0x11eb(%rip),%rdi
lea    0x1235(%rip),%rsi
call   1030 <parses_to@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [38 x i8] c"# comments, blank lines\0A #\0A ##\0A\0A \0C \0D\0A\00"
@.str.2 = [88 x i8] c"X=1\0AY=\0AX := \0AX := # comment\0AX := a\0AX := b c # comment\0AX += x\0AX ?= x\0AY =# comment\0A\00"
@.str.3 = [122 x i8] c"DEFINE X = 1\0ADEFINE Y = \0ADEFINE X := \0ADEFINE X := \0ADEFINE X := a\0ADEFINE X := b c\0ADEFINE X += x\0ADEFINE X ?= x\0ADEFINE Y = \0A\00"
@.str.4 = [60 x i8] c".dir\0A.dir with some \09 text\0A.dir ignore #blah\0A.dir #blah\0A\00"
@.str.5 = [46 x i8] c".dir\0A.dir with some \09 text\0A.dir ignore \0A.dir\0A\00"
@.str.6 = [103 x i8] c"ifdef a\0AX=0\0Aendif # ignore\0Aifndef b # foo\0AX=1\0Aendif \0Aifeq (a,b)\0AX=2\0Aendif\0Aifneq (c,d) \0AX=3\0Aendif\0A\00"
@.str.7 = [65 x i8] c"IFDEF a\0AIFDEF b\0ADEFINE X = 1\0AIFEQ (a,b)\0AIFEQ (c,d)\0ADEFINE X = 3\0A\00"
@.str.8 = [94 x i8] c"ifdef a\0AX=0\0Aifdef b\0AX=1\0Aelse\0AX=2\0Aendif\0AX=3\0Aelse\0AX=4\0Aifdef c\0AX=5\0Aelse\0AX=6\0Aendif\0AX=7\0Aendif\0AX=8\0A\00"
@.str.9 = [69 x i8] c"IFDEF a\0ADEFINE X = 4\0AIFDEF c\0ADEFINE X = 6\0ADEFINE X = 7\0ADEFINE X = 8\0A\00"
@.str.10 = [63 x i8] c"a:\0A a \09 : #comment\0A a b c\\: :\0Ab: c\0Ax:y z q\0Aa:;foo\0Aa:b;foo\0A\00"
@.str.11 = [102 x i8] c"RULE a : \0A\0ARULE a : \0A\0ARULE a b c\\: : \0A\0ARULE b : c\0A\0ARULE x : y z q\0A\0ARULE a : \0A\09foo\0A\0ARULE a : b\0A\09foo\0A\0A\00"
@.str.12 = [55 x i8] c"A = ${B} $*\0AA = foo${B}bar\0AA = ${${B}}\0AA = ${x y,z,q}\0A\00"
@.str.13 = [85 x i8] c"DEFINE A = $(B) $(*)\0ADEFINE A = foo$(B)bar\0ADEFINE A = $($(B))\0ADEFINE A = $(x y,z,q)\0A\00"
@.str.14 = [81 x i8] c"define E\0Aendef\0Adefine A\0A foo\0A bar\0Aendef\0Adefine N\0A define M\0A foo\0A endef\0Aendef\0A\00"
@.str.15 = [67 x i8] c"DEFINE E = \0ADEFINE A = foo\0A bar\0ADEFINE N = define M\0A foo\0A endef\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @parses_to(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @assert(i32 %2)
%4 = call i32 @parses_to(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @assert(i32 %4)
%6 = call i32 @parses_to(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @assert(i32 %6)
%8 = call i32 @parses_to(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @assert(i32 %8)
%10 = call i32 @parses_to(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @assert(i32 %10)
%12 = call i32 @parses_to(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.9, i64 0, i64 0))
%13 = call i32 @assert(i32 %12)
%14 = call i32 @parses_to(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str.11, i64 0, i64 0))
%15 = call i32 @assert(i32 %14)
%16 = call i32 @parses_to(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.13, i64 0, i64 0))
%17 = call i32 @assert(i32 %16)
%18 = call i32 @parses_to(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.15, i64 0, i64 0))
%19 = call i32 @assert(i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [38 x i8] c"# comments, blank lines\0A #\0A ##\0A\0A \0C \0D\0A\00"
@.str.2 = [88 x i8] c"X=1\0AY=\0AX := \0AX := # comment\0AX := a\0AX := b c # comment\0AX += x\0AX ?= x\0AY =# comment\0A\00"
@.str.3 = [122 x i8] c"DEFINE X = 1\0ADEFINE Y = \0ADEFINE X := \0ADEFINE X := \0ADEFINE X := a\0ADEFINE X := b c\0ADEFINE X += x\0ADEFINE X ?= x\0ADEFINE Y = \0A\00"
@.str.4 = [60 x i8] c".dir\0A.dir with some \09 text\0A.dir ignore #blah\0A.dir #blah\0A\00"
@.str.5 = [46 x i8] c".dir\0A.dir with some \09 text\0A.dir ignore \0A.dir\0A\00"
@.str.6 = [103 x i8] c"ifdef a\0AX=0\0Aendif # ignore\0Aifndef b # foo\0AX=1\0Aendif \0Aifeq (a,b)\0AX=2\0Aendif\0Aifneq (c,d) \0AX=3\0Aendif\0A\00"
@.str.7 = [65 x i8] c"IFDEF a\0AIFDEF b\0ADEFINE X = 1\0AIFEQ (a,b)\0AIFEQ (c,d)\0ADEFINE X = 3\0A\00"
@.str.8 = [94 x i8] c"ifdef a\0AX=0\0Aifdef b\0AX=1\0Aelse\0AX=2\0Aendif\0AX=3\0Aelse\0AX=4\0Aifdef c\0AX=5\0Aelse\0AX=6\0Aendif\0AX=7\0Aendif\0AX=8\0A\00"
@.str.9 = [69 x i8] c"IFDEF a\0ADEFINE X = 4\0AIFDEF c\0ADEFINE X = 6\0ADEFINE X = 7\0ADEFINE X = 8\0A\00"
@.str.10 = [63 x i8] c"a:\0A a \09 : #comment\0A a b c\\: :\0Ab: c\0Ax:y z q\0Aa:;foo\0Aa:b;foo\0A\00"
@.str.11 = [102 x i8] c"RULE a : \0A\0ARULE a : \0A\0ARULE a b c\\: : \0A\0ARULE b : c\0A\0ARULE x : y z q\0A\0ARULE a : \0A\09foo\0A\0ARULE a : b\0A\09foo\0A\0A\00"
@.str.12 = [55 x i8] c"A = ${B} $*\0AA = foo${B}bar\0AA = ${${B}}\0AA = ${x y,z,q}\0A\00"
@.str.13 = [85 x i8] c"DEFINE A = $(B) $(*)\0ADEFINE A = foo$(B)bar\0ADEFINE A = $($(B))\0ADEFINE A = $(x y,z,q)\0A\00"
@.str.14 = [81 x i8] c"define E\0Aendef\0Adefine A\0A foo\0A bar\0Aendef\0Adefine N\0A define M\0A foo\0A endef\0Aendef\0A\00"
@.str.15 = [67 x i8] c"DEFINE E = \0ADEFINE A = foo\0A bar\0ADEFINE N = define M\0A foo\0A endef\0A\00"
define i32 @main() {
%1 = tail call i32 @parses_to(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 @parses_to(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @parses_to(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @parses_to(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @parses_to(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.7, i64 0, i64 0))
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @parses_to(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.9, i64 0, i64 0))
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @parses_to(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str.11, i64 0, i64 0))
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 @parses_to(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.13, i64 0, i64 0))
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 @parses_to(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.15, i64 0, i64 0))
%18 = tail call i32 @assert(i32 %17)
ret i32 0
}