; LLVM IR from mhsitu/welding_robot :: coppeliaSim-client/common/stack (stackObject)

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

%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@simIsStackValueNull = external global ptr, align 8
@simPopStackItem = external global ptr, align 8
@simGetStackBoolValue = external global ptr, align 8
@simGetStackDoubleValue = external global ptr, align 8
@simGetStackStringValue = external global ptr, align 8
@simReleaseBuffer = external global ptr, align 8
@simGetStackTableInfo = external global ptr, align 8
@simGetStackDoubleTable = external global ptr, align 8
@simGetStackSize = external global ptr, align 8
@simUnfoldStackTable = external global ptr, align 8
@simMoveStackItemToTop = external global ptr, align 8

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN12CStackObject29buildItemFromTopStackPositionEi(i32 noundef %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca double, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.std::vector.3", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca i8, align 1
  %22 = alloca i8, align 1
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store ptr null, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %23 = load ptr, ptr @simIsStackValueNull, align 8, !tbaa !9
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = call noundef i32 %23(i32 noundef %24)
  %26 = icmp eq i32 1, %25
  br i1 %26, label %27, label %37

27:                                               ; preds = %1
  %28 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #7
  invoke void @_ZN10CStackNullC1Ev(ptr noundef nonnull align 8 dereferenceable(12) %28)
          to label %29 unwind label %33

29:                                               ; preds = %27
  store ptr %28, ptr %3, align 8, !tbaa !9
  %30 = load ptr, ptr @simPopStackItem, align 8, !tbaa !9
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = call noundef i32 %30(i32 noundef %31, i32 noundef 1)
  br label %303

33:                                               ; preds = %27
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %6, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %28, i64 noundef 16) #8
  br label %305

37:                                               ; preds = %1
  %38 = load ptr, ptr @simGetStackBoolValue, align 8, !tbaa !9
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = call noundef i32 %38(i32 noundef %39, ptr noundef %4)
  %41 = icmp eq i32 1, %40
  br i1 %41, label %42, label %55

42:                                               ; preds = %37
  %43 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #7
  %44 = load i8, ptr %4, align 1, !tbaa !11
  %45 = zext i8 %44 to i32
  %46 = icmp ne i32 %45, 0
  invoke void @_ZN10CStackBoolC1Eb(ptr noundef nonnull align 8 dereferenceable(13) %43, i1 noundef zeroext %46)
          to label %47 unwind label %51

47:                                               ; preds = %42
  store ptr %43, ptr %3, align 8, !tbaa !9
  %48 = load ptr, ptr @simPopStackItem, align 8, !tbaa !9
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = call noundef i32 %48(i32 noundef %49, i32 noundef 1)
  br label %302

51:                                               ; preds = %42
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %6, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %43, i64 noundef 16) #8
  br label %305

55:                                               ; preds = %37
  %56 = load ptr, ptr @simGetStackDoubleValue, align 8, !tbaa !9
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = call noundef i32 %56(i32 noundef %57, ptr noundef %5)
  %59 = icmp eq i32 1, %58
  br i1 %59, label %60, label %71

60:                                               ; preds = %55
  %61 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 24) #7
  %62 = load double, ptr %5, align 8, !tbaa !12
  invoke void @_ZN12CStackNumberC1Ed(ptr noundef nonnull align 8 dereferenceable(24) %61, double noundef %62)
          to label %63 unwind label %67

63:                                               ; preds = %60
  store ptr %61, ptr %3, align 8, !tbaa !9
  %64 = load ptr, ptr @simPopStackItem, align 8, !tbaa !9
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = call noundef i32 %64(i32 noundef %65, i32 noundef 1)
  br label %301

67:                                               ; preds = %60
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %6, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %61, i64 noundef 24) #8
  br label %305

71:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %72 = load ptr, ptr @simGetStackStringValue, align 8, !tbaa !9
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = call noundef ptr %72(i32 noundef %73, ptr noundef %8)
  store ptr %74, ptr %9, align 8, !tbaa !9
  %75 = load ptr, ptr %9, align 8, !tbaa !9
  %76 = icmp ne ptr %75, null
  br i1 %76, label %77, label %92

77:                                               ; preds = %71
  %78 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 48) #7
  %79 = load ptr, ptr %9, align 8, !tbaa !9
  %80 = load i32, ptr %8, align 4, !tbaa !5
  invoke void @_ZN12CStackStringC1EPKci(ptr noundef nonnull align 8 dereferenceable(48) %78, ptr noundef %79, i32 noundef %80)
          to label %81 unwind label %88

81:                                               ; preds = %77
  store ptr %78, ptr %3, align 8, !tbaa !9
  %82 = load ptr, ptr @simReleaseBuffer, align 8, !tbaa !9
  %83 = load ptr, ptr %9, align 8, !tbaa !9
  %84 = call noundef i32 %82(ptr noundef %83)
  %85 = load ptr, ptr @simPopStackItem, align 8, !tbaa !9
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = call noundef i32 %85(i32 noundef %86, i32 noundef 1)
  br label %299

