#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 floor(float);
int /*<<< orphan*/ printf(char *, int, int, int, int);
void print_log_time(float value) {
  int hours = floor(value / 3600);
  value -= hours * 3600;
  int minutes = floor(value / 60);
  value -= minutes * 60;
  int seconds = floor(value);
  value -= seconds;
  int miliseconds = floor(value * 1000);
  printf("%02d:%02d:%02d,%03d", hours, minutes, seconds, miliseconds);
}


x86 assembly (clang, -O0):
<print_log_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xece(%rip),%xmm1
divss  %xmm1,%xmm0
call   1040 <floor@plt>
mov    %eax,-0x8(%rbp)
imul   $0xe10,-0x8(%rbp),%eax
cvtsi2ss %eax,%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xe98(%rip),%xmm1
divss  %xmm1,%xmm0
call   1040 <floor@plt>
mov    %eax,-0xc(%rbp)
imul   $0x3c,-0xc(%rbp),%eax
cvtsi2ss %eax,%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <floor@plt>
mov    %eax,-0x10(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xe4a(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1040 <floor@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_log_time>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
divss  0xeca(%rip),%xmm0
call   1040 <floor@plt>
mov    %eax,%r14d
imul   $0xe10,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
movaps %xmm1,%xmm0
divss  0xe9e(%rip),%xmm0
call   1040 <floor@plt>
mov    %eax,%ebp
imul   $0x3c,%eax,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movss  0xc(%rsp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
call   1040 <floor@plt>
mov    %eax,%ebx
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
mulss  0xe61(%rip),%xmm1
movaps %xmm1,%xmm0
call   1040 <floor@plt>
lea    0xe56(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"%02d:%02d:%02d,%03d\00"
define void @print_log_time(float %0) {
%2 = fdiv float %0, 3.600000e+03
%3 = tail call i32 @floor(float %2)
%4 = mul nsw i32 %3, 3600
%5 = sitofp i32 %4 to float
%6 = fsub float %0, %5
%7 = fdiv float %6, 6.000000e+01
%8 = tail call i32 @floor(float %7)
%9 = mul nsw i32 %8, 60
%10 = sitofp i32 %9 to float
%11 = fsub float %6, %10
%12 = tail call i32 @floor(float %11)
%13 = sitofp i32 %12 to float
%14 = fsub float %11, %13
%15 = fmul float %14, 1.000000e+03
%16 = tail call i32 @floor(float %15)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %8, i32 %12, i32 %16)
ret void
}