#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(unsigned char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ MD5_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ MD5_Update(int /*<<< orphan*/ *, void *, int /*<<< orphan*/);
int /*<<< orphan*/ MDPrint(unsigned char *);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char *argv[]) {
  unsigned char md5[16];
  MD5_CTX ctx;
  MD5_Init(&ctx);
  MD5_Update(&ctx, (void *)argv[1], strlen(argv[1]));
  MD5_Final(md5, &ctx);
  MDPrint(md5);
  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)
lea    -0x24(%rbp),%rdi
call   1050 <MD5_Init@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
lea    -0x24(%rbp),%rdi
call   1070 <MD5_Update@plt>
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1030 <MD5_Final@plt>
lea    -0x20(%rbp),%rdi
call   1060 <MDPrint@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1050 <MD5_Init@plt>
mov    0x8(%rbx),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1070 <MD5_Update@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <MD5_Final@plt>
mov    %rbx,%rdi
call   1060 <MDPrint@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @MD5_Init(i32* %7)
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @strlen(i8* %14)
%16 = call i32 @MD5_Update(i32* %7, i8* %11, i32 %15)
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%18 = call i32 @MD5_Final(i8* %17, i32* %7)
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%20 = call i32 @MDPrint(i8* %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [16 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = bitcast i32* %4 to i8*
%7 = call i32 @MD5_Init(i32* %4)
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @MD5_Update(i32* %4, i8* %9, i32 %10)
%12 = call i32 @MD5_Final(i8* %5, i32* %4)
%13 = call i32 @MDPrint(i8* %5)
ret i32 0
}