88:                                               ; preds = %77
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %6, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %78, i64 noundef 48) #8
  br label %300

92:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %93 = load ptr, ptr @simGetStackTableInfo, align 8, !tbaa !9
  %94 = load i32, ptr %2, align 4, !tbaa !5
  %95 = call noundef i32 %93(i32 noundef %94, i32 noundef 0)
  store i32 %95, ptr %10, align 4, !tbaa !5
  %96 = load i32, ptr %10, align 4, !tbaa !5
  %97 = icmp eq i32 %96, -4
  br i1 %97, label %98, label %110

98:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %99 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 96) #7
  invoke void @_ZN11CStackArrayC1Ev(ptr noundef nonnull align 8 dereferenceable(89) %99)
          to label %100 unwind label %106

100:                                              ; preds = %98
  store ptr %99, ptr %11, align 8, !tbaa !9
  %101 = load ptr, ptr %11, align 8, !tbaa !9
  call void @_ZN11CStackArray14setCircularRefEv(ptr noundef nonnull align 8 dereferenceable(89) %101)
  %102 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr %102, ptr %3, align 8, !tbaa !9
  %103 = load ptr, ptr @simPopStackItem, align 8, !tbaa !9
  %104 = load i32, ptr %2, align 4, !tbaa !5
  %105 = call noundef i32 %103(i32 noundef %104, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %297

106:                                              ; preds = %98
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %6, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %99, i64 noundef 96) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %298

110:                                              ; preds = %92
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = icmp eq i32 %111, 0
  br i1 %112, label %113, label %123

113:                                              ; preds = %110
  %114 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 96) #7
  invoke void @_ZN11CStackArrayC1Ev(ptr noundef nonnull align 8 dereferenceable(89) %114)
          to label %115 unwind label %119

115:                                              ; preds = %113
  store ptr %114, ptr %3, align 8, !tbaa !9
  %116 = load ptr, ptr @simPopStackItem, align 8, !tbaa !9
  %117 = load i32, ptr %2, align 4, !tbaa !5
  %118 = call noundef i32 %116(i32 noundef %117, i32 noundef 1)
  br label %296

119:                                              ; preds = %113
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %6, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %114, i64 noundef 96) #8
  br label %298

123:                                              ; preds = %110
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = icmp sgt i32 %124, 0
  br i1 %125, label %126, label %208

126:                                              ; preds = %123
  %127 = load ptr, ptr @simGetStackTableInfo, align 8, !tbaa !9
  %128 = load i32, ptr %2, align 4, !tbaa !5
  %129 = call noundef i32 %127(i32 noundef %128, i32 noundef 2)
  %130 = icmp eq i32 1, %129
  br i1 %130, label %131, label %163

131:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %132 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 96) #7
  invoke void @_ZN11CStackArrayC1Ev(ptr noundef nonnull align 8 dereferenceable(89) %132)
          to label %133 unwind label %154

133:                                              ; preds = %131
  store ptr %132, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #6
  call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  %134 = load i32, ptr %10, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  invoke void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %135)
          to label %136 unwind label %158

136:                                              ; preds = %133
  %137 = load ptr, ptr @simGetStackDoubleTable, align 8, !tbaa !9
  %138 = load i32, ptr %2, align 4, !tbaa !5
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 0) #6
  %140 = load i32, ptr %10, align 4, !tbaa !5
  %141 = invoke noundef i32 %137(i32 noundef %138, ptr noundef %139, i32 noundef %140)
          to label %142 unwind label %158

142:                                              ; preds = %136
  %143 = load ptr, ptr %12, align 8, !tbaa !9
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 0) #6
  %145 = load i32, ptr %10, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = invoke noundef zeroext i1 @_ZN11CStackArray14setDoubleArrayEPKdm(ptr noundef nonnull align 8 dereferenceable(89) %143, ptr noundef %144, i64 noundef %146)
          to label %148 unwind label %158

148:                                              ; preds = %142
  %149 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %149, ptr %3, align 8, !tbaa !9
  %150 = load ptr, ptr @simPopStackItem, align 8, !tbaa !9
  %151 = load i32, ptr %2, align 4, !tbaa !5
  %152 = invoke noundef i32 %150(i32 noundef %151, i32 noundef 1)
          to label %153 unwind label %158

153:                                              ; preds = %148
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %207

154:                                              ; preds = %131
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %6, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %132, i64 noundef 96) #8
  br label %162

158:                                              ; preds = %148, %142, %136, %133
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %6, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %7, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  br label %162

162:                                              ; preds = %158, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %298

163:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %164 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 96) #7
  invoke void @_ZN11CStackArrayC1Ev(ptr noundef nonnull align 8 dereferenceable(89) %164)
          to label %165 unwind label %184

