#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 EXIT_FAILURE;
int EXIT_SUCCESS;
char *inasehash_static(int /*<<< orphan*/);
int /*<<< orphan*/ parse_arg(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ puts(char *);
int unhash(int, char **);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    usage(argv[0]);
    return EXIT_FAILURE;
  }
  if (argc >= 3 && argv[1][0] == '-' && argv[1][1] == 'd' &&
      argv[1][2] == '\0') {
    return unhash(argc, argv);
  }
  if (argc == 2) {
    puts(inasehash_static(parse_arg(argv[1])));
  } else {
    for (int i = 1; i < argc; ++i) {
      char *hash = inasehash_static(parse_arg(argv[i]));
      printf("%8s: %s\n", argv[i], hash);
    }
  }
  return EXIT_SUCCESS;
}


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)
jge    119d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <usage@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    128e <main+0x12e>
cmpl   $0x3,-0x8(%rbp)
jl     11f9 <main+0x99>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11f9 <main+0x99>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x64,%eax
jne    11f9 <main+0x99>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    11f9 <main+0x99>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <unhash@plt>
mov    %eax,-0x4(%rbp)
jmp    128e <main+0x12e>
cmpl   $0x2,-0x8(%rbp)
jne    1224 <main+0xc4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <parse_arg@plt>
mov    %eax,%edi
call   1070 <inasehash_static@plt>
mov    %rax,%rdi
call   1040 <puts@plt>
jmp    1282 <main+0x122>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    127d <main+0x11d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <parse_arg@plt>
mov    %eax,%edi
call   1070 <inasehash_static@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x20(%rbp),%rdx
lea    0xd96(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    122b <main+0xcb>
jmp    1282 <main+0x122>
mov    0x2d4f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     1183 <main+0x23>
mov    (%rbx),%rdi
call   1060 <usage@plt>
mov    0x2e62(%rip),%rax
jmp    121f <main+0xbf>
mov    %edi,%ebp
mov    0x8(%rbx),%rdi
cmp    $0x2,%ebp
jne    11a4 <main+0x44>
call   1030 <parse_arg@plt>
mov    %eax,%edi
call   1070 <inasehash_static@plt>
mov    %rax,%rdi
call   1040 <puts@plt>
jmp    1218 <main+0xb8>
cmpb   $0x2d,(%rdi)
jne    11b5 <main+0x55>
cmpb   $0x64,0x1(%rdi)
jne    11b5 <main+0x55>
cmpb   $0x0,0x2(%rdi)
je     122c <main+0xcc>
call   1030 <parse_arg@plt>
mov    %eax,%edi
call   1070 <inasehash_static@plt>
mov    0x8(%rbx),%rsi
lea    0xe34(%rip),%rdi
mov    %rax,%rdx
call   1050 <printf@plt>
cmp    $0x2,%ebp
je     1218 <main+0xb8>
mov    %ebp,%r15d
mov    $0x2,%ebp
lea    0xe18(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rbp,8),%rdi
call   1030 <parse_arg@plt>
mov    %eax,%edi
call   1070 <inasehash_static@plt>
mov    (%rbx,%rbp,8),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    11f0 <main+0x90>
mov    0x2db9(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <unhash@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [9 x i8] c"%8s: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @usage(i8* %13)
%15 = load i32, i32* @EXIT_FAILURE
store i32 %15, i32* %3
br label %83
16: ; preds = %2
%17 = load i32, i32* %4
%18 = icmp sge i32 %17, 3
br i1 %18, label %19, label %47
19: ; preds = %16
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 45
br i1 %26, label %27, label %47
27: ; preds = %19
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 100
br i1 %34, label %35, label %47
35: ; preds = %27
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = getelementptr inbounds i8, i8* %38, i64 2
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %35
%44 = load i32, i32* %4
%45 = load i8**, i8*** %5
%46 = call i32 @unhash(i32 %44, i8** %45)
store i32 %46, i32* %3
br label %83
47: ; preds = %35, %27, %19, %16
%48 = load i32, i32* %4
%49 = icmp eq i32 %48, 2
br i1 %49, label %50, label %57
50: ; preds = %47
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 1
%53 = load i8*, i8** %52
%54 = call i32 @parse_arg(i8* %53)
%55 = call i8* @inasehash_static(i32 %54)
%56 = call i32 @puts(i8* %55)
br label %81
57: ; preds = %47
store i32 1, i32* %6
br label %58
58: ; preds = %77, %57
%59 = load i32, i32* %6
%60 = load i32, i32* %4
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %80
62: ; preds = %58
%63 = load i8**, i8*** %5
%64 = load i32, i32* %6
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8*, i8** %63, i64 %65
%67 = load i8*, i8** %66
%68 = call i32 @parse_arg(i8* %67)
%69 = call i8* @inasehash_static(i32 %68)
store i8* %69, i8** %7
%70 = load i8**, i8*** %5
%71 = load i32, i32* %6
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8*, i8** %70, i64 %72
%74 = load i8*, i8** %73
%75 = load i8*, i8** %7
%76 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %74, i8* %75)
br label %77
77: ; preds = %62
%78 = load i32, i32* %6
%79 = add nsw i32 %78, 1
store i32 %79, i32* %6
br label %58
80: ; preds = %58
br label %81
81: ; preds = %80, %50
%82 = load i32, i32* @EXIT_SUCCESS
store i32 %82, i32* %3
br label %83
83: ; preds = %81, %43, %10
%84 = load i32, i32* %3
ret i32 %84
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [9 x i8] c"%8s: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
%7 = load i32, i32* @EXIT_FAILURE
br label %50
8: ; preds = %2
%9 = icmp eq i32 %0, 2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
br i1 %9, label %33, label %12
12: ; preds = %8
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 45
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = getelementptr inbounds i8, i8* %11, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 100
br i1 %18, label %19, label %25
19: ; preds = %15
%20 = getelementptr inbounds i8, i8* %11, i64 2
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = tail call i32 @unhash(i32 %0, i8** %1)
br label %50
25: ; preds = %12, %15, %19
%26 = zext i32 %0 to i64
%27 = getelementptr inbounds i8*, i8** %1, i64 1
%28 = tail call i32 @parse_arg(i8* %11)
%29 = tail call i8* @inasehash_static(i32 %28)
%30 = load i8*, i8** %27
%31 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %30, i8* %29)
%32 = icmp eq i32 %0, 2
br i1 %32, label %48, label %37
33: ; preds = %8
%34 = tail call i32 @parse_arg(i8* %11)
%35 = tail call i8* @inasehash_static(i32 %34)
%36 = tail call i32 @puts(i8* dereferenceable(1) %35)
br label %48
37: ; preds = %25, %37
%38 = phi i64 [ %46, %37 ], [ 2, %25 ]
%39 = getelementptr inbounds i8*, i8** %1, i64 %38
%40 = load i8*, i8** %39
%41 = getelementptr inbounds i8*, i8** %1, i64 %38
%42 = tail call i32 @parse_arg(i8* %40)
%43 = tail call i8* @inasehash_static(i32 %42)
%44 = load i8*, i8** %41
%45 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %44, i8* %43)
%46 = add nuw nsw i64 %38, 1
%47 = icmp eq i64 %46, %26
br i1 %47, label %48, label %37
48: ; preds = %37, %25, %33
%49 = load i32, i32* @EXIT_SUCCESS
br label %50
50: ; preds = %48, %23, %4
%51 = phi i32 [ %7, %4 ], [ %24, %23 ], [ %49, %48 ]
ret i32 %51
}