#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*/ fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
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 -1:
    fread(NULL, 1, 1, NULL);
    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    1163 <main+0x33>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
jmp    116d <main+0x3d>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    116d <main+0x3d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0xffffffff,%eax
je     122c <main+0xfc>
jmp    1181 <main+0x51>
mov    -0x1c(%rbp),%eax
sub    $0x62,%eax
je     11c5 <main+0x95>
jmp    1192 <main+0x62>
mov    -0x1c(%rbp),%eax
sub    $0x6d,%eax
je     11ef <main+0xbf>
jmp    11a3 <main+0x73>
mov    -0x1c(%rbp),%eax
sub    $0x74,%eax
je     121b <main+0xeb>
jmp    11b4 <main+0x84>
mov    -0x1c(%rbp),%eax
sub    $0x76,%eax
je     1205 <main+0xd5>
jmp    123f <main+0x10f>
movl   $0x1234567,-0x14(%rbp)
movzbl -0x14(%rbp),%ecx
lea    0xe2c(%rip),%rdi
lea    0xe22(%rip),%rax
cmp    $0x67,%ecx
cmove  %rax,%rdi
call   1030 <puts@plt>
jmp    123f <main+0x10f>
lea    0xe11(%rip),%rdi
mov    $0x4,%esi
call   1050 <printf@plt>
jmp    123f <main+0x10f>
lea    0xdfb(%rip),%rdi
mov    $0x9,%esi
call   1050 <printf@plt>
jmp    123f <main+0x10f>
lea    0xde9(%rip),%rdi
call   1030 <puts@plt>
jmp    123f <main+0x10f>
xor    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%edx
mov    %rcx,%rdi
mov    %edx,%esi
call   1040 <fread@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    11ad <main+0x7d>
mov    0x8(%rsi),%rax
movsbl (%rax),%ecx
lea    -0x62(%rcx),%eax
cmp    $0x14,%eax
ja     1166 <main+0x36>
lea    0xeb4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1234567,0x4(%rsp)
01
lea    0xef0(%rip),%rdi
jmp    1195 <main+0x65>
cmp    $0xffffffff,%ecx
jne    11ad <main+0x7d>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1040 <fread@plt>
jmp    11ad <main+0x7d>
lea    0xed0(%rip),%rdi
mov    $0x4,%esi
jmp    11a8 <main+0x78>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
jmp    11ad <main+0x7d>
lea    0xeb4(%rip),%rdi
mov    $0x9,%esi
call   1050 <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"
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 -1, 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 %35
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 %35
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 %35
31: ; preds = %17
%32 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %35
33: ; preds = %17
%34 = call i32 @fread(i32* null, i32 1, i32 1, i32* null)
br label %35
35: ; preds = %17, %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"
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 -1, 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 @fread(i32* null, i32 1, i32 1, i32* null)
br label %21
21: ; preds = %2, %5, %19, %17, %15, %13, %10
ret i32 0
}