#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_define(void) {
  test("\"%d\" 3", "#define MSG \"%d\"\n"
                   " # define NUM  3 \n"
                   " MSG NUM");
  test("3", "#define FOO(x) x\n"
            "FOO(3)");
  test("3", "#define FOO() 3\n"
            "FOO()");
  test("3", "#define FOO(x) 3\n"
            "FOO()");
  test("3", "#define FOO(x) 3\n"
            "FOO(bar)");
  test("int x=5; (x);", "#define FOO (x)\n"
                        "int x=5; FOO;");
  test("3, 4", "#define FOO(x, y) x, y\n"
               "FOO(3, 4)");
}


x86 assembly (clang, -O0):
<TEST_cpp_define>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee5(%rip),%rsi
call   1030 <test@plt>
lea    0xed7(%rip),%rdi
lea    0xefe(%rip),%rsi
call   1030 <test@plt>
lea    0xec4(%rip),%rdi
lea    0xf03(%rip),%rsi
call   1030 <test@plt>
lea    0xeb1(%rip),%rdi
lea    0xf06(%rip),%rsi
call   1030 <test@plt>
lea    0xe9e(%rip),%rdi
lea    0xf0a(%rip),%rsi
call   1030 <test@plt>
lea    0xf18(%rip),%rdi
lea    0xf1f(%rip),%rsi
call   1030 <test@plt>
lea    0xf31(%rip),%rdi
lea    0xf2f(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_cpp_define>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xee8(%rip),%rsi
call   1030 <test@plt>
lea    0xeda(%rip),%rbx
lea    0xf01(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xf0a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xf11(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xf19(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xf24(%rip),%rdi
lea    0xf2b(%rip),%rsi
call   1030 <test@plt>
lea    0xf3d(%rip),%rdi
lea    0xf3b(%rip),%rsi
pop    %rbx
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\22%d\22 3\00"
@.str.1 = [44 x i8] c"#define MSG \22%d\22\0A # define NUM 3 \0A MSG NUM\00"
@.str.2 = [2 x i8] c"3\00"
@.str.3 = [24 x i8] c"#define FOO(x) x\0AFOO(3)\00"
@.str.4 = [22 x i8] c"#define FOO() 3\0AFOO()\00"
@.str.5 = [23 x i8] c"#define FOO(x) 3\0AFOO()\00"
@.str.6 = [26 x i8] c"#define FOO(x) 3\0AFOO(bar)\00"
@.str.7 = [14 x i8] c"int x=5; (x);\00"
@.str.8 = [30 x i8] c"#define FOO (x)\0Aint x=5; FOO;\00"
@.str.9 = [5 x i8] c"3, 4\00"
@.str.10 = [33 x i8] c"#define FOO(x, y) x, y\0AFOO(3, 4)\00"
define void @TEST_cpp_define() {
%1 = call i32 @test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%4 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%5 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%6 = call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%7 = call i32 @test(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\22%d\22 3\00"
@.str.1 = [44 x i8] c"#define MSG \22%d\22\0A # define NUM 3 \0A MSG NUM\00"
@.str.2 = [2 x i8] c"3\00"
@.str.3 = [24 x i8] c"#define FOO(x) x\0AFOO(3)\00"
@.str.4 = [22 x i8] c"#define FOO() 3\0AFOO()\00"
@.str.5 = [23 x i8] c"#define FOO(x) 3\0AFOO()\00"
@.str.6 = [26 x i8] c"#define FOO(x) 3\0AFOO(bar)\00"
@.str.7 = [14 x i8] c"int x=5; (x);\00"
@.str.8 = [30 x i8] c"#define FOO (x)\0Aint x=5; FOO;\00"
@.str.9 = [5 x i8] c"3, 4\00"
@.str.10 = [33 x i8] c"#define FOO(x, y) x, y\0AFOO(3, 4)\00"
define void @TEST_cpp_define() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%4 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%5 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%6 = tail call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%7 = tail call i32 @test(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0))
ret void
}