; LLVM IR from gem5/gem5 :: ext/mcpat/cacti/component.ll (ZN9Component17compute_gate_areaEiiddd)

; 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.TechnologyParameter = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i64, %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::InterconnectType", %"class.TechnologyParameter::InterconnectType", %"class.TechnologyParameter::InterconnectType", %"class.TechnologyParameter::ScalingFactor", %"class.TechnologyParameter::MemoryType", %"class.TechnologyParameter::MemoryType", %"class.TechnologyParameter::MemoryType" }
%"class.TechnologyParameter::DeviceType" = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
%"class.TechnologyParameter::InterconnectType" = type { double, double, double, double, double, double, double, double }
%"class.TechnologyParameter::ScalingFactor" = type { double, double, double }
%"class.TechnologyParameter::MemoryType" = type { double, double, double, double, double, double }
%"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.Area = type { double, double, double }

@g_tp = external global %class.TechnologyParameter, align 8
@.str = external hidden unnamed_addr constant [18 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@__PRETTY_FUNCTION__._ZN9Component17compute_gate_areaEiiddd = external hidden unnamed_addr constant [70 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4AreaC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280), i32 noundef, i32 noundef) #0 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN9Component17compute_gate_areaEiiddd(ptr noundef nonnull align 8 dereferenceable(280) %0, i32 noundef %1, i32 noundef %2, double noundef %3, double noundef %4, double noundef %5) #3 align 2 {
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca %class.Area, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !9
  store double %3, ptr %11, align 8, !tbaa !11
  store double %4, ptr %12, align 8, !tbaa !11
  store double %5, ptr %13, align 8, !tbaa !11
  %24 = load ptr, ptr %8, align 8
  %25 = load double, ptr %11, align 8, !tbaa !11
  %26 = fcmp ole double %25, 0.000000e+00
  br i1 %26, label %30, label %27

27:                                               ; preds = %6
  %28 = load double, ptr %12, align 8, !tbaa !11
  %29 = fcmp ole double %28, 0.000000e+00
  br i1 %29, label %30, label %31

30:                                               ; preds = %27, %6
  store double 0.000000e+00, ptr %7, align 8
  br label %130

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #7
  call void @_ZN4AreaC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %32 = load double, ptr %13, align 8, !tbaa !11
  %33 = load double, ptr getelementptr inbounds (%class.TechnologyParameter, ptr @g_tp, i32 0, i32 38), align 8, !tbaa !13
  %34 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %33, double %32)
  store double %34, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %35 = load double, ptr %11, align 8, !tbaa !11
  %36 = load double, ptr %11, align 8, !tbaa !11
  %37 = load double, ptr %12, align 8, !tbaa !11
  %38 = fadd double %36, %37
  %39 = fdiv double %35, %38
  store double %39, ptr %22, align 8, !tbaa !11
  %40 = load double, ptr %22, align 8, !tbaa !11
  %41 = fcmp oge double %40, 1.000000e+00
  br i1 %41, label %45, label %42

42:                                               ; preds = %31
  %43 = load double, ptr %22, align 8, !tbaa !11
  %44 = fcmp ole double %43, 0.000000e+00
  br i1 %44, label %45, label %46

45:                                               ; preds = %42, %31
  store double 0.000000e+00, ptr %7, align 8
  store i32 1, ptr %23, align 4
  br label %129

46:                                               ; preds = %42
  %47 = load double, ptr %21, align 8, !tbaa !11
  %48 = load double, ptr getelementptr inbounds (%class.TechnologyParameter, ptr @g_tp, i32 0, i32 36), align 8, !tbaa !20
  %49 = fsub double %47, %48
  %50 = load double, ptr %22, align 8, !tbaa !11
  %51 = fmul double %49, %50
  store double %51, ptr %14, align 8, !tbaa !11
  %52 = load double, ptr %21, align 8, !tbaa !11
  %53 = load double, ptr getelementptr inbounds (%class.TechnologyParameter, ptr @g_tp, i32 0, i32 36), align 8, !tbaa !20
  %54 = fsub double %52, %53
  %55 = load double, ptr %22, align 8, !tbaa !11
  %56 = fsub double 1.000000e+00, %55
  %57 = fmul double %54, %56
  store double %57, ptr %15, align 8, !tbaa !11
  %58 = load double, ptr %14, align 8, !tbaa !11
  %59 = fcmp ogt double %58, 0.000000e+00
  br i1 %59, label %60, label %61

60:                                               ; preds = %46
  br label %63

