#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 fabs(double);
scalar_t__ my_isnan(double);
int /*<<< orphan*/ printf(char *, double, int, double, int, double, double,
                          ...);
void print_result(double date, double d, double i, double h, double x, double y,
                  double z, double f) {
  int ddeg, ideg;
  double dmin, imin;
  ddeg = (int)d;
  dmin = (d - (double)ddeg) * 60;
  if (d > 0 && dmin >= 59.5) {
    dmin -= 60.0;
    ddeg++;
  }
  if (d < 0 && dmin <= -59.5) {
    dmin += 60.0;
    ddeg--;
  }
  if (ddeg != 0)
    dmin = fabs(dmin);
  ideg = (int)i;
  imin = (i - (double)ideg) * 60;
  if (i > 0 && imin >= 59.5) {
    imin -= 60.0;
    ideg++;
  }
  if (i < 0 && imin <= -59.5) {
    imin += 60.0;
    ideg--;
  }
  if (ideg != 0)
    imin = fabs(imin);
  if (my_isnan(d)) {
    if (my_isnan(x))
      printf("  %4.2f       NaN    %4dd %3.0fm  %8.1f      NaN      NaN %8.1f "
             "%8.1f\n",
             date, ideg, imin, h, z, f);
    else
      printf(
          "  %4.2f       NaN    %4dd %3.0fm  %8.1f %8.1f %8.1f %8.1f %8.1f\n",
          date, ideg, imin, h, x, y, z, f);
  } else
    printf("  %4.2f  %4dd %3.0fm  %4dd %3.0fm  %8.1f %8.1f %8.1f %8.1f %8.1f\n",
           date, ddeg, dmin, ideg, imin, h, x, y, z, f);
  return;
}


