program abc168C
    implicit none

    integer(8) :: a, b
    real(8) :: h, m
    real(8), parameter :: pi = 3.141592653589_8
    real(8) :: int1, int2, realp
    read(*,*) a, b, h, m
    
    int1 = real(a**2+b**2, kind=8)
    int2 = real(2*a*b, kind=8)
    realp = cos((h/6-m/30+m/360)*pi)

    write(*,*) sqrt(int1-int2*realp)

    stop
end program abc168C
; 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.dbb56df626b23bac5808720cf15663e4 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1387/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.dbb56df626b23bac5808720cf15663e4, i32 8)
  %6 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %1, i32 8)
  %7 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %2, i32 8)
  %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 i64, ptr %1, align 8, !tbaa !3
  %12 = mul i64 %11, %11
  %13 = load i64, ptr %2, align 8, !tbaa !3
  %14 = mul i64 %13, %13
  %15 = add i64 %14, %12
  %16 = sitofp i64 %15 to double
  %17 = shl i64 %11, 1
  %18 = mul i64 %17, %13
  %19 = sitofp i64 %18 to double
  %20 = load double, ptr %3, align 8, !tbaa !3
  %21 = fdiv contract double %20, 6.000000e+00
  %22 = load double, ptr %4, align 8, !tbaa !3
  %23 = fdiv contract double %22, 3.000000e+01
  %24 = fsub contract double %21, %23
  %25 = fdiv contract double %22, 3.600000e+02
  %26 = fadd contract double %25, %24
  %27 = fmul contract double %26, 0x400921FB5444261E
  %28 = call contract double @llvm.cos.f64(double %27)
  %29 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.dbb56df626b23bac5808720cf15663e4, i32 14)
  %30 = fmul contract double %28, %19
  %31 = fsub contract double %16, %30
  %32 = call contract double @llvm.sqrt.f64(double %31)
  %33 = call i1 @_FortranAioOutputReal64(ptr %29, double %32)
  %34 = call i32 @_FortranAioEndIoStatement(ptr %29)
  %35 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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

declare i1 @_FortranAioInputInteger(ptr, 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

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

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

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

attributes #0 = { noreturn }
attributes #1 = { 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"}
