#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 */
struct tm {
  int tm_hour;
  double tm_min;
};

/* Variables and functions */
float Myhour(struct tm *ptr) {
  if (0 < ptr->tm_hour && ptr->tm_hour < 12) {
    return (float)((3.1415926535898 / 2) -
                   ((float)ptr->tm_hour + ptr->tm_min / 60.0) / 12 * 2 *
                       3.1415926535898);
  } else {
    return (float)((3.1415926535898 / 2) -
                   ((ptr->tm_hour - 12.0 + ptr->tm_min / 60.0) / 12) * 2 *
                       3.1415926535898);
  }
}


x86 assembly (clang, -O0):
<Myhour>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    (%rcx),%eax
jge    119d <Myhour+0x9d>
mov    -0x10(%rbp),%rax
cmpl   $0xc,(%rax)
jge    119d <Myhour+0x9d>
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  0xec8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe81(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    121a <Myhour+0x11a>
mov    -0x10(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movsd  0xe6b(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  0xe5e(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  0xe46(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe32(%rip),%xmm1
mulsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xdff(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdfb(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Myhour>:
mov    (%rdi),%eax
lea    -0x1(%rax),%ecx
cmp    $0xa,%ecx
ja     1121 <Myhour+0x21>
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x8(%rdi),%xmm1
divsd  0xee9(%rip),%xmm1
jmp    113a <Myhour+0x3a>
cvtsi2sd %eax,%xmm1
addsd  0xed3(%rip),%xmm1
movsd  0x8(%rdi),%xmm0
divsd  0xece(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xeca(%rip),%xmm0
mulsd  0xeca(%rip),%xmm0
mulsd  0xeca(%rip),%xmm0
addsd  0xeca(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
%struct.tm = type { i32, double }
define float @Myhour(%struct.tm* %0) {
%2 = alloca float
%3 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %3
%4 = load %struct.tm*, %struct.tm** %3
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = icmp slt i32 0, %6
br i1 %7, label %8, label %29
8: ; preds = %1
%9 = load %struct.tm*, %struct.tm** %3
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = icmp slt i32 %11, 12
br i1 %12, label %13, label %29
13: ; preds = %8
%14 = load %struct.tm*, %struct.tm** %3
%15 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = sitofp i32 %16 to float
%18 = fpext float %17 to double
%19 = load %struct.tm*, %struct.tm** %3
%20 = getelementptr inbounds %struct.tm, %struct.tm* %19, i32 0, i32 1
%21 = load double, double* %20
%22 = fdiv double %21, 6.000000e+01
%23 = fadd double %18, %22
%24 = fdiv double %23, 1.200000e+01
%25 = fmul double %24, 2.000000e+00
%26 = fneg double %25
%27 = call double @llvm.fmuladd.f64(double %26, double 0x400921FB54442D28, double 0x3FF921FB54442D28)
%28 = fptrunc double %27 to float
store float %28, float* %2
br label %45
29: ; preds = %8, %1
%30 = load %struct.tm*, %struct.tm** %3
%31 = getelementptr inbounds %struct.tm, %struct.tm* %30, i32 0, i32 0
%32 = load i32, i32* %31
%33 = sitofp i32 %32 to double
%34 = fsub double %33, 1.200000e+01
%35 = load %struct.tm*, %struct.tm** %3
%36 = getelementptr inbounds %struct.tm, %struct.tm* %35, i32 0, i32 1
%37 = load double, double* %36
%38 = fdiv double %37, 6.000000e+01
%39 = fadd double %34, %38
%40 = fdiv double %39, 1.200000e+01
%41 = fmul double %40, 2.000000e+00
%42 = fneg double %41
%43 = call double @llvm.fmuladd.f64(double %42, double 0x400921FB54442D28, double 0x3FF921FB54442D28)
%44 = fptrunc double %43 to float
store float %44, float* %2
br label %45
45: ; preds = %29, %13
%46 = load float, float* %2
ret float %46
}

LLVM IR (-O2):
%struct.tm = type { i32, double }
define float @Myhour(%struct.tm* nocapture %0) {
%2 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = add i32 %3, -1
%5 = icmp ult i32 %4, 11
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = sitofp i32 %3 to float
%8 = fpext float %7 to double
%9 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%10 = load double, double* %9
%11 = fdiv double %10, 6.000000e+01
br label %18
12: ; preds = %1
%13 = sitofp i32 %3 to double
%14 = fadd double %13, -1.200000e+01
%15 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%16 = load double, double* %15
%17 = fdiv double %16, 6.000000e+01
br label %18
18: ; preds = %12, %6
%19 = phi double [ %17, %12 ], [ %8, %6 ]
%20 = phi double [ %14, %12 ], [ %11, %6 ]
%21 = fadd double %20, %19
%22 = fdiv double %21, 1.200000e+01
%23 = fmul double %22, -2.000000e+00
%24 = tail call double @llvm.fmuladd.f64(double %23, double 0x400921FB54442D28, double 0x3FF921FB54442D28)
%25 = fptrunc double %24 to float
ret float %25
}