x86 assembly (clang, -O0):
<print_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x44(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x44(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe92(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11bf <print_result+0x9f>
movsd  -0x50(%rbp),%xmm0
movsd  0xe72(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11bf <print_result+0x9f>
movsd  -0x50(%rbp),%xmm0
movsd  0xe53(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11fb <print_result+0xdb>
movsd  0xe3b(%rip),%xmm0
ucomisd -0x50(%rbp),%xmm0
jb     11fb <print_result+0xdb>
movsd  0xe18(%rip),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x44(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
je     121a <print_result+0xfa>
movsd  -0x50(%rbp),%xmm0
movaps 0xe0f(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x48(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xdc8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1289 <print_result+0x169>
movsd  -0x58(%rbp),%xmm0
movsd  0xda8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1289 <print_result+0x169>
movsd  -0x58(%rbp),%xmm0
movsd  0xd89(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    12c5 <print_result+0x1a5>
movsd  0xd71(%rip),%xmm0
ucomisd -0x58(%rbp),%xmm0
jb     12c5 <print_result+0x1a5>
movsd  0xd4e(%rip),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x48(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x48(%rbp)
je     12e4 <print_result+0x1c4>
movsd  -0x58(%rbp),%xmm0
movaps 0xd45(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <my_isnan@plt>
cmp    $0x0,%rax
je     1374 <print_result+0x254>
movsd  -0x28(%rbp),%xmm0
call   1040 <my_isnan@plt>
cmp    $0x0,%rax
je     133b <print_result+0x21b>
movsd  -0x8(%rbp),%xmm0
mov    -0x48(%rbp),%esi
movsd  -0x58(%rbp),%xmm1
cvttsd2si -0x20(%rbp),%edx
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
lea    0xd01(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
jmp    136f <print_result+0x24f>
movsd  -0x8(%rbp),%xmm0
mov    -0x48(%rbp),%esi
movsd  -0x58(%rbp),%xmm1
cvttsd2si -0x20(%rbp),%edx
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
movsd  -0x40(%rbp),%xmm5
lea    0xd0f(%rip),%rdi
mov    $0x6,%al
call   1030 <printf@plt>
jmp    13b0 <print_result+0x290>
movsd  -0x8(%rbp),%xmm0
mov    -0x44(%rbp),%esi
movsd  -0x50(%rbp),%xmm1
mov    -0x48(%rbp),%edx
movsd  -0x58(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
movsd  -0x38(%rbp),%xmm6
movsd  -0x40(%rbp),%xmm7
lea    0xd0f(%rip),%rdi
mov    $0x8,%al
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_result>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
movapd %xmm1,%xmm9
xorpd  %xmm8,%xmm8
ucomisd %xmm8,%xmm1
seta   %cl
movapd %xmm2,%xmm10
unpcklpd %xmm1,%xmm10
cvttpd2dq %xmm10,%xmm11
cvtdq2pd %xmm11,%xmm1
subpd  %xmm1,%xmm10
mulpd  0xea4(%rip),%xmm10
movsd  %xmm7,0x10(%rsp)
movsd  %xmm6,0x8(%rsp)
movsd  %xmm5,0x20(%rsp)
movsd  %xmm3,0x28(%rsp)
movsd  %xmm0,(%rsp)
movapd 0xe8f(%rip),%xmm0
cmplepd %xmm10,%xmm0
movmskpd %xmm0,%eax
mov    %eax,%ebp
shr    %bpl
movapd %xmm10,%xmm1
unpckhpd %xmm10,%xmm1
movsd  0xe8e(%rip),%xmm3
and    %cl,%bpl
movsd  %xmm4,0x18(%rsp)
je     11b1 <print_result+0x91>
addsd  %xmm3,%xmm1
ucomisd %xmm9,%xmm8
seta   %cl
movsd  0xe77(%rip),%xmm4
ucomisd %xmm1,%xmm4
setae  %r14b
movsd  0xe6f(%rip),%xmm0
and    %cl,%r14b
je     11da <print_result+0xba>
addsd  %xmm0,%xmm1
ucomisd %xmm8,%xmm2
seta   %cl
and    %al,%cl
movzbl %cl,%eax
movd   %xmm11,%ebx
test   %al,%al
je     11f5 <print_result+0xd5>
addsd  %xmm3,%xmm10
add    %eax,%ebx
ucomisd %xmm2,%xmm8
seta   %al
ucomisd %xmm10,%xmm4
setae  %cl
and    %al,%cl
movzbl %cl,%eax
test   %al,%al
je     1215 <print_result+0xf5>
addsd  %xmm0,%xmm10
sub    %eax,%ebx
movapd %xmm1,0x50(%rsp)
movaps %xmm11,0x40(%rsp)
je     122e <print_result+0x10e>
andpd  0xdf2(%rip),%xmm10
movapd %xmm10,0x30(%rsp)
movapd %xmm9,%xmm0
call   1040 <my_isnan@plt>
test   %rax,%rax
je     128c <print_result+0x16c>
movsd  0x18(%rsp),%xmm0
call   1040 <my_isnan@plt>
cvttsd2si 0x28(%rsp),%edx
test   %rax,%rax
je     12f1 <print_result+0x1d1>
lea    0xde3(%rip),%rdi
movsd  (%rsp),%xmm0
mov    %ebx,%esi
movaps 0x30(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
mov    $0x4,%al
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>
pshufd $0x55,0x40(%rsp),%xmm0
movzbl %bpl,%eax
movd   %xmm0,%esi
add    %eax,%esi
movzbl %r14b,%eax
sub    %eax,%esi
movaps 0x30(%rsp),%xmm2
movsd  0x18(%rsp),%xmm4
movaps 0x50(%rsp),%xmm1
je     12bc <print_result+0x19c>
andps  0xd64(%rip),%xmm1
lea    0xe0d(%rip),%rdi
movsd  (%rsp),%xmm0
mov    %ebx,%edx
movsd  0x28(%rsp),%xmm3
movsd  0x20(%rsp),%xmm5
movsd  0x8(%rsp),%xmm6
movsd  0x10(%rsp),%xmm7
mov    $0x8,%al
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>
lea    0xd97(%rip),%rdi
movsd  (%rsp),%xmm0
mov    %ebx,%esi
movaps 0x30(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
movsd  0x10(%rsp),%xmm5
mov    $0x6,%al
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [71 x i8] c" %4.2f NaN %4dd %3.0fm %8.1f NaN NaN %8.1f %8.1f\0A\00"
@.str.1 = [65 x i8] c" %4.2f NaN %4dd %3.0fm %8.1f %8.1f %8.1f %8.1f %8.1f\0A\00"
@.str.2 = [66 x i8] c" %4.2f %4dd %3.0fm %4dd %3.0fm %8.1f %8.1f %8.1f %8.1f %8.1f\0A\00"
define void @print_result(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca i32
%18 = alloca i32
%19 = alloca double
%20 = alloca double
store double %0, double* %9
store double %1, double* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double %5, double* %14
store double %6, double* %15
store double %7, double* %16
%21 = load double, double* %10
%22 = fptosi double %21 to i32
store i32 %22, i32* %17
%23 = load double, double* %10
%24 = load i32, i32* %17
%25 = sitofp i32 %24 to double
%26 = fsub double %23, %25
%27 = fmul double %26, 6.000000e+01
store double %27, double* %19
%28 = load double, double* %10
%29 = fcmp ogt double %28, 0.000000e+00
br i1 %29, label %30, label %38
30: ; preds = %8
%31 = load double, double* %19
%32 = fcmp oge double %31, 5.950000e+01
br i1 %32, label %33, label %38
33: ; preds = %30
%34 = load double, double* %19
%35 = fsub double %34, 6.000000e+01
store double %35, double* %19
%36 = load i32, i32* %17
%37 = add nsw i32 %36, 1
store i32 %37, i32* %17
br label %38
38: ; preds = %33, %30, %8
%39 = load double, double* %10
%40 = fcmp olt double %39, 0.000000e+00
br i1 %40, label %41, label %49
41: ; preds = %38
%42 = load double, double* %19
%43 = fcmp ole double %42, -5.950000e+01
br i1 %43, label %44, label %49
44: ; preds = %41
%45 = load double, double* %19
%46 = fadd double %45, 6.000000e+01
store double %46, double* %19
%47 = load i32, i32* %17
%48 = add nsw i32 %47, -1
store i32 %48, i32* %17
br label %49
49: ; preds = %44, %41, %38
%50 = load i32, i32* %17
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = load double, double* %19
%54 = call double @llvm.fabs.f64(double %53)
store double %54, double* %19
br label %55
55: ; preds = %52, %49
%56 = load double, double* %11
%57 = fptosi double %56 to i32
store i32 %57, i32* %18
%58 = load double, double* %11
%59 = load i32, i32* %18
%60 = sitofp i32 %59 to double
%61 = fsub double %58, %60
%62 = fmul double %61, 6.000000e+01
store double %62, double* %20
%63 = load double, double* %11
%64 = fcmp ogt double %63, 0.000000e+00
br i1 %64, label %65, label %73
65: ; preds = %55
%66 = load double, double* %20
%67 = fcmp oge double %66, 5.950000e+01
br i1 %67, label %68, label %73
68: ; preds = %65
%69 = load double, double* %20
%70 = fsub double %69, 6.000000e+01
store double %70, double* %20
%71 = load i32, i32* %18
%72 = add nsw i32 %71, 1
store i32 %72, i32* %18
br label %73
73: ; preds = %68, %65, %55
%74 = load double, double* %11
%75 = fcmp olt double %74, 0.000000e+00
br i1 %75, label %76, label %84
76: ; preds = %73
%77 = load double, double* %20
%78 = fcmp ole double %77, -5.950000e+01
br i1 %78, label %79, label %84
79: ; preds = %76
%80 = load double, double* %20
%81 = fadd double %80, 6.000000e+01
store double %81, double* %20
%82 = load i32, i32* %18
%83 = add nsw i32 %82, -1
store i32 %83, i32* %18
br label %84
84: ; preds = %79, %76, %73
%85 = load i32, i32* %18
%86 = icmp ne i32 %85, 0
br i1 %86, label %87, label %90
87: ; preds = %84
%88 = load double, double* %20
%89 = call double @llvm.fabs.f64(double %88)
store double %89, double* %20
br label %90
90: ; preds = %87, %84
%91 = load double, double* %10
%92 = call i64 @my_isnan(double %91)
%93 = icmp ne i64 %92, 0
br i1 %93, label %94, label %119
94: ; preds = %90
%95 = load double, double* %13
%96 = call i64 @my_isnan(double %95)
%97 = icmp ne i64 %96, 0
br i1 %97, label %98, label %107
98: ; preds = %94
%99 = load double, double* %9
%100 = load i32, i32* %18
%101 = load double, double* %20
%102 = load double, double* %12
%103 = fptosi double %102 to i32
%104 = load double, double* %15
%105 = load double, double* %16
%106 = call i32 (i8*, double, i32, double, i32, double, double, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), double %99, i32 %100, double %101, i32 %103, double %104, double %105)
br label %118
107: ; preds = %94
%108 = load double, double* %9
%109 = load i32, i32* %18
%110 = load double, double* %20
%111 = load double, double* %12
%112 = fptosi double %111 to i32
%113 = load double, double* %13
%114 = load double, double* %14
%115 = load double, double* %15
%116 = load double, double* %16
%117 = call i32 (i8*, double, i32, double, i32, double, double, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), double %108, i32 %109, double %110, i32 %112, double %113, double %114, double %115, double %116)
br label %118
118: ; preds = %107, %98
br label %131
119: ; preds = %90
%120 = load double, double* %9
%121 = load i32, i32* %17
%122 = load double, double* %19
%123 = load i32, i32* %18
%124 = load double, double* %20
%125 = load double, double* %12
%126 = load double, double* %13
%127 = load double, double* %14
%128 = load double, double* %15
%129 = load double, double* %16
%130 = call i32 (i8*, double, i32, double, i32, double, double, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0), double %120, i32 %121, double %122, i32 %123, double %124, double %125, double %126, double %127, double %128, double %129)
br label %131
131: ; preds = %119, %118
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c" %4.2f NaN %4dd %3.0fm %8.1f NaN NaN %8.1f %8.1f\0A\00"
@.str.1 = [65 x i8] c" %4.2f NaN %4dd %3.0fm %8.1f %8.1f %8.1f %8.1f %8.1f\0A\00"
@.str.2 = [66 x i8] c" %4.2f %4dd %3.0fm %4dd %3.0fm %8.1f %8.1f %8.1f %8.1f %8.1f\0A\00"
define void @print_result(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = fcmp ogt double %1, 0.000000e+00
%10 = insertelement <2 x double> poison, double %2, i64 0
%11 = insertelement <2 x double> %10, double %1, i64 1
%12 = fptosi <2 x double> %11 to <2 x i32>
%13 = sitofp <2 x i32> %12 to <2 x double>
%14 = fsub <2 x double> %11, %13
%15 = fmul <2 x double> %14, <double 6.000000e+01, double 6.000000e+01>
%16 = fcmp oge <2 x double> %15, <double 5.950000e+01, double 5.950000e+01>
%17 = extractelement <2 x i1> %16, i64 1
%18 = select i1 %9, i1 %17, i1 false
%19 = extractelement <2 x double> %15, i64 1
%20 = fadd double %19, -6.000000e+01
%21 = zext i1 %18 to i32
%22 = extractelement <2 x i32> %12, i64 1
%23 = add nsw i32 %22, %21
%24 = select i1 %18, double %20, double %19
%25 = fcmp olt double %1, 0.000000e+00
%26 = fcmp ole double %24, -5.950000e+01
%27 = select i1 %25, i1 %26, i1 false
%28 = fadd double %24, 6.000000e+01
%29 = sext i1 %27 to i32
%30 = add nsw i32 %23, %29
%31 = select i1 %27, double %28, double %24
%32 = fcmp ogt double %2, 0.000000e+00
%33 = extractelement <2 x i1> %16, i64 0
%34 = select i1 %32, i1 %33, i1 false
%35 = extractelement <2 x double> %15, i64 0
%36 = fadd double %35, -6.000000e+01
%37 = zext i1 %34 to i32
%38 = extractelement <2 x i32> %12, i64 0
%39 = add nsw i32 %38, %37
%40 = select i1 %34, double %36, double %35
%41 = fcmp olt double %2, 0.000000e+00
%42 = fcmp ole double %40, -5.950000e+01
%43 = select i1 %41, i1 %42, i1 false
%44 = fadd double %40, 6.000000e+01
%45 = sext i1 %43 to i32
%46 = add nsw i32 %39, %45
%47 = select i1 %43, double %44, double %40
%48 = icmp eq i32 %46, 0
%49 = tail call double @llvm.fabs.f64(double %47)
%50 = select i1 %48, double %47, double %49
%51 = tail call i64 @my_isnan(double %1)
%52 = icmp eq i64 %51, 0
br i1 %52, label %61, label %53
53: ; preds = %8
%54 = tail call i64 @my_isnan(double %4)
%55 = icmp eq i64 %54, 0
%56 = fptosi double %3 to i32
br i1 %55, label %59, label %57
57: ; preds = %53
%58 = tail call i32 (i8*, double, i32, double, i32, double, double, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), double %0, i32 %46, double %50, i32 %56, double %6, double %7)
br label %66
59: ; preds = %53
%60 = tail call i32 (i8*, double, i32, double, i32, double, double, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), double %0, i32 %46, double %50, i32 %56, double %4, double %5, double %6, double %7)
br label %66
61: ; preds = %8
%62 = icmp eq i32 %30, 0
%63 = tail call double @llvm.fabs.f64(double %31)
%64 = select i1 %62, double %31, double %63
%65 = tail call i32 (i8*, double, i32, double, i32, double, double, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0), double %0, i32 %30, double %64, i32 %46, double %50, double %3, double %4, double %5, double %6, double %7)
br label %66
66: ; preds = %57, %59, %61
ret void
}