#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);
int strlen(char *);
void md5(char *data, int len, char *hash) {
  MD5_CTX c;
  int i, size;
  char *secret = "ge{}cen[]gun!@#komikti", msg[512];
  MD5_Init(&c);
  MD5_Update(&c, secret, strlen(secret));
  MD5_Update(&c, data, len);
  MD5_Final(hash, &c);
}


x86 assembly (clang, -O0):
<md5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xea3(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0x1c(%rbp),%rdi
call   1050 <MD5_Init@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x238(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x238(%rbp),%rsi
mov    %eax,%edx
lea    -0x1c(%rbp),%rdi
call   1060 <MD5_Update@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    -0x1c(%rbp),%rdi
call   1060 <MD5_Update@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <MD5_Final@plt>
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md5>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%r12
lea    0xc(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <MD5_Init@plt>
lea    0xe97(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1060 <MD5_Update@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r15d,%edx
call   1060 <MD5_Update@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1030 <MD5_Final@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"ge{}cen[]gun!@#komikti\00"
define void @md5(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca [512 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %10
%12 = call i32 @MD5_Init(i32* %7)
%13 = load i8*, i8** %10
%14 = load i8*, i8** %10
%15 = call i32 @strlen(i8* %14)
%16 = call i32 @MD5_Update(i32* %7, i8* %13, i32 %15)
%17 = load i8*, i8** %4
%18 = load i32, i32* %5
%19 = call i32 @MD5_Update(i32* %7, i8* %17, i32 %18)
%20 = load i8*, i8** %6
%21 = call i32 @MD5_Final(i8* %20, i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"ge{}cen[]gun!@#komikti\00"
define void @md5(i8* %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @MD5_Init(i32* %4)
%7 = call i32 @strlen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @MD5_Update(i32* %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @MD5_Update(i32* %4, i8* %0, i32 %1)
%10 = call i32 @MD5_Final(i8* %2, i32* %4)
ret void
}