#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 */
scalar_t__ floor(float const);
void convertTimestamp2HourMinSec(const float timestamp, int *hour, int *min,
                                 float *sec) {
  *hour = (int)floor(timestamp / 3600);
  float temp = timestamp - (*hour) * 3600;
  *min = (int)floor(temp / 60);
  *sec = temp - (*min) * 60;
}


x86 assembly (clang, -O0):
<convertTimestamp2HourMinSec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xece(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <floor@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
imul   $0xe10,(%rax),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
movss  0xe90(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <floor@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movss  -0x24(%rbp),%xmm0
mov    -0x18(%rbp),%rax
imul   $0x3c,(%rax),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertTimestamp2HourMinSec>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movss  %xmm0,0xc(%rsp)
divss  0xed0(%rip),%xmm0
call   1030 <floor@plt>
imul   $0xe10,%eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
mov    %eax,(%rbx)
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
movaps %xmm1,%xmm0
divss  0xea5(%rip),%xmm0
call   1030 <floor@plt>
imul   $0x3c,%eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
mov    %eax,(%r15)
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @convertTimestamp2HourMinSec(float %0, i32* %1, i32* %2, float* %3) {
%5 = alloca float
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca float*
%9 = alloca float
store float %0, float* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store float* %3, float** %8
%10 = load float, float* %5
%11 = fdiv float %10, 3.600000e+03
%12 = call i64 @floor(float %11)
%13 = trunc i64 %12 to i32
%14 = load i32*, i32** %6
store i32 %13, i32* %14
%15 = load float, float* %5
%16 = load i32*, i32** %6
%17 = load i32, i32* %16
%18 = mul nsw i32 %17, 3600
%19 = sitofp i32 %18 to float
%20 = fsub float %15, %19
store float %20, float* %9
%21 = load float, float* %9
%22 = fdiv float %21, 6.000000e+01
%23 = call i64 @floor(float %22)
%24 = trunc i64 %23 to i32
%25 = load i32*, i32** %7
store i32 %24, i32* %25
%26 = load float, float* %9
%27 = load i32*, i32** %7
%28 = load i32, i32* %27
%29 = mul nsw i32 %28, 60
%30 = sitofp i32 %29 to float
%31 = fsub float %26, %30
%32 = load float*, float** %8
store float %31, float* %32
ret void
}

LLVM IR (-O2):
define void @convertTimestamp2HourMinSec(float %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, float* nocapture writeonly %3) {
%5 = fdiv float %0, 3.600000e+03
%6 = tail call i64 @floor(float %5)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
%8 = mul nsw i32 %7, 3600
%9 = sitofp i32 %8 to float
%10 = fsub float %0, %9
%11 = fdiv float %10, 6.000000e+01
%12 = tail call i64 @floor(float %11)
%13 = trunc i64 %12 to i32
store i32 %13, i32* %2
%14 = mul nsw i32 %13, 60
%15 = sitofp i32 %14 to float
%16 = fsub float %10, %15
store float %16, float* %3
ret void
}