#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*/ sprintf(char *, char *, int, int, int, int);
char *TotalExecutionTime(double dt) {
  static char c[128];
  int days, hours, mins, secs;
  days = (int)(dt / 86400.0);
  hours = (int)((dt - 86400.0 * days) / 3600.0);
  mins = (int)((dt - 86400.0 * days - 3600.0 * hours) / 60.);
  secs = (int)(dt - 86400.0 * days - 3600.0 * hours - 60.0 * mins);
  sprintf(c, " %dd:%dh:%dm:%ds", days, hours, mins, secs);
  return (c);
}


x86 assembly (clang, -O0):
<TotalExecutionTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefe(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe9c(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xe7f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe7f(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe5a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xe3d(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xe20(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
lea    0x2e3c(%rip),%rdi
lea    0xe25(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2e29(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TotalExecutionTime>:
push   %rbx
movapd %xmm0,%xmm1
divsd  0xee3(%rip),%xmm1
cvttsd2si %xmm1,%edx
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm1
mulsd  0xed7(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
divsd  0xecf(%rip),%xmm0
cvttsd2si %xmm0,%ecx
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
mulsd  0xec3(%rip),%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
divsd  0xebb(%rip),%xmm1
cvttsd2si %xmm1,%r8d
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm1
mulsd  0xeae(%rip),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%r9d
lea    0x2eb6(%rip),%rbx
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@TotalExecutionTime.c = internal global [128 x i8] zeroinitializer
@.str = [17 x i8] c" %dd:%dh:%dm:%ds\00"
define i8* @TotalExecutionTime(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store double %0, double* %2
%7 = load double, double* %2
%8 = fdiv double %7, 8.640000e+04
%9 = fptosi double %8 to i32
store i32 %9, i32* %3
%10 = load double, double* %2
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = call double @llvm.fmuladd.f64(double -8.640000e+04, double %12, double %10)
%14 = fdiv double %13, 3.600000e+03
%15 = fptosi double %14 to i32
store i32 %15, i32* %4
%16 = load double, double* %2
%17 = load i32, i32* %3
%18 = sitofp i32 %17 to double
%19 = call double @llvm.fmuladd.f64(double -8.640000e+04, double %18, double %16)
%20 = load i32, i32* %4
%21 = sitofp i32 %20 to double
%22 = call double @llvm.fmuladd.f64(double -3.600000e+03, double %21, double %19)
%23 = fdiv double %22, 6.000000e+01
%24 = fptosi double %23 to i32
store i32 %24, i32* %5
%25 = load double, double* %2
%26 = load i32, i32* %3
%27 = sitofp i32 %26 to double
%28 = call double @llvm.fmuladd.f64(double -8.640000e+04, double %27, double %25)
%29 = load i32, i32* %4
%30 = sitofp i32 %29 to double
%31 = call double @llvm.fmuladd.f64(double -3.600000e+03, double %30, double %28)
%32 = load i32, i32* %5
%33 = sitofp i32 %32 to double
%34 = call double @llvm.fmuladd.f64(double -6.000000e+01, double %33, double %31)
%35 = fptosi double %34 to i32
store i32 %35, i32* %6
%36 = load i32, i32* %3
%37 = load i32, i32* %4
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @TotalExecutionTime.c, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %36, i32 %37, i32 %38, i32 %39)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @TotalExecutionTime.c, i64 0, i64 0)
}

LLVM IR (-O2):
@TotalExecutionTime.c = internal global [128 x i8] zeroinitializer
@.str = [17 x i8] c" %dd:%dh:%dm:%ds\00"
define i8* @TotalExecutionTime(double %0) {
%2 = fdiv double %0, 8.640000e+04
%3 = fptosi double %2 to i32
%4 = sitofp i32 %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double -8.640000e+04, double %0)
%6 = fdiv double %5, 3.600000e+03
%7 = fptosi double %6 to i32
%8 = sitofp i32 %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double -3.600000e+03, double %5)
%10 = fdiv double %9, 6.000000e+01
%11 = fptosi double %10 to i32
%12 = sitofp i32 %11 to double
%13 = tail call double @llvm.fmuladd.f64(double %12, double -6.000000e+01, double %9)
%14 = fptosi double %13 to i32
%15 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @TotalExecutionTime.c, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %7, i32 %11, i32 %14)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @TotalExecutionTime.c, i64 0, i64 0)
}