#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 atoi(char *);
int /*<<< orphan*/ brief_usage();
char *crypt(char *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ full_usage();
int getopt(int, char **, char *);
char *getpass(char *);
char *make_bf_salt(int, int);
char *make_bf_salt_para(int, char *);
char *make_des_salt();
char *make_ext_salt(int);
char *make_ext_salt_para(int, char *);
char *make_md5_salt(int);
char *make_md5_salt_para(char *);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int main(int argc, char *argv[]) {
  char *plaintext = NULL;
  extern char *optarg;
  int c;
  char *saltpara = NULL;
  char *salt;
  int flag = 0;
  int length = 0;
  int rounds = 0;
  while ((c = getopt(argc, argv, "mdber:h?l:s:p:")) != -1) {
    switch (c) {
    case 'm':
      flag |= 0x00000001;
      break;
    case 'd':
      flag |= 0x00000002;
      break;
    case 'b':
      flag |= 0x00000020;
      rounds = 4;
      break;
    case 'e':
      flag |= 0x00000080;
      rounds = 25;
      break;
    case 'l':
      flag |= 0x00000010;
      length = atoi(optarg);
      break;
    case 'r':
      flag |= 0x00000040;
      rounds = atoi(optarg);
      break;
    case 's':
      flag |= 0x00000004;
      saltpara = optarg;
      break;
    case 'p':
      flag |= 0x00000008;
      plaintext = optarg;
      break;
    case 'h':
      full_usage();
      break;
    case '?':
      brief_usage();
      break;
    default:
      printf("Invalid Option: -%c\n", c);
      break;
    }
  }
  if (flag & 0x00000001) {
    if (length == 0)
      length = 8;
    if (flag & 0x00000004)
      salt = make_md5_salt_para(saltpara);
    else
      salt = make_md5_salt(length);
  } else if (flag & 0x00000020) {
    if (length == 0)
      length = 22;
    if (flag & 0x00000004)
      salt = make_bf_salt_para(rounds, saltpara);
    else
      salt = make_bf_salt(rounds, length);
  } else if (flag & 0x00000080) {
    if (flag & 0x00000004) {
      if ((strlen(saltpara) == 4)) {
        salt = make_ext_salt_para(rounds, saltpara);
      } else {
        printf("Invalid salt, please enter 4 alphanumeric characters\n");
        exit(1);
      }
    } else {
      salt = make_ext_salt(rounds);
    }
  } else {
    if (flag & 0x00000004) {
      if ((strlen(saltpara) == 2)) {
        salt = saltpara;
      } else {
        printf("Invalid salt, please enter 2 alphanumeric characters\n");
        exit(1);
      }
    } else {
      salt = make_des_salt();
    }
  }
  if (flag & 0x00000008) {
    if (!plaintext)
      printf("Please enter a valid password\n");
  } else {
    plaintext = getpass("plaintext: ");
  }
  printf("%s\n", crypt(plaintext, salt));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe8b(%rip),%rdx
call   1100 <getopt@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     1371 <main+0x171>
mov    -0x1c(%rbp),%eax
add    $0xffffffc1,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x34,%eax
ja     135b <main+0x15b>
mov    -0x48(%rbp),%rax
lea    0xd86(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x34(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    136c <main+0x16c>
mov    -0x34(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x34(%rbp)
jmp    136c <main+0x16c>
mov    -0x34(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x34(%rbp)
movl   $0x4,-0x3c(%rbp)
jmp    136c <main+0x16c>
mov    -0x34(%rbp),%eax
or     $0x80,%eax
mov    %eax,-0x34(%rbp)
movl   $0x19,-0x3c(%rbp)
jmp    136c <main+0x16c>
mov    -0x34(%rbp),%eax
or     $0x10,%eax
mov    %eax,-0x34(%rbp)
mov    0x2d05(%rip),%rax
mov    (%rax),%rdi
call   1110 <atoi@plt>
mov    %eax,-0x38(%rbp)
jmp    136c <main+0x16c>
mov    -0x34(%rbp),%eax
or     $0x40,%eax
mov    %eax,-0x34(%rbp)
mov    0x2ce5(%rip),%rax
mov    (%rax),%rdi
call   1110 <atoi@plt>
mov    %eax,-0x3c(%rbp)
jmp    136c <main+0x16c>
mov    -0x34(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    0x2cc5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    136c <main+0x16c>
mov    -0x34(%rbp),%eax
or     $0x8,%eax
mov    %eax,-0x34(%rbp)
mov    0x2ca9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    136c <main+0x16c>
mov    $0x0,%al
call   1040 <full_usage@plt>
jmp    136c <main+0x16c>
mov    $0x0,%al
call   10d0 <brief_usage@plt>
jmp    136c <main+0x16c>
mov    -0x1c(%rbp),%esi
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    123b <main+0x3b>
mov    -0x34(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     13c3 <main+0x1c3>
cmpl   $0x0,-0x38(%rbp)
jne    1391 <main+0x191>
movl   $0x8,-0x38(%rbp)
mov    -0x34(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     13b2 <main+0x1b2>
mov    -0x28(%rbp),%rdi
call   10c0 <make_md5_salt_para@plt>
mov    %rax,-0x30(%rbp)
jmp    13be <main+0x1be>
mov    -0x38(%rbp),%edi
call   10e0 <make_md5_salt@plt>
mov    %rax,-0x30(%rbp)
jmp    14f5 <main+0x2f5>
mov    -0x34(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     141b <main+0x21b>
cmpl   $0x0,-0x38(%rbp)
jne    13e3 <main+0x1e3>
movl   $0x16,-0x38(%rbp)
mov    -0x34(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1407 <main+0x207>
mov    -0x3c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1030 <make_bf_salt_para@plt>
mov    %rax,-0x30(%rbp)
jmp    1416 <main+0x216>
mov    -0x3c(%rbp),%edi
mov    -0x38(%rbp),%esi
call   10b0 <make_bf_salt@plt>
mov    %rax,-0x30(%rbp)
jmp    14f0 <main+0x2f0>
mov    -0x34(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1490 <main+0x290>
mov    -0x34(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     147f <main+0x27f>
mov    -0x28(%rbp),%rdi
call   1070 <strlen@plt>
cmp    $0x4,%eax
jne    1462 <main+0x262>
mov    -0x3c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1080 <make_ext_salt_para@plt>
mov    %rax,-0x30(%rbp)
jmp    147a <main+0x27a>
lea    0xc8f(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
jmp    148b <main+0x28b>
mov    -0x3c(%rbp),%edi
call   10a0 <make_ext_salt@plt>
mov    %rax,-0x30(%rbp)
jmp    14eb <main+0x2eb>
mov    -0x34(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     14db <main+0x2db>
mov    -0x28(%rbp),%rdi
call   1070 <strlen@plt>
cmp    $0x2,%eax
jne    14be <main+0x2be>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    14d6 <main+0x2d6>
lea    0xc69(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
jmp    14e6 <main+0x2e6>
mov    $0x0,%al
call   1060 <make_des_salt@plt>
mov    %rax,-0x30(%rbp)
jmp    14eb <main+0x2eb>
jmp    14f0 <main+0x2f0>
jmp    14f5 <main+0x2f5>
mov    -0x34(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1522 <main+0x322>
cmpq   $0x0,-0x18(%rbp)
jne    151d <main+0x31d>
lea    0xc4e(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    1532 <main+0x332>
lea    0xc5a(%rip),%rdi
call   10f0 <getpass@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1050 <crypt@plt>
mov    %rax,%rsi
lea    0xc46(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeaa(%rip),%r14
lea    0xdcf(%rip),%r12
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x8(%rsp)
xor    %r15d,%r15d
movl   $0x0,0x4(%rsp)
xor    %r13d,%r13d
jmp    1260 <main+0x50>
or     $0x2,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1110 <getopt@plt>
lea    -0x3f(%rax),%ecx
cmp    $0x34,%ecx
ja     1319 <main+0x109>
movslq (%r12,%rcx,4),%rcx
add    %r12,%rcx
jmp    *%rcx
xor    %eax,%eax
call   10e0 <brief_usage@plt>
jmp    1260 <main+0x50>
or     $0x20,%r15d
mov    $0x4,%r13d
jmp    1260 <main+0x50>
or     $0x1,%r15d
jmp    1260 <main+0x50>
xor    %eax,%eax
call   1040 <full_usage@plt>
jmp    1260 <main+0x50>
or     $0x8,%r15d
mov    0x2d2f(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x10(%rsp)
jmp    1260 <main+0x50>
or     $0x80,%r15d
mov    $0x19,%r13d
jmp    1260 <main+0x50>
or     $0x10,%r15d
mov    0x2d0b(%rip),%rax
mov    (%rax),%rdi
call   1120 <atoi@plt>
mov    %eax,0x4(%rsp)
jmp    1260 <main+0x50>
or     $0x4,%r15d
mov    0x2cef(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x8(%rsp)
jmp    1260 <main+0x50>
or     $0x40,%r15d
mov    0x2cd7(%rip),%rax
mov    (%rax),%rdi
call   1120 <atoi@plt>
mov    %eax,%r13d
jmp    1260 <main+0x50>
cmp    $0xffffffff,%eax
je     1333 <main+0x123>
lea    0xdbe(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    1260 <main+0x50>
test   $0x1,%r15b
jne    1357 <main+0x147>
test   $0x20,%r15b
jne    1375 <main+0x165>
test   $0x80,%r15b
jne    139f <main+0x18f>
test   $0x4,%r15b
jne    13be <main+0x1ae>
xor    %eax,%eax
call   1070 <make_des_salt@plt>
jmp    1404 <main+0x1f4>
test   $0x4,%r15b
jne    1393 <main+0x183>
mov    0x4(%rsp),%eax
test   %eax,%eax
mov    $0x8,%edi
cmovne %eax,%edi
call   10f0 <make_md5_salt@plt>
jmp    1404 <main+0x1f4>
test   $0x4,%r15b
jne    13af <main+0x19f>
mov    0x4(%rsp),%eax
test   %eax,%eax
mov    $0x16,%esi
cmovne %eax,%esi
mov    %r13d,%edi
call   10c0 <make_bf_salt@plt>
jmp    1404 <main+0x1f4>
mov    0x8(%rsp),%rdi
call   10d0 <make_md5_salt_para@plt>
jmp    1404 <main+0x1f4>
test   $0x4,%r15b
jne    13e7 <main+0x1d7>
mov    %r13d,%edi
call   10b0 <make_ext_salt@plt>
jmp    1404 <main+0x1f4>
mov    %r13d,%edi
mov    0x8(%rsp),%rsi
call   1030 <make_bf_salt_para@plt>
jmp    1404 <main+0x1f4>
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <strlen@plt>
cmp    $0x2,%eax
jne    1446 <main+0x236>
test   $0x8,%r15b
jne    140d <main+0x1fd>
lea    0xd1b(%rip),%rdi
call   1100 <getpass@plt>
mov    %rax,%rdi
jmp    1425 <main+0x215>
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <strlen@plt>
cmp    $0x4,%eax
jne    144f <main+0x23f>
mov    %r13d,%edi
mov    %rbx,%rsi
call   1090 <make_ext_salt_para@plt>
mov    %rax,%rbx
test   $0x8,%r15b
je     13d6 <main+0x1c6>
mov    0x10(%rsp),%rdi
test   %rdi,%rdi
jne    1425 <main+0x215>
lea    0xce6(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <crypt@plt>
mov    %rax,%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcd5(%rip),%rdi
jmp    1456 <main+0x246>
lea    0xd01(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   1130 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"mdber:h?l:s:p:\00"
@optarg = external global i8*
@.str.1 = [21 x i8] c"Invalid Option: -%c\0A\00"
@.str.2 = [54 x i8] c"Invalid salt, please enter 4 alphanumeric characters\0A\00"
@.str.3 = [54 x i8] c"Invalid salt, please enter 2 alphanumeric characters\0A\00"
@.str.4 = [31 x i8] c"Please enter a valid password\0A\00"
@.str.5 = [12 x i8] c"plaintext: \00"
@.str.6 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %8
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
br label %13
13: ; preds = %57, %2
%14 = load i32, i32* %4
%15 = load i8**, i8*** %5
%16 = call i32 @getopt(i32 %14, i8** %15, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 %16, i32* %7
%17 = icmp ne i32 %16, -1
br i1 %17, label %18, label %58
18: ; preds = %13
%19 = load i32, i32* %7
switch i32 %19, label %54 [
i32 109, label %20
i32 100, label %23
i32 98, label %26
i32 101, label %29
i32 108, label %32
i32 114, label %37
i32 115, label %42
i32 112, label %46
i32 104, label %50
i32 63, label %52
]
20: ; preds = %18
%21 = load i32, i32* %10
%22 = or i32 %21, 1
store i32 %22, i32* %10
br label %57
23: ; preds = %18
%24 = load i32, i32* %10
%25 = or i32 %24, 2
store i32 %25, i32* %10
br label %57
26: ; preds = %18
%27 = load i32, i32* %10
%28 = or i32 %27, 32
store i32 %28, i32* %10
store i32 4, i32* %12
br label %57
29: ; preds = %18
%30 = load i32, i32* %10
%31 = or i32 %30, 128
store i32 %31, i32* %10
store i32 25, i32* %12
br label %57
32: ; preds = %18
%33 = load i32, i32* %10
%34 = or i32 %33, 16
store i32 %34, i32* %10
%35 = load i8*, i8** @optarg
%36 = call i32 @atoi(i8* %35)
store i32 %36, i32* %11
br label %57
37: ; preds = %18
%38 = load i32, i32* %10
%39 = or i32 %38, 64
store i32 %39, i32* %10
%40 = load i8*, i8** @optarg
%41 = call i32 @atoi(i8* %40)
store i32 %41, i32* %12
br label %57
42: ; preds = %18
%43 = load i32, i32* %10
%44 = or i32 %43, 4
store i32 %44, i32* %10
%45 = load i8*, i8** @optarg
store i8* %45, i8** %8
br label %57
46: ; preds = %18
%47 = load i32, i32* %10
%48 = or i32 %47, 8
store i32 %48, i32* %10
%49 = load i8*, i8** @optarg
store i8* %49, i8** %6
br label %57
50: ; preds = %18
%51 = call i32 (...) @full_usage()
br label %57
52: ; preds = %18
%53 = call i32 (...) @brief_usage()
br label %57
54: ; preds = %18
%55 = load i32, i32* %7
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %55)
br label %57
57: ; preds = %54, %52, %50, %46, %42, %37, %32, %29, %26, %23, %20
br label %13
58: ; preds = %13
%59 = load i32, i32* %10
%60 = and i32 %59, 1
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %77
62: ; preds = %58
%63 = load i32, i32* %11
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %66
65: ; preds = %62
store i32 8, i32* %11
br label %66
66: ; preds = %65, %62
%67 = load i32, i32* %10
%68 = and i32 %67, 4
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %66
%71 = load i8*, i8** %8
%72 = call i8* @make_md5_salt_para(i8* %71)
store i8* %72, i8** %9
br label %76
73: ; preds = %66
%74 = load i32, i32* %11
%75 = call i8* @make_md5_salt(i32 %74)
store i8* %75, i8** %9
br label %76
76: ; preds = %73, %70
br label %141
77: ; preds = %58
%78 = load i32, i32* %10
%79 = and i32 %78, 32
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %98
81: ; preds = %77
%82 = load i32, i32* %11
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %85
84: ; preds = %81
store i32 22, i32* %11
br label %85
85: ; preds = %84, %81
%86 = load i32, i32* %10
%87 = and i32 %86, 4
%88 = icmp ne i32 %87, 0
br i1 %88, label %89, label %93
89: ; preds = %85
%90 = load i32, i32* %12
%91 = load i8*, i8** %8
%92 = call i8* @make_bf_salt_para(i32 %90, i8* %91)
store i8* %92, i8** %9
br label %97
93: ; preds = %85
%94 = load i32, i32* %12
%95 = load i32, i32* %11
%96 = call i8* @make_bf_salt(i32 %94, i32 %95)
store i8* %96, i8** %9
br label %97
97: ; preds = %93, %89
br label %140
98: ; preds = %77
%99 = load i32, i32* %10
%100 = and i32 %99, 128
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %122
102: ; preds = %98
%103 = load i32, i32* %10
%104 = and i32 %103, 4
%105 = icmp ne i32 %104, 0
br i1 %105, label %106, label %118
106: ; preds = %102
%107 = load i8*, i8** %8
%108 = call i32 @strlen(i8* %107)
%109 = icmp eq i32 %108, 4
br i1 %109, label %110, label %114
110: ; preds = %106
%111 = load i32, i32* %12
%112 = load i8*, i8** %8
%113 = call i8* @make_ext_salt_para(i32 %111, i8* %112)
store i8* %113, i8** %9
br label %117
114: ; preds = %106
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%116 = call i32 @exit(i32 1)
unreachable
117: ; preds = %110
br label %121
118: ; preds = %102
%119 = load i32, i32* %12
%120 = call i8* @make_ext_salt(i32 %119)
store i8* %120, i8** %9
br label %121
121: ; preds = %118, %117
br label %139
122: ; preds = %98
%123 = load i32, i32* %10
%124 = and i32 %123, 4
%125 = icmp ne i32 %124, 0
br i1 %125, label %126, label %136
126: ; preds = %122
%127 = load i8*, i8** %8
%128 = call i32 @strlen(i8* %127)
%129 = icmp eq i32 %128, 2
br i1 %129, label %130, label %132
130: ; preds = %126
%131 = load i8*, i8** %8
store i8* %131, i8** %9
br label %135
132: ; preds = %126
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0))
%134 = call i32 @exit(i32 1)
unreachable
135: ; preds = %130
br label %138
136: ; preds = %122
%137 = call i8* (...) @make_des_salt()
store i8* %137, i8** %9
br label %138
138: ; preds = %136, %135
br label %139
139: ; preds = %138, %121
br label %140
140: ; preds = %139, %97
br label %141
141: ; preds = %140, %76
%142 = load i32, i32* %10
%143 = and i32 %142, 8
%144 = icmp ne i32 %143, 0
br i1 %144, label %145, label %151
145: ; preds = %141
%146 = load i8*, i8** %6
%147 = icmp ne i8* %146, null
br i1 %147, label %150, label %148
148: ; preds = %145
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %150
150: ; preds = %148, %145
br label %153
151: ; preds = %141
%152 = call i8* @getpass(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
store i8* %152, i8** %6
br label %153
153: ; preds = %151, %150
%154 = load i8*, i8** %6
%155 = load i8*, i8** %9
%156 = call i8* @crypt(i8* %154, i8* %155)
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %156)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"mdber:h?l:s:p:\00"
@optarg = external global i8*
@.str.1 = [21 x i8] c"Invalid Option: -%c\0A\00"
@.str.5 = [12 x i8] c"plaintext: \00"
@str = [30 x i8] c"Please enter a valid password\00"
@str.7 = [53 x i8] c"Invalid salt, please enter 2 alphanumeric characters\00"
@str.8 = [53 x i8] c"Invalid salt, please enter 4 alphanumeric characters\00"
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %38, %2
%4 = phi i8* [ null, %2 ], [ %39, %38 ]
%5 = phi i8* [ null, %2 ], [ %40, %38 ]
%6 = phi i32 [ 0, %2 ], [ %41, %38 ]
%7 = phi i32 [ 0, %2 ], [ %42, %38 ]
%8 = phi i32 [ 0, %2 ], [ %43, %38 ]
%9 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
switch i32 %9, label %36 [
i32 -1, label %44
i32 109, label %10
i32 100, label %12
i32 98, label %14
i32 101, label %16
i32 108, label %18
i32 114, label %22
i32 115, label %26
i32 112, label %29
i32 104, label %32
i32 63, label %34
]
10: ; preds = %3
%11 = or i32 %6, 1
br label %38
12: ; preds = %3
%13 = or i32 %6, 2
br label %38
14: ; preds = %3
%15 = or i32 %6, 32
br label %38
16: ; preds = %3
%17 = or i32 %6, 128
br label %38
18: ; preds = %3
%19 = or i32 %6, 16
%20 = load i8*, i8** @optarg
%21 = tail call i32 @atoi(i8* %20)
br label %38
22: ; preds = %3
%23 = or i32 %6, 64
%24 = load i8*, i8** @optarg
%25 = tail call i32 @atoi(i8* %24)
br label %38
26: ; preds = %3
%27 = or i32 %6, 4
%28 = load i8*, i8** @optarg
br label %38
29: ; preds = %3
%30 = or i32 %6, 8
%31 = load i8*, i8** @optarg
br label %38
32: ; preds = %3
%33 = tail call i32 (...) @full_usage()
br label %38
34: ; preds = %3
%35 = tail call i32 (...) @brief_usage()
br label %38
36: ; preds = %3
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %38
38: ; preds = %36, %34, %32, %29, %26, %22, %18, %16, %14, %12, %10
%39 = phi i8* [ %4, %36 ], [ %4, %34 ], [ %4, %32 ], [ %31, %29 ], [ %4, %26 ], [ %4, %22 ], [ %4, %18 ], [ %4, %16 ], [ %4, %14 ], [ %4, %12 ], [ %4, %10 ]
%40 = phi i8* [ %5, %36 ], [ %5, %34 ], [ %5, %32 ], [ %5, %29 ], [ %28, %26 ], [ %5, %22 ], [ %5, %18 ], [ %5, %16 ], [ %5, %14 ], [ %5, %12 ], [ %5, %10 ]
%41 = phi i32 [ %6, %36 ], [ %6, %34 ], [ %6, %32 ], [ %30, %29 ], [ %27, %26 ], [ %23, %22 ], [ %19, %18 ], [ %17, %16 ], [ %15, %14 ], [ %13, %12 ], [ %11, %10 ]
%42 = phi i32 [ %7, %36 ], [ %7, %34 ], [ %7, %32 ], [ %7, %29 ], [ %7, %26 ], [ %7, %22 ], [ %21, %18 ], [ %7, %16 ], [ %7, %14 ], [ %7, %12 ], [ %7, %10 ]
%43 = phi i32 [ %8, %36 ], [ %8, %34 ], [ %8, %32 ], [ %8, %29 ], [ %8, %26 ], [ %25, %22 ], [ %8, %18 ], [ 25, %16 ], [ 4, %14 ], [ %8, %12 ], [ %8, %10 ]
br label %3
44: ; preds = %3
%45 = and i32 %6, 1
%46 = icmp eq i32 %45, 0
br i1 %46, label %56, label %47
47: ; preds = %44
%48 = and i32 %6, 4
%49 = icmp eq i32 %48, 0
br i1 %49, label %52, label %50
50: ; preds = %47
%51 = tail call i8* @make_md5_salt_para(i8* %5)
br label %93
52: ; preds = %47
%53 = icmp eq i32 %7, 0
%54 = select i1 %53, i32 8, i32 %7
%55 = tail call i8* @make_md5_salt(i32 %54)
br label %93
56: ; preds = %44
%57 = and i32 %6, 32
%58 = icmp eq i32 %57, 0
br i1 %58, label %68, label %59
59: ; preds = %56
%60 = and i32 %6, 4
%61 = icmp eq i32 %60, 0
br i1 %61, label %64, label %62
62: ; preds = %59
%63 = tail call i8* @make_bf_salt_para(i32 %8, i8* %5)
br label %93
64: ; preds = %59
%65 = icmp eq i32 %7, 0
%66 = select i1 %65, i32 22, i32 %7
%67 = tail call i8* @make_bf_salt(i32 %8, i32 %66)
br label %93
68: ; preds = %56
%69 = and i32 %6, 128
%70 = icmp eq i32 %69, 0
%71 = and i32 %6, 4
%72 = icmp eq i32 %71, 0
br i1 %70, label %84, label %73
73: ; preds = %68
br i1 %72, label %82, label %74
74: ; preds = %73
%75 = tail call i32 @strlen(i8* %5)
%76 = icmp eq i32 %75, 4
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = tail call i8* @make_ext_salt_para(i32 %8, i8* %5)
br label %93
79: ; preds = %74
%80 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.8, i64 0, i64 0))
%81 = tail call i32 @exit(i32 1)
unreachable
82: ; preds = %73
%83 = tail call i8* @make_ext_salt(i32 %8)
br label %93
84: ; preds = %68
br i1 %72, label %91, label %85
85: ; preds = %84
%86 = tail call i32 @strlen(i8* %5)
%87 = icmp eq i32 %86, 2
br i1 %87, label %93, label %88
88: ; preds = %85
%89 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.7, i64 0, i64 0))
%90 = tail call i32 @exit(i32 1)
unreachable
91: ; preds = %84
%92 = tail call i8* (...) @make_des_salt()
br label %93
93: ; preds = %85, %64, %62, %91, %77, %82, %50, %52
%94 = phi i8* [ %51, %50 ], [ %55, %52 ], [ %63, %62 ], [ %67, %64 ], [ %78, %77 ], [ %83, %82 ], [ %92, %91 ], [ %5, %85 ]
%95 = and i32 %6, 8
%96 = icmp eq i32 %95, 0
br i1 %96, label %101, label %97
97: ; preds = %93
%98 = icmp eq i8* %4, null
br i1 %98, label %99, label %103
99: ; preds = %97
%100 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %103
101: ; preds = %93
%102 = tail call i8* @getpass(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %103
103: ; preds = %97, %99, %101
%104 = phi i8* [ %4, %97 ], [ null, %99 ], [ %102, %101 ]
%105 = tail call i8* @crypt(i8* %104, i8* %94)
%106 = tail call i32 @puts(i8* dereferenceable(1) %105)
ret i32 0
}