#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(int *, int /*<<< orphan*/, int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ strlen(char *);
int main() {
  uint8_t buf[16];
  int i;
  md5((uint8_t *)"hello", strlen("hello"), buf);
  for (i = 0; i < 16; i++) {
    printf("%x", buf[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    -0x50(%rbp),%rdx
lea    0xea8(%rip),%rdi
call   1050 <md5@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x10,-0x54(%rbp)
jge    1190 <main+0x60>
movslq -0x54(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1164 <main+0x34>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <md5@plt>
mov    (%rsp),%esi
lea    0xeab(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x2c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x30(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x34(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x38(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x3c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [3 x i8] c"%x\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%6 = call i32 @md5(i32* bitcast ([6 x i8]* @.str to i32*), i32 %4, i32* %5)
store i32 0, i32* %3
br label %7
7: ; preds = %16, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 16
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %7
19: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [3 x i8] c"%x\00"
define i32 @main() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%5 = call i32 @md5(i32* bitcast ([6 x i8]* @.str to i32*), i32 %3, i32* %4)
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 2
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 3
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 4
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 5
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 6
%24 = load i32, i32* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 7
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 8
%30 = load i32, i32* %29
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 9
%33 = load i32, i32* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 10
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 11
%39 = load i32, i32* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 12
%42 = load i32, i32* %41
%43 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 13
%45 = load i32, i32* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 14
%48 = load i32, i32* %47
%49 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %48)
%50 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 15
%51 = load i32, i32* %50
%52 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %51)
ret i32 0
}