; LLVM IR from gem5/gem5 :: ext/mcpat/cacti/basic_circuit.ll (Z17cmos_Isub_leakageddi9Gate_typebbb17Half_net_topology)

; 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"

@.str.2 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@__PRETTY_FUNCTION__._Z17cmos_Isub_leakageddi9Gate_typebbb17Half_net_topology = external hidden unnamed_addr constant [104 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z23simplified_nmos_leakagedbbb(double noundef, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z11combinationii(i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z23simplified_pmos_leakagedbbb(double noundef, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z17cmos_Isub_leakageddi9Gate_typebbb17Half_net_topology(double noundef %0, double noundef %1, i32 noundef %2, i32 noundef %3, i1 noundef zeroext %4, i1 noundef zeroext %5, i1 noundef zeroext %6, i32 noundef %7) #4 {
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca i8, align 1
  %16 = alloca i32, align 4
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store double %0, ptr %9, align 8, !tbaa !5
  store double %1, ptr %10, align 8, !tbaa !5
  store i32 %2, ptr %11, align 4, !tbaa !9
  store i32 %3, ptr %12, align 4, !tbaa !11
  %22 = zext i1 %4 to i8
  store i8 %22, ptr %13, align 1, !tbaa !13
  %23 = zext i1 %5 to i8
  store i8 %23, ptr %14, align 1, !tbaa !13
  %24 = zext i1 %6 to i8
  store i8 %24, ptr %15, align 1, !tbaa !13
  store i32 %7, ptr %16, align 4, !tbaa !15
  %25 = load i32, ptr %11, align 4, !tbaa !9
  %26 = icmp sge i32 %25, 1
  br i1 %26, label %27, label %28

27:                                               ; preds = %8
  br label %30

28:                                               ; preds = %8
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.2, i32 noundef 409, ptr noundef @__PRETTY_FUNCTION__._Z17cmos_Isub_leakageddi9Gate_typebbb17Half_net_topology) #6
  unreachable

29:                                               ; No predecessors!
  br label %30

30:                                               ; preds = %29, %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %31 = load double, ptr %9, align 8, !tbaa !5
  %32 = load i8, ptr %13, align 1, !tbaa !13, !range !17, !noundef !18
  %33 = trunc i8 %32 to i1
  %34 = load i8, ptr %14, align 1, !tbaa !13, !range !17, !noundef !18
  %35 = trunc i8 %34 to i1
  %36 = load i8, ptr %15, align 1, !tbaa !13, !range !17, !noundef !18
  %37 = trunc i8 %36 to i1
  %38 = call noundef double @_Z23simplified_nmos_leakagedbbb(double noundef %31, i1 noundef zeroext %33, i1 noundef zeroext %35, i1 noundef zeroext %37)
  store double %38, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %39 = load double, ptr %10, align 8, !tbaa !5
  %40 = load i8, ptr %13, align 1, !tbaa !13, !range !17, !noundef !18
  %41 = trunc i8 %40 to i1
  %42 = load i8, ptr %14, align 1, !tbaa !13, !range !17, !noundef !18
  %43 = trunc i8 %42 to i1
  %44 = load i8, ptr %15, align 1, !tbaa !13, !range !17, !noundef !18
  %45 = trunc i8 %44 to i1
  %46 = call noundef double @_Z23simplified_pmos_leakagedbbb(double noundef %39, i1 noundef zeroext %41, i1 noundef zeroext %43, i1 noundef zeroext %45)
  store double %46, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store double 0.000000e+00, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %47 = load i32, ptr %11, align 4, !tbaa !9
  %48 = call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 2.000000e+00, i32 noundef %47)
  %49 = fptosi double %48 to i32
  store i32 %49, ptr %20, align 4, !tbaa !9
  %50 = load i32, ptr %12, align 4, !tbaa !11
  switch i32 %50, label %225 [
    i32 0, label %51
    i32 1, label %97
    i32 2, label %143
    i32 3, label %148
    i32 4, label %178
    i32 5, label %208
    i32 6, label %220
  ]

51:                                               ; preds = %30
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = icmp eq i32 %52, 1
  br i1 %53, label %54, label %59

54:                                               ; preds = %51
  %55 = load double, ptr %17, align 8, !tbaa !5
  %56 = load i32, ptr %20, align 4, !tbaa !9
  %57 = sitofp i32 %56 to double
  %58 = fdiv double %55, %57
  store double %58, ptr %19, align 8, !tbaa !5
  br label %96

59:                                               ; preds = %51
  %60 = load i32, ptr %16, align 4, !tbaa !15
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %70

62:                                               ; preds = %59
  %63 = load double, ptr %17, align 8, !tbaa !5
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = sitofp i32 %64 to double
  %66 = fmul double %63, %65
  %67 = load i32, ptr %20, align 4, !tbaa !9
  %68 = sitofp i32 %67 to double
  %69 = fdiv double %66, %68
  store double %69, ptr %19, align 8, !tbaa !5
  br label %95

70:                                               ; preds = %59
  store i32 1, ptr %21, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %87, %70
  %72 = load i32, ptr %21, align 4, !tbaa !9
  %73 = load i32, ptr %11, align 4, !tbaa !9
  %74 = icmp sle i32 %72, %73
  br i1 %74, label %75, label %90

75:                                               ; preds = %71
  %76 = load double, ptr %17, align 8, !tbaa !5
  %77 = load i32, ptr %21, align 4, !tbaa !9
  %78 = sub nsw i32 %77, 1
  %79 = call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 4.300000e-01, i32 noundef %78)
  %80 = fmul double %76, %79
  %81 = load i32, ptr %11, align 4, !tbaa !9
  %82 = load i32, ptr %21, align 4, !tbaa !9
  %83 = call noundef i32 @_Z11combinationii(i32 noundef %81, i32 noundef %82)
  %84 = sitofp i32 %83 to double
  %85 = load double, ptr %19, align 8, !tbaa !5
  %86 = call double @llvm.fmuladd.f64(double %80, double %84, double %85)
  store double %86, ptr %19, align 8, !tbaa !5
  br label %87

87:                                               ; preds = %75
  %88 = load i32, ptr %21, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %21, align 4, !tbaa !9
  br label %71, !llvm.loop !19

90:                                               ; preds = %71
  %91 = load i32, ptr %20, align 4, !tbaa !9
  %92 = sitofp i32 %91 to double
  %93 = load double, ptr %19, align 8, !tbaa !5
  %94 = fdiv double %93, %92
  store double %94, ptr %19, align 8, !tbaa !5
  br label %95

95:                                               ; preds = %90, %62
  br label %96

96:                                               ; preds = %95, %54
  br label %226

97:                                               ; preds = %30
  %98 = load i32, ptr %11, align 4, !tbaa !9
  %99 = icmp eq i32 %98, 1
  br i1 %99, label %100, label %105

100:                                              ; preds = %97
  %101 = load double, ptr %18, align 8, !tbaa !5
  %102 = load i32, ptr %20, align 4, !tbaa !9
  %103 = sitofp i32 %102 to double
  %104 = fdiv double %101, %103
  store double %104, ptr %19, align 8, !tbaa !5
  br label %142

105:                                              ; preds = %97
  %106 = load i32, ptr %16, align 4, !tbaa !15
  %107 = icmp eq i32 %106, 0
  br i1 %107, label %108, label %116

108:                                              ; preds = %105
  %109 = load double, ptr %18, align 8, !tbaa !5
  %110 = load i32, ptr %11, align 4, !tbaa !9
  %111 = sitofp i32 %110 to double
  %112 = fmul double %109, %111
  %113 = load i32, ptr %20, align 4, !tbaa !9
  %114 = sitofp i32 %113 to double
  %115 = fdiv double %112, %114
  store double %115, ptr %19, align 8, !tbaa !5
  br label %141

116:                                              ; preds = %105
  store i32 1, ptr %21, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %133, %116
  %118 = load i32, ptr %21, align 4, !tbaa !9
  %119 = load i32, ptr %11, align 4, !tbaa !9
  %120 = icmp sle i32 %118, %119
  br i1 %120, label %121, label %136

121:                                              ; preds = %117
  %122 = load double, ptr %18, align 8, !tbaa !5
  %123 = load i32, ptr %21, align 4, !tbaa !9
  %124 = sub nsw i32 %123, 1
  %125 = call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 4.300000e-01, i32 noundef %124)
  %126 = fmul double %122, %125
  %127 = load i32, ptr %11, align 4, !tbaa !9
  %128 = load i32, ptr %21, align 4, !tbaa !9
  %129 = call noundef i32 @_Z11combinationii(i32 noundef %127, i32 noundef %128)
  %130 = sitofp i32 %129 to double
  %131 = load double, ptr %19, align 8, !tbaa !5
  %132 = call double @llvm.fmuladd.f64(double %126, double %130, double %131)
  store double %132, ptr %19, align 8, !tbaa !5
  br label %133

