#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 */
char *bigcrypt(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
char *strchr(char *, char);
int main(int argc, char **argv) {
  if (argc < 3) {
    fprintf(stderr, "Usage: %s password salt\n",
            strchr(argv[0], '/') ? (strchr(argv[0], '/') + 1) : argv[0]);
    return 0;
  }
  fprintf(stdout, "%s\n", bigcrypt(argv[1], argv[2]));
  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)
cmpl   $0x3,-0x8(%rbp)
jge    11bf <main+0x8f>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2f,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     1195 <main+0x65>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2f,%esi
call   1040 <strchr@plt>
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11a0 <main+0x70>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rdx
lea    0xe52(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11f9 <main+0xc9>
mov    0x2e12(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <bigcrypt@plt>
mov    -0x24(%rbp),%edi
mov    %rax,%rdx
lea    0xe2c(%rip),%rsi
call   1050 <fprintf@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
jg     1167 <main+0x37>
mov    0x2ea1(%rip),%rax
mov    (%rax),%ebp
mov    (%rsi),%rbx
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1040 <strchr@plt>
lea    0x1(%rax),%rdx
test   %rax,%rax
cmove  %rbx,%rdx
lea    0xe9d(%rip),%rsi
mov    %ebp,%edi
jmp    1189 <main+0x59>
mov    0x2e6a(%rip),%rax
mov    (%rax),%ebx
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1030 <bigcrypt@plt>
lea    0xe95(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s password salt\0A\00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %28
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i8* @strchr(i8* %12, i8 signext 47)
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %21
15: ; preds = %8
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i8* @strchr(i8* %18, i8 signext 47)
%20 = getelementptr inbounds i8, i8* %19, i64 1
br label %25
21: ; preds = %8
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
br label %25
25: ; preds = %21, %15
%26 = phi i8* [ %20, %15 ], [ %24, %21 ]
%27 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %26)
store i32 0, i32* %3
br label %38
28: ; preds = %2
%29 = load i32, i32* @stdout
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = call i8* @bigcrypt(i8* %32, i8* %35)
%37 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %36)
store i32 0, i32* %3
br label %38
38: ; preds = %28, %25
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s password salt\0A\00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i8* @strchr(i8* dereferenceable(1) %6, i8 signext 47)
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = select i1 %8, i8* %6, i8* %9
%11 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %20
12: ; preds = %2
%13 = load i32, i32* @stdout
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i8* @bigcrypt(i8* %15, i8* %17)
%19 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %12, %4
ret i32 0
}