#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(int);
void Phys_SecsToHMS(int t, int *hr, int *min, int *sec) {
  *hr = (int)floor(t / 3600.0);
  *min = (int)floor((t % 3600) / 60.0);
  *sec = (t % 3600) % 60;
  return;
}


x86 assembly (clang, -O0):
<Phys_SecsToHMS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xea0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%rax
mov    %edx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Phys_SecsToHMS>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%ebp
cvtsi2sd %edi,%xmm0
divsd  0xed2(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
mov    %eax,(%rbx)
movslq %ebp,%rbx
imul   $0xffffffff91a2b3c5,%rbx,%rax
shr    $0x20,%rax
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xb,%eax
add    %ecx,%eax
imul   $0xe10,%eax,%eax
sub    %eax,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
divsd  0xe9e(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
mov    %eax,(%r15)
movswl %bx,%eax
imul   $0xffff8889,%eax,%eax
shr    $0x10,%eax
add    %ebx,%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
sar    $0x5,%ecx
add    %eax,%ecx
imul   $0x3c,%ecx,%eax
sub    %eax,%ebx
movswl %bx,%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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