#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*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  switch (argc == 2 ? argv[1][0] : 0) {
  case 'b': {
    volatile unsigned foo = 0x01234567;
    puts(*(unsigned char *)&foo == 0x67 ? "no" : "yes");
    break;
  }
  case 'm':
    printf("%d\n", 4);
    break;
  case 'v':
    printf("%d\n", 9);
    break;
  case 't':
    puts("x86_64"
         "-"
         "linux"
         "-"
         "gnu");
    break;
  case 'c':
    puts("gcc");
    break;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1153 <main+0x33>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
jmp    115d <main+0x3d>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    115d <main+0x3d>
mov    -0x18(%rbp),%eax
add    $0xffffff9e,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x14,%eax
ja     11fe <main+0xde>
mov    -0x20(%rbp),%rax
lea    0xe83(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1234567,-0x14(%rbp)
movzbl -0x14(%rbp),%ecx
lea    0xebf(%rip),%rdi
lea    0xeb5(%rip),%rax
cmp    $0x67,%ecx
cmove  %rax,%rdi
call   1030 <puts@plt>
jmp    1203 <main+0xe3>
lea    0xea4(%rip),%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
jmp    1203 <main+0xe3>
lea    0xe8e(%rip),%rdi
mov    $0x9,%esi
call   1040 <printf@plt>
jmp    1203 <main+0xe3>
lea    0xe7c(%rip),%rdi
call   1030 <puts@plt>
jmp    1203 <main+0xe3>
lea    0xe7c(%rip),%rdi
call   1030 <puts@plt>
jmp    1203 <main+0xe3>
jmp    1203 <main+0xe3>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    118c <main+0x6c>
mov    0x8(%rsi),%rax
movsbl (%rax),%eax
add    $0xffffff9e,%eax
cmp    $0x14,%eax
ja     118c <main+0x6c>
lea    0xec4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1234567,0x4(%rsp)
01
lea    0xf00(%rip),%rdi
jmp    1174 <main+0x54>
lea    0xf0f(%rip),%rdi
jmp    1174 <main+0x54>
lea    0xef1(%rip),%rdi
mov    $0x4,%esi
jmp    1187 <main+0x67>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
jmp    118c <main+0x6c>
lea    0xed5(%rip),%rdi
mov    $0x9,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"no\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [17 x i8] c"x86_64-linux-gnu\00"
@.str.4 = [4 x i8] c"gcc\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
br label %17
16: ; preds = %2
br label %17
17: ; preds = %16, %9
%18 = phi i32 [ %15, %9 ], [ 0, %16 ]
switch i32 %18, label %35 [
i32 98, label %19
i32 109, label %27
i32 118, label %29
i32 116, label %31
i32 99, label %33
]
19: ; preds = %17
store volatile i32 19088743, i32* %6
%20 = bitcast i32* %6 to i8*
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = icmp eq i32 %22, 103
%24 = zext i1 %23 to i64
%25 = select i1 %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%26 = call i32 @puts(i8* %25)
br label %36
27: ; preds = %17
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 4)
br label %36
29: ; preds = %17
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 9)
br label %36
31: ; preds = %17
%32 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %36
33: ; preds = %17
%34 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %36
35: ; preds = %17
br label %36
36: ; preds = %35, %33, %31, %29, %27, %19
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"no\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [17 x i8] c"x86_64-linux-gnu\00"
@.str.4 = [4 x i8] c"gcc\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = icmp eq i32 %0, 2
br i1 %4, label %5, label %21
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
switch i32 %9, label %21 [
i32 98, label %10
i32 109, label %13
i32 118, label %15
i32 116, label %17
i32 99, label %19
]
10: ; preds = %5
%11 = bitcast i32* %3 to i8*
store volatile i32 19088743, i32* %3
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %21
13: ; preds = %5
%14 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 4)
br label %21
15: ; preds = %5
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 9)
br label %21
17: ; preds = %5
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %21
19: ; preds = %5
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %21
21: ; preds = %2, %5, %19, %17, %15, %13, %10
ret i32 0
}