165:                                              ; preds = %163
  store ptr %164, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %166 = load ptr, ptr @simGetStackSize, align 8, !tbaa !9
  %167 = load i32, ptr %2, align 4, !tbaa !5
  %168 = call noundef i32 %166(i32 noundef %167)
  %169 = sub nsw i32 %168, 1
  store i32 %169, ptr %15, align 4, !tbaa !5
  %170 = load ptr, ptr @simUnfoldStackTable, align 8, !tbaa !9
  %171 = load i32, ptr %2, align 4, !tbaa !5
  %172 = call noundef i32 %170(i32 noundef %171)
  %173 = load ptr, ptr @simGetStackSize, align 8, !tbaa !9
  %174 = load i32, ptr %2, align 4, !tbaa !5
  %175 = call noundef i32 %173(i32 noundef %174)
  %176 = load i32, ptr %15, align 4, !tbaa !5
  %177 = sub nsw i32 %175, %176
  %178 = sdiv i32 %177, 2
  store i32 %178, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %179

179:                                              ; preds = %202, %165
  %180 = load i32, ptr %16, align 4, !tbaa !5
  %181 = load i32, ptr %10, align 4, !tbaa !5
  %182 = icmp slt i32 %180, %181
  br i1 %182, label %188, label %183

183:                                              ; preds = %179
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %205

184:                                              ; preds = %163
  %185 = landingpad { ptr, i32 }
          cleanup
  %186 = extractvalue { ptr, i32 } %185, 0
  store ptr %186, ptr %6, align 8
  %187 = extractvalue { ptr, i32 } %185, 1
  store i32 %187, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %164, i64 noundef 96) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %298

188:                                              ; preds = %179
  %189 = load ptr, ptr @simMoveStackItemToTop, align 8, !tbaa !9
  %190 = load i32, ptr %2, align 4, !tbaa !5
  %191 = load i32, ptr %15, align 4, !tbaa !5
  %192 = call noundef i32 %189(i32 noundef %190, i32 noundef %191)
  %193 = load ptr, ptr @simPopStackItem, align 8, !tbaa !9
  %194 = load i32, ptr %2, align 4, !tbaa !5
  %195 = call noundef i32 %193(i32 noundef %194, i32 noundef 1)
  %196 = load ptr, ptr @simMoveStackItemToTop, align 8, !tbaa !9
  %197 = load i32, ptr %2, align 4, !tbaa !5
  %198 = load i32, ptr %15, align 4, !tbaa !5
  %199 = call noundef i32 %196(i32 noundef %197, i32 noundef %198)
  %200 = load ptr, ptr %14, align 8, !tbaa !9
  %201 = load i32, ptr %2, align 4, !tbaa !5
  call void @_ZN11CStackArray18appendTopStackItemEi(ptr noundef nonnull align 8 dereferenceable(89) %200, i32 noundef %201)
  br label %202

202:                                              ; preds = %188
  %203 = load i32, ptr %16, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %16, align 4, !tbaa !5
  br label %179, !llvm.loop !14

205:                                              ; preds = %183
  %206 = load ptr, ptr %14, align 8, !tbaa !9
  store ptr %206, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %207

207:                                              ; preds = %205, %153
  br label %295

208:                                              ; preds = %123
  %209 = load i32, ptr %10, align 4, !tbaa !5
  %210 = icmp eq i32 %209, -2
  br i1 %210, label %211, label %294

211:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %212 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 160) #7
  invoke void @_ZN9CStackMapC1Ev(ptr noundef nonnull align 8 dereferenceable(160) %212)
          to label %213 unwind label %232

213:                                              ; preds = %211
  store ptr %212, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %214 = load ptr, ptr @simGetStackSize, align 8, !tbaa !9
  %215 = load i32, ptr %2, align 4, !tbaa !5
  %216 = call noundef i32 %214(i32 noundef %215)
  %217 = sub nsw i32 %216, 1
  store i32 %217, ptr %18, align 4, !tbaa !5
  %218 = load ptr, ptr @simUnfoldStackTable, align 8, !tbaa !9
  %219 = load i32, ptr %2, align 4, !tbaa !5
  %220 = call noundef i32 %218(i32 noundef %219)
  %221 = load ptr, ptr @simGetStackSize, align 8, !tbaa !9
  %222 = load i32, ptr %2, align 4, !tbaa !5
  %223 = call noundef i32 %221(i32 noundef %222)
  %224 = load i32, ptr %18, align 4, !tbaa !5
  %225 = sub nsw i32 %223, %224
  %226 = sdiv i32 %225, 2
  store i32 %226, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %227

227:                                              ; preds = %289, %213
  %228 = load i32, ptr %19, align 4, !tbaa !5
  %229 = load i32, ptr %10, align 4, !tbaa !5
  %230 = icmp slt i32 %228, %229
  br i1 %230, label %236, label %231

231:                                              ; preds = %227
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %292

232:                                              ; preds = %211
  %233 = landingpad { ptr, i32 }
          cleanup
  %234 = extractvalue { ptr, i32 } %233, 0
  store ptr %234, ptr %6, align 8
  %235 = extractvalue { ptr, i32 } %233, 1
  store i32 %235, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %212, i64 noundef 160) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %298

