#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*/ test(char *, char *);
void TEST_cpp_conditional_include(void) {
  test("a", "#define X\n"
            "#if defined(X)\n"
            "a\n"
            "#endif");
  test("\"a\"", "#define X\n"
                "#if defined(X)\n"
                "\"a\"\n"
                "#else\n"
                "\"b\"\n"
                "#endif");
  test("b", "#if defined(X)\n"
            "a\n"
            "#endif\n"
            "b");
  test("'b'", "#if defined(X)\n"
              "'a'\n"
              "#else\n"
              "'b'\n"
              "#endif");
  test("b", "#if defined(X)\n"
            "# if foo\n"
            "# else\n"
            "# endif\n"
            "# if bar\n"
            "# endif\n"
            "a\n"
            "#else\n"
            "b\n"
            "#endif");
  test("b", "#if defined(X)\n"
            "# ifdef\n"
            "# endif\n"
            "# ifndef\n"
            "# endif\n"
            "a\n"
            "#else\n"
            "b\n"
            "#endif");
  test("b", "#ifdef X\n"
            "      # ifdef\n"
            "# endif\n"
            "# ifndef\n"
            "# endif\n"
            "a\n"
            "#else\n"
            "b\n"
            "#endif");
  test("a", "#ifndef X\n"
            "a\n"
            "#else\n"
            "b\n"
            "#endif");
  test("\"c\"", "#if defined(X)\n"
                "a\n"
                "#elif defined(Y)\n"
                "b\n"
                "#else\n"
                "\"c\"\n"
                "#endif");
}


x86 assembly (clang, -O0):
<TEST_cpp_conditional_include>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <test@plt>
lea    0xef6(%rip),%rdi
lea    0xef3(%rip),%rsi
call   1030 <test@plt>
lea    0xf2d(%rip),%rdi
lea    0xf0e(%rip),%rsi
call   1030 <test@plt>
lea    0xf1c(%rip),%rdi
lea    0xf19(%rip),%rsi
call   1030 <test@plt>
lea    0xf07(%rip),%rdi
lea    0xf2a(%rip),%rsi
call   1030 <test@plt>
lea    0xef4(%rip),%rdi
lea    0xf60(%rip),%rsi
call   1030 <test@plt>
lea    0xee1(%rip),%rdi
lea    0xf8e(%rip),%rsi
call   1030 <test@plt>
lea    0xe60(%rip),%rdi
lea    0xfbc(%rip),%rsi
call   1030 <test@plt>
lea    0xfcb(%rip),%rdi
lea    0xfc8(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_cpp_conditional_include>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
lea    0xee0(%rip),%rsi
mov    %r14,%rdi
call   1030 <test@plt>
lea    0xef3(%rip),%rdi
lea    0xef0(%rip),%rsi
call   1030 <test@plt>
lea    0xf2a(%rip),%rbx
lea    0xf0b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xf16(%rip),%rdi
lea    0xf13(%rip),%rsi
call   1030 <test@plt>
lea    0xf2b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xf65(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xf97(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xfc9(%rip),%rsi
mov    %r14,%rdi
call   1030 <test@plt>
lea    0xfd5(%rip),%rdi
lea    0xfd2(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [34 x i8] c"#define X\0A#if defined(X)\0Aa\0A#endif\00"
@.str.2 = [4 x i8] c"\22a\22\00"
@.str.3 = [46 x i8] c"#define X\0A#if defined(X)\0A\22a\22\0A#else\0A\22b\22\0A#endif\00"
@.str.4 = [2 x i8] c"b\00"
@.str.5 = [26 x i8] c"#if defined(X)\0Aa\0A#endif\0Ab\00"
@.str.6 = [4 x i8] c"'b'\00"
@.str.7 = [36 x i8] c"#if defined(X)\0A'a'\0A#else\0A'b'\0A#endif\00"
@.str.8 = [73 x i8] c"#if defined(X)\0A# if foo\0A# else\0A# endif\0A# if bar\0A# endif\0Aa\0A#else\0Ab\0A#endif\00"
@.str.9 = [65 x i8] c"#if defined(X)\0A# ifdef\0A# endif\0A# ifndef\0A# endif\0Aa\0A#else\0Ab\0A#endif\00"
@.str.10 = [65 x i8] c"#ifdef X\0A # ifdef\0A# endif\0A# ifndef\0A# endif\0Aa\0A#else\0Ab\0A#endif\00"
@.str.11 = [27 x i8] c"#ifndef X\0Aa\0A#else\0Ab\0A#endif\00"
@.str.12 = [4 x i8] c"\22c\22\00"
@.str.13 = [53 x i8] c"#if defined(X)\0Aa\0A#elif defined(Y)\0Ab\0A#else\0A\22c\22\0A#endif\00"
define void @TEST_cpp_conditional_include() {
%1 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%4 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0))
%5 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.8, i64 0, i64 0))
%6 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0))
%7 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.10, i64 0, i64 0))
%8 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0))
%9 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.13, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [34 x i8] c"#define X\0A#if defined(X)\0Aa\0A#endif\00"
@.str.2 = [4 x i8] c"\22a\22\00"
@.str.3 = [46 x i8] c"#define X\0A#if defined(X)\0A\22a\22\0A#else\0A\22b\22\0A#endif\00"
@.str.4 = [2 x i8] c"b\00"
@.str.5 = [26 x i8] c"#if defined(X)\0Aa\0A#endif\0Ab\00"
@.str.6 = [4 x i8] c"'b'\00"
@.str.7 = [36 x i8] c"#if defined(X)\0A'a'\0A#else\0A'b'\0A#endif\00"
@.str.8 = [73 x i8] c"#if defined(X)\0A# if foo\0A# else\0A# endif\0A# if bar\0A# endif\0Aa\0A#else\0Ab\0A#endif\00"
@.str.9 = [65 x i8] c"#if defined(X)\0A# ifdef\0A# endif\0A# ifndef\0A# endif\0Aa\0A#else\0Ab\0A#endif\00"
@.str.10 = [65 x i8] c"#ifdef X\0A # ifdef\0A# endif\0A# ifndef\0A# endif\0Aa\0A#else\0Ab\0A#endif\00"
@.str.11 = [27 x i8] c"#ifndef X\0Aa\0A#else\0Ab\0A#endif\00"
@.str.12 = [4 x i8] c"\22c\22\00"
@.str.13 = [53 x i8] c"#if defined(X)\0Aa\0A#elif defined(Y)\0Ab\0A#else\0A\22c\22\0A#endif\00"
define void @TEST_cpp_conditional_include() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%4 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0))
%5 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.8, i64 0, i64 0))
%6 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0))
%7 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.10, i64 0, i64 0))
%8 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0))
%9 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.13, i64 0, i64 0))
ret void
}