#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 __detect_PLATFORM_ENV_CPU_DETAIL();
int __detect_PLATFORM_ENV_CPU_FEATURE_DETAIL();
int __detect_PLATFORM_ENV_OS_DETAIL();
int __detect_PLATFORM_ENV_OS_FEATURE_DETAIL();
int __detect_PLATFORM_ENV_OS_VER_DETAIL();
int __detect_PLATFORM_ENV_TOOLCHAIN_DETAIL();
int __detect_PLATFORM_ENV_TOOLCHAIN_VER_DETAIL();
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    return -1;
  }
  if (strncmp(argv[1], "PLATFORM_ENV_OS_DETAIL",
              sizeof("PLATFORM_ENV_OS_DETAIL") - 1) == 0) {
    return __detect_PLATFORM_ENV_OS_DETAIL();
  }
  if (strncmp(argv[1], "PLATFORM_ENV_OS_VER_DETAIL",
              sizeof("PLATFORM_ENV_OS_VER_DETAIL") - 1) == 0) {
    return __detect_PLATFORM_ENV_OS_VER_DETAIL();
  }
  if (strncmp(argv[1], "PLATFORM_ENV_OS_FEATURE_DETAIL",
              sizeof("PLATFORM_ENV_OS_FEATURE_DETAIL") - 1) == 0) {
    return __detect_PLATFORM_ENV_OS_FEATURE_DETAIL();
  }
  if (strncmp(argv[1], "PLATFORM_ENV_CPU_DETAIL",
              sizeof("PLATFORM_ENV_CPU_DETAIL") - 1) == 0) {
    return __detect_PLATFORM_ENV_CPU_DETAIL();
  }
  if (strncmp(argv[1], "PLATFORM_ENV_CPU_FEATURE_DETAIL",
              sizeof("PLATFORM_ENV_CPU_FEATURE_DETAIL") - 1) == 0) {
    return __detect_PLATFORM_ENV_CPU_FEATURE_DETAIL();
  }
  if (strncmp(argv[1], "PLATFORM_ENV_TOOLCHAIN_DETAIL",
              sizeof("PLATFORM_ENV_TOOLCHAIN_DETAIL") - 1) == 0) {
    return __detect_PLATFORM_ENV_TOOLCHAIN_DETAIL();
  }
  if (strncmp(argv[1], "PLATFORM_ENV_TOOLCHAIN_VER_DETAIL",
              sizeof("PLATFORM_ENV_TOOLCHAIN_VER_DETAIL") - 1) == 0) {
    return __detect_PLATFORM_ENV_TOOLCHAIN_VER_DETAIL();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11ac <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1305 <main+0x185>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe45(%rip),%rsi
mov    $0x16,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11de <main+0x5e>
mov    $0x0,%al
call   1070 <__detect_PLATFORM_ENV_OS_DETAIL@plt>
mov    %eax,-0x4(%rbp)
jmp    1305 <main+0x185>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2a(%rip),%rsi
mov    $0x1a,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1210 <main+0x90>
mov    $0x0,%al
call   1050 <__detect_PLATFORM_ENV_OS_VER_DETAIL@plt>
mov    %eax,-0x4(%rbp)
jmp    1305 <main+0x185>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe13(%rip),%rsi
mov    $0x1e,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1242 <main+0xc2>
mov    $0x0,%al
call   1060 <__detect_PLATFORM_ENV_OS_FEATURE_DETAIL@plt>
mov    %eax,-0x4(%rbp)
jmp    1305 <main+0x185>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe00(%rip),%rsi
mov    $0x17,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1274 <main+0xf4>
mov    $0x0,%al
call   1040 <__detect_PLATFORM_ENV_CPU_DETAIL@plt>
mov    %eax,-0x4(%rbp)
jmp    1305 <main+0x185>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde6(%rip),%rsi
mov    $0x1f,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12a6 <main+0x126>
mov    $0x0,%al
call   1090 <__detect_PLATFORM_ENV_CPU_FEATURE_DETAIL@plt>
mov    %eax,-0x4(%rbp)
jmp    1305 <main+0x185>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd4(%rip),%rsi
mov    $0x1d,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12d8 <main+0x158>
mov    $0x0,%al
call   1080 <__detect_PLATFORM_ENV_TOOLCHAIN_DETAIL@plt>
mov    %eax,-0x4(%rbp)
jmp    1305 <main+0x185>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdc0(%rip),%rsi
mov    $0x21,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1305 <main+0x185>
mov    $0x0,%al
call   10a0 <__detect_PLATFORM_ENV_TOOLCHAIN_VER_DETAIL@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jne    1255 <main+0xd5>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe63(%rip),%rsi
mov    $0x16,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1257 <main+0xd7>
mov    0x8(%rbx),%rdi
lea    0xe5c(%rip),%rsi
mov    $0x1a,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     125f <main+0xdf>
mov    0x8(%rbx),%rdi
lea    0xe59(%rip),%rsi
mov    $0x1e,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1267 <main+0xe7>
mov    0x8(%rbx),%rdi
lea    0xe5e(%rip),%rsi
mov    $0x17,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     126f <main+0xef>
mov    0x8(%rbx),%rdi
lea    0xe5c(%rip),%rsi
mov    $0x1f,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1277 <main+0xf7>
mov    0x8(%rbx),%rdi
lea    0xe62(%rip),%rsi
mov    $0x1d,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     127f <main+0xff>
mov    0x8(%rbx),%rdi
lea    0xe66(%rip),%rsi
mov    $0x21,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1287 <main+0x107>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1070 <__detect_PLATFORM_ENV_OS_DETAIL@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <__detect_PLATFORM_ENV_OS_VER_DETAIL@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <__detect_PLATFORM_ENV_OS_FEATURE_DETAIL@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <__detect_PLATFORM_ENV_CPU_DETAIL@plt>
xor    %eax,%eax
pop    %rbx
jmp    1090 <__detect_PLATFORM_ENV_CPU_FEATURE_DETAIL@plt>
xor    %eax,%eax
pop    %rbx
jmp    1080 <__detect_PLATFORM_ENV_TOOLCHAIN_DETAIL@plt>
xor    %eax,%eax
pop    %rbx
jmp    10a0 <__detect_PLATFORM_ENV_TOOLCHAIN_VER_DETAIL@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"PLATFORM_ENV_OS_DETAIL\00"
@.str.1 = [27 x i8] c"PLATFORM_ENV_OS_VER_DETAIL\00"
@.str.2 = [31 x i8] c"PLATFORM_ENV_OS_FEATURE_DETAIL\00"
@.str.3 = [24 x i8] c"PLATFORM_ENV_CPU_DETAIL\00"
@.str.4 = [32 x i8] c"PLATFORM_ENV_CPU_FEATURE_DETAIL\00"
@.str.5 = [30 x i8] c"PLATFORM_ENV_TOOLCHAIN_DETAIL\00"
@.str.6 = [34 x i8] c"PLATFORM_ENV_TOOLCHAIN_VER_DETAIL\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %65
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strncmp(i8* %12, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 22)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = call i32 (...) @__detect_PLATFORM_ENV_OS_DETAIL()
store i32 %16, i32* %3
br label %65
17: ; preds = %9
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @strncmp(i8* %20, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 26)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %17
%24 = call i32 (...) @__detect_PLATFORM_ENV_OS_VER_DETAIL()
store i32 %24, i32* %3
br label %65
25: ; preds = %17
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i64 @strncmp(i8* %28, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 30)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %25
%32 = call i32 (...) @__detect_PLATFORM_ENV_OS_FEATURE_DETAIL()
store i32 %32, i32* %3
br label %65
33: ; preds = %25
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 23)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %33
%40 = call i32 (...) @__detect_PLATFORM_ENV_CPU_DETAIL()
store i32 %40, i32* %3
br label %65
41: ; preds = %33
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = call i64 @strncmp(i8* %44, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 31)
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %41
%48 = call i32 (...) @__detect_PLATFORM_ENV_CPU_FEATURE_DETAIL()
store i32 %48, i32* %3
br label %65
49: ; preds = %41
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 1
%52 = load i8*, i8** %51
%53 = call i64 @strncmp(i8* %52, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 29)
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %49
%56 = call i32 (...) @__detect_PLATFORM_ENV_TOOLCHAIN_DETAIL()
store i32 %56, i32* %3
br label %65
57: ; preds = %49
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 1
%60 = load i8*, i8** %59
%61 = call i64 @strncmp(i8* %60, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 33)
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %57
%64 = call i32 (...) @__detect_PLATFORM_ENV_TOOLCHAIN_VER_DETAIL()
store i32 %64, i32* %3
br label %65
65: ; preds = %8, %15, %23, %31, %39, %47, %55, %63, %57
%66 = load i32, i32* %3
ret i32 %66
}