133:                                              ; preds = %121
  %134 = load i32, ptr %21, align 4, !tbaa !9
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %21, align 4, !tbaa !9
  br label %117, !llvm.loop !21

136:                                              ; preds = %117
  %137 = load i32, ptr %20, align 4, !tbaa !9
  %138 = sitofp i32 %137 to double
  %139 = load double, ptr %19, align 8, !tbaa !5
  %140 = fdiv double %139, %138
  store double %140, ptr %19, align 8, !tbaa !5
  br label %141

141:                                              ; preds = %136, %108
  br label %142

142:                                              ; preds = %141, %100
  br label %226

143:                                              ; preds = %30
  %144 = load double, ptr %17, align 8, !tbaa !5
  %145 = load double, ptr %18, align 8, !tbaa !5
  %146 = fadd double %144, %145
  %147 = fdiv double %146, 2.000000e+00
  store double %147, ptr %19, align 8, !tbaa !5
  br label %226

148:                                              ; preds = %30
  %149 = load i32, ptr %11, align 4, !tbaa !9
  %150 = sitofp i32 %149 to double
  %151 = load double, ptr %18, align 8, !tbaa !5
  %152 = load double, ptr %19, align 8, !tbaa !5
  %153 = call double @llvm.fmuladd.f64(double %150, double %151, double %152)
  store double %153, ptr %19, align 8, !tbaa !5
  store i32 1, ptr %21, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %170, %148
  %155 = load i32, ptr %21, align 4, !tbaa !9
  %156 = load i32, ptr %11, align 4, !tbaa !9
  %157 = icmp sle i32 %155, %156
  br i1 %157, label %158, label %173

158:                                              ; preds = %154
  %159 = load double, ptr %17, align 8, !tbaa !5
  %160 = load i32, ptr %21, align 4, !tbaa !9
  %161 = sub nsw i32 %160, 1
  %162 = call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 4.300000e-01, i32 noundef %161)
  %163 = fmul double %159, %162
  %164 = load i32, ptr %11, align 4, !tbaa !9
  %165 = load i32, ptr %21, align 4, !tbaa !9
  %166 = call noundef i32 @_Z11combinationii(i32 noundef %164, i32 noundef %165)
  %167 = sitofp i32 %166 to double
  %168 = load double, ptr %19, align 8, !tbaa !5
  %169 = call double @llvm.fmuladd.f64(double %163, double %167, double %168)
  store double %169, ptr %19, align 8, !tbaa !5
  br label %170

170:                                              ; preds = %158
  %171 = load i32, ptr %21, align 4, !tbaa !9
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %21, align 4, !tbaa !9
  br label %154, !llvm.loop !22

173:                                              ; preds = %154
  %174 = load i32, ptr %20, align 4, !tbaa !9
  %175 = sitofp i32 %174 to double
  %176 = load double, ptr %19, align 8, !tbaa !5
  %177 = fdiv double %176, %175
  store double %177, ptr %19, align 8, !tbaa !5
  br label %226

178:                                              ; preds = %30
  store i32 1, ptr %21, align 4, !tbaa !9
  br label %179

179:                                              ; preds = %195, %178
  %180 = load i32, ptr %21, align 4, !tbaa !9
  %181 = load i32, ptr %11, align 4, !tbaa !9
  %182 = icmp sle i32 %180, %181
  br i1 %182, label %183, label %198

183:                                              ; preds = %179
  %184 = load double, ptr %18, align 8, !tbaa !5
  %185 = load i32, ptr %21, align 4, !tbaa !9
  %186 = sub nsw i32 %185, 1
  %187 = call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 4.300000e-01, i32 noundef %186)
  %188 = fmul double %184, %187
  %189 = load i32, ptr %11, align 4, !tbaa !9
  %190 = load i32, ptr %21, align 4, !tbaa !9
  %191 = call noundef i32 @_Z11combinationii(i32 noundef %189, i32 noundef %190)
  %192 = sitofp i32 %191 to double
  %193 = load double, ptr %19, align 8, !tbaa !5
  %194 = call double @llvm.fmuladd.f64(double %188, double %192, double %193)
  store double %194, ptr %19, align 8, !tbaa !5
  br label %195

195:                                              ; preds = %183
  %196 = load i32, ptr %21, align 4, !tbaa !9
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %21, align 4, !tbaa !9
  br label %179, !llvm.loop !23

198:                                              ; preds = %179
  %199 = load i32, ptr %11, align 4, !tbaa !9
  %200 = sitofp i32 %199 to double
  %201 = load double, ptr %17, align 8, !tbaa !5
  %202 = load double, ptr %19, align 8, !tbaa !5
  %203 = call double @llvm.fmuladd.f64(double %200, double %201, double %202)
  store double %203, ptr %19, align 8, !tbaa !5
  %204 = load i32, ptr %20, align 4, !tbaa !9
  %205 = sitofp i32 %204 to double
  %206 = load double, ptr %19, align 8, !tbaa !5
  %207 = fdiv double %206, %205
  store double %207, ptr %19, align 8, !tbaa !5
  br label %226

208:                                              ; preds = %30
  %209 = load double, ptr %17, align 8, !tbaa !5
  %210 = load double, ptr %18, align 8, !tbaa !5
  %211 = fadd double %209, %210
  %212 = fdiv double %211, 2.000000e+00
  %213 = load double, ptr %19, align 8, !tbaa !5
  %214 = fadd double %213, %212
  store double %214, ptr %19, align 8, !tbaa !5
  %215 = load double, ptr %17, align 8, !tbaa !5
  %216 = load double, ptr %19, align 8, !tbaa !5
  %217 = call double @llvm.fmuladd.f64(double %215, double 4.300000e-01, double %216)
  store double %217, ptr %19, align 8, !tbaa !5
  %218 = load double, ptr %19, align 8, !tbaa !5
  %219 = fdiv double %218, 2.000000e+00
  store double %219, ptr %19, align 8, !tbaa !5
  br label %226

220:                                              ; preds = %30
  %221 = load double, ptr %17, align 8, !tbaa !5
  %222 = load double, ptr %18, align 8, !tbaa !5
  %223 = fadd double %221, %222
  %224 = fdiv double %223, 2.000000e+00
  store double %224, ptr %19, align 8, !tbaa !5
  br label %226

225:                                              ; preds = %30
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.2, i32 noundef 492, ptr noundef @__PRETTY_FUNCTION__._Z17cmos_Isub_leakageddi9Gate_typebbb17Half_net_topology) #6
  unreachable

