#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, ...);
void print_PA(double ang) {
  int d, m;
  printf("PA: %g degr == ", ang);
  d = (int)ang;
  ang = (ang - d) * 60.;
  m = (int)ang;
  ang = (ang - m) * 60.;
  printf("%02d:%02d:%02.1f\n", d, m, ang);
}


x86 assembly (clang, -O0):
<print_PA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%esi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeb2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe8b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x8(%rbp),%xmm0
lea    0xe88(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_PA>:
push   %rbx
sub    $0x10,%rsp
movapd %xmm0,(%rsp)
cvttsd2si %xmm0,%ebx
lea    0xee3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movapd (%rsp),%xmm2
cvttpd2dq %xmm2,%xmm0
cvtdq2pd %xmm0,%xmm0
subsd  %xmm0,%xmm2
movsd  0xeb9(%rip),%xmm0
mulsd  %xmm0,%xmm2
cvttsd2si %xmm2,%edx
cvttpd2dq %xmm2,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
lea    0xeae(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%al
add    $0x10,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"PA: %g degr == \00"
@.str.1 = [18 x i8] c"%02d:%02d:%02.1f\0A\00"
define void @print_PA(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
store double %0, double* %2
%5 = load double, double* %2
%6 = fptosi double %5 to i32
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load double, double* %2
%9 = fptosi double %8 to i32
store i32 %9, i32* %3
%10 = load double, double* %2
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = fsub double %10, %12
%14 = fmul double %13, 6.000000e+01
store double %14, double* %2
%15 = load double, double* %2
%16 = fptosi double %15 to i32
store i32 %16, i32* %4
%17 = load double, double* %2
%18 = load i32, i32* %4
%19 = sitofp i32 %18 to double
%20 = fsub double %17, %19
%21 = fmul double %20, 6.000000e+01
store double %21, double* %2
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = load double, double* %2
%25 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %23, double %24)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"PA: %g degr == \00"
@.str.1 = [18 x i8] c"%02d:%02d:%02.1f\0A\00"
define void @print_PA(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = sitofp i32 %2 to double
%5 = fsub double %0, %4
%6 = fmul double %5, 6.000000e+01
%7 = fptosi double %6 to i32
%8 = sitofp i32 %7 to double
%9 = fsub double %6, %8
%10 = fmul double %9, 6.000000e+01
%11 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %7, double %10)
ret void
}