#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*/ printf(char *, int, int, double);
void phms(double deg) {
  double dh;
  int h, m;
  double s;
  dh = deg / 15;
  h = (int)(dh);
  m = (int)((dh - h) * 60);
  s = ((dh - h) * 3600 - m * 60);
  printf("%.2d %.2d %6.3f", h, m, s);
}


x86 assembly (clang, -O0):
<phms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeb7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
subsd  %xmm1,%xmm0
imul   $0x3c,-0x18(%rbp),%eax
cvtsi2sd %eax,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe6f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phms>:
divsd  0xee8(%rip),%xmm0
cvttsd2si %xmm0,%esi
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  0xed8(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edx
imul   $0x3c,%edx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0xec6(%rip),%xmm0
subsd  %xmm1,%xmm0
lea    0xec3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%.2d %.2d %6.3f\00"
define void @phms(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store double %0, double* %2
%7 = load double, double* %2
%8 = fdiv double %7, 1.500000e+01
store double %8, double* %3
%9 = load double, double* %3
%10 = fptosi double %9 to i32
store i32 %10, i32* %4
%11 = load double, double* %3
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to double
%14 = fsub double %11, %13
%15 = fmul double %14, 6.000000e+01
%16 = fptosi double %15 to i32
store i32 %16, i32* %5
%17 = load double, double* %3
%18 = load i32, i32* %4
%19 = sitofp i32 %18 to double
%20 = fsub double %17, %19
%21 = load i32, i32* %5
%22 = mul nsw i32 %21, 60
%23 = sitofp i32 %22 to double
%24 = fneg double %23
%25 = call double @llvm.fmuladd.f64(double %20, double 3.600000e+03, double %24)
store double %25, double* %6
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = load double, double* %6
%29 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %26, i32 %27, double %28)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%.2d %.2d %6.3f\00"
define void @phms(double %0) {
%2 = fdiv double %0, 1.500000e+01
%3 = fptosi double %2 to i32
%4 = sitofp i32 %3 to double
%5 = fsub double %2, %4
%6 = fmul double %5, 6.000000e+01
%7 = fptosi double %6 to i32
%8 = mul nsw i32 %7, 60
%9 = sitofp i32 %8 to double
%10 = fneg double %9
%11 = tail call double @llvm.fmuladd.f64(double %5, double 3.600000e+03, double %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %7, double %11)
ret void
}