#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void print_summary(char *input_string, char *rand_string,
                   unsigned char *ori_hash, unsigned char *found_hash,
                   int count) {
  int i;
  fprintf(stdout, "The %d attempts.\n", count);
  fprintf(stdout, "The input string: %s\n", input_string);
  fprintf(stdout, "The random string: %s\n", rand_string);
  fprintf(stdout, "The hash of input string: ");
  for (i = 0; i < 3; i++)
    fprintf(stdout, "%02x", ori_hash[i]);
  fprintf(stdout, "\n");
  fprintf(stdout, "The hash of random string: ");
  for (i = 0; i < 3; i++)
    fprintf(stdout, "%02x", found_hash[i]);
  fprintf(stdout, "\n");
}


x86 assembly (clang, -O0):
<print_summary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    11d5 <print_summary+0xc5>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xe9a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    119a <print_summary+0x8a>
mov    0x2e04(%rip),%rax
mov    (%rax),%edi
lea    0xe2b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ded(%rip),%rax
mov    (%rax),%edi
lea    0xe63(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    1245 <print_summary+0x135>
mov    0x2dc5(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xe2a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    120a <print_summary+0xfa>
mov    0x2d94(%rip),%rax
mov    (%rax),%edi
lea    0xdbb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_summary>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r13
mov    %rsi,%r15
mov    %rdi,%r12
mov    0x2eb4(%rip),%rbx
mov    (%rbx),%edi
lea    0xecb(%rip),%rsi
mov    %r8d,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeca(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xecd(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
movzbl 0x0(%r13),%edx
lea    0xed7(%rip),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
movzbl 0x1(%r13),%edx
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
movzbl 0x2(%r13),%edx
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe58(%rip),%r12
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe94(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
movzbl (%r14),%edx
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
movzbl 0x1(%r14),%edx
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
movzbl 0x2(%r14),%edx
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r12,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [18 x i8] c"The %d attempts.\0A\00"
@.str.1 = [22 x i8] c"The input string: %s\0A\00"
@.str.2 = [23 x i8] c"The random string: %s\0A\00"
@.str.3 = [27 x i8] c"The hash of input string: \00"
@.str.4 = [5 x i8] c"%02x\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [28 x i8] c"The hash of random string: \00"
define void @print_summary(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = load i32, i32* @stdout
%13 = load i32, i32* %10
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32, i32* @stdout
%16 = load i8*, i8** %6
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = load i32, i32* @stdout
%19 = load i8*, i8** %7
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = load i32, i32* @stdout
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %11
br label %23
23: ; preds = %35, %5
%24 = load i32, i32* %11
%25 = icmp slt i32 %24, 3
br i1 %25, label %26, label %38
26: ; preds = %23
%27 = load i32, i32* @stdout
%28 = load i8*, i8** %8
%29 = load i32, i32* %11
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %26
%36 = load i32, i32* %11
%37 = add nsw i32 %36, 1
store i32 %37, i32* %11
br label %23
38: ; preds = %23
%39 = load i32, i32* @stdout
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%41 = load i32, i32* @stdout
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %11
br label %43
43: ; preds = %55, %38
%44 = load i32, i32* %11
%45 = icmp slt i32 %44, 3
br i1 %45, label %46, label %58
46: ; preds = %43
%47 = load i32, i32* @stdout
%48 = load i8*, i8** %9
%49 = load i32, i32* %11
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %48, i64 %50
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %46
%56 = load i32, i32* %11
%57 = add nsw i32 %56, 1
store i32 %57, i32* %11
br label %43
58: ; preds = %43
%59 = load i32, i32* @stdout
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [18 x i8] c"The %d attempts.\0A\00"
@.str.1 = [22 x i8] c"The input string: %s\0A\00"
@.str.2 = [23 x i8] c"The random string: %s\0A\00"
@.str.3 = [27 x i8] c"The hash of input string: \00"
@.str.4 = [5 x i8] c"%02x\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [28 x i8] c"The hash of random string: \00"
define void @print_summary(i8* %0, i8* %1, i8* nocapture %2, i8* nocapture %3, i32 %4) {
%6 = load i32, i32* @stdout
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%8 = load i32, i32* @stdout
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%10 = load i32, i32* @stdout
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%12 = load i32, i32* @stdout
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32, i32* @stdout
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @stdout
%19 = getelementptr inbounds i8, i8* %2, i64 1
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%23 = load i32, i32* @stdout
%24 = getelementptr inbounds i8, i8* %2, i64 2
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %26)
%28 = load i32, i32* @stdout
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%30 = load i32, i32* @stdout
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%32 = load i32, i32* @stdout
%33 = load i8, i8* %3
%34 = zext i8 %33 to i32
%35 = tail call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %34)
%36 = load i32, i32* @stdout
%37 = getelementptr inbounds i8, i8* %3, i64 1
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %39)
%41 = load i32, i32* @stdout
%42 = getelementptr inbounds i8, i8* %3, i64 2
%43 = load i8, i8* %42
%44 = zext i8 %43 to i32
%45 = tail call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %44)
%46 = load i32, i32* @stdout
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret void
}