#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*/ exit(int);
int /*<<< orphan*/ generate_key_file(long);
int /*<<< orphan*/ generate_report(long, int, float);
int /*<<< orphan*/ printf(char *);
void print_result(long success_key, int encryption_method, float time_spent) {
  printf("done...");
  if (success_key != -1) {
    printf("success\n");
    generate_key_file(success_key);
    generate_report(success_key, encryption_method, time_spent);
  } else {
    printf("not found\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<print_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
cmpq   $0xffffffffffffffff,-0x8(%rbp)
je     1196 <print_result+0x56>
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <generate_key_file@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movss  -0x10(%rbp),%xmm0
call   1050 <generate_report@plt>
jmp    11ac <print_result+0x6c>
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_result>:
push   %rbp
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xe9b(%rip),%rdi
call   1050 <printf@plt>
cmp    $0xffffffffffffffff,%rbx
je     119a <print_result+0x4a>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <generate_key_file@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
movss  0x4(%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <generate_report@plt>
lea    0xe67(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"done...\00"
@.str.1 = [9 x i8] c"success\0A\00"
@.str.2 = [11 x i8] c"not found\0A\00"
define void @print_result(i64 %0, i32 %1, float %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca float
store i64 %0, i64* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = load i64, i64* %4
%9 = icmp ne i64 %8, -1
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = load i64, i64* %4
%13 = call i32 @generate_key_file(i64 %12)
%14 = load i64, i64* %4
%15 = load i32, i32* %5
%16 = load float, float* %6
%17 = call i32 @generate_report(i64 %14, i32 %15, float %16)
br label %21
18: ; preds = %3
%19 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @exit(i32 -1)
unreachable
21: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"done...\00"
@str = [10 x i8] c"not found\00"
@str.3 = [8 x i8] c"success\00"
define void @print_result(i64 %0, i32 %1, float %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %0, -1
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.3, i64 0, i64 0))
%8 = tail call i32 @generate_key_file(i64 %0)
%9 = tail call i32 @generate_report(i64 %0, i32 %1, float %2)
ret void
10: ; preds = %3
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 -1)
unreachable
}