236:                                              ; preds = %227
  %237 = load ptr, ptr @simMoveStackItemToTop, align 8, !tbaa !9
  %238 = load i32, ptr %2, align 4, !tbaa !5
  %239 = load i32, ptr %18, align 4, !tbaa !5
  %240 = call noundef i32 %237(i32 noundef %238, i32 noundef %239)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %241 = load ptr, ptr @simGetStackStringValue, align 8, !tbaa !9
  %242 = load i32, ptr %2, align 4, !tbaa !5
  %243 = call noundef ptr %241(i32 noundef %242, ptr noundef null)
  store ptr %243, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #6
  %244 = load ptr, ptr @simGetStackBoolValue, align 8, !tbaa !9
  %245 = load i32, ptr %2, align 4, !tbaa !5
  %246 = call noundef i32 %244(i32 noundef %245, ptr noundef %4)
  %247 = icmp eq i32 %246, 1
  %248 = zext i1 %247 to i8
  store i8 %248, ptr %21, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #6
  %249 = load ptr, ptr @simGetStackDoubleValue, align 8, !tbaa !9
  %250 = load i32, ptr %2, align 4, !tbaa !5
  %251 = call noundef i32 %249(i32 noundef %250, ptr noundef %5)
  %252 = icmp eq i32 %251, 1
  %253 = zext i1 %252 to i8
  store i8 %253, ptr %22, align 1, !tbaa !16
  %254 = load ptr, ptr @simPopStackItem, align 8, !tbaa !9
  %255 = load i32, ptr %2, align 4, !tbaa !5
  %256 = call noundef i32 %254(i32 noundef %255, i32 noundef 1)
  %257 = load ptr, ptr @simMoveStackItemToTop, align 8, !tbaa !9
  %258 = load i32, ptr %2, align 4, !tbaa !5
  %259 = load i32, ptr %18, align 4, !tbaa !5
  %260 = call noundef i32 %257(i32 noundef %258, i32 noundef %259)
  %261 = load i8, ptr %22, align 1, !tbaa !16, !range !18, !noundef !19
  %262 = trunc i8 %261 to i1
  br i1 %262, label %263, label %268

263:                                              ; preds = %236
  %264 = load ptr, ptr %17, align 8, !tbaa !9
  %265 = load double, ptr %5, align 8, !tbaa !12
  %266 = fptosi double %265 to i32
  %267 = load i32, ptr %2, align 4, !tbaa !5
  call void @_ZN9CStackMap18appendTopStackItemEii(ptr noundef nonnull align 8 dereferenceable(160) %264, i32 noundef %266, i32 noundef %267)
  br label %281

268:                                              ; preds = %236
  %269 = load i8, ptr %21, align 1, !tbaa !16, !range !18, !noundef !19
  %270 = trunc i8 %269 to i1
  br i1 %270, label %271, label %276

271:                                              ; preds = %268
  %272 = load ptr, ptr %17, align 8, !tbaa !9
  %273 = load i8, ptr %4, align 1, !tbaa !11
  %274 = zext i8 %273 to i32
  %275 = load i32, ptr %2, align 4, !tbaa !5
  call void @_ZN9CStackMap18appendTopStackItemEii(ptr noundef nonnull align 8 dereferenceable(160) %272, i32 noundef %274, i32 noundef %275)
  br label %280

276:                                              ; preds = %268
  %277 = load ptr, ptr %17, align 8, !tbaa !9
  %278 = load ptr, ptr %20, align 8, !tbaa !9
  %279 = load i32, ptr %2, align 4, !tbaa !5
  call void @_ZN9CStackMap18appendTopStackItemEPKci(ptr noundef nonnull align 8 dereferenceable(160) %277, ptr noundef %278, i32 noundef %279)
  br label %280

280:                                              ; preds = %276, %271
  br label %281

281:                                              ; preds = %280, %263
  %282 = load ptr, ptr %20, align 8, !tbaa !9
  %283 = icmp ne ptr %282, null
  br i1 %283, label %284, label %288

284:                                              ; preds = %281
  %285 = load ptr, ptr @simReleaseBuffer, align 8, !tbaa !9
  %286 = load ptr, ptr %20, align 8, !tbaa !9
  %287 = call noundef i32 %285(ptr noundef %286)
  br label %288

288:                                              ; preds = %284, %281
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %289

289:                                              ; preds = %288
  %290 = load i32, ptr %19, align 4, !tbaa !5
  %291 = add nsw i32 %290, 1
  store i32 %291, ptr %19, align 4, !tbaa !5
  br label %227, !llvm.loop !20

292:                                              ; preds = %231
  %293 = load ptr, ptr %17, align 8, !tbaa !9
  store ptr %293, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %294

294:                                              ; preds = %292, %208
  br label %295

295:                                              ; preds = %294, %207
  br label %296

296:                                              ; preds = %295, %115
  br label %297

