#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 time_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, float);
int /*<<< orphan*/ stdout;
int time(int /*<<< orphan*/ *);
int report_time(char *message, int start) {
  time_t finish = time(NULL);
  int seconds = finish - start;
  float minutes;
  if (seconds <= 1) {
    return 0;
  }
  if (seconds < 100) {
    fprintf(stdout, "%s: %i seconds\n", message, seconds);
    return seconds;
  }
  minutes = (float)seconds / 60;
  fprintf(stdout, "%s: %.2f minutes\n", message, minutes);
  return seconds;
}


x86 assembly (clang, -O0):
<report_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jg     115a <report_time+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    11c7 <report_time+0xa7>
cmpl   $0x64,-0x1c(%rbp)
jge    118d <report_time+0x6d>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
cvtsi2ssl -0x1c(%rbp),%xmm0
lea    0xe87(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11c7 <report_time+0xa7>
cvtsi2ssl -0x1c(%rbp),%xmm0
movss  0xe66(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
movss  -0x20(%rbp),%xmm0
lea    0xe58(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_time>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r14
xor    %r15d,%r15d
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%ebx
sub    %ebp,%ebx
cmp    $0x2,%ebx
jl     1181 <report_time+0x61>
cmp    $0x63,%ebx
ja     115a <report_time+0x3a>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
cvtsi2ss %ebx,%xmm0
lea    0xeac(%rip),%rsi
jmp    1176 <report_time+0x56>
cvtsi2ss %ebx,%xmm0
divss  0xe9a(%rip),%xmm0
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    %ebx,%r15d
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [16 x i8] c"%s: %i seconds\0A\00"
@.str.1 = [18 x i8] c"%s: %.2f minutes\0A\00"
define i32 @report_time(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
store i8* %0, i8** %4
store i32 %1, i32* %5
%9 = call i32 @time(i32* null)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp sle i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %35
16: ; preds = %2
%17 = load i32, i32* %7
%18 = icmp slt i32 %17, 100
br i1 %18, label %19, label %26
19: ; preds = %16
%20 = load i32, i32* @stdout
%21 = load i8*, i8** %4
%22 = load i32, i32* %7
%23 = sitofp i32 %22 to float
%24 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %21, float %23)
%25 = load i32, i32* %7
store i32 %25, i32* %3
br label %35
26: ; preds = %16
%27 = load i32, i32* %7
%28 = sitofp i32 %27 to float
%29 = fdiv float %28, 6.000000e+01
store float %29, float* %8
%30 = load i32, i32* @stdout
%31 = load i8*, i8** %4
%32 = load float, float* %8
%33 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %31, float %32)
%34 = load i32, i32* %7
store i32 %34, i32* %3
br label %35
35: ; preds = %26, %19, %15
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [16 x i8] c"%s: %i seconds\0A\00"
@.str.1 = [18 x i8] c"%s: %.2f minutes\0A\00"
define i32 @report_time(i8* %0, i32 %1) {
%3 = tail call i32 @time(i32* null)
%4 = sub nsw i32 %3, %1
%5 = icmp slt i32 %4, 2
br i1 %5, label %17, label %6
6: ; preds = %2
%7 = icmp ult i32 %4, 100
br i1 %7, label %8, label %12
8: ; preds = %6
%9 = load i32, i32* @stdout
%10 = sitofp i32 %4 to float
%11 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, float %10)
br label %17
12: ; preds = %6
%13 = sitofp i32 %4 to float
%14 = fdiv float %13, 6.000000e+01
%15 = load i32, i32* @stdout
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0, float %14)
br label %17
17: ; preds = %2, %12, %8
%18 = phi i32 [ %4, %8 ], [ %4, %12 ], [ 0, %2 ]
ret i32 %18
}