226:                                              ; preds = %220, %208, %198, %173, %143, %142, %96
  %227 = load double, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %17) #7
  ret double %227
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef, i32 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { 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 #5 = { 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 #6 = { noreturn nounwind }
attributes #7 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS9Gate_type", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"_ZTS17Half_net_topology", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}


; 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"

@.str.2 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@__PRETTY_FUNCTION__._Z17cmos_Isub_leakageddi9Gate_typebbb17Half_net_topology = external hidden unnamed_addr constant [104 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z23simplified_nmos_leakagedbbb(double noundef, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z11combinationii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z23simplified_pmos_leakagedbbb(double noundef, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_Z17cmos_Isub_leakageddi9Gate_typebbb17Half_net_topology(double noundef %0, double noundef %1, i32 noundef %2, i32 noundef %3, i1 noundef zeroext %4, i1 noundef zeroext %5, i1 noundef zeroext %6, i32 noundef %7) local_unnamed_addr #2 {
  %9 = icmp sgt i32 %2, 0
  br i1 %9, label %11, label %10

10:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef 409, ptr noundef nonnull @__PRETTY_FUNCTION__._Z17cmos_Isub_leakageddi9Gate_typebbb17Half_net_topology) #4
  unreachable

11:                                               ; preds = %8
  %12 = tail call noundef double @_Z23simplified_nmos_leakagedbbb(double noundef %0, i1 noundef zeroext %4, i1 noundef zeroext %5, i1 noundef zeroext %6)
  %13 = tail call noundef double @_Z23simplified_pmos_leakagedbbb(double noundef %1, i1 noundef zeroext %4, i1 noundef zeroext %5, i1 noundef zeroext %6)
  %14 = tail call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 2.000000e+00, i32 noundef %2)
  %15 = fptosi double %14 to i32
  switch i32 %3, label %92 [
    i32 0, label %16
    i32 1, label %37
    i32 2, label %58
    i32 3, label %.lr.ph98.preheader
    i32 4, label %.lr.ph
    i32 5, label %83
    i32 6, label %89
  ]

16:                                               ; preds = %11
  %17 = icmp eq i32 %2, 1
  br i1 %17, label %18, label %21

18:                                               ; preds = %16
  %19 = sitofp i32 %15 to double
  %20 = fdiv double %12, %19
  br label %93

21:                                               ; preds = %16
  %22 = icmp eq i32 %7, 0
  br i1 %22, label %23, label %.lr.ph110

23:                                               ; preds = %21
  %24 = uitofp nneg i32 %2 to double
  %25 = fmul double %12, %24
  %26 = sitofp i32 %15 to double
  %27 = fdiv double %25, %26
  br label %93

.lr.ph110:                                        ; preds = %21, %.lr.ph110
  %.0109 = phi i32 [ %34, %.lr.ph110 ], [ 1, %21 ]
  %.081108 = phi double [ %33, %.lr.ph110 ], [ 0.000000e+00, %21 ]
  %28 = add nsw i32 %.0109, -1
  %29 = tail call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 4.300000e-01, i32 noundef %28)
  %30 = fmul double %12, %29
  %31 = tail call noundef i32 @_Z11combinationii(i32 noundef %2, i32 noundef %.0109)
  %32 = sitofp i32 %31 to double
  %33 = tail call double @llvm.fmuladd.f64(double %30, double %32, double %.081108)
  %34 = add nuw i32 %.0109, 1
  %exitcond118.not = icmp eq i32 %.0109, %2
  br i1 %exitcond118.not, label %._crit_edge111, label %.lr.ph110, !llvm.loop !5

._crit_edge111:                                   ; preds = %.lr.ph110
  %35 = sitofp i32 %15 to double
  %36 = fdiv double %33, %35
  br label %93

37:                                               ; preds = %11
  %38 = icmp eq i32 %2, 1
  br i1 %38, label %39, label %42

39:                                               ; preds = %37
  %40 = sitofp i32 %15 to double
  %41 = fdiv double %13, %40
  br label %93

42:                                               ; preds = %37
  %43 = icmp eq i32 %7, 0
  br i1 %43, label %44, label %.lr.ph104

44:                                               ; preds = %42
  %45 = uitofp nneg i32 %2 to double
  %46 = fmul double %13, %45
  %47 = sitofp i32 %15 to double
  %48 = fdiv double %46, %47
  br label %93

.lr.ph104:                                        ; preds = %42, %.lr.ph104
  %.1103 = phi i32 [ %55, %.lr.ph104 ], [ 1, %42 ]
  %.182102 = phi double [ %54, %.lr.ph104 ], [ 0.000000e+00, %42 ]
  %49 = add nsw i32 %.1103, -1
  %50 = tail call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 4.300000e-01, i32 noundef %49)
  %51 = fmul double %13, %50
  %52 = tail call noundef i32 @_Z11combinationii(i32 noundef %2, i32 noundef %.1103)
  %53 = sitofp i32 %52 to double
  %54 = tail call double @llvm.fmuladd.f64(double %51, double %53, double %.182102)
  %55 = add nuw i32 %.1103, 1
  %exitcond117.not = icmp eq i32 %.1103, %2
  br i1 %exitcond117.not, label %._crit_edge105, label %.lr.ph104, !llvm.loop !7

