#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 */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MD5(char *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Usage: %s passwd\n", argv[0]);
    return 1;
  }
  char passwd[21];
  strncpy(passwd, argv[1], 20);
  passwd[20] = '\0';
  uint8_t hash[16];
  MD5(passwd, strlen(passwd), (char *)hash);
  printf("Your password '%s' hashes to: uint8_t hash[] = {", passwd);
  for (int i = 0; i < 16; ++i) {
    printf("%d, ", hash[i]);
  }
  printf("\b\b};\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1184 <main+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    121a <main+0xda>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x14,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x1c(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x80(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x80(%rbp),%rdi
mov    %eax,%esi
lea    -0x70(%rbp),%rdx
call   1060 <MD5@plt>
lea    -0x30(%rbp),%rsi
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x74(%rbp)
cmpl   $0x10,-0x74(%rbp)
jge    1205 <main+0xc5>
movslq -0x74(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11d7 <main+0x97>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x58,%rsp
cmp    $0x2,%edi
jne    1296 <main+0x146>
mov    0x8(%rsi),%rsi
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x14,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x54(%rsp)
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1070 <MD5@plt>
lea    0xe7c(%rip),%rdi
xor    %ebp,%ebp
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rsp),%esi
lea    0xe97(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x30(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x34(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x38(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x3c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdb9(%rip),%rdi
call   1040 <puts@plt>
jmp    12ac <main+0x15c>
mov    (%rsi),%rsi
lea    0xd60(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Usage: %s passwd\0A\00"
@.str.1 = [49 x i8] c"Your password '%s' hashes to: uint8_t hash[] = {\00"
@.str.2 = [5 x i8] c"%d, \00"
@.str.3 = [6 x i8] c"\08\08};\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [21 x i8]
%7 = alloca [16 x i32]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 1, i32* %3
br label %45
16: ; preds = %2
%17 = getelementptr inbounds [21 x i8], [21 x i8]* %6, i64 0, i64 0
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @strncpy(i8* %17, i8* %20, i32 20)
%22 = getelementptr inbounds [21 x i8], [21 x i8]* %6, i64 0, i64 20
store i8 0, i8* %22
%23 = getelementptr inbounds [21 x i8], [21 x i8]* %6, i64 0, i64 0
%24 = getelementptr inbounds [21 x i8], [21 x i8]* %6, i64 0, i64 0
%25 = call i32 @strlen(i8* %24)
%26 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
%27 = bitcast i32* %26 to i8*
%28 = call i32 @MD5(i8* %23, i32 %25, i8* %27)
%29 = getelementptr inbounds [21 x i8], [21 x i8]* %6, i64 0, i64 0
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i8* %29)
store i32 0, i32* %8
br label %31
31: ; preds = %40, %16
%32 = load i32, i32* %8
%33 = icmp slt i32 %32, 16
br i1 %33, label %34, label %43
34: ; preds = %31
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %34
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %8
br label %31
43: ; preds = %31
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %45
45: ; preds = %43, %11
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s passwd\0A\00"
@.str.1 = [49 x i8] c"Your password '%s' hashes to: uint8_t hash[] = {\00"
@.str.2 = [5 x i8] c"%d, \00"
@str = [5 x i8] c"\08\08};\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [21 x i8]
%4 = alloca [16 x i32]
%5 = icmp eq i32 %0, 2
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %68
9: ; preds = %2
%10 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strncpy(i8* %10, i8* %12, i32 20)
%14 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 20
store i8 0, i8* %14
%15 = bitcast [16 x i32]* %4 to i8*
%16 = call i32 @strlen(i8* %10)
%17 = call i32 @MD5(i8* %10, i32 %16, i8* %15)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%19 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 1
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 2
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 3
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 4
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 5
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 6
%38 = load i32, i32* %37
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 7
%41 = load i32, i32* %40
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 8
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %44)
%46 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 9
%47 = load i32, i32* %46
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %47)
%49 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 10
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %50)
%52 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 11
%53 = load i32, i32* %52
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %53)
%55 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 12
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %56)
%58 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 13
%59 = load i32, i32* %58
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %59)
%61 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 14
%62 = load i32, i32* %61
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %62)
%64 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 15
%65 = load i32, i32* %64
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %65)
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %68
68: ; preds = %9, %6
%69 = phi i32 [ 1, %6 ], [ 0, %9 ]
ret i32 %69
}