LLVM IR (-O2):
@.str = [23 x i8] c"PLATFORM_ENV_OS_DETAIL\00"
@.str.1 = [27 x i8] c"PLATFORM_ENV_OS_VER_DETAIL\00"
@.str.2 = [31 x i8] c"PLATFORM_ENV_OS_FEATURE_DETAIL\00"
@.str.3 = [24 x i8] c"PLATFORM_ENV_CPU_DETAIL\00"
@.str.4 = [32 x i8] c"PLATFORM_ENV_CPU_FEATURE_DETAIL\00"
@.str.5 = [30 x i8] c"PLATFORM_ENV_TOOLCHAIN_DETAIL\00"
@.str.6 = [34 x i8] c"PLATFORM_ENV_TOOLCHAIN_VER_DETAIL\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %47
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strncmp(i8* %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 22)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (...) @__detect_PLATFORM_ENV_OS_DETAIL()
br label %47
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = tail call i64 @strncmp(i8* %12, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 26)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = tail call i32 (...) @__detect_PLATFORM_ENV_OS_VER_DETAIL()
br label %47
17: ; preds = %11
%18 = load i8*, i8** %5
%19 = tail call i64 @strncmp(i8* %18, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 30)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = tail call i32 (...) @__detect_PLATFORM_ENV_OS_FEATURE_DETAIL()
br label %47
23: ; preds = %17
%24 = load i8*, i8** %5
%25 = tail call i64 @strncmp(i8* %24, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 23)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = tail call i32 (...) @__detect_PLATFORM_ENV_CPU_DETAIL()
br label %47
29: ; preds = %23
%30 = load i8*, i8** %5
%31 = tail call i64 @strncmp(i8* %30, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 31)
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = tail call i32 (...) @__detect_PLATFORM_ENV_CPU_FEATURE_DETAIL()
br label %47
35: ; preds = %29
%36 = load i8*, i8** %5
%37 = tail call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 29)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = tail call i32 (...) @__detect_PLATFORM_ENV_TOOLCHAIN_DETAIL()
br label %47
41: ; preds = %35
%42 = load i8*, i8** %5
%43 = tail call i64 @strncmp(i8* %42, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 33)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = tail call i32 (...) @__detect_PLATFORM_ENV_TOOLCHAIN_VER_DETAIL()
br label %47
47: ; preds = %2, %9, %15, %21, %27, %33, %39, %45, %41
%48 = phi i32 [ %10, %9 ], [ %16, %15 ], [ %22, %21 ], [ %28, %27 ], [ %34, %33 ], [ %40, %39 ], [ %46, %45 ], [ 0, %41 ], [ -1, %2 ]
ret i32 %48
}