#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 myHash(char *);
int /*<<< orphan*/ printError(char *);
int /*<<< orphan*/ printInfo(char *);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ s1c1();
int /*<<< orphan*/ s1c2();
int /*<<< orphan*/ s1c3();
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  int i = 0;
  if (argc < 2) {
    printError("No arguments\n");
    usage();
  } else {
    for (i = 1; i < argc; i++) {
      printf("myHash for %s:%d\n", *(argv + i), myHash(*(argv + i)));
      switch (myHash(*(argv + i))) {
      case 357:
        printInfo("-s1c1\n");
        s1c1();
        break;
      case 358:
        printInfo("-s1c2\n");
        s1c2();
        break;
      case 359:
        printInfo("-s1c3\n");
        s1c3();
        break;
      default:
        printf("argv:%s\n", *(argv + i));
        break;
      }
    }
  }
  printInfo("the end ...\n");
  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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11bf <main+0x3f>
lea    0xe52(%rip),%rdi
call   1070 <printError@plt>
mov    $0x0,%al
call   1060 <usage@plt>
jmp    12c1 <main+0x141>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12bc <main+0x13c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    %rdi,-0x20(%rbp)
call   1050 <myHash@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe1a(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <myHash@plt>
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
sub    $0x165,%eax
je     1247 <main+0xc7>
jmp    1221 <main+0xa1>
mov    -0x18(%rbp),%eax
sub    $0x166,%eax
je     125f <main+0xdf>
jmp    1234 <main+0xb4>
mov    -0x18(%rbp),%eax
sub    $0x167,%eax
je     1277 <main+0xf7>
jmp    128f <main+0x10f>
lea    0xdd2(%rip),%rdi
call   10a0 <printInfo@plt>
mov    $0x0,%al
call   1080 <s1c1@plt>
jmp    12a9 <main+0x129>
lea    0xdc1(%rip),%rdi
call   10a0 <printInfo@plt>
mov    $0x0,%al
call   1040 <s1c2@plt>
jmp    12a9 <main+0x129>
lea    0xdb0(%rip),%rdi
call   10a0 <printInfo@plt>
mov    $0x0,%al
call   1090 <s1c3@plt>
jmp    12a9 <main+0x129>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ae <main+0x12e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c6 <main+0x46>
jmp    12c1 <main+0x141>
lea    0xd76(%rip),%rdi
call   10a0 <printInfo@plt>
xor    %eax,%eax
add    $0x20,%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
jge    11c0 <main+0x40>
lea    0xe69(%rip),%rdi
call   1070 <printError@plt>
xor    %eax,%eax
call   1060 <usage@plt>
lea    0xe94(%rip),%rdi
call   10a0 <printInfo@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsi,%rbx
mov    %edi,%r13d
mov    $0x1,%r12d
lea    0xe3b(%rip),%r14
lea    0xe5b(%rip),%rbp
jmp    11fc <main+0x7c>
nopl   0x0(%rax)
lea    0xe40(%rip),%rdi
call   10a0 <printInfo@plt>
xor    %eax,%eax
call   1040 <s1c2@plt>
add    $0x1,%r12
cmp    %r12,%r13
je     11a3 <main+0x23>
mov    (%rbx,%r12,8),%r15
mov    %r15,%rdi
call   1050 <myHash@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx,%r12,8),%rdi
call   1050 <myHash@plt>
cmp    $0x167,%eax
je     1250 <main+0xd0>
cmp    $0x166,%eax
je     11e0 <main+0x60>
cmp    $0x165,%eax
jne    1270 <main+0xf0>
lea    0xde4(%rip),%rdi
call   10a0 <printInfo@plt>
xor    %eax,%eax
call   1080 <s1c1@plt>
jmp    11f3 <main+0x73>
nopw   0x0(%rax,%rax,1)
lea    0xdd7(%rip),%rdi
call   10a0 <printInfo@plt>
xor    %eax,%eax
call   1090 <s1c3@plt>
jmp    11f3 <main+0x73>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx,%r12,8),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11f3 <main+0x73>

LLVM IR (-O0):
@.str = [14 x i8] c"No arguments\0A\00"
@.str.1 = [18 x i8] c"myHash for %s:%d\0A\00"
@.str.2 = [7 x i8] c"-s1c1\0A\00"
@.str.3 = [7 x i8] c"-s1c2\0A\00"
@.str.4 = [7 x i8] c"-s1c3\0A\00"
@.str.5 = [9 x i8] c"argv:%s\0A\00"
@.str.6 = [13 x i8] c"the end ...\0A\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
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @printError(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @usage()
br label %57
12: ; preds = %2
store i32 1, i32* %6
br label %13
13: ; preds = %53, %12
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %56
17: ; preds = %13
%18 = load i8**, i8*** %5
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = load i8**, i8*** %5
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = call i32 @myHash(i8* %27)
%29 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %22, i32 %28)
%30 = load i8**, i8*** %5
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %30, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 @myHash(i8* %34)
switch i32 %35, label %45 [
i32 357, label %36
i32 358, label %39
i32 359, label %42
]
36: ; preds = %17
%37 = call i32 @printInfo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%38 = call i32 (...) @s1c1()
br label %52
39: ; preds = %17
%40 = call i32 @printInfo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%41 = call i32 (...) @s1c2()
br label %52
42: ; preds = %17
%43 = call i32 @printInfo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%44 = call i32 (...) @s1c3()
br label %52
45: ; preds = %17
%46 = load i8**, i8*** %5
%47 = load i32, i32* %6
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8*, i8** %46, i64 %48
%50 = load i8*, i8** %49
%51 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %50)
br label %52
52: ; preds = %45, %42, %39, %36
br label %53
53: ; preds = %52
%54 = load i32, i32* %6
%55 = add nsw i32 %54, 1
store i32 %55, i32* %6
br label %13
56: ; preds = %13
br label %57
57: ; preds = %56, %9
%58 = call i32 @printInfo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"No arguments\0A\00"
@.str.1 = [18 x i8] c"myHash for %s:%d\0A\00"
@.str.2 = [7 x i8] c"-s1c1\0A\00"
@.str.3 = [7 x i8] c"-s1c2\0A\00"
@.str.4 = [7 x i8] c"-s1c3\0A\00"
@.str.5 = [9 x i8] c"argv:%s\0A\00"
@.str.6 = [13 x i8] c"the end ...\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %9
6: ; preds = %2
%7 = tail call i32 @printError(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @usage()
br label %32
9: ; preds = %4, %29
%10 = phi i64 [ 1, %4 ], [ %30, %29 ]
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @myHash(i8* %12)
%14 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %12, i32 %13)
%15 = load i8*, i8** %11
%16 = tail call i32 @myHash(i8* %15)
switch i32 %16, label %26 [
i32 357, label %17
i32 358, label %20
i32 359, label %23
]
17: ; preds = %9
%18 = tail call i32 @printInfo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%19 = tail call i32 (...) @s1c1()
br label %29
20: ; preds = %9
%21 = tail call i32 @printInfo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%22 = tail call i32 (...) @s1c2()
br label %29
23: ; preds = %9
%24 = tail call i32 @printInfo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%25 = tail call i32 (...) @s1c3()
br label %29
26: ; preds = %9
%27 = load i8*, i8** %11
%28 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %27)
br label %29
29: ; preds = %17, %20, %23, %26
%30 = add nuw nsw i64 %10, 1
%31 = icmp eq i64 %30, %5
br i1 %31, label %32, label %9
32: ; preds = %29, %6
%33 = tail call i32 @printInfo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}