program main
real*8 :: a,b,h,m,pi,om1,om2,x1,y1,x2,y2,t,ans
read(*,*) a,b,h,m

pi = 3.141592653589793d0
om1 = 2.d0*pi/(12.d0 * 60.d0)
om2 = 2.d0*pi/60.d0
t = 60.d0 * h + m
x1 = a*cos(om1*t)
y1 = a*sin(om1*t)
x2 = b*cos(om2*t)
y2 = b*sin(om2*t)

ans = sqrt((x1 - x2)**2 + (y1 - y2)**2)
write(*,*)ans
end program
; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QQcl.d9b73a43e3219f78e439f625bb5378e9 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1383/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca double, align 8
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.d9b73a43e3219f78e439f625bb5378e9, i32 3)
  %6 = call i1 @_FortranAioInputReal64(ptr %5, ptr nonnull %1)
  %7 = call i1 @_FortranAioInputReal64(ptr %5, ptr nonnull %2)
  %8 = call i1 @_FortranAioInputReal64(ptr %5, ptr nonnull %3)
  %9 = call i1 @_FortranAioInputReal64(ptr %5, ptr nonnull %4)
  %10 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %11 = load double, ptr %3, align 8, !tbaa !3
  %12 = fmul contract double %11, 6.000000e+01
  %13 = load double, ptr %4, align 8, !tbaa !3
  %14 = fadd contract double %12, %13
  %15 = load double, ptr %1, align 8, !tbaa !3
  %16 = fmul contract double %14, 0x3F81DF46A2529D39
  %17 = call contract double @llvm.cos.f64(double %16)
  %18 = fmul contract double %15, %17
  %19 = call contract double @llvm.sin.f64(double %16)
  %20 = fmul contract double %15, %19
  %21 = load double, ptr %2, align 8, !tbaa !3
  %22 = fmul contract double %14, 0x3FBACEE9F37BEBD5
  %23 = call contract double @llvm.cos.f64(double %22)
  %24 = fmul contract double %21, %23
  %25 = call contract double @llvm.sin.f64(double %22)
  %26 = fmul contract double %21, %25
  %27 = fsub contract double %18, %24
  %28 = fmul double %27, %27
  %29 = fsub contract double %20, %26
  %30 = fmul double %29, %29
  %31 = fadd contract double %28, %30
  %32 = call contract double @llvm.sqrt.f64(double %31)
  %33 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.d9b73a43e3219f78e439f625bb5378e9, i32 15)
  %34 = call i1 @_FortranAioOutputReal64(ptr %33, double %32)
  %35 = call i32 @_FortranAioEndIoStatement(ptr %33)
  ret void
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputReal64(ptr, ptr) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputReal64(ptr, double) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.cos.f64(double) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sin.f64(double) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #0

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!llvm.module.flags = !{!0, !1, !2}

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