297:                                              ; preds = %296, %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %299

298:                                              ; preds = %232, %184, %162, %119, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %300

299:                                              ; preds = %297, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %301

300:                                              ; preds = %298, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %305

301:                                              ; preds = %299, %63
  br label %302

302:                                              ; preds = %301, %47
  br label %303

303:                                              ; preds = %302, %29
  %304 = load ptr, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret ptr %304

305:                                              ; preds = %300, %67, %51, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %306

306:                                              ; preds = %305
  %307 = load ptr, ptr %6, align 8
  %308 = load i32, ptr %7, align 4
  %309 = insertvalue { ptr, i32 } poison, ptr %307, 0
  %310 = insertvalue { ptr, i32 } %309, i32 %308, 1
  resume { ptr, i32 } %310
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

declare void @_ZN10CStackNullC1Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #4

declare void @_ZN10CStackBoolC1Eb(ptr noundef nonnull align 8 dereferenceable(13), i1 noundef zeroext) unnamed_addr #3

declare void @_ZN12CStackNumberC1Ed(ptr noundef nonnull align 8 dereferenceable(24), double noundef) unnamed_addr #3

declare void @_ZN12CStackStringC1EPKci(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i32 noundef) unnamed_addr #3

declare void @_ZN11CStackArrayC1Ev(ptr noundef nonnull align 8 dereferenceable(89)) unnamed_addr #3

declare void @_ZN11CStackArray14setCircularRefEv(ptr noundef nonnull align 8 dereferenceable(89)) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #5 align 2

declare noundef zeroext i1 @_ZN11CStackArray14setDoubleArrayEPKdm(ptr noundef nonnull align 8 dereferenceable(89), ptr noundef, i64 noundef) #3

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

declare void @_ZN11CStackArray18appendTopStackItemEi(ptr noundef nonnull align 8 dereferenceable(89), i32 noundef) #3

declare void @_ZN9CStackMapC1Ev(ptr noundef nonnull align 8 dereferenceable(160)) unnamed_addr #3

declare void @_ZN9CStackMap18appendTopStackItemEii(ptr noundef nonnull align 8 dereferenceable(160), i32 noundef, i32 noundef) #3

declare void @_ZN9CStackMap18appendTopStackItemEPKci(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef, i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nobuiltin allocsize(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 = { "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 = { nobuiltin 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 = { 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 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !17, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !15}


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

%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@simIsStackValueNull = external local_unnamed_addr global ptr, align 8
@simPopStackItem = external local_unnamed_addr global ptr, align 8
@simGetStackBoolValue = external local_unnamed_addr global ptr, align 8
@simGetStackDoubleValue = external local_unnamed_addr global ptr, align 8
@simGetStackStringValue = external local_unnamed_addr global ptr, align 8
@simReleaseBuffer = external local_unnamed_addr global ptr, align 8
@simGetStackTableInfo = external local_unnamed_addr global ptr, align 8
@simGetStackDoubleTable = external local_unnamed_addr global ptr, align 8
@simGetStackSize = external local_unnamed_addr global ptr, align 8
@simUnfoldStackTable = external local_unnamed_addr global ptr, align 8
@simMoveStackItemToTop = external local_unnamed_addr global ptr, align 8

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN12CStackObject29buildItemFromTopStackPositionEi(i32 noundef %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i8, align 1
  %3 = alloca double, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector.3", align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %6 = load ptr, ptr @simIsStackValueNull, align 8, !tbaa !5
  %7 = tail call noundef i32 %6(i32 noundef %0)
  %8 = icmp eq i32 %7, 1
  br i1 %8, label %9, label %16

9:                                                ; preds = %1
  %10 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #7
  invoke void @_ZN10CStackNullC1Ev(ptr noundef nonnull align 8 dereferenceable(12) %10)
          to label %11 unwind label %14

11:                                               ; preds = %9
  %12 = load ptr, ptr @simPopStackItem, align 8, !tbaa !5
  %13 = tail call noundef i32 %12(i32 noundef %0, i32 noundef 1)
  br label %163

14:                                               ; preds = %9
  %15 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %10, i64 noundef 16) #8
  br label %164

16:                                               ; preds = %1
  %17 = load ptr, ptr @simGetStackBoolValue, align 8, !tbaa !5
  %18 = call noundef i32 %17(i32 noundef %0, ptr noundef nonnull %2)
  %19 = icmp eq i32 %18, 1
  br i1 %19, label %20, label %29

20:                                               ; preds = %16
  %21 = call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #7
  %22 = load i8, ptr %2, align 1, !tbaa !9
  %23 = icmp ne i8 %22, 0
  invoke void @_ZN10CStackBoolC1Eb(ptr noundef nonnull align 8 dereferenceable(13) %21, i1 noundef zeroext %23)
          to label %24 unwind label %27

24:                                               ; preds = %20
  %25 = load ptr, ptr @simPopStackItem, align 8, !tbaa !5
  %26 = call noundef i32 %25(i32 noundef %0, i32 noundef 1)
  br label %163

27:                                               ; preds = %20
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %21, i64 noundef 16) #8
  br label %164

29:                                               ; preds = %16
  %30 = load ptr, ptr @simGetStackDoubleValue, align 8, !tbaa !5
  %31 = call noundef i32 %30(i32 noundef %0, ptr noundef nonnull %3)
  %32 = icmp eq i32 %31, 1
  br i1 %32, label %33, label %41

33:                                               ; preds = %29
  %34 = call noalias noundef nonnull dereferenceable(24) ptr @_Znwm(i64 noundef 24) #7
  %35 = load double, ptr %3, align 8, !tbaa !10
  invoke void @_ZN12CStackNumberC1Ed(ptr noundef nonnull align 8 dereferenceable(24) %34, double noundef %35)
          to label %36 unwind label %39

36:                                               ; preds = %33
  %37 = load ptr, ptr @simPopStackItem, align 8, !tbaa !5
  %38 = call noundef i32 %37(i32 noundef %0, i32 noundef 1)
  br label %163

39:                                               ; preds = %33
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %34, i64 noundef 24) #8
  br label %164

41:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %42 = load ptr, ptr @simGetStackStringValue, align 8, !tbaa !5
  %43 = call noundef ptr %42(i32 noundef %0, ptr noundef nonnull %4)
  %.not = icmp eq ptr %43, null
  br i1 %.not, label %54, label %44

44:                                               ; preds = %41
  %45 = call noalias noundef nonnull dereferenceable(48) ptr @_Znwm(i64 noundef 48) #7
  %46 = load i32, ptr %4, align 4, !tbaa !12
  invoke void @_ZN12CStackStringC1EPKci(ptr noundef nonnull align 8 dereferenceable(48) %45, ptr noundef nonnull %43, i32 noundef %46)
          to label %47 unwind label %52

47:                                               ; preds = %44
  %48 = load ptr, ptr @simReleaseBuffer, align 8, !tbaa !5
  %49 = call noundef i32 %48(ptr noundef nonnull %43)
  %50 = load ptr, ptr @simPopStackItem, align 8, !tbaa !5
  %51 = call noundef i32 %50(i32 noundef %0, i32 noundef 1)
  br label %.loopexit

52:                                               ; preds = %44
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %45, i64 noundef 48) #8
  br label %162

