; LLVM IR from ImperialCollegeLondon/pnflow :: src/pnm/pnflow/polygon/cornerApex.ll (ZN10CornerApex15finitCornerApexEdddddbb)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.Apex = type { ptr, i8, double, double, ptr, i32, double, double, double, double, i8, i8, i8, i8, %"struct.std::pair" }
%"struct.std::pair" = type { i32, double }
%class.CornerApex = type { %class.Apex, ptr, double, double, double, ptr }

@_ZN4Apex2PIE = external dso_local global double, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind
declare double @cos(double noundef) #1

; Function Attrs: nounwind
declare double @sin(double noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK9ElemModel3RRREv(ptr noundef nonnull align 8 dereferenceable(152)) #2 align 2

; Function Attrs: nounwind
declare double @tan(double noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10CornerApex15finitCornerApexEdddddbb(ptr noundef nonnull align 8 dereferenceable(144) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, i1 noundef zeroext %6, i1 noundef zeroext %7) #5 align 2 {
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca i8, align 1
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store double %1, ptr %10, align 8, !tbaa !9
  store double %2, ptr %11, align 8, !tbaa !9
  store double %3, ptr %12, align 8, !tbaa !9
  store double %4, ptr %13, align 8, !tbaa !9
  store double %5, ptr %14, align 8, !tbaa !9
  %20 = zext i1 %6 to i8
  store i8 %20, ptr %15, align 1, !tbaa !11
  %21 = zext i1 %7 to i8
  store i8 %21, ptr %16, align 1, !tbaa !11
  %22 = load ptr, ptr %9, align 8
  %23 = getelementptr inbounds %class.Apex, ptr %22, i32 0, i32 12
  %24 = load i8, ptr %23, align 2, !tbaa !13, !range !17, !noundef !18
  %25 = trunc i8 %24 to i1
  br i1 %25, label %27, label %26

26:                                               ; preds = %8
  br label %124

27:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %28 = getelementptr inbounds %class.CornerApex, ptr %22, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !19
  %30 = call noundef ptr @_ZNK9ElemModel6elemanEv(ptr noundef nonnull align 8 dereferenceable(152) %29)
  %31 = call noundef zeroext i1 @_ZNK4Elem12isTrappedWatE9FluidBlob(ptr noundef nonnull align 8 dereferenceable(408) %30, i32 noundef 0)
  %32 = zext i1 %31 to i32
  %33 = getelementptr inbounds %class.CornerApex, ptr %22, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !19
  %35 = call noundef ptr @_ZNK9ElemModel6elemanEv(ptr noundef nonnull align 8 dereferenceable(152) %34)
  %36 = call noundef zeroext i1 @_ZNK4Elem12isTrappedOilEv(ptr noundef nonnull align 8 dereferenceable(408) %35)
  br i1 %36, label %44, label %37

37:                                               ; preds = %27
  %38 = getelementptr inbounds %class.CornerApex, ptr %22, i32 0, i32 5
  %39 = load ptr, ptr %38, align 8, !tbaa !21
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4Apex10trappingCLEv(ptr noundef nonnull align 8 dereferenceable(104) %39)
  %41 = getelementptr inbounds %"struct.std::pair", ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !22
  %43 = icmp sgt i32 %42, -1
  br label %44

44:                                               ; preds = %37, %27
  %45 = phi i1 [ true, %27 ], [ %43, %37 ]
  %46 = zext i1 %45 to i32
  %47 = add nsw i32 %32, %46
  store i32 %47, ptr %17, align 4, !tbaa !23
  %48 = getelementptr inbounds %class.Apex, ptr %22, i32 0, i32 13
  %49 = load i8, ptr %48, align 1, !tbaa !24, !range !17, !noundef !18
  %50 = trunc i8 %49 to i1
  br i1 %50, label %54, label %51

51:                                               ; preds = %44
  %52 = load i32, ptr %17, align 4, !tbaa !23
  %53 = icmp slt i32 %52, 1
  br i1 %53, label %54, label %123

54:                                               ; preds = %51, %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %55 = load i8, ptr %15, align 1, !tbaa !11, !range !17, !noundef !18
  %56 = trunc i8 %55 to i1
  br i1 %56, label %57, label %59

57:                                               ; preds = %54
  %58 = load double, ptr %11, align 8, !tbaa !9
  br label %61

59:                                               ; preds = %54
  %60 = load double, ptr %12, align 8, !tbaa !9
  br label %61

61:                                               ; preds = %59, %57
  %62 = phi double [ %58, %57 ], [ %60, %59 ]
  store double %62, ptr %19, align 8, !tbaa !9
  %63 = load double, ptr %10, align 8, !tbaa !9
  %64 = load double, ptr %13, align 8, !tbaa !9
  %65 = load double, ptr %14, align 8, !tbaa !9
  call void @_ZNK10CornerApex18getCApexDistConAngERdS0_dddbbb(ptr noundef nonnull align 8 dereferenceable(144) %22, ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19, double noundef %63, double noundef %64, double noundef %65, i1 noundef zeroext true, i1 noundef zeroext false, i1 noundef zeroext false)
  %66 = load double, ptr %18, align 8, !tbaa !9
  %67 = fcmp ole double %66, 0.000000e+00
  br i1 %67, label %78, label %68

68:                                               ; preds = %61
  %69 = load double, ptr %18, align 8, !tbaa !9
  %70 = getelementptr inbounds %class.CornerApex, ptr %22, i32 0, i32 1
  %71 = load ptr, ptr %70, align 8, !tbaa !19
  %72 = call noundef double @_ZNK9ElemModel3RRREv(ptr noundef nonnull align 8 dereferenceable(152) %71)
  %73 = load double, ptr %13, align 8, !tbaa !9
  %74 = call double @tan(double noundef %73) #6
  %75 = fdiv double %72, %74
  %76 = fmul double %75, 2.000000e+00
  %77 = fcmp ogt double %69, %76
  br i1 %77, label %78, label %80

78:                                               ; preds = %68, %61
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.11)
  br label %80

80:                                               ; preds = %78, %68
  %81 = load double, ptr %18, align 8, !tbaa !9
  %82 = getelementptr inbounds %class.CornerApex, ptr %22, i32 0, i32 2
  store double %81, ptr %82, align 8, !tbaa !25
  %83 = load double, ptr %14, align 8, !tbaa !9
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4Apex2PIE, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %85 = load double, ptr %84, align 8, !tbaa !9
  %86 = load double, ptr %13, align 8, !tbaa !9
  %87 = fadd double %85, %86
  %88 = call double @cos(double noundef %87) #6
  %89 = fmul double %83, %88
  %90 = getelementptr inbounds %class.CornerApex, ptr %22, i32 0, i32 2
  %91 = load double, ptr %90, align 8, !tbaa !25
  %92 = load double, ptr %13, align 8, !tbaa !9
  %93 = call double @sin(double noundef %92) #6
  %94 = fmul double %91, %93
  %95 = fdiv double %89, %94
  %96 = getelementptr inbounds %class.Apex, ptr %22, i32 0, i32 6
  store double %95, ptr %96, align 8, !tbaa !26
  %97 = load double, ptr %14, align 8, !tbaa !9
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4Apex2PIE, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %99 = load double, ptr %98, align 8, !tbaa !9
  %100 = load double, ptr %13, align 8, !tbaa !9
  %101 = fadd double %99, %100
  %102 = call double @cos(double noundef %101) #6
  %103 = fmul double %97, %102
  %104 = getelementptr inbounds %class.CornerApex, ptr %22, i32 0, i32 2
  %105 = load double, ptr %104, align 8, !tbaa !25
  %106 = load double, ptr %13, align 8, !tbaa !9
  %107 = call double @sin(double noundef %106) #6
  %108 = fmul double %105, %107
  %109 = fdiv double %103, %108
  %110 = getelementptr inbounds %class.Apex, ptr %22, i32 0, i32 7
  store double %109, ptr %110, align 8, !tbaa !27
  %111 = load double, ptr %10, align 8, !tbaa !9
  %112 = getelementptr inbounds %class.CornerApex, ptr %22, i32 0, i32 3
  %113 = load double, ptr %112, align 8, !tbaa !28
  %114 = fcmp ogt double %111, %113
  br i1 %114, label %115, label %121

115:                                              ; preds = %80
  %116 = getelementptr inbounds %class.CornerApex, ptr %22, i32 0, i32 2
  %117 = load double, ptr %116, align 8, !tbaa !25
  %118 = getelementptr inbounds %class.CornerApex, ptr %22, i32 0, i32 4
  store double %117, ptr %118, align 8, !tbaa !29
  %119 = load double, ptr %10, align 8, !tbaa !9
  %120 = getelementptr inbounds %class.CornerApex, ptr %22, i32 0, i32 3
  store double %119, ptr %120, align 8, !tbaa !28
  br label %121

121:                                              ; preds = %115, %80
  %122 = getelementptr inbounds %class.Apex, ptr %22, i32 0, i32 13
  store i8 0, ptr %122, align 1, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %123

123:                                              ; preds = %121, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %124

124:                                              ; preds = %123, %26
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9ElemModel6elemanEv(ptr noundef nonnull align 8 dereferenceable(152)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Elem12isTrappedWatE9FluidBlob(ptr noundef nonnull align 8 dereferenceable(408), i32 noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Elem12isTrappedOilEv(ptr noundef nonnull align 8 dereferenceable(408)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4Apex10trappingCLEv(ptr noundef nonnull align 8 dereferenceable(104)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10CornerApex18getCApexDistConAngERdS0_dddbbb(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), double noundef, double noundef, double noundef, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext) #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !12, i64 82}
!14 = !{!"_ZTS4Apex", !12, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !15, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !12, i64 80, !12, i64 81, !12, i64 82, !12, i64 83, !16, i64 88}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSSt4pairIidE", !15, i64 0, !10, i64 8}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !6, i64 104}
!20 = !{!"_ZTS10CornerApex", !14, i64 0, !6, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !6, i64 136}
!21 = !{!20, !6, i64 136}
!22 = !{!16, !15, i64 0}
!23 = !{!15, !15, i64 0}
!24 = !{!14, !12, i64 83}
!25 = !{!20, !10, i64 112}
!26 = !{!14, !10, i64 48}
!27 = !{!14, !10, i64 56}
!28 = !{!20, !10, i64 120}
!29 = !{!20, !10, i64 128}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZN4Apex2PIE = external dso_local global double, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK9ElemModel3RRREv(ptr noundef nonnull align 8 dereferenceable(152)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @tan(double noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10CornerApex15finitCornerApexEdddddbb(ptr noundef nonnull align 8 dereferenceable(144) %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, i1 noundef zeroext %6, i1 noundef zeroext %7) local_unnamed_addr #5 align 2 {
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  store double %2, ptr %9, align 8, !tbaa !5
  store double %3, ptr %10, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 82
  %14 = load i8, ptr %13, align 2, !tbaa !9, !range !15, !noundef !16
  %15 = trunc nuw i8 %14 to i1
  br i1 %15, label %16, label %82

16:                                               ; preds = %8
  %17 = getelementptr inbounds i8, ptr %0, i64 104
  %18 = load ptr, ptr %17, align 8, !tbaa !17
  %19 = tail call noundef ptr @_ZNK9ElemModel6elemanEv(ptr noundef nonnull align 8 dereferenceable(152) %18)
  %20 = tail call noundef zeroext i1 @_ZNK4Elem12isTrappedWatE9FluidBlob(ptr noundef nonnull align 8 dereferenceable(408) %19, i32 noundef 0)
  %21 = zext i1 %20 to i32
  %22 = load ptr, ptr %17, align 8, !tbaa !17
  %23 = tail call noundef ptr @_ZNK9ElemModel6elemanEv(ptr noundef nonnull align 8 dereferenceable(152) %22)
  %24 = tail call noundef zeroext i1 @_ZNK4Elem12isTrappedOilEv(ptr noundef nonnull align 8 dereferenceable(408) %23)
  br i1 %24, label %32, label %25

25:                                               ; preds = %16
  %26 = getelementptr inbounds i8, ptr %0, i64 136
  %27 = load ptr, ptr %26, align 8, !tbaa !19
  %28 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4Apex10trappingCLEv(ptr noundef nonnull align 8 dereferenceable(104) %27)
  %29 = load i32, ptr %28, align 8, !tbaa !20
  %30 = icmp sgt i32 %29, -1
  %31 = zext i1 %30 to i32
  br label %32

32:                                               ; preds = %25, %16
  %33 = phi i32 [ 1, %16 ], [ %31, %25 ]
  %34 = getelementptr inbounds i8, ptr %0, i64 83
  %35 = load i8, ptr %34, align 1, !tbaa !21, !range !15, !noundef !16
  %36 = trunc nuw i8 %35 to i1
  %37 = or i32 %33, %21
  %38 = icmp eq i32 %37, 0
  %or.cond = select i1 %36, i1 true, i1 %38
  br i1 %or.cond, label %39, label %82

39:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %40 = select i1 %6, double %2, double %3
  store double %40, ptr %12, align 8, !tbaa !5
  call void @_ZNK10CornerApex18getCApexDistConAngERdS0_dddbbb(ptr noundef nonnull align 8 dereferenceable(144) %0, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12, double noundef %1, double noundef %4, double noundef %5, i1 noundef zeroext true, i1 noundef zeroext false, i1 noundef zeroext false)
  %41 = load double, ptr %11, align 8, !tbaa !5
  %42 = fcmp ugt double %41, 0.000000e+00
  br i1 %42, label %43, label %50

43:                                               ; preds = %39
  %44 = load ptr, ptr %17, align 8, !tbaa !17
  %45 = call noundef double @_ZNK9ElemModel3RRREv(ptr noundef nonnull align 8 dereferenceable(152) %44)
  %46 = call double @tan(double noundef %4) #6
  %47 = fdiv double %45, %46
  %48 = fmul double %47, 2.000000e+00
  %49 = fcmp ogt double %41, %48
  br i1 %49, label %50, label %52

50:                                               ; preds = %43, %39
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.11)
  br label %52

52:                                               ; preds = %50, %43
  %53 = load double, ptr %11, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %0, i64 112
  store double %53, ptr %54, align 8, !tbaa !22
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4Apex2PIE, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %56 = load double, ptr %55, align 8, !tbaa !5
  %57 = fadd double %56, %4
  %58 = call double @cos(double noundef %57) #6
  %59 = fmul double %58, %5
  %60 = load double, ptr %54, align 8, !tbaa !22
  %61 = call double @sin(double noundef %4) #6
  %62 = fmul double %60, %61
  %63 = fdiv double %59, %62
  %64 = getelementptr inbounds i8, ptr %0, i64 48
  store double %63, ptr %64, align 8, !tbaa !23
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @_ZN4Apex2PIE, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %66 = load double, ptr %65, align 8, !tbaa !5
  %67 = fadd double %66, %4
  %68 = call double @cos(double noundef %67) #6
  %69 = fmul double %68, %5
  %70 = load double, ptr %54, align 8, !tbaa !22
  %71 = call double @sin(double noundef %4) #6
  %72 = fmul double %70, %71
  %73 = fdiv double %69, %72
  %74 = getelementptr inbounds i8, ptr %0, i64 56
  store double %73, ptr %74, align 8, !tbaa !24
  %75 = getelementptr inbounds i8, ptr %0, i64 120
  %76 = load double, ptr %75, align 8, !tbaa !25
  %77 = fcmp olt double %76, %1
  br i1 %77, label %78, label %81

78:                                               ; preds = %52
  %79 = load double, ptr %54, align 8, !tbaa !22
  %80 = getelementptr inbounds i8, ptr %0, i64 128
  store double %79, ptr %80, align 8, !tbaa !26
  store double %1, ptr %75, align 8, !tbaa !25
  br label %81

81:                                               ; preds = %78, %52
  store i8 0, ptr %34, align 1, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  br label %82

82:                                               ; preds = %81, %32, %8
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9ElemModel6elemanEv(ptr noundef nonnull align 8 dereferenceable(152)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Elem12isTrappedWatE9FluidBlob(ptr noundef nonnull align 8 dereferenceable(408), i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Elem12isTrappedOilEv(ptr noundef nonnull align 8 dereferenceable(408)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK4Apex10trappingCLEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10CornerApex18getCApexDistConAngERdS0_dddbbb(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), double noundef, double noundef, double noundef, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 82}
!10 = !{!"_ZTS4Apex", !11, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !13, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !11, i64 80, !11, i64 81, !11, i64 82, !11, i64 83, !14, i64 88}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSSt4pairIidE", !13, i64 0, !6, i64 8}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !12, i64 104}
!18 = !{!"_ZTS10CornerApex", !10, i64 0, !12, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !12, i64 136}
!19 = !{!18, !12, i64 136}
!20 = !{!14, !13, i64 0}
!21 = !{!10, !11, i64 83}
!22 = !{!18, !6, i64 112}
!23 = !{!10, !6, i64 48}
!24 = !{!10, !6, i64 56}
!25 = !{!18, !6, i64 120}
!26 = !{!18, !6, i64 128}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass