#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);
void UTL_ConvertFloattoTime(double dt, char *time) {
  int hour, minute, second, fracsec;
  hour = (int)(dt / 3600.0);
  dt -= (hour * 3600);
  minute = (int)(dt / 60.);
  dt -= (minute * 60);
  second = (int)dt;
  dt -= second;
  fracsec = (int)((dt * 1000000) + 0.5);
  sprintf(time, "%02d%02d%02d.%06d", hour, minute, second, fracsec);
  return;
}


x86 assembly (clang, -O0):
<UTL_ConvertFloattoTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
imul   $0xe10,-0x14(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
imul   $0x3c,-0x18(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe58(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe54(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
lea    0xe48(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTL_ConvertFloattoTime>:
movapd %xmm0,%xmm1
divsd  0xee4(%rip),%xmm1
cvttsd2si %xmm1,%edx
imul   $0xe10,%edx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
divsd  0xecb(%rip),%xmm1
cvttsd2si %xmm1,%ecx
imul   $0x3c,%ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r8d
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xea8(%rip),%xmm0
addsd  0xea8(%rip),%xmm0
cvttsd2si %xmm0,%r9d
lea    0xea4(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%02d%02d%02d.%06d\00"
define void @UTL_ConvertFloattoTime(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store double %0, double* %3
store i8* %1, i8** %4
%9 = load double, double* %3
%10 = fdiv double %9, 3.600000e+03
%11 = fptosi double %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 3600
%14 = sitofp i32 %13 to double
%15 = load double, double* %3
%16 = fsub double %15, %14
store double %16, double* %3
%17 = load double, double* %3
%18 = fdiv double %17, 6.000000e+01
%19 = fptosi double %18 to i32
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = mul nsw i32 %20, 60
%22 = sitofp i32 %21 to double
%23 = load double, double* %3
%24 = fsub double %23, %22
store double %24, double* %3
%25 = load double, double* %3
%26 = fptosi double %25 to i32
store i32 %26, i32* %7
%27 = load i32, i32* %7
%28 = sitofp i32 %27 to double
%29 = load double, double* %3
%30 = fsub double %29, %28
store double %30, double* %3
%31 = load double, double* %3
%32 = call double @llvm.fmuladd.f64(double %31, double 1.000000e+06, double 5.000000e-01)
%33 = fptosi double %32 to i32
store i32 %33, i32* %8
%34 = load i8*, i8** %4
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = load i32, i32* %7
%38 = load i32, i32* %8
%39 = call i32 @sprintf(i8* %34, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %35, i32 %36, i32 %37, i32 %38)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%02d%02d%02d.%06d\00"
define void @UTL_ConvertFloattoTime(double %0, i8* nocapture writeonly %1) {
%3 = fdiv double %0, 3.600000e+03
%4 = fptosi double %3 to i32
%5 = mul nsw i32 %4, 3600
%6 = sitofp i32 %5 to double
%7 = fsub double %0, %6
%8 = fdiv double %7, 6.000000e+01
%9 = fptosi double %8 to i32
%10 = mul nsw i32 %9, 60
%11 = sitofp i32 %10 to double
%12 = fsub double %7, %11
%13 = fptosi double %12 to i32
%14 = sitofp i32 %13 to double
%15 = fsub double %12, %14
%16 = tail call double @llvm.fmuladd.f64(double %15, double 1.000000e+06, double 5.000000e-01)
%17 = fptosi double %16 to i32
%18 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %9, i32 %13, i32 %17)
ret void
}