61:                                               ; preds = %46
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 101, ptr noundef @__PRETTY_FUNCTION__._ZN9Component17compute_gate_areaEiiddd) #8
  unreachable

62:                                               ; No predecessors!
  br label %63

63:                                               ; preds = %62, %60
  %64 = load double, ptr %11, align 8, !tbaa !11
  %65 = load double, ptr %14, align 8, !tbaa !11
  %66 = fdiv double %64, %65
  %67 = call double @llvm.ceil.f64(double %66)
  %68 = fptosi double %67 to i32
  store i32 %68, ptr %16, align 4, !tbaa !9
  %69 = load double, ptr %12, align 8, !tbaa !11
  %70 = load double, ptr %15, align 8, !tbaa !11
  %71 = fdiv double %69, %70
  %72 = call double @llvm.ceil.f64(double %71)
  %73 = fptosi double %72 to i32
  store i32 %73, ptr %17, align 4, !tbaa !9
  %74 = load i32, ptr %9, align 4, !tbaa !9
  switch i32 %74, label %96 [
    i32 0, label %75
    i32 1, label %80
    i32 2, label %88
  ]

75:                                               ; preds = %63
  %76 = load i32, ptr %17, align 4, !tbaa !9
  %77 = call noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280) %24, i32 noundef 1, i32 noundef %76)
  store double %77, ptr %18, align 8, !tbaa !11
  %78 = load i32, ptr %16, align 4, !tbaa !9
  %79 = call noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280) %24, i32 noundef 1, i32 noundef %78)
  store double %79, ptr %19, align 8, !tbaa !11
  br label %101

80:                                               ; preds = %63
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = load i32, ptr %17, align 4, !tbaa !9
  %83 = mul nsw i32 %81, %82
  %84 = call noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280) %24, i32 noundef 1, i32 noundef %83)
  store double %84, ptr %18, align 8, !tbaa !11
  %85 = load i32, ptr %10, align 4, !tbaa !9
  %86 = load i32, ptr %16, align 4, !tbaa !9
  %87 = call noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280) %24, i32 noundef %85, i32 noundef %86)
  store double %87, ptr %19, align 8, !tbaa !11
  br label %101

88:                                               ; preds = %63
  %89 = load i32, ptr %10, align 4, !tbaa !9
  %90 = load i32, ptr %17, align 4, !tbaa !9
  %91 = call noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280) %24, i32 noundef %89, i32 noundef %90)
  store double %91, ptr %18, align 8, !tbaa !11
  %92 = load i32, ptr %10, align 4, !tbaa !9
  %93 = load i32, ptr %16, align 4, !tbaa !9
  %94 = mul nsw i32 %92, %93
  %95 = call noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280) %24, i32 noundef 1, i32 noundef %94)
  store double %95, ptr %19, align 8, !tbaa !11
  br label %101

96:                                               ; preds = %63
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  %98 = load i32, ptr %9, align 4, !tbaa !9
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %97, i32 noundef %98)
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef 1) #8
  unreachable

101:                                              ; preds = %88, %80, %75
  %102 = load double, ptr %18, align 8, !tbaa !11
  %103 = load double, ptr %19, align 8, !tbaa !11
  %104 = fcmp ogt double %102, %103
  br i1 %104, label %105, label %107

105:                                              ; preds = %101
  %106 = load double, ptr %18, align 8, !tbaa !11
  br label %109

107:                                              ; preds = %101
  %108 = load double, ptr %19, align 8, !tbaa !11
  br label %109

109:                                              ; preds = %107, %105
  %110 = phi double [ %106, %105 ], [ %108, %107 ]
  %111 = getelementptr inbounds %class.Area, ptr %20, i32 0, i32 0
  store double %110, ptr %111, align 8, !tbaa !21
  %112 = load double, ptr %15, align 8, !tbaa !11
  %113 = load double, ptr %12, align 8, !tbaa !11
  %114 = fcmp ogt double %112, %113
  br i1 %114, label %115, label %124

115:                                              ; preds = %109
  %116 = load double, ptr %12, align 8, !tbaa !11
  %117 = load double, ptr %11, align 8, !tbaa !11
  %118 = fadd double %116, %117
  %119 = load double, ptr getelementptr inbounds (%class.TechnologyParameter, ptr @g_tp, i32 0, i32 36), align 8, !tbaa !20
  %120 = fadd double %118, %119
  %121 = load double, ptr getelementptr inbounds (%class.TechnologyParameter, ptr @g_tp, i32 0, i32 38), align 8, !tbaa !13
  %122 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %121, double %120)
  %123 = getelementptr inbounds %class.Area, ptr %20, i32 0, i32 1
  store double %122, ptr %123, align 8, !tbaa !23
  br label %127

124:                                              ; preds = %109
  %125 = load double, ptr %13, align 8, !tbaa !11
  %126 = getelementptr inbounds %class.Area, ptr %20, i32 0, i32 1
  store double %125, ptr %126, align 8, !tbaa !23
  br label %127

127:                                              ; preds = %124, %115
  %128 = call noundef double @_ZNK4Area8get_areaEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  store double %128, ptr %7, align 8
  store i32 1, ptr %23, align 4
  br label %129

129:                                              ; preds = %127, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %130

130:                                              ; preds = %129, %30
  %131 = load double, ptr %7, align 8
  ret double %131
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

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

; 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) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 = { noreturn 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 #5 = { 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 #6 = { "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 #7 = { nounwind }
attributes #8 = { noreturn 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !12, i64 304}
!14 = !{!"_ZTS19TechnologyParameter", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !12, i64 232, !12, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272, !12, i64 280, !12, i64 288, !12, i64 296, !12, i64 304, !12, i64 312, !12, i64 320, !12, i64 328, !12, i64 336, !12, i64 344, !15, i64 352, !16, i64 360, !16, i64 528, !16, i64 696, !16, i64 864, !16, i64 1032, !17, i64 1200, !17, i64 1264, !17, i64 1328, !18, i64 1392, !19, i64 1416, !19, i64 1464, !19, i64 1512}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTSN19TechnologyParameter10DeviceTypeE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160}
!17 = !{!"_ZTSN19TechnologyParameter16InterconnectTypeE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56}
!18 = !{!"_ZTSN19TechnologyParameter13ScalingFactorE", !12, i64 0, !12, i64 8, !12, i64 16}
!19 = !{!"_ZTSN19TechnologyParameter10MemoryTypeE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40}
!20 = !{!14, !12, i64 288}
!21 = !{!22, !12, i64 0}
!22 = !{!"_ZTS4Area", !12, i64 0, !12, i64 8, !12, i64 16}
!23 = !{!22, !12, i64 8}


; 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.TechnologyParameter = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i64, %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::DeviceType", %"class.TechnologyParameter::InterconnectType", %"class.TechnologyParameter::InterconnectType", %"class.TechnologyParameter::InterconnectType", %"class.TechnologyParameter::ScalingFactor", %"class.TechnologyParameter::MemoryType", %"class.TechnologyParameter::MemoryType", %"class.TechnologyParameter::MemoryType" }
%"class.TechnologyParameter::DeviceType" = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
%"class.TechnologyParameter::InterconnectType" = type { double, double, double, double, double, double, double, double }
%"class.TechnologyParameter::ScalingFactor" = type { double, double, double }
%"class.TechnologyParameter::MemoryType" = type { double, double, double, double, double, double }
%"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.Area = type { double, double, double }

@g_tp = external local_unnamed_addr global %class.TechnologyParameter, align 8
@.str = external hidden unnamed_addr constant [18 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@__PRETTY_FUNCTION__._ZN9Component17compute_gate_areaEiiddd = external hidden unnamed_addr constant [70 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4AreaC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN9Component17compute_gate_areaEiiddd(ptr noundef nonnull align 8 dereferenceable(280) %0, i32 noundef %1, i32 noundef %2, double noundef %3, double noundef %4, double noundef %5) local_unnamed_addr #3 align 2 {
  %7 = alloca %class.Area, align 8
  %8 = fcmp ole double %3, 0.000000e+00
  %9 = fcmp ole double %4, 0.000000e+00
  %or.cond = or i1 %8, %9
  br i1 %or.cond, label %60, label %10

10:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  call void @_ZN4AreaC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %11 = fadd double %3, %4
  %12 = fdiv double %3, %11
  %13 = fcmp oge double %12, 1.000000e+00
  %14 = fcmp ole double %12, 0.000000e+00
  %or.cond3 = or i1 %13, %14
  br i1 %or.cond3, label %59, label %15

15:                                               ; preds = %10
  %16 = load double, ptr getelementptr inbounds (i8, ptr @g_tp, i64 304), align 8, !tbaa !5
  %17 = call double @llvm.fmuladd.f64(double %16, double -2.000000e+00, double %5)
  %18 = load double, ptr getelementptr inbounds (i8, ptr @g_tp, i64 288), align 8, !tbaa !15
  %19 = fsub double %17, %18
  %20 = fmul double %12, %19
  %21 = fsub double 1.000000e+00, %12
  %22 = fmul double %21, %19
  %23 = fcmp ogt double %20, 0.000000e+00
  br i1 %23, label %25, label %24

24:                                               ; preds = %15
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 101, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN9Component17compute_gate_areaEiiddd) #8
  unreachable

25:                                               ; preds = %15
  %26 = fdiv double %3, %20
  %27 = call double @llvm.ceil.f64(double %26)
  %28 = fptosi double %27 to i32
  %29 = fdiv double %4, %22
  %30 = call double @llvm.ceil.f64(double %29)
  %31 = fptosi double %30 to i32
  switch i32 %1, label %43 [
    i32 0, label %32
    i32 1, label %35
    i32 2, label %39
  ]

32:                                               ; preds = %25
  %33 = call noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280) %0, i32 noundef 1, i32 noundef %31)
  %34 = call noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280) %0, i32 noundef 1, i32 noundef %28)
  br label %47

35:                                               ; preds = %25
  %36 = mul nsw i32 %31, %2
  %37 = call noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280) %0, i32 noundef 1, i32 noundef %36)
  %38 = call noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280) %0, i32 noundef %2, i32 noundef %28)
  br label %47

39:                                               ; preds = %25
  %40 = call noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280) %0, i32 noundef %2, i32 noundef %31)
  %41 = mul nsw i32 %28, %2
  %42 = call noundef double @_ZN9Component23compute_diffusion_widthEii(ptr noundef nonnull align 8 dereferenceable(280) %0, i32 noundef 1, i32 noundef %41)
  br label %47

43:                                               ; preds = %25
  %44 = 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.2)
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %44, i32 noundef %1)
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef 1) #8
  unreachable

47:                                               ; preds = %39, %35, %32
  %.043 = phi double [ %42, %39 ], [ %38, %35 ], [ %34, %32 ]
  %.042 = phi double [ %40, %39 ], [ %37, %35 ], [ %33, %32 ]
  %48 = fcmp ogt double %.042, %.043
  %49 = select i1 %48, double %.042, double %.043
  store double %49, ptr %7, align 8, !tbaa !16
  %50 = fcmp ogt double %22, %4
  br i1 %50, label %51, label %56

51:                                               ; preds = %47
  %52 = load double, ptr getelementptr inbounds (i8, ptr @g_tp, i64 288), align 8, !tbaa !15
  %53 = fadd double %11, %52
  %54 = load double, ptr getelementptr inbounds (i8, ptr @g_tp, i64 304), align 8, !tbaa !5
  %55 = call double @llvm.fmuladd.f64(double %54, double 2.000000e+00, double %53)
  br label %56

56:                                               ; preds = %47, %51
  %.sink = phi double [ %55, %51 ], [ %5, %47 ]
  %57 = getelementptr inbounds i8, ptr %7, i64 8
  store double %.sink, ptr %57, align 8
  %58 = call noundef double @_ZNK4Area8get_areaEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  br label %59

59:                                               ; preds = %10, %56
  %.0 = phi double [ %58, %56 ], [ 0.000000e+00, %10 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  br label %60

60:                                               ; preds = %6, %59
  %.1 = phi double [ %.0, %59 ], [ 0.000000e+00, %6 ]
  ret double %.1
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

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

; 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 #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 = { noreturn 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 #5 = { 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 #6 = { "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 #7 = { nounwind }
attributes #8 = { noreturn 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, !7, i64 304}
!6 = !{!"_ZTS19TechnologyParameter", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !10, i64 352, !11, i64 360, !11, i64 528, !11, i64 696, !11, i64 864, !11, i64 1032, !12, i64 1200, !12, i64 1264, !12, i64 1328, !13, i64 1392, !14, i64 1416, !14, i64 1464, !14, i64 1512}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_ZTSN19TechnologyParameter10DeviceTypeE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160}
!12 = !{!"_ZTSN19TechnologyParameter16InterconnectTypeE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56}
!13 = !{!"_ZTSN19TechnologyParameter13ScalingFactorE", !7, i64 0, !7, i64 8, !7, i64 16}
!14 = !{!"_ZTSN19TechnologyParameter10MemoryTypeE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!15 = !{!6, !7, i64 288}
!16 = !{!17, !7, i64 0}
!17 = !{!"_ZTS4Area", !7, i64 0, !7, i64 8, !7, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MergedLoadStoreMotionPass,ReassociatePass,SROAPass,SimplifyCFGPass