54:                                               ; preds = %41
  %55 = load ptr, ptr @simGetStackTableInfo, align 8, !tbaa !5
  %56 = call noundef i32 %55(i32 noundef %0, i32 noundef 0)
  switch i32 %56, label %71 [
    i32 -4, label %57
    i32 0, label %64
  ]

57:                                               ; preds = %54
  %58 = call noalias noundef nonnull dereferenceable(96) ptr @_Znwm(i64 noundef 96) #7
  invoke void @_ZN11CStackArrayC1Ev(ptr noundef nonnull align 8 dereferenceable(89) %58)
          to label %59 unwind label %62

59:                                               ; preds = %57
  call void @_ZN11CStackArray14setCircularRefEv(ptr noundef nonnull align 8 dereferenceable(89) %58)
  %60 = load ptr, ptr @simPopStackItem, align 8, !tbaa !5
  %61 = call noundef i32 %60(i32 noundef %0, i32 noundef 1)
  br label %.loopexit

62:                                               ; preds = %57
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %58, i64 noundef 96) #8
  br label %162

64:                                               ; preds = %54
  %65 = call noalias noundef nonnull dereferenceable(96) ptr @_Znwm(i64 noundef 96) #7
  invoke void @_ZN11CStackArrayC1Ev(ptr noundef nonnull align 8 dereferenceable(89) %65)
          to label %66 unwind label %69

66:                                               ; preds = %64
  %67 = load ptr, ptr @simPopStackItem, align 8, !tbaa !5
  %68 = call noundef i32 %67(i32 noundef %0, i32 noundef 1)
  br label %.loopexit

69:                                               ; preds = %64
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %65, i64 noundef 96) #8
  br label %162

71:                                               ; preds = %54
  %72 = icmp sgt i32 %56, 0
  br i1 %72, label %73, label %117

73:                                               ; preds = %71
  %74 = load ptr, ptr @simGetStackTableInfo, align 8, !tbaa !5
  %75 = call noundef i32 %74(i32 noundef %0, i32 noundef 2)
  %76 = icmp eq i32 %75, 1
  %77 = call noalias noundef nonnull dereferenceable(96) ptr @_Znwm(i64 noundef 96) #7
  br i1 %76, label %78, label %96

78:                                               ; preds = %73
  invoke void @_ZN11CStackArrayC1Ev(ptr noundef nonnull align 8 dereferenceable(89) %77)
          to label %79 unwind label %92

79:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %80 = zext nneg i32 %56 to i64
  invoke void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %80)
          to label %81 unwind label %94

81:                                               ; preds = %79
  %82 = load ptr, ptr @simGetStackDoubleTable, align 8, !tbaa !5
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 0) #6
  %84 = invoke noundef i32 %82(i32 noundef %0, ptr noundef nonnull %83, i32 noundef %56)
          to label %85 unwind label %94

85:                                               ; preds = %81
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 0) #6
  %87 = invoke noundef zeroext i1 @_ZN11CStackArray14setDoubleArrayEPKdm(ptr noundef nonnull align 8 dereferenceable(89) %77, ptr noundef nonnull %86, i64 noundef %80)
          to label %88 unwind label %94

88:                                               ; preds = %85
  %89 = load ptr, ptr @simPopStackItem, align 8, !tbaa !5
  %90 = invoke noundef i32 %89(i32 noundef %0, i32 noundef 1)
          to label %91 unwind label %94

91:                                               ; preds = %88
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %.loopexit

92:                                               ; preds = %78
  %93 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %77, i64 noundef 96) #8
  br label %162

94:                                               ; preds = %88, %85, %81, %79
  %95 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %162

96:                                               ; preds = %73
  invoke void @_ZN11CStackArrayC1Ev(ptr noundef nonnull align 8 dereferenceable(89) %77)
          to label %97 unwind label %108

97:                                               ; preds = %96
  %98 = load ptr, ptr @simGetStackSize, align 8, !tbaa !5
  %99 = call noundef i32 %98(i32 noundef %0)
  %100 = add nsw i32 %99, -1
  %101 = load ptr, ptr @simUnfoldStackTable, align 8, !tbaa !5
  %102 = call noundef i32 %101(i32 noundef %0)
  %103 = load ptr, ptr @simGetStackSize, align 8, !tbaa !5
  %104 = call noundef i32 %103(i32 noundef %0)
  %105 = sub nsw i32 %104, %100
  %106 = sdiv i32 %105, 2
  %107 = icmp sgt i32 %105, 1
  br i1 %107, label %.lr.ph95, label %.loopexit

108:                                              ; preds = %96
  %109 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %77, i64 noundef 96) #8
  br label %162

.lr.ph95:                                         ; preds = %97, %.lr.ph95
  %.08094 = phi i32 [ %116, %.lr.ph95 ], [ 0, %97 ]
  %110 = load ptr, ptr @simMoveStackItemToTop, align 8, !tbaa !5
  %111 = call noundef i32 %110(i32 noundef %0, i32 noundef %100)
  %112 = load ptr, ptr @simPopStackItem, align 8, !tbaa !5
  %113 = call noundef i32 %112(i32 noundef %0, i32 noundef 1)
  %114 = load ptr, ptr @simMoveStackItemToTop, align 8, !tbaa !5
  %115 = call noundef i32 %114(i32 noundef %0, i32 noundef %100)
  call void @_ZN11CStackArray18appendTopStackItemEi(ptr noundef nonnull align 8 dereferenceable(89) %77, i32 noundef %0)
  %116 = add nuw nsw i32 %.08094, 1
  %exitcond97.not = icmp eq i32 %116, %106
  br i1 %exitcond97.not, label %.loopexit, label %.lr.ph95, !llvm.loop !14

117:                                              ; preds = %71
  %118 = icmp eq i32 %56, -2
  br i1 %118, label %119, label %.loopexit

119:                                              ; preds = %117
  %120 = call noalias noundef nonnull dereferenceable(160) ptr @_Znwm(i64 noundef 160) #7
  invoke void @_ZN9CStackMapC1Ev(ptr noundef nonnull align 8 dereferenceable(160) %120)
          to label %121 unwind label %132

121:                                              ; preds = %119
  %122 = load ptr, ptr @simGetStackSize, align 8, !tbaa !5
  %123 = call noundef i32 %122(i32 noundef %0)
  %124 = add nsw i32 %123, -1
  %125 = load ptr, ptr @simUnfoldStackTable, align 8, !tbaa !5
  %126 = call noundef i32 %125(i32 noundef %0)
  %127 = load ptr, ptr @simGetStackSize, align 8, !tbaa !5
  %128 = call noundef i32 %127(i32 noundef %0)
  %129 = sub nsw i32 %128, %124
  %130 = sdiv i32 %129, 2
  %131 = icmp sgt i32 %129, 1
  br i1 %131, label %.lr.ph, label %.loopexit

132:                                              ; preds = %119
  %133 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %120, i64 noundef 160) #8
  br label %162

.lr.ph:                                           ; preds = %121, %160
  %.07993 = phi i32 [ %161, %160 ], [ 0, %121 ]
  %134 = load ptr, ptr @simMoveStackItemToTop, align 8, !tbaa !5
  %135 = call noundef i32 %134(i32 noundef %0, i32 noundef %124)
  %136 = load ptr, ptr @simGetStackStringValue, align 8, !tbaa !5
  %137 = call noundef ptr %136(i32 noundef %0, ptr noundef null)
  %138 = load ptr, ptr @simGetStackBoolValue, align 8, !tbaa !5
  %139 = call noundef i32 %138(i32 noundef %0, ptr noundef nonnull %2)
  %140 = load ptr, ptr @simGetStackDoubleValue, align 8, !tbaa !5
  %141 = call noundef i32 %140(i32 noundef %0, ptr noundef nonnull %3)
  %142 = icmp eq i32 %141, 1
  %143 = load ptr, ptr @simPopStackItem, align 8, !tbaa !5
  %144 = call noundef i32 %143(i32 noundef %0, i32 noundef 1)
  %145 = load ptr, ptr @simMoveStackItemToTop, align 8, !tbaa !5
  %146 = call noundef i32 %145(i32 noundef %0, i32 noundef %124)
  br i1 %142, label %147, label %150

147:                                              ; preds = %.lr.ph
  %148 = load double, ptr %3, align 8, !tbaa !10
  %149 = fptosi double %148 to i32
  call void @_ZN9CStackMap18appendTopStackItemEii(ptr noundef nonnull align 8 dereferenceable(160) %120, i32 noundef %149, i32 noundef %0)
  br label %156

150:                                              ; preds = %.lr.ph
  %151 = icmp eq i32 %139, 1
  br i1 %151, label %152, label %155

152:                                              ; preds = %150
  %153 = load i8, ptr %2, align 1, !tbaa !9
  %154 = zext i8 %153 to i32
  call void @_ZN9CStackMap18appendTopStackItemEii(ptr noundef nonnull align 8 dereferenceable(160) %120, i32 noundef %154, i32 noundef %0)
  br label %156

155:                                              ; preds = %150
  call void @_ZN9CStackMap18appendTopStackItemEPKci(ptr noundef nonnull align 8 dereferenceable(160) %120, ptr noundef %137, i32 noundef %0)
  br label %156

156:                                              ; preds = %152, %155, %147
  %.not84 = icmp eq ptr %137, null
  br i1 %.not84, label %160, label %157

157:                                              ; preds = %156
  %158 = load ptr, ptr @simReleaseBuffer, align 8, !tbaa !5
  %159 = call noundef i32 %158(ptr noundef nonnull %137)
  br label %160

160:                                              ; preds = %157, %156
  %161 = add nuw nsw i32 %.07993, 1
  %exitcond.not = icmp eq i32 %161, %130
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !16

.loopexit:                                        ; preds = %160, %.lr.ph95, %121, %97, %59, %91, %117, %66, %47
  %.1 = phi ptr [ %45, %47 ], [ %58, %59 ], [ %65, %66 ], [ %77, %91 ], [ null, %117 ], [ %77, %97 ], [ %120, %121 ], [ %77, %.lr.ph95 ], [ %120, %160 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %163

162:                                              ; preds = %62, %69, %108, %132, %94, %92, %52
  %.pn88 = phi { ptr, i32 } [ %53, %52 ], [ %63, %62 ], [ %70, %69 ], [ %109, %108 ], [ %133, %132 ], [ %95, %94 ], [ %93, %92 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %164

163:                                              ; preds = %24, %.loopexit, %36, %11
  %.2 = phi ptr [ %10, %11 ], [ %21, %24 ], [ %34, %36 ], [ %.1, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  ret ptr %.2

164:                                              ; preds = %162, %39, %27, %14
  %.pn90 = phi { ptr, i32 } [ %15, %14 ], [ %28, %27 ], [ %40, %39 ], [ %.pn88, %162 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn90
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

declare void @_ZN10CStackNullC1Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #4

declare void @_ZN10CStackBoolC1Eb(ptr noundef nonnull align 8 dereferenceable(13), i1 noundef zeroext) unnamed_addr #3

declare void @_ZN12CStackNumberC1Ed(ptr noundef nonnull align 8 dereferenceable(24), double noundef) unnamed_addr #3

declare void @_ZN12CStackStringC1EPKci(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i32 noundef) unnamed_addr #3

declare void @_ZN11CStackArrayC1Ev(ptr noundef nonnull align 8 dereferenceable(89)) unnamed_addr #3

declare void @_ZN11CStackArray14setCircularRefEv(ptr noundef nonnull align 8 dereferenceable(89)) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #5 align 2

declare noundef zeroext i1 @_ZN11CStackArray14setDoubleArrayEPKdm(ptr noundef nonnull align 8 dereferenceable(89), ptr noundef, i64 noundef) local_unnamed_addr #3

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

declare void @_ZN11CStackArray18appendTopStackItemEi(ptr noundef nonnull align 8 dereferenceable(89), i32 noundef) local_unnamed_addr #3

declare void @_ZN9CStackMapC1Ev(ptr noundef nonnull align 8 dereferenceable(160)) unnamed_addr #3

declare void @_ZN9CStackMap18appendTopStackItemEii(ptr noundef nonnull align 8 dereferenceable(160), i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @_ZN9CStackMap18appendTopStackItemEPKci(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef, i32 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nobuiltin allocsize(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 = { "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 = { nobuiltin 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 = { 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 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass