#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 BUFSIZ;
int /*<<< orphan*/ doHelp();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcasecmp(char *, char *);
int strlen(char *);
scalar_t__ strstr(char *, char *);
int main(int argv, char *argc[]) {
  int size = 0;
  char *type = (char *)NULL;
  char isType = 'n';
  if (argv > 1) {
    type = argc[1];
  } else {
    doHelp();
    return 0;
  }
  if (!strcasecmp(type, "long")) {
    size = sizeof(long);
    isType = 'y';
  } else if (!strcasecmp(type, "short")) {
    size = sizeof(short);
    isType = 'y';
  } else if (!strcasecmp(type, "int")) {
    size = sizeof(int);
    isType = 'y';
  } else if (!strcasecmp(type, "char")) {
    size = sizeof(char);
    isType = 'y';
  } else if (!strcasecmp(type, "float")) {
    size = sizeof(float);
    isType = 'y';
  } else if (!strcasecmp(type, "double")) {
    size = sizeof(double);
    isType = 'y';
  } else if (!strcasecmp(type, "BUFSIZ")) {
    size = 0;
    isType = 'b';
  } else if (strstr(type, "help")) {
    doHelp();
    return 0;
  } else {
    size = strlen(type) * sizeof(char);
    isType = 'n';
  }
  switch (isType) {
  case 'y':
    printf("Data type %s is %d bytes long.\n", type, size);
    break;
  case 'b':
    printf("BUFSIZ is %d bytes.\n", BUFSIZ);
    break;
  default:
    printf("String \"%s\" is %d bytes long.\n", type, size);
    break;
  };
  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)
movq   $0x0,-0x20(%rbp)
movb   $0x6e,-0x21(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1194 <main+0x44>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    11a7 <main+0x57>
mov    $0x0,%al
call   1060 <doHelp@plt>
movl   $0x0,-0x4(%rbp)
jmp    13a4 <main+0x254>
mov    -0x20(%rbp),%rdi
lea    0xe4e(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11d0 <main+0x80>
movl   $0x8,-0x14(%rbp)
movb   $0x79,-0x21(%rbp)
jmp    132c <main+0x1dc>
mov    -0x20(%rbp),%rdi
lea    0xe2a(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11f9 <main+0xa9>
movl   $0x2,-0x14(%rbp)
movb   $0x79,-0x21(%rbp)
jmp    1327 <main+0x1d7>
mov    -0x20(%rbp),%rdi
lea    0xe07(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1222 <main+0xd2>
movl   $0x4,-0x14(%rbp)
movb   $0x79,-0x21(%rbp)
jmp    1322 <main+0x1d2>
mov    -0x20(%rbp),%rdi
lea    0xde2(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    124b <main+0xfb>
movl   $0x1,-0x14(%rbp)
movb   $0x79,-0x21(%rbp)
jmp    131d <main+0x1cd>
mov    -0x20(%rbp),%rdi
lea    0xdbe(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1274 <main+0x124>
movl   $0x4,-0x14(%rbp)
movb   $0x79,-0x21(%rbp)
jmp    1318 <main+0x1c8>
mov    -0x20(%rbp),%rdi
lea    0xd9b(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    129d <main+0x14d>
movl   $0x8,-0x14(%rbp)
movb   $0x79,-0x21(%rbp)
jmp    1313 <main+0x1c3>
mov    -0x20(%rbp),%rdi
lea    0xd79(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    12c6 <main+0x176>
movl   $0x0,-0x14(%rbp)
movb   $0x62,-0x21(%rbp)
jmp    130e <main+0x1be>
mov    -0x20(%rbp),%rdi
lea    0xd57(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     12f3 <main+0x1a3>
mov    $0x0,%al
call   1060 <doHelp@plt>
movl   $0x0,-0x4(%rbp)
jmp    13a4 <main+0x254>
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,-0x14(%rbp)
movb   $0x6e,-0x21(%rbp)
jmp    130e <main+0x1be>
jmp    1313 <main+0x1c3>
jmp    1318 <main+0x1c8>
jmp    131d <main+0x1cd>
jmp    1322 <main+0x1d2>
jmp    1327 <main+0x1d7>
jmp    132c <main+0x1dc>
movsbl -0x21(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x62,%eax
je     136c <main+0x21c>
jmp    1341 <main+0x1f1>
mov    -0x28(%rbp),%eax
sub    $0x79,%eax
jne    1388 <main+0x238>
jmp    1352 <main+0x202>
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xccd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    139d <main+0x24d>
mov    0x2c6d(%rip),%rax
mov    (%rax),%esi
lea    0xcd1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    139d <main+0x24d>
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xccc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1210 <main+0xc0>
mov    0x8(%rsi),%rbx
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    $0x8,%ebp
test   %eax,%eax
je     1225 <main+0xd5>
lea    0xe82(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1219 <main+0xc9>
lea    0xe71(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    $0x4,%ebp
test   %eax,%eax
je     1225 <main+0xd5>
lea    0xe5d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1220 <main+0xd0>
lea    0xe4f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1225 <main+0xd5>
lea    0xe42(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    $0x8,%ebp
test   %eax,%eax
je     1225 <main+0xd5>
lea    0xe31(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1241 <main+0xf1>
lea    0xe25(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strstr@plt>
test   %rax,%rax
je     125a <main+0x10a>
xor    %eax,%eax
call   1060 <doHelp@plt>
jmp    1238 <main+0xe8>
mov    $0x2,%ebp
jmp    1225 <main+0xd5>
mov    $0x1,%ebp
lea    0xe01(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2d98(%rip),%rax
mov    (%rax),%esi
lea    0xdfc(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1238 <main+0xe8>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xdf9(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
jmp    1231 <main+0xe1>

LLVM IR (-O0):
@.str = [5 x i8] c"long\00"
@.str.1 = [6 x i8] c"short\00"
@.str.2 = [4 x i8] c"int\00"
@.str.3 = [5 x i8] c"char\00"
@.str.4 = [6 x i8] c"float\00"
@.str.5 = [7 x i8] c"double\00"
@.str.6 = [7 x i8] c"BUFSIZ\00"
@.str.7 = [5 x i8] c"help\00"
@.str.8 = [32 x i8] c"Data type %s is %d bytes long.\0A\00"
@.str.9 = [21 x i8] c"BUFSIZ is %d bytes.\0A\00"
@BUFSIZ = global i32 0
@.str.10 = [31 x i8] c"String \22%s\22 is %d bytes long.\0A\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 i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* null, i8** %7
store i8 110, i8* %8
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
store i8* %14, i8** %7
br label %17
15: ; preds = %2
%16 = call i32 (...) @doHelp()
store i32 0, i32* %3
br label %86
17: ; preds = %11
%18 = load i8*, i8** %7
%19 = call i32 @strcasecmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%20 = icmp ne i32 %19, 0
br i1 %20, label %22, label %21
21: ; preds = %17
store i32 8, i32* %6
store i8 121, i8* %8
br label %71
22: ; preds = %17
%23 = load i8*, i8** %7
%24 = call i32 @strcasecmp(i8* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %22
store i32 2, i32* %6
store i8 121, i8* %8
br label %70
27: ; preds = %22
%28 = load i8*, i8** %7
%29 = call i32 @strcasecmp(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %32, label %31
31: ; preds = %27
store i32 4, i32* %6
store i8 121, i8* %8
br label %69
32: ; preds = %27
%33 = load i8*, i8** %7
%34 = call i32 @strcasecmp(i8* %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %32
store i32 1, i32* %6
store i8 121, i8* %8
br label %68
37: ; preds = %32
%38 = load i8*, i8** %7
%39 = call i32 @strcasecmp(i8* %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%40 = icmp ne i32 %39, 0
br i1 %40, label %42, label %41
41: ; preds = %37
store i32 4, i32* %6
store i8 121, i8* %8
br label %67
42: ; preds = %37
%43 = load i8*, i8** %7
%44 = call i32 @strcasecmp(i8* %43, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%45 = icmp ne i32 %44, 0
br i1 %45, label %47, label %46
46: ; preds = %42
store i32 8, i32* %6
store i8 121, i8* %8
br label %66
47: ; preds = %42
%48 = load i8*, i8** %7
%49 = call i32 @strcasecmp(i8* %48, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%50 = icmp ne i32 %49, 0
br i1 %50, label %52, label %51
51: ; preds = %47
store i32 0, i32* %6
store i8 98, i8* %8
br label %65
52: ; preds = %47
%53 = load i8*, i8** %7
%54 = call i64 @strstr(i8* %53, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%55 = icmp ne i64 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = call i32 (...) @doHelp()
store i32 0, i32* %3
br label %86
58: ; preds = %52
%59 = load i8*, i8** %7
%60 = call i32 @strlen(i8* %59)
%61 = sext i32 %60 to i64
%62 = mul i64 %61, 1
%63 = trunc i64 %62 to i32
store i32 %63, i32* %6
store i8 110, i8* %8
br label %64
64: ; preds = %58
br label %65
65: ; preds = %64, %51
br label %66
66: ; preds = %65, %46
br label %67
67: ; preds = %66, %41
br label %68
68: ; preds = %67, %36
br label %69
69: ; preds = %68, %31
br label %70
70: ; preds = %69, %26
br label %71
71: ; preds = %70, %21
%72 = load i8, i8* %8
%73 = sext i8 %72 to i32
switch i32 %73, label %81 [
i32 121, label %74
i32 98, label %78
]
74: ; preds = %71
%75 = load i8*, i8** %7
%76 = load i32, i32* %6
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8* %75, i32 %76)
br label %85
78: ; preds = %71
%79 = load i32, i32* @BUFSIZ
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %79)
br label %85
81: ; preds = %71
%82 = load i8*, i8** %7
%83 = load i32, i32* %6
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* %82, i32 %83)
br label %85
85: ; preds = %81, %78, %74
store i32 0, i32* %3
br label %86
86: ; preds = %85, %56, %15
%87 = load i32, i32* %3
ret i32 %87
}

LLVM IR (-O2):
@.str = [5 x i8] c"long\00"
@.str.1 = [6 x i8] c"short\00"
@.str.2 = [4 x i8] c"int\00"
@.str.3 = [5 x i8] c"char\00"
@.str.4 = [6 x i8] c"float\00"
@.str.5 = [7 x i8] c"double\00"
@.str.6 = [7 x i8] c"BUFSIZ\00"
@.str.7 = [5 x i8] c"help\00"
@.str.8 = [32 x i8] c"Data type %s is %d bytes long.\0A\00"
@.str.9 = [21 x i8] c"BUFSIZ is %d bytes.\0A\00"
@BUFSIZ = global i32 0
@.str.10 = [31 x i8] c"String \22%s\22 is %d bytes long.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %34, label %11
9: ; preds = %2
%10 = tail call i32 (...) @doHelp()
br label %43
11: ; preds = %4
%12 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %34, label %14
14: ; preds = %11
%15 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %34, label %17
17: ; preds = %14
%18 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %34, label %20
20: ; preds = %17
%21 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%22 = icmp eq i32 %21, 0
br i1 %22, label %34, label %23
23: ; preds = %20
%24 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %34, label %26
26: ; preds = %23
%27 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %37, label %29
29: ; preds = %26
%30 = tail call i64 @strstr(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %40, label %32
32: ; preds = %29
%33 = tail call i32 (...) @doHelp()
br label %43
34: ; preds = %4, %11, %14, %17, %20, %23
%35 = phi i32 [ 8, %23 ], [ 4, %20 ], [ 1, %17 ], [ 4, %14 ], [ 2, %11 ], [ 8, %4 ]
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8* %6, i32 %35)
br label %43
37: ; preds = %26
%38 = load i32, i32* @BUFSIZ
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %38)
br label %43
40: ; preds = %29
%41 = tail call i32 @strlen(i8* %6)
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* %6, i32 %41)
br label %43
43: ; preds = %34, %37, %40, %32, %9
ret i32 0
}