#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 /*<<< orphan*/ printf(char *, unsigned char *, char *);
int /*<<< orphan*/ tm_CryptoHashFile(char *, unsigned char *);
int /*<<< orphan*/ tm_CryptoHashToString(unsigned char *, unsigned char *);
int main(int argc, char **argv) {
  unsigned char digest[20];
  unsigned char hash[41];
  tm_CryptoHashFile(argv[1], digest);
  tm_CryptoHashToString(digest, hash);
  printf("%s  %s\n", hash, argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <tm_CryptoHashFile@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1050 <tm_CryptoHashToString@plt>
lea    -0x60(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1030 <tm_CryptoHashFile@plt>
lea    0x20(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <tm_CryptoHashToString@plt>
mov    0x8(%rbx),%rdx
lea    0xe9a(%rip),%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i8]
%7 = alloca [41 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%12 = call i32 @tm_CryptoHashFile(i8* %10, i8* %11)
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%14 = getelementptr inbounds [41 x i8], [41 x i8]* %7, i64 0, i64 0
%15 = call i32 @tm_CryptoHashToString(i8* %13, i8* %14)
%16 = getelementptr inbounds [41 x i8], [41 x i8]* %7, i64 0, i64 0
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [20 x i8]
%4 = alloca [41 x i8]
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [41 x i8], [41 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @tm_CryptoHashFile(i8* %8, i8* %5)
%10 = call i32 @tm_CryptoHashToString(i8* %5, i8* %6)
%11 = load i8*, i8** %7
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %11)
ret i32 0
}