._crit_edge105:                                   ; preds = %.lr.ph104
  %56 = sitofp i32 %15 to double
  %57 = fdiv double %54, %56
  br label %93

58:                                               ; preds = %11
  %59 = fadd double %12, %13
  %60 = fmul double %59, 5.000000e-01
  br label %93

.lr.ph98.preheader:                               ; preds = %11
  %61 = uitofp nneg i32 %2 to double
  %62 = tail call double @llvm.fmuladd.f64(double %61, double %13, double 0.000000e+00)
  br label %.lr.ph98

.lr.ph98:                                         ; preds = %.lr.ph98.preheader, %.lr.ph98
  %.296 = phi i32 [ %69, %.lr.ph98 ], [ 1, %.lr.ph98.preheader ]
  %.28395 = phi double [ %68, %.lr.ph98 ], [ %62, %.lr.ph98.preheader ]
  %63 = add nsw i32 %.296, -1
  %64 = tail call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 4.300000e-01, i32 noundef %63)
  %65 = fmul double %12, %64
  %66 = tail call noundef i32 @_Z11combinationii(i32 noundef %2, i32 noundef %.296)
  %67 = sitofp i32 %66 to double
  %68 = tail call double @llvm.fmuladd.f64(double %65, double %67, double %.28395)
  %69 = add nuw i32 %.296, 1
  %exitcond116.not = icmp eq i32 %.296, %2
  br i1 %exitcond116.not, label %._crit_edge99, label %.lr.ph98, !llvm.loop !8

._crit_edge99:                                    ; preds = %.lr.ph98
  %70 = sitofp i32 %15 to double
  %71 = fdiv double %68, %70
  br label %93

.lr.ph:                                           ; preds = %11, %.lr.ph
  %.393 = phi i32 [ %78, %.lr.ph ], [ 1, %11 ]
  %.38492 = phi double [ %77, %.lr.ph ], [ 0.000000e+00, %11 ]
  %72 = add nsw i32 %.393, -1
  %73 = tail call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 4.300000e-01, i32 noundef %72)
  %74 = fmul double %13, %73
  %75 = tail call noundef i32 @_Z11combinationii(i32 noundef %2, i32 noundef %.393)
  %76 = sitofp i32 %75 to double
  %77 = tail call double @llvm.fmuladd.f64(double %74, double %76, double %.38492)
  %78 = add nuw i32 %.393, 1
  %exitcond.not = icmp eq i32 %.393, %2
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph
  %79 = uitofp nneg i32 %2 to double
  %80 = tail call double @llvm.fmuladd.f64(double %79, double %12, double %77)
  %81 = sitofp i32 %15 to double
  %82 = fdiv double %80, %81
  br label %93

83:                                               ; preds = %11
  %84 = fadd double %12, %13
  %85 = fmul double %84, 5.000000e-01
  %86 = fadd double %85, 0.000000e+00
  %87 = tail call double @llvm.fmuladd.f64(double %12, double 4.300000e-01, double %86)
  %88 = fmul double %87, 5.000000e-01
  br label %93

89:                                               ; preds = %11
  %90 = fadd double %12, %13
  %91 = fmul double %90, 5.000000e-01
  br label %93

92:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.2, i32 noundef 492, ptr noundef nonnull @__PRETTY_FUNCTION__._Z17cmos_Isub_leakageddi9Gate_typebbb17Half_net_topology) #4
  unreachable

93:                                               ; preds = %39, %._crit_edge105, %44, %18, %._crit_edge111, %23, %89, %83, %._crit_edge, %._crit_edge99, %58
  %.4 = phi double [ %91, %89 ], [ %88, %83 ], [ %82, %._crit_edge ], [ %71, %._crit_edge99 ], [ %60, %58 ], [ %41, %39 ], [ %48, %44 ], [ %57, %._crit_edge105 ], [ %20, %18 ], [ %27, %23 ], [ %36, %._crit_edge111 ]
  ret double %.4
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef, i32 noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 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 #4 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}
!9 = distinct !{!9, !6}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass