#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
scalar_t__ strncmp(char const *, char *, int);
scalar_t__ strstr(char const *, char *);
int main(int argc, const char *argv[]) {
  int cpp = 0;
  const char *msc_ver = "1600";
  int i;
  for (i = 1; i < argc; ++i) {
    if (strncmp(argv[i], "--cc-define=", 12) == 0) {
      fprintf(stdout, "\n#define %s 1", argv[i] + 12);
    } else if (strncmp(argv[i], "-msc=", 5) == 0) {
      msc_ver = argv[i] + 5;
    } else if (strstr(argv[i], ".cpp")) {
      cpp = 1;
    }
  }
  fprintf(stdout, "\n");
  if (cpp) {
    fprintf(stdout, "#define __cplusplus 199711L\n");
  }
  fprintf(stdout, "#define _MSC_VER %s\n", msc_ver);
  fprintf(stdout, "#define __has_include(x) x\n"
                  "#define __has_include_next(x) x\n"
                  "#define _WIN32 1\n"
                  "#define __has_last(x) x");
  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)
movl   $0x0,-0x14(%rbp)
lea    0xeac(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1244 <main+0x114>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe87(%rip),%rsi
mov    $0xc,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11be <main+0x8e>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
add    $0xc,%rdx
lea    0xe60(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1231 <main+0x101>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe4f(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11fe <main+0xce>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
add    $0x5,%rax
mov    %rax,-0x20(%rbp)
jmp    122c <main+0xfc>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe15(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     1227 <main+0xf7>
movl   $0x1,-0x14(%rbp)
jmp    122c <main+0xfc>
jmp    1231 <main+0x101>
jmp    1236 <main+0x106>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115f <main+0x2f>
mov    0x2d95(%rip),%rax
mov    (%rax),%edi
lea    0xdf2(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     127c <main+0x14c>
mov    0x2d74(%rip),%rax
mov    (%rax),%edi
lea    0xdb6(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xdb8(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2d42(%rip),%rax
mov    (%rax),%edi
lea    0xdb6(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     11fa <main+0xca>
mov    %rsi,%rbx
mov    %edi,%r12d
lea    0xeaf(%rip),%rax
mov    %rax,(%rsp)
mov    $0x1,%r14d
lea    0xea3(%rip),%r15
lea    0xeb7(%rip),%r13
xor    %ebp,%ebp
jmp    1198 <main+0x68>
nopl   (%rax)
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    (%rbx,%r14,8),%rdx
add    $0xc,%rdx
lea    0xe8a(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%r14
cmp    %r14,%r12
je     120a <main+0xda>
mov    (%rbx,%r14,8),%rdi
mov    %r15,%rsi
mov    $0xc,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1170 <main+0x40>
mov    (%rbx,%r14,8),%rdi
mov    %r13,%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
mov    (%rbx,%r14,8),%rdi
test   %rax,%rax
je     11f0 <main+0xc0>
lea    0xe57(%rip),%rsi
call   1050 <strstr@plt>
test   %rax,%rax
mov    $0x1,%eax
cmovne %eax,%ebp
jmp    118f <main+0x5f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x5,%rdi
mov    %rdi,(%rsp)
jmp    118f <main+0x5f>
lea    0xdff(%rip),%rbp
lea    0xe3e(%rip),%rsi
jmp    1230 <main+0x100>
mov    0x2dcf(%rip),%rax
mov    (%rax),%edi
lea    0xe2c(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
test   %ebp,%ebp
je     1242 <main+0x112>
lea    0xdff(%rip),%rsi
mov    (%rsp),%rbp
mov    0x2da9(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1246 <main+0x116>
mov    (%rsp),%rbp
mov    0x2d93(%rip),%rbx
mov    (%rbx),%edi
lea    0xdf2(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xdf4(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"1600\00"
@.str.1 = [13 x i8] c"--cc-define=\00"
@stdout = global i32 0
@.str.2 = [14 x i8] c"\0A#define %s 1\00"
@.str.3 = [6 x i8] c"-msc=\00"
@.str.4 = [5 x i8] c".cpp\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [29 x i8] c"#define __cplusplus 199711L\0A\00"
@.str.7 = [21 x i8] c"#define _MSC_VER %s\0A\00"
@.str.8 = [100 x i8] c"#define __has_include(x) x\0A#define __has_include_next(x) x\0A#define _WIN32 1\0A#define __has_last(x) x\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %7
store i32 1, i32* %8
br label %9
9: ; preds = %57, %2
%10 = load i32, i32* %8
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %60
13: ; preds = %9
%14 = load i8**, i8*** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = call i64 @strncmp(i8* %18, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 12)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %13
%22 = load i32, i32* @stdout
%23 = load i8**, i8*** %5
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8, i8* %27, i64 12
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %28)
br label %56
30: ; preds = %13
%31 = load i8**, i8*** %5
%32 = load i32, i32* %8
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %31, i64 %33
%35 = load i8*, i8** %34
%36 = call i64 @strncmp(i8* %35, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 5)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %45
38: ; preds = %30
%39 = load i8**, i8*** %5
%40 = load i32, i32* %8
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8*, i8** %39, i64 %41
%43 = load i8*, i8** %42
%44 = getelementptr inbounds i8, i8* %43, i64 5
store i8* %44, i8** %7
br label %55
45: ; preds = %30
%46 = load i8**, i8*** %5
%47 = load i32, i32* %8
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8*, i8** %46, i64 %48
%50 = load i8*, i8** %49
%51 = call i64 @strstr(i8* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%52 = icmp ne i64 %51, 0
br i1 %52, label %53, label %54
53: ; preds = %45
store i32 1, i32* %6
br label %54
54: ; preds = %53, %45
br label %55
55: ; preds = %54, %38
br label %56
56: ; preds = %55, %21
br label %57
57: ; preds = %56
%58 = load i32, i32* %8
%59 = add nsw i32 %58, 1
store i32 %59, i32* %8
br label %9
60: ; preds = %9
%61 = load i32, i32* @stdout
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%63 = load i32, i32* %6
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %68
65: ; preds = %60
%66 = load i32, i32* @stdout
%67 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
br label %68
68: ; preds = %65, %60
%69 = load i32, i32* @stdout
%70 = load i8*, i8** %7
%71 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* %70)
%72 = load i32, i32* @stdout
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"1600\00"
@.str.1 = [13 x i8] c"--cc-define=\00"
@stdout = global i32 0
@.str.2 = [14 x i8] c"\0A#define %s 1\00"
@.str.3 = [6 x i8] c"-msc=\00"
@.str.4 = [5 x i8] c".cpp\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [29 x i8] c"#define __cplusplus 199711L\0A\00"
@.str.7 = [21 x i8] c"#define _MSC_VER %s\0A\00"
@.str.8 = [100 x i8] c"#define __has_include(x) x\0A#define __has_include_next(x) x\0A#define _WIN32 1\0A#define __has_last(x) x\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %39
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %30
%7 = phi i64 [ 1, %4 ], [ %33, %30 ]
%8 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %4 ], [ %32, %30 ]
%9 = phi i32 [ 0, %4 ], [ %31, %30 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %7
%11 = load i8*, i8** %10
%12 = tail call i64 @strncmp(i8* %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 12)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %6
%15 = load i32, i32* @stdout
%16 = load i8*, i8** %10
%17 = getelementptr inbounds i8, i8* %16, i64 12
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %17)
br label %30
19: ; preds = %6
%20 = load i8*, i8** %10
%21 = tail call i64 @strncmp(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 5)
%22 = icmp eq i64 %21, 0
%23 = load i8*, i8** %10
br i1 %22, label %24, label %26
24: ; preds = %19
%25 = getelementptr inbounds i8, i8* %23, i64 5
br label %30
26: ; preds = %19
%27 = tail call i64 @strstr(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
%29 = select i1 %28, i32 %9, i32 1
br label %30
30: ; preds = %26, %14, %24
%31 = phi i32 [ %9, %14 ], [ %9, %24 ], [ %29, %26 ]
%32 = phi i8* [ %8, %14 ], [ %25, %24 ], [ %8, %26 ]
%33 = add nuw nsw i64 %7, 1
%34 = icmp eq i64 %33, %5
br i1 %34, label %35, label %6
35: ; preds = %30
%36 = load i32, i32* @stdout
%37 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%38 = icmp eq i32 %31, 0
br i1 %38, label %44, label %39
39: ; preds = %35, %2
%40 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), %2 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), %35 ]
%41 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %2 ], [ %32, %35 ]
%42 = load i32, i32* @stdout
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* %40)
br label %44
44: ; preds = %39, %35
%45 = phi i8* [ %32, %35 ], [ %41, %39 ]
%46 = load i32, i32* @stdout
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* %45)
%48 = load i32, i32* @stdout
%49 = tail call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}