#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 /*<<< orphan*/ MD5_CTX;

/* Variables and functions */
int /*<<< orphan*/ MD5_Final(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ MD5_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ MD5_Update(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char *argv[]) {
  MD5_CTX prog_md5;
  MD5_CTX prog2_md5;
  char prog_hash[17] = {0};
  char prog_hash2[17] = {0};
  int i;
  if (argc != 3) {
    printf("Usage:\n\t%s <prog> <prog2>\n", argv[0]);
    return 1;
  }
  MD5_Init(&prog_md5);
  MD5_Update(&prog_md5, argv[1], strlen(argv[1]));
  MD5_Final(prog_hash, &prog_md5);
  MD5_Init(&prog2_md5);
  MD5_Update(&prog2_md5, argv[2], strlen(argv[2]));
  MD5_Final(prog_hash2, &prog2_md5);
  for (i = 0; i < 16; ++i) {
    if (prog_hash[i] != prog_hash2[i]) {
      printf("Two values are not the same.\n%s: %s\n%s: %s\n", argv[1],
             prog_hash, argv[2], prog_hash2);
      return 1;
    }
  }
  printf("Two values are the same: %s: %s\n", argv[1], prog_hash);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x11,%edx
call   1060 <memset@plt>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x11,%edx
call   1060 <memset@plt>
cmpl   $0x3,-0x8(%rbp)
je     11c1 <main+0x61>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12ce <main+0x16e>
lea    -0x14(%rbp),%rdi
call   1070 <MD5_Init@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x68(%rbp),%rsi
mov    %eax,%edx
lea    -0x14(%rbp),%rdi
call   1080 <MD5_Update@plt>
lea    -0x30(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <MD5_Final@plt>
lea    -0x18(%rbp),%rdi
call   1070 <MD5_Init@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x60(%rbp),%rsi
mov    %eax,%edx
lea    -0x18(%rbp),%rdi
call   1080 <MD5_Update@plt>
lea    -0x50(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <MD5_Final@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x10,-0x54(%rbp)
jge    12ad <main+0x14d>
movslq -0x54(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%eax
movslq -0x54(%rbp),%rcx
movsbl -0x50(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     129a <main+0x13a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x30(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    -0x50(%rbp),%r8
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12ce <main+0x16e>
jmp    129f <main+0x13f>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1244 <main+0xe4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x30(%rbp),%rdx
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movb   $0x0,0x30(%rsp)
cmp    $0x3,%edi
jne    12b3 <main+0x163>
lea    0x3c(%rsp),%r15
mov    %r15,%rdi
call   1060 <MD5_Init@plt>
mov    0x8(%r14),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1070 <MD5_Update@plt>
mov    %rsp,%rdi
mov    %r15,%rsi
call   1030 <MD5_Final@plt>
lea    0x38(%rsp),%r15
mov    %r15,%rdi
call   1060 <MD5_Init@plt>
mov    0x10(%r14),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1070 <MD5_Update@plt>
lea    0x20(%rsp),%rdi
mov    %r15,%rsi
call   1030 <MD5_Final@plt>
mov    (%rsp),%al
cmp    0x20(%rsp),%al
jne    12c6 <main+0x176>
mov    0x1(%rsp),%al
cmp    0x21(%rsp),%al
jne    12c6 <main+0x176>
mov    0x2(%rsp),%al
cmp    0x22(%rsp),%al
jne    12c6 <main+0x176>
mov    0x3(%rsp),%al
cmp    0x23(%rsp),%al
jne    12c6 <main+0x176>
mov    0x4(%rsp),%al
cmp    0x24(%rsp),%al
jne    12c6 <main+0x176>
mov    0x5(%rsp),%al
cmp    0x25(%rsp),%al
jne    12c6 <main+0x176>
mov    0x6(%rsp),%al
cmp    0x26(%rsp),%al
jne    12c6 <main+0x176>
mov    0x7(%rsp),%al
cmp    0x27(%rsp),%al
jne    12c6 <main+0x176>
mov    0x8(%rsp),%al
cmp    0x28(%rsp),%al
jne    12c6 <main+0x176>
mov    0x9(%rsp),%al
cmp    0x29(%rsp),%al
jne    12c6 <main+0x176>
mov    0xa(%rsp),%al
cmp    0x2a(%rsp),%al
jne    12c6 <main+0x176>
mov    0xb(%rsp),%al
cmp    0x2b(%rsp),%al
jne    12c6 <main+0x176>
mov    0xc(%rsp),%al
cmp    0x2c(%rsp),%al
jne    12c6 <main+0x176>
mov    0xd(%rsp),%al
cmp    0x2d(%rsp),%al
jne    12c6 <main+0x176>
mov    0xe(%rsp),%al
cmp    0x2e(%rsp),%al
jne    12c6 <main+0x176>
mov    0xf(%rsp),%al
cmp    0x2f(%rsp),%al
jne    12c6 <main+0x176>
mov    0x8(%r14),%rsi
lea    0xda2(%rip),%rdi
xor    %ebx,%ebx
mov    %rsp,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    12e9 <main+0x199>
mov    (%r14),%rsi
lea    0xd43(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    12e4 <main+0x194>
mov    0x8(%r14),%rsi
mov    0x10(%r14),%rcx
lea    0xd46(%rip),%rdi
mov    %rsp,%rdx
lea    0x20(%rsp),%r8
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Usage:\0A\09%s <prog> <prog2>\0A\00"
@.str.1 = [44 x i8] c"Two values are not the same.\0A%s: %s\0A%s: %s\0A\00"
@.str.2 = [33 x i8] c"Two values are the same: %s: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [17 x i8]
%9 = alloca [17 x i8]
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = bitcast [17 x i8]* %8 to i8*
%12 = bitcast [17 x i8]* %9 to i8*
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %20
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %18)
store i32 1, i32* %3
br label %78
20: ; preds = %2
%21 = call i32 @MD5_Init(i32* %6)
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @strlen(i8* %27)
%29 = call i32 @MD5_Update(i32* %6, i8* %24, i32 %28)
%30 = getelementptr inbounds [17 x i8], [17 x i8]* %8, i64 0, i64 0
%31 = call i32 @MD5_Final(i8* %30, i32* %6)
%32 = call i32 @MD5_Init(i32* %7)
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 2
%38 = load i8*, i8** %37
%39 = call i32 @strlen(i8* %38)
%40 = call i32 @MD5_Update(i32* %7, i8* %35, i32 %39)
%41 = getelementptr inbounds [17 x i8], [17 x i8]* %9, i64 0, i64 0
%42 = call i32 @MD5_Final(i8* %41, i32* %7)
store i32 0, i32* %10
br label %43
43: ; preds = %69, %20
%44 = load i32, i32* %10
%45 = icmp slt i32 %44, 16
br i1 %45, label %46, label %72
46: ; preds = %43
%47 = load i32, i32* %10
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [17 x i8], [17 x i8]* %8, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = load i32, i32* %10
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [17 x i8], [17 x i8]* %9, i64 0, i64 %53
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp ne i32 %51, %56
br i1 %57, label %58, label %68
58: ; preds = %46
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 1
%61 = load i8*, i8** %60
%62 = getelementptr inbounds [17 x i8], [17 x i8]* %8, i64 0, i64 0
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 2
%65 = load i8*, i8** %64
%66 = getelementptr inbounds [17 x i8], [17 x i8]* %9, i64 0, i64 0
%67 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %61, i8* %62, i8* %65, i8* %66)
store i32 1, i32* %3
br label %78
68: ; preds = %46
br label %69
69: ; preds = %68
%70 = load i32, i32* %10
%71 = add nsw i32 %70, 1
store i32 %71, i32* %10
br label %43
72: ; preds = %43
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 1
%75 = load i8*, i8** %74
%76 = getelementptr inbounds [17 x i8], [17 x i8]* %8, i64 0, i64 0
%77 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %75, i8* %76)
store i32 0, i32* %3
br label %78
78: ; preds = %72, %58, %15
%79 = load i32, i32* %3
ret i32 %79
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage:\0A\09%s <prog> <prog2>\0A\00"
@.str.1 = [44 x i8] c"Two values are not the same.\0A%s: %s\0A%s: %s\0A\00"
@.str.2 = [33 x i8] c"Two values are the same: %s: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [17 x i8]
%6 = alloca [17 x i8]
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 0
%11 = icmp eq i32 %0, 3
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i8*, i8** %1
%14 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %128
15: ; preds = %2
%16 = call i32 @MD5_Init(i32* %3)
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @strlen(i8* %18)
%20 = call i32 @MD5_Update(i32* %3, i8* %18, i32 %19)
%21 = call i32 @MD5_Final(i8* %9, i32* %3)
%22 = call i32 @MD5_Init(i32* %4)
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @strlen(i8* %24)
%26 = call i32 @MD5_Update(i32* %4, i8* %24, i32 %25)
%27 = call i32 @MD5_Final(i8* %10, i32* %4)
%28 = load i8, i8* %9
%29 = load i8, i8* %10
%30 = icmp eq i8 %28, %29
br i1 %30, label %31, label %124
31: ; preds = %15
%32 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 1
%33 = load i8, i8* %32
%34 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 1
%35 = load i8, i8* %34
%36 = icmp eq i8 %33, %35
br i1 %36, label %37, label %124
37: ; preds = %31
%38 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 2
%39 = load i8, i8* %38
%40 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 2
%41 = load i8, i8* %40
%42 = icmp eq i8 %39, %41
br i1 %42, label %43, label %124
43: ; preds = %37
%44 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 3
%45 = load i8, i8* %44
%46 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 3
%47 = load i8, i8* %46
%48 = icmp eq i8 %45, %47
br i1 %48, label %49, label %124
49: ; preds = %43
%50 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 4
%51 = load i8, i8* %50
%52 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 4
%53 = load i8, i8* %52
%54 = icmp eq i8 %51, %53
br i1 %54, label %55, label %124
55: ; preds = %49
%56 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 5
%57 = load i8, i8* %56
%58 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 5
%59 = load i8, i8* %58
%60 = icmp eq i8 %57, %59
br i1 %60, label %61, label %124
61: ; preds = %55
%62 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 6
%63 = load i8, i8* %62
%64 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 6
%65 = load i8, i8* %64
%66 = icmp eq i8 %63, %65
br i1 %66, label %67, label %124
67: ; preds = %61
%68 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 7
%69 = load i8, i8* %68
%70 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 7
%71 = load i8, i8* %70
%72 = icmp eq i8 %69, %71
br i1 %72, label %73, label %124
73: ; preds = %67
%74 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 8
%75 = load i8, i8* %74
%76 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 8
%77 = load i8, i8* %76
%78 = icmp eq i8 %75, %77
br i1 %78, label %79, label %124
79: ; preds = %73
%80 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 9
%81 = load i8, i8* %80
%82 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 9
%83 = load i8, i8* %82
%84 = icmp eq i8 %81, %83
br i1 %84, label %85, label %124
85: ; preds = %79
%86 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 10
%87 = load i8, i8* %86
%88 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 10
%89 = load i8, i8* %88
%90 = icmp eq i8 %87, %89
br i1 %90, label %91, label %124
91: ; preds = %85
%92 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 11
%93 = load i8, i8* %92
%94 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 11
%95 = load i8, i8* %94
%96 = icmp eq i8 %93, %95
br i1 %96, label %97, label %124
97: ; preds = %91
%98 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 12
%99 = load i8, i8* %98
%100 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 12
%101 = load i8, i8* %100
%102 = icmp eq i8 %99, %101
br i1 %102, label %103, label %124
103: ; preds = %97
%104 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 13
%105 = load i8, i8* %104
%106 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 13
%107 = load i8, i8* %106
%108 = icmp eq i8 %105, %107
br i1 %108, label %109, label %124
109: ; preds = %103
%110 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 14
%111 = load i8, i8* %110
%112 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 14
%113 = load i8, i8* %112
%114 = icmp eq i8 %111, %113
br i1 %114, label %115, label %124
115: ; preds = %109
%116 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 15
%117 = load i8, i8* %116
%118 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 15
%119 = load i8, i8* %118
%120 = icmp eq i8 %117, %119
br i1 %120, label %121, label %124
121: ; preds = %115
%122 = load i8*, i8** %17
%123 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %122, i8* %9)
br label %128
124: ; preds = %115, %109, %103, %97, %91, %85, %79, %73, %67, %61, %55, %49, %43, %37, %31, %15
%125 = load i8*, i8** %17
%126 = load i8*, i8** %23
%127 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %125, i8* %9, i8* %126, i8* %10)
br label %128
128: ; preds = %121, %124, %12
%129 = phi i32 [ 1, %12 ], [ 1, %124 ], [ 0, %121 ]
ret i32 %129
}