; LLVM IR from gem5/gem5 :: ext/mcpat/cacti/basic_circuit.ll (Z15cmos_Ig_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
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__._Z15cmos_Ig_leakageddi9Gate_typebbb17Half_net_topology = external hidden unnamed_addr constant [102 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 i32 @_Z11combinationii(i32 noundef, i32 noundef) #3

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z15cmos_Ig_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) #5 {
  %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 509, ptr noundef @__PRETTY_FUNCTION__._Z15cmos_Ig_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 @_Z9cmos_Ig_ndbbb(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 @_Z9cmos_Ig_pdbbb(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 %305 [
    i32 0, label %51
    i32 1, label %115
    i32 2, label %179
    i32 3, label %184
    i32 4, label %234
    i32 5, label %284
    i32 6, label %300
  ]

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 %114

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

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

63:                                               ; preds = %78, %62
  %64 = load i32, ptr %21, align 4, !tbaa !9
  %65 = load i32, ptr %11, align 4, !tbaa !9
  %66 = icmp sle i32 %64, %65
  br i1 %66, label %67, label %81

67:                                               ; preds = %63
  %68 = load double, ptr %17, align 8, !tbaa !5
  %69 = load i32, ptr %11, align 4, !tbaa !9
  %70 = load i32, ptr %21, align 4, !tbaa !9
  %71 = call noundef i32 @_Z11combinationii(i32 noundef %69, i32 noundef %70)
  %72 = sitofp i32 %71 to double
  %73 = fmul double %68, %72
  %74 = load i32, ptr %21, align 4, !tbaa !9
  %75 = sitofp i32 %74 to double
  %76 = load double, ptr %19, align 8, !tbaa !5
  %77 = call double @llvm.fmuladd.f64(double %73, double %75, double %76)
  store double %77, ptr %19, align 8, !tbaa !5
  br label %78

78:                                               ; preds = %67
  %79 = load i32, ptr %21, align 4, !tbaa !9
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %21, align 4, !tbaa !9
  br label %63, !llvm.loop !19

81:                                               ; preds = %63
  br label %113

82:                                               ; preds = %59
  %83 = load double, ptr %17, align 8, !tbaa !5
  %84 = load i32, ptr %11, align 4, !tbaa !9
  %85 = sitofp i32 %84 to double
  %86 = load double, ptr %19, align 8, !tbaa !5
  %87 = call double @llvm.fmuladd.f64(double %83, double %85, double %86)
  store double %87, ptr %19, align 8, !tbaa !5
  store i32 1, ptr %21, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %105, %82
  %89 = load i32, ptr %21, align 4, !tbaa !9
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %92, label %108

92:                                               ; preds = %88
  %93 = load double, ptr %17, align 8, !tbaa !5
  %94 = load i32, ptr %11, align 4, !tbaa !9
  %95 = load i32, ptr %21, align 4, !tbaa !9
  %96 = call noundef i32 @_Z11combinationii(i32 noundef %94, i32 noundef %95)
  %97 = sitofp i32 %96 to double
  %98 = fmul double %93, %97
  %99 = load i32, ptr %21, align 4, !tbaa !9
  %100 = sitofp i32 %99 to double
  %101 = fmul double %98, %100
  %102 = fdiv double %101, 2.000000e+00
  %103 = load double, ptr %19, align 8, !tbaa !5
  %104 = fadd double %103, %102
  store double %104, ptr %19, align 8, !tbaa !5
  br label %105

105:                                              ; preds = %92
  %106 = load i32, ptr %21, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %21, align 4, !tbaa !9
  br label %88, !llvm.loop !21

108:                                              ; preds = %88
  %109 = load i32, ptr %20, align 4, !tbaa !9
  %110 = sitofp i32 %109 to double
  %111 = load double, ptr %19, align 8, !tbaa !5
  %112 = fdiv double %111, %110
  store double %112, ptr %19, align 8, !tbaa !5
  br label %113

113:                                              ; preds = %108, %81
  br label %114

114:                                              ; preds = %113, %54
  br label %306

115:                                              ; preds = %30
  %116 = load i32, ptr %11, align 4, !tbaa !9
  %117 = icmp eq i32 %116, 1
  br i1 %117, label %118, label %123

118:                                              ; preds = %115
  %119 = load double, ptr %18, align 8, !tbaa !5
  %120 = load i32, ptr %20, align 4, !tbaa !9
  %121 = sitofp i32 %120 to double
  %122 = fdiv double %119, %121
  store double %122, ptr %19, align 8, !tbaa !5
  br label %178

123:                                              ; preds = %115
  %124 = load i32, ptr %16, align 4, !tbaa !15
  %125 = icmp eq i32 %124, 0
  br i1 %125, label %126, label %146

126:                                              ; preds = %123
  store i32 1, ptr %21, align 4, !tbaa !9
  br label %127

127:                                              ; preds = %142, %126
  %128 = load i32, ptr %21, align 4, !tbaa !9
  %129 = load i32, ptr %11, align 4, !tbaa !9
  %130 = icmp sle i32 %128, %129
  br i1 %130, label %131, label %145

131:                                              ; preds = %127
  %132 = load double, ptr %18, align 8, !tbaa !5
  %133 = load i32, ptr %11, align 4, !tbaa !9
  %134 = load i32, ptr %21, align 4, !tbaa !9
  %135 = call noundef i32 @_Z11combinationii(i32 noundef %133, i32 noundef %134)
  %136 = sitofp i32 %135 to double
  %137 = fmul double %132, %136
  %138 = load i32, ptr %21, align 4, !tbaa !9
  %139 = sitofp i32 %138 to double
  %140 = load double, ptr %19, align 8, !tbaa !5
  %141 = call double @llvm.fmuladd.f64(double %137, double %139, double %140)
  store double %141, ptr %19, align 8, !tbaa !5
  br label %142

142:                                              ; preds = %131
  %143 = load i32, ptr %21, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %21, align 4, !tbaa !9
  br label %127, !llvm.loop !22

145:                                              ; preds = %127
  br label %177

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

152:                                              ; preds = %169, %146
  %153 = load i32, ptr %21, align 4, !tbaa !9
  %154 = load i32, ptr %11, align 4, !tbaa !9
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %156, label %172

156:                                              ; preds = %152
  %157 = load double, ptr %18, align 8, !tbaa !5
  %158 = load i32, ptr %11, align 4, !tbaa !9
  %159 = load i32, ptr %21, align 4, !tbaa !9
  %160 = call noundef i32 @_Z11combinationii(i32 noundef %158, i32 noundef %159)
  %161 = sitofp i32 %160 to double
  %162 = fmul double %157, %161
  %163 = load i32, ptr %21, align 4, !tbaa !9
  %164 = sitofp i32 %163 to double
  %165 = fmul double %162, %164
  %166 = fdiv double %165, 2.000000e+00
  %167 = load double, ptr %19, align 8, !tbaa !5
  %168 = fadd double %167, %166
  store double %168, ptr %19, align 8, !tbaa !5
  br label %169

169:                                              ; preds = %156
  %170 = load i32, ptr %21, align 4, !tbaa !9
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %21, align 4, !tbaa !9
  br label %152, !llvm.loop !23

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

177:                                              ; preds = %172, %145
  br label %178

178:                                              ; preds = %177, %118
  br label %306

179:                                              ; preds = %30
  %180 = load double, ptr %17, align 8, !tbaa !5
  %181 = load double, ptr %18, align 8, !tbaa !5
  %182 = fadd double %180, %181
  %183 = fdiv double %182, 2.000000e+00
  store double %183, ptr %19, align 8, !tbaa !5
  br label %306

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

185:                                              ; preds = %200, %184
  %186 = load i32, ptr %21, align 4, !tbaa !9
  %187 = load i32, ptr %11, align 4, !tbaa !9
  %188 = icmp sle i32 %186, %187
  br i1 %188, label %189, label %203

189:                                              ; preds = %185
  %190 = load double, ptr %18, align 8, !tbaa !5
  %191 = load i32, ptr %11, align 4, !tbaa !9
  %192 = load i32, ptr %21, align 4, !tbaa !9
  %193 = call noundef i32 @_Z11combinationii(i32 noundef %191, i32 noundef %192)
  %194 = sitofp i32 %193 to double
  %195 = fmul double %190, %194
  %196 = load i32, ptr %21, align 4, !tbaa !9
  %197 = sitofp i32 %196 to double
  %198 = load double, ptr %19, align 8, !tbaa !5
  %199 = call double @llvm.fmuladd.f64(double %195, double %197, double %198)
  store double %199, ptr %19, align 8, !tbaa !5
  br label %200

200:                                              ; preds = %189
  %201 = load i32, ptr %21, align 4, !tbaa !9
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %21, align 4, !tbaa !9
  br label %185, !llvm.loop !24

203:                                              ; preds = %185
  %204 = load double, ptr %17, align 8, !tbaa !5
  %205 = load i32, ptr %11, align 4, !tbaa !9
  %206 = sitofp i32 %205 to double
  %207 = load double, ptr %19, align 8, !tbaa !5
  %208 = call double @llvm.fmuladd.f64(double %204, double %206, double %207)
  store double %208, ptr %19, align 8, !tbaa !5
  store i32 1, ptr %21, align 4, !tbaa !9
  br label %209

209:                                              ; preds = %226, %203
  %210 = load i32, ptr %21, align 4, !tbaa !9
  %211 = load i32, ptr %11, align 4, !tbaa !9
  %212 = icmp slt i32 %210, %211
  br i1 %212, label %213, label %229

213:                                              ; preds = %209
  %214 = load double, ptr %17, align 8, !tbaa !5
  %215 = load i32, ptr %11, align 4, !tbaa !9
  %216 = load i32, ptr %21, align 4, !tbaa !9
  %217 = call noundef i32 @_Z11combinationii(i32 noundef %215, i32 noundef %216)
  %218 = sitofp i32 %217 to double
  %219 = fmul double %214, %218
  %220 = load i32, ptr %21, align 4, !tbaa !9
  %221 = sitofp i32 %220 to double
  %222 = fmul double %219, %221
  %223 = fdiv double %222, 2.000000e+00
  %224 = load double, ptr %19, align 8, !tbaa !5
  %225 = fadd double %224, %223
  store double %225, ptr %19, align 8, !tbaa !5
  br label %226

226:                                              ; preds = %213
  %227 = load i32, ptr %21, align 4, !tbaa !9
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %21, align 4, !tbaa !9
  br label %209, !llvm.loop !25

229:                                              ; preds = %209
  %230 = load i32, ptr %20, align 4, !tbaa !9
  %231 = sitofp i32 %230 to double
  %232 = load double, ptr %19, align 8, !tbaa !5
  %233 = fdiv double %232, %231
  store double %233, ptr %19, align 8, !tbaa !5
  br label %306

234:                                              ; preds = %30
  %235 = load double, ptr %18, align 8, !tbaa !5
  %236 = load i32, ptr %11, align 4, !tbaa !9
  %237 = sitofp i32 %236 to double
  %238 = load double, ptr %19, align 8, !tbaa !5
  %239 = call double @llvm.fmuladd.f64(double %235, double %237, double %238)
  store double %239, ptr %19, align 8, !tbaa !5
  store i32 1, ptr %21, align 4, !tbaa !9
  br label %240

240:                                              ; preds = %257, %234
  %241 = load i32, ptr %21, align 4, !tbaa !9
  %242 = load i32, ptr %11, align 4, !tbaa !9
  %243 = icmp slt i32 %241, %242
  br i1 %243, label %244, label %260

244:                                              ; preds = %240
  %245 = load double, ptr %18, align 8, !tbaa !5
  %246 = load i32, ptr %11, align 4, !tbaa !9
  %247 = load i32, ptr %21, align 4, !tbaa !9
  %248 = call noundef i32 @_Z11combinationii(i32 noundef %246, i32 noundef %247)
  %249 = sitofp i32 %248 to double
  %250 = fmul double %245, %249
  %251 = load i32, ptr %21, align 4, !tbaa !9
  %252 = sitofp i32 %251 to double
  %253 = fmul double %250, %252
  %254 = fdiv double %253, 2.000000e+00
  %255 = load double, ptr %19, align 8, !tbaa !5
  %256 = fadd double %255, %254
  store double %256, ptr %19, align 8, !tbaa !5
  br label %257

257:                                              ; preds = %244
  %258 = load i32, ptr %21, align 4, !tbaa !9
  %259 = add nsw i32 %258, 1
  store i32 %259, ptr %21, align 4, !tbaa !9
  br label %240, !llvm.loop !26

260:                                              ; preds = %240
  store i32 1, ptr %21, align 4, !tbaa !9
  br label %261

261:                                              ; preds = %276, %260
  %262 = load i32, ptr %21, align 4, !tbaa !9
  %263 = load i32, ptr %11, align 4, !tbaa !9
  %264 = icmp sle i32 %262, %263
  br i1 %264, label %265, label %279

265:                                              ; preds = %261
  %266 = load double, ptr %17, align 8, !tbaa !5
  %267 = load i32, ptr %11, align 4, !tbaa !9
  %268 = load i32, ptr %21, align 4, !tbaa !9
  %269 = call noundef i32 @_Z11combinationii(i32 noundef %267, i32 noundef %268)
  %270 = sitofp i32 %269 to double
  %271 = fmul double %266, %270
  %272 = load i32, ptr %21, align 4, !tbaa !9
  %273 = sitofp i32 %272 to double
  %274 = load double, ptr %19, align 8, !tbaa !5
  %275 = call double @llvm.fmuladd.f64(double %271, double %273, double %274)
  store double %275, ptr %19, align 8, !tbaa !5
  br label %276

276:                                              ; preds = %265
  %277 = load i32, ptr %21, align 4, !tbaa !9
  %278 = add nsw i32 %277, 1
  store i32 %278, ptr %21, align 4, !tbaa !9
  br label %261, !llvm.loop !27

279:                                              ; preds = %261
  %280 = load i32, ptr %20, align 4, !tbaa !9
  %281 = sitofp i32 %280 to double
  %282 = load double, ptr %19, align 8, !tbaa !5
  %283 = fdiv double %282, %281
  store double %283, ptr %19, align 8, !tbaa !5
  br label %306

284:                                              ; preds = %30
  %285 = load double, ptr %17, align 8, !tbaa !5
  %286 = load double, ptr %18, align 8, !tbaa !5
  %287 = fmul double 2.000000e+00, %286
  %288 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %285, double %287)
  %289 = fdiv double %288, 2.000000e+00
  %290 = load double, ptr %19, align 8, !tbaa !5
  %291 = fadd double %290, %289
  store double %291, ptr %19, align 8, !tbaa !5
  %292 = load double, ptr %17, align 8, !tbaa !5
  %293 = load double, ptr %18, align 8, !tbaa !5
  %294 = fadd double %292, %293
  %295 = fdiv double %294, 2.000000e+00
  %296 = load double, ptr %19, align 8, !tbaa !5
  %297 = fadd double %296, %295
  store double %297, ptr %19, align 8, !tbaa !5
  %298 = load double, ptr %19, align 8, !tbaa !5
  %299 = fdiv double %298, 2.000000e+00
  store double %299, ptr %19, align 8, !tbaa !5
  br label %306

300:                                              ; preds = %30
  %301 = load double, ptr %17, align 8, !tbaa !5
  %302 = load double, ptr %18, align 8, !tbaa !5
  %303 = fadd double %301, %302
  %304 = fdiv double %303, 2.000000e+00
  store double %304, ptr %19, align 8, !tbaa !5
  br label %306

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

306:                                              ; preds = %300, %284, %279, %229, %179, %178, %114
  %307 = 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 %307
}

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 = { 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 = { 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}
!24 = distinct !{!24, !20}
!25 = distinct !{!25, !20}
!26 = distinct !{!26, !20}
!27 = distinct !{!27, !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
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__._Z15cmos_Ig_leakageddi9Gate_typebbb17Half_net_topology = external hidden unnamed_addr constant [102 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 i32 @_Z11combinationii(i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

; 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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_Z15cmos_Ig_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 509, ptr noundef nonnull @__PRETTY_FUNCTION__._Z15cmos_Ig_leakageddi9Gate_typebbb17Half_net_topology) #5
  unreachable

11:                                               ; preds = %8
  %12 = tail call noundef double @_Z9cmos_Ig_ndbbb(double noundef %0, i1 noundef zeroext %4, i1 noundef zeroext %5, i1 noundef zeroext %6)
  %13 = tail call noundef double @_Z9cmos_Ig_pdbbb(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 %118 [
    i32 0, label %16
    i32 1, label %41
    i32 2, label %66
    i32 3, label %.lr.ph140
    i32 4, label %87
    i32 5, label %106
    i32 6, label %115
  ]

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 %.loopexit

21:                                               ; preds = %16
  %22 = icmp eq i32 %7, 0
  br i1 %22, label %.lr.ph169, label %.lr.ph163.preheader

.lr.ph169:                                        ; preds = %21, %.lr.ph169
  %.0168 = phi i32 [ %28, %.lr.ph169 ], [ 1, %21 ]
  %.0114167 = phi double [ %27, %.lr.ph169 ], [ 0.000000e+00, %21 ]
  %23 = tail call noundef i32 @_Z11combinationii(i32 noundef %2, i32 noundef %.0168)
  %24 = sitofp i32 %23 to double
  %25 = fmul double %12, %24
  %26 = uitofp nneg i32 %.0168 to double
  %27 = tail call double @llvm.fmuladd.f64(double %25, double %26, double %.0114167)
  %28 = add nuw i32 %.0168, 1
  %exitcond189.not = icmp eq i32 %.0168, %2
  br i1 %exitcond189.not, label %.loopexit, label %.lr.ph169, !llvm.loop !5

.lr.ph163.preheader:                              ; preds = %21
  %29 = uitofp nneg i32 %2 to double
  %30 = tail call double @llvm.fmuladd.f64(double %12, double %29, double 0.000000e+00)
  br label %.lr.ph163

.lr.ph163:                                        ; preds = %.lr.ph163.preheader, %.lr.ph163
  %.1161 = phi i32 [ %38, %.lr.ph163 ], [ 1, %.lr.ph163.preheader ]
  %.1115160 = phi double [ %37, %.lr.ph163 ], [ %30, %.lr.ph163.preheader ]
  %31 = tail call noundef i32 @_Z11combinationii(i32 noundef %2, i32 noundef %.1161)
  %32 = sitofp i32 %31 to double
  %33 = fmul double %12, %32
  %34 = uitofp nneg i32 %.1161 to double
  %35 = fmul double %33, %34
  %36 = fmul double %35, 5.000000e-01
  %37 = fadd double %.1115160, %36
  %38 = add nuw nsw i32 %.1161, 1
  %exitcond188.not = icmp eq i32 %38, %2
  br i1 %exitcond188.not, label %._crit_edge164, label %.lr.ph163, !llvm.loop !7

._crit_edge164:                                   ; preds = %.lr.ph163
  %39 = sitofp i32 %15 to double
  %40 = fdiv double %37, %39
  br label %.loopexit

41:                                               ; preds = %11
  %42 = icmp eq i32 %2, 1
  br i1 %42, label %43, label %46

43:                                               ; preds = %41
  %44 = sitofp i32 %15 to double
  %45 = fdiv double %13, %44
  br label %.loopexit

46:                                               ; preds = %41
  %47 = icmp eq i32 %7, 0
  br i1 %47, label %.lr.ph158, label %.lr.ph152.preheader

.lr.ph158:                                        ; preds = %46, %.lr.ph158
  %.2157 = phi i32 [ %53, %.lr.ph158 ], [ 1, %46 ]
  %.2116156 = phi double [ %52, %.lr.ph158 ], [ 0.000000e+00, %46 ]
  %48 = tail call noundef i32 @_Z11combinationii(i32 noundef %2, i32 noundef %.2157)
  %49 = sitofp i32 %48 to double
  %50 = fmul double %13, %49
  %51 = uitofp nneg i32 %.2157 to double
  %52 = tail call double @llvm.fmuladd.f64(double %50, double %51, double %.2116156)
  %53 = add nuw i32 %.2157, 1
  %exitcond187.not = icmp eq i32 %.2157, %2
  br i1 %exitcond187.not, label %.loopexit, label %.lr.ph158, !llvm.loop !8

.lr.ph152.preheader:                              ; preds = %46
  %54 = uitofp nneg i32 %2 to double
  %55 = tail call double @llvm.fmuladd.f64(double %13, double %54, double 0.000000e+00)
  br label %.lr.ph152

.lr.ph152:                                        ; preds = %.lr.ph152.preheader, %.lr.ph152
  %.3150 = phi i32 [ %63, %.lr.ph152 ], [ 1, %.lr.ph152.preheader ]
  %.3117149 = phi double [ %62, %.lr.ph152 ], [ %55, %.lr.ph152.preheader ]
  %56 = tail call noundef i32 @_Z11combinationii(i32 noundef %2, i32 noundef %.3150)
  %57 = sitofp i32 %56 to double
  %58 = fmul double %13, %57
  %59 = uitofp nneg i32 %.3150 to double
  %60 = fmul double %58, %59
  %61 = fmul double %60, 5.000000e-01
  %62 = fadd double %.3117149, %61
  %63 = add nuw nsw i32 %.3150, 1
  %exitcond186.not = icmp eq i32 %63, %2
  br i1 %exitcond186.not, label %._crit_edge153, label %.lr.ph152, !llvm.loop !9

._crit_edge153:                                   ; preds = %.lr.ph152
  %64 = sitofp i32 %15 to double
  %65 = fdiv double %62, %64
  br label %.loopexit

66:                                               ; preds = %11
  %67 = fadd double %12, %13
  %68 = fmul double %67, 5.000000e-01
  br label %.loopexit

.lr.ph140:                                        ; preds = %11, %.lr.ph140
  %.4139 = phi i32 [ %74, %.lr.ph140 ], [ 1, %11 ]
  %.4118138 = phi double [ %73, %.lr.ph140 ], [ 0.000000e+00, %11 ]
  %69 = tail call noundef i32 @_Z11combinationii(i32 noundef %2, i32 noundef %.4139)
  %70 = sitofp i32 %69 to double
  %71 = fmul double %13, %70
  %72 = uitofp nneg i32 %.4139 to double
  %73 = tail call double @llvm.fmuladd.f64(double %71, double %72, double %.4118138)
  %74 = add nuw i32 %.4139, 1
  %exitcond183.not = icmp eq i32 %.4139, %2
  br i1 %exitcond183.not, label %._crit_edge141, label %.lr.ph140, !llvm.loop !10

._crit_edge141:                                   ; preds = %.lr.ph140
  %75 = uitofp nneg i32 %2 to double
  %76 = tail call double @llvm.fmuladd.f64(double %12, double %75, double %73)
  %.not = icmp eq i32 %2, 1
  br i1 %.not, label %._crit_edge147, label %.lr.ph146.preheader

.lr.ph146.preheader:                              ; preds = %._crit_edge141
  %smax184 = tail call i32 @llvm.smax.i32(i32 %2, i32 2)
  br label %.lr.ph146

.lr.ph146:                                        ; preds = %.lr.ph146.preheader, %.lr.ph146
  %.5144 = phi i32 [ %84, %.lr.ph146 ], [ 1, %.lr.ph146.preheader ]
  %.5119143 = phi double [ %83, %.lr.ph146 ], [ %76, %.lr.ph146.preheader ]
  %77 = tail call noundef i32 @_Z11combinationii(i32 noundef %2, i32 noundef %.5144)
  %78 = sitofp i32 %77 to double
  %79 = fmul double %12, %78
  %80 = uitofp nneg i32 %.5144 to double
  %81 = fmul double %79, %80
  %82 = fmul double %81, 5.000000e-01
  %83 = fadd double %.5119143, %82
  %84 = add nuw nsw i32 %.5144, 1
  %exitcond185.not = icmp eq i32 %84, %smax184
  br i1 %exitcond185.not, label %._crit_edge147, label %.lr.ph146, !llvm.loop !11

._crit_edge147:                                   ; preds = %.lr.ph146, %._crit_edge141
  %.5119.lcssa = phi double [ %76, %._crit_edge141 ], [ %83, %.lr.ph146 ]
  %85 = sitofp i32 %15 to double
  %86 = fdiv double %.5119.lcssa, %85
  br label %.loopexit

87:                                               ; preds = %11
  %88 = uitofp nneg i32 %2 to double
  %89 = tail call double @llvm.fmuladd.f64(double %13, double %88, double 0.000000e+00)
  %.not171 = icmp eq i32 %2, 1
  br i1 %.not171, label %.lr.ph135.preheader, label %.lr.ph

.lr.ph135.preheader:                              ; preds = %.lr.ph, %87
  %.6120.lcssa = phi double [ %89, %87 ], [ %96, %.lr.ph ]
  %smax = tail call i32 @llvm.smax.i32(i32 %2, i32 1)
  br label %.lr.ph135

.lr.ph:                                           ; preds = %87, %.lr.ph
  %.6131 = phi i32 [ %97, %.lr.ph ], [ 1, %87 ]
  %.6120130 = phi double [ %96, %.lr.ph ], [ %89, %87 ]
  %90 = tail call noundef i32 @_Z11combinationii(i32 noundef %2, i32 noundef %.6131)
  %91 = sitofp i32 %90 to double
  %92 = fmul double %13, %91
  %93 = uitofp nneg i32 %.6131 to double
  %94 = fmul double %92, %93
  %95 = fmul double %94, 5.000000e-01
  %96 = fadd double %.6120130, %95
  %97 = add nuw nsw i32 %.6131, 1
  %exitcond.not = icmp eq i32 %97, %2
  br i1 %exitcond.not, label %.lr.ph135.preheader, label %.lr.ph, !llvm.loop !12

.lr.ph135:                                        ; preds = %.lr.ph135.preheader, %.lr.ph135
  %.7134 = phi i32 [ %103, %.lr.ph135 ], [ 1, %.lr.ph135.preheader ]
  %.7121133 = phi double [ %102, %.lr.ph135 ], [ %.6120.lcssa, %.lr.ph135.preheader ]
  %98 = tail call noundef i32 @_Z11combinationii(i32 noundef %2, i32 noundef %.7134)
  %99 = sitofp i32 %98 to double
  %100 = fmul double %12, %99
  %101 = uitofp nneg i32 %.7134 to double
  %102 = tail call double @llvm.fmuladd.f64(double %100, double %101, double %.7121133)
  %103 = add nuw i32 %.7134, 1
  %exitcond182.not = icmp eq i32 %.7134, %smax
  br i1 %exitcond182.not, label %._crit_edge, label %.lr.ph135, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph135
  %104 = sitofp i32 %15 to double
  %105 = fdiv double %102, %104
  br label %.loopexit

106:                                              ; preds = %11
  %107 = fmul double %13, 2.000000e+00
  %108 = tail call double @llvm.fmuladd.f64(double %12, double 2.000000e+00, double %107)
  %109 = fmul double %108, 5.000000e-01
  %110 = fadd double %109, 0.000000e+00
  %111 = fadd double %12, %13
  %112 = fmul double %111, 5.000000e-01
  %113 = fadd double %112, %110
  %114 = fmul double %113, 5.000000e-01
  br label %.loopexit

115:                                              ; preds = %11
  %116 = fadd double %12, %13
  %117 = fmul double %116, 5.000000e-01
  br label %.loopexit

118:                                              ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.2, i32 noundef 613, ptr noundef nonnull @__PRETTY_FUNCTION__._Z15cmos_Ig_leakageddi9Gate_typebbb17Half_net_topology) #5
  unreachable

.loopexit:                                        ; preds = %.lr.ph158, %.lr.ph169, %43, %._crit_edge153, %18, %._crit_edge164, %115, %106, %._crit_edge, %._crit_edge147, %66
  %.8 = phi double [ %117, %115 ], [ %114, %106 ], [ %105, %._crit_edge ], [ %86, %._crit_edge147 ], [ %68, %66 ], [ %45, %43 ], [ %65, %._crit_edge153 ], [ %20, %18 ], [ %40, %._crit_edge164 ], [ %27, %.lr.ph169 ], [ %52, %.lr.ph158 ]
  ret double %.8
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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}
!10 = distinct !{!10, !6}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}


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