#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 */
double modf(double, double *);
int /*<<< orphan*/ secs2hms(long, char *);
int /*<<< orphan*/ sprintf(char *, char *, double);
int /*<<< orphan*/ strcat(char *, char *);
void fsec2hmsf(double seconds, char *outstring) {
  double intpart = 0;
  double floatpart;
  long i;
  char helpstring[250];
  floatpart = modf(seconds, &intpart);
  i = intpart;
  secs2hms(i, outstring);
  sprintf(helpstring, "%.3f", floatpart);
  strcat(outstring, helpstring + 1);
}


x86 assembly (clang, -O0):
<fsec2hmsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
call   1030 <modf@plt>
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <secs2hms@plt>
lea    -0x130(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
lea    0xe67(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x130(%rbp),%rsi
add    $0x1,%rsi
call   1040 <strcat@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsec2hmsf>:
push   %rbx
sub    $0x110,%rsp
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <modf@plt>
movsd  %xmm0,0x8(%rsp)
cvttsd2si (%rsp),%rdi
mov    %rbx,%rsi
call   1060 <secs2hms@plt>
lea    0xe8a(%rip),%rsi
lea    0x10(%rsp),%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <sprintf@plt>
lea    0x11(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.3f\00"
define void @fsec2hmsf(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
%7 = alloca i64
%8 = alloca [250 x i8]
store double %0, double* %3
store i8* %1, i8** %4
store double 0.000000e+00, double* %5
%9 = load double, double* %3
%10 = call double @modf(double %9, double* %5)
store double %10, double* %6
%11 = load double, double* %5
%12 = fptosi double %11 to i64
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i8*, i8** %4
%15 = call i32 @secs2hms(i64 %13, i8* %14)
%16 = getelementptr inbounds [250 x i8], [250 x i8]* %8, i64 0, i64 0
%17 = load double, double* %6
%18 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %17)
%19 = load i8*, i8** %4
%20 = getelementptr inbounds [250 x i8], [250 x i8]* %8, i64 0, i64 0
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = call i32 @strcat(i8* %19, i8* %21)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.3f\00"
define void @fsec2hmsf(double %0, i8* %1) {
%3 = alloca double
%4 = alloca [250 x i8]
%5 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%6 = getelementptr inbounds [250 x i8], [250 x i8]* %4, i64 0, i64 0
%7 = call double @modf(double %0, double* %3)
%8 = load double, double* %3
%9 = fptosi double %8 to i64
%10 = tail call i32 @secs2hms(i64 %9, i8* %1)
%11 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %7)
%12 = getelementptr inbounds [250 x i8], [250 x i8]* %4, i64 0, i64 1
%13 = call i32 @strcat(i8* %1, i8* %12)
ret void
}