#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 */

/* Variables and functions */
int Compute_file_md5(char const *, char *);
int /*<<< orphan*/ printf(char *, char const *);
int main(int argc, char *argv[]) {
  int ret;
  const char *file_path = "md5_file.c";
  char md5_str[(16 * 2) + 1];
  ret = Compute_file_md5(file_path, md5_str);
  if (0 == ret) {
    printf("[file - %s] md5 value:\n", file_path);
    printf("%s\n", md5_str);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <Compute_file_md5@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
jne    117c <main+0x5c>
mov    -0x20(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
call   1030 <Compute_file_md5@plt>
test   %eax,%eax
jne    1159 <main+0x39>
lea    0xecd(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"md5_file.c\00"
@.str.1 = [24 x i8] c"[file - %s] md5 value:\0A\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca [33 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %7
%9 = load i8*, i8** %7
%10 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%11 = call i32 @Compute_file_md5(i8* %9, i8* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp eq i32 0, %12
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i8*, i8** %7
%16 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [33 x i8], [33 x i8]* %8, i64 0, i64 0
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %14, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"md5_file.c\00"
@.str.1 = [24 x i8] c"[file - %s] md5 value:\0A\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [33 x i8]
%4 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%5 = call i32 @Compute_file_md5(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %4)
br label %10
10: ; preds = %7, %2
ret i32 0
}