; LLVM IR from sympiler/nasoq :: src/common/PostOrder.ll (ZN5nasoq10postOrderCEPimS0_S0_i)

; 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 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@__PRETTY_FUNCTION__._ZN5nasoq10postOrderCEPimS0_S0_i = external hidden unnamed_addr constant [56 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5nasoq10postOrderCEPimS0_S0_i(ptr noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 1, ptr %22, align 4, !tbaa !11
  %26 = load i64, ptr %8, align 8, !tbaa !9
  %27 = call noundef i64 @_ZN5nasoq11mult_size_tEmmPi(i64 noundef %26, i64 noundef 3, ptr noundef %22)
  store i64 %27, ptr %21, align 8, !tbaa !9
  %28 = load i32, ptr %22, align 4, !tbaa !11
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %31, label %30

30:                                               ; preds = %5
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %291

31:                                               ; preds = %5
  %32 = load i64, ptr %21, align 8, !tbaa !9
  %33 = add i64 %32, 1
  %34 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %33, i64 4)
  %35 = extractvalue { i64, i1 } %34, 1
  %36 = extractvalue { i64, i1 } %34, 0
  %37 = select i1 %35, i64 -1, i64 %36
  %38 = call noalias noundef nonnull ptr @_Znam(i64 noundef %37) #9
  call void @llvm.memset.p0.i64(ptr align 4 %38, i8 0, i64 %37, i1 false)
  store ptr %38, ptr %15, align 8, !tbaa !5
  %39 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %39, ptr %12, align 8, !tbaa !5
  %40 = load ptr, ptr %15, align 8, !tbaa !5
  %41 = load i64, ptr %8, align 8, !tbaa !9
  %42 = getelementptr inbounds i32, ptr %40, i64 %41
  %43 = getelementptr inbounds i32, ptr %42, i64 1
  store ptr %43, ptr %13, align 8, !tbaa !5
  %44 = load ptr, ptr %15, align 8, !tbaa !5
  %45 = load i64, ptr %8, align 8, !tbaa !9
  %46 = mul i64 2, %45
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  %48 = getelementptr inbounds i32, ptr %47, i64 1
  store ptr %48, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 0, ptr %24, align 4, !tbaa !11
  br label %49

49:                                               ; preds = %61, %31
  %50 = load i32, ptr %24, align 4, !tbaa !11
  %51 = sext i32 %50 to i64
  %52 = load i64, ptr %8, align 8, !tbaa !9
  %53 = add i64 %52, 1
  %54 = icmp ult i64 %51, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %49
  store i32 2, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %64

56:                                               ; preds = %49
  %57 = load ptr, ptr %12, align 8, !tbaa !5
  %58 = load i32, ptr %24, align 4, !tbaa !11
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i32, ptr %57, i64 %59
  store i32 -1, ptr %60, align 4, !tbaa !11
  br label %61

61:                                               ; preds = %56
  %62 = load i32, ptr %24, align 4, !tbaa !11
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %24, align 4, !tbaa !11
  br label %49, !llvm.loop !13

64:                                               ; preds = %55
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = icmp eq ptr %65, null
  br i1 %66, label %67, label %107

67:                                               ; preds = %64
  %68 = load i64, ptr %8, align 8, !tbaa !9
  %69 = sub i64 %68, 1
  %70 = trunc i64 %69 to i32
  store i32 %70, ptr %16, align 4, !tbaa !11
  br label %71

71:                                               ; preds = %103, %67
  %72 = load i32, ptr %16, align 4, !tbaa !11
  %73 = icmp sge i32 %72, 0
  br i1 %73, label %74, label %106

74:                                               ; preds = %71
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = load i32, ptr %16, align 4, !tbaa !11
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr %75, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !11
  store i32 %79, ptr %17, align 4, !tbaa !11
  %80 = load i32, ptr %17, align 4, !tbaa !11
  %81 = icmp sge i32 %80, 0
  br i1 %81, label %82, label %102

82:                                               ; preds = %74
  %83 = load i32, ptr %17, align 4, !tbaa !11
  %84 = load i64, ptr %8, align 8, !tbaa !9
  %85 = trunc i64 %84 to i32
  %86 = icmp slt i32 %83, %85
  br i1 %86, label %87, label %102

87:                                               ; preds = %82
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = load i32, ptr %17, align 4, !tbaa !11
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %88, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !11
  %93 = load ptr, ptr %13, align 8, !tbaa !5
  %94 = load i32, ptr %16, align 4, !tbaa !11
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr %93, i64 %95
  store i32 %92, ptr %96, align 4, !tbaa !11
  %97 = load i32, ptr %16, align 4, !tbaa !11
  %98 = load ptr, ptr %12, align 8, !tbaa !5
  %99 = load i32, ptr %17, align 4, !tbaa !11
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %98, i64 %100
  store i32 %97, ptr %101, align 4, !tbaa !11
  br label %102

102:                                              ; preds = %87, %82, %74
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %16, align 4, !tbaa !11
  %105 = add nsw i32 %104, -1
  store i32 %105, ptr %16, align 4, !tbaa !11
  br label %71, !llvm.loop !15

106:                                              ; preds = %71
  br label %246

107:                                              ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %108 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %108, ptr %25, align 8, !tbaa !5
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %109

109:                                              ; preds = %119, %107
  %110 = load i32, ptr %19, align 4, !tbaa !11
  %111 = load i64, ptr %8, align 8, !tbaa !9
  %112 = trunc i64 %111 to i32
  %113 = icmp slt i32 %110, %112
  br i1 %113, label %114, label %122

114:                                              ; preds = %109
  %115 = load ptr, ptr %25, align 8, !tbaa !5
  %116 = load i32, ptr %19, align 4, !tbaa !11
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i32, ptr %115, i64 %117
  store i32 -1, ptr %118, align 4, !tbaa !11
  br label %119

119:                                              ; preds = %114
  %120 = load i32, ptr %19, align 4, !tbaa !11
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %19, align 4, !tbaa !11
  br label %109, !llvm.loop !16

122:                                              ; preds = %109
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %123

123:                                              ; preds = %182, %122
  %124 = load i32, ptr %16, align 4, !tbaa !11
  %125 = load i64, ptr %8, align 8, !tbaa !9
  %126 = trunc i64 %125 to i32
  %127 = icmp slt i32 %124, %126
  br i1 %127, label %128, label %185

128:                                              ; preds = %123
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = load i32, ptr %16, align 4, !tbaa !11
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds i32, ptr %129, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !11
  store i32 %133, ptr %17, align 4, !tbaa !11
  %134 = load i32, ptr %17, align 4, !tbaa !11
  %135 = icmp sge i32 %134, 0
  br i1 %135, label %136, label %181

136:                                              ; preds = %128
  %137 = load i32, ptr %17, align 4, !tbaa !11
  %138 = load i64, ptr %8, align 8, !tbaa !9
  %139 = trunc i64 %138 to i32
  %140 = icmp slt i32 %137, %139
  br i1 %140, label %141, label %181

141:                                              ; preds = %136
  %142 = load ptr, ptr %9, align 8, !tbaa !5
  %143 = load i32, ptr %16, align 4, !tbaa !11
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %142, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !11
  store i32 %146, ptr %19, align 4, !tbaa !11
  %147 = load i32, ptr %19, align 4, !tbaa !11
  %148 = icmp sgt i32 0, %147
  br i1 %148, label %149, label %150

149:                                              ; preds = %141
  br label %152

150:                                              ; preds = %141
  %151 = load i32, ptr %19, align 4, !tbaa !11
  br label %152

152:                                              ; preds = %150, %149
  %153 = phi i32 [ 0, %149 ], [ %151, %150 ]
  store i32 %153, ptr %19, align 4, !tbaa !11
  %154 = load i32, ptr %19, align 4, !tbaa !11
  %155 = load i64, ptr %8, align 8, !tbaa !9
  %156 = trunc i64 %155 to i32
  %157 = sub nsw i32 %156, 1
  %158 = icmp slt i32 %154, %157
  br i1 %158, label %159, label %161

159:                                              ; preds = %152
  %160 = load i32, ptr %19, align 4, !tbaa !11
  br label %165

161:                                              ; preds = %152
  %162 = load i64, ptr %8, align 8, !tbaa !9
  %163 = trunc i64 %162 to i32
  %164 = sub nsw i32 %163, 1
  br label %165

165:                                              ; preds = %161, %159
  %166 = phi i32 [ %160, %159 ], [ %164, %161 ]
  store i32 %166, ptr %19, align 4, !tbaa !11
  %167 = load ptr, ptr %25, align 8, !tbaa !5
  %168 = load i32, ptr %19, align 4, !tbaa !11
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds i32, ptr %167, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !11
  %172 = load ptr, ptr %13, align 8, !tbaa !5
  %173 = load i32, ptr %16, align 4, !tbaa !11
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i32, ptr %172, i64 %174
  store i32 %171, ptr %175, align 4, !tbaa !11
  %176 = load i32, ptr %16, align 4, !tbaa !11
  %177 = load ptr, ptr %25, align 8, !tbaa !5
  %178 = load i32, ptr %19, align 4, !tbaa !11
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds i32, ptr %177, i64 %179
  store i32 %176, ptr %180, align 4, !tbaa !11
  br label %181

181:                                              ; preds = %165, %136, %128
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %16, align 4, !tbaa !11
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %16, align 4, !tbaa !11
  br label %123, !llvm.loop !17

185:                                              ; preds = %123
  %186 = load i64, ptr %8, align 8, !tbaa !9
  %187 = sub i64 %186, 1
  %188 = trunc i64 %187 to i32
  store i32 %188, ptr %19, align 4, !tbaa !11
  br label %189

189:                                              ; preds = %242, %185
  %190 = load i32, ptr %19, align 4, !tbaa !11
  %191 = icmp sge i32 %190, 0
  br i1 %191, label %192, label %245

192:                                              ; preds = %189
  %193 = load ptr, ptr %25, align 8, !tbaa !5
  %194 = load i32, ptr %19, align 4, !tbaa !11
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds i32, ptr %193, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !11
  store i32 %197, ptr %16, align 4, !tbaa !11
  br label %198

198:                                              ; preds = %239, %192
  %199 = load i32, ptr %16, align 4, !tbaa !11
  %200 = icmp ne i32 %199, -1
  br i1 %200, label %201, label %241

201:                                              ; preds = %198
  %202 = load ptr, ptr %13, align 8, !tbaa !5
  %203 = load i32, ptr %16, align 4, !tbaa !11
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds i32, ptr %202, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !11
  store i32 %206, ptr %20, align 4, !tbaa !11
  %207 = load ptr, ptr %7, align 8, !tbaa !5
  %208 = load i32, ptr %16, align 4, !tbaa !11
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds i32, ptr %207, i64 %209
  %211 = load i32, ptr %210, align 4, !tbaa !11
  store i32 %211, ptr %17, align 4, !tbaa !11
  %212 = load i32, ptr %17, align 4, !tbaa !11
  %213 = icmp sge i32 %212, 0
  br i1 %213, label %214, label %219

214:                                              ; preds = %201
  %215 = load i32, ptr %17, align 4, !tbaa !11
  %216 = load i64, ptr %8, align 8, !tbaa !9
  %217 = trunc i64 %216 to i32
  %218 = icmp slt i32 %215, %217
  br label %219

219:                                              ; preds = %214, %201
  %220 = phi i1 [ false, %201 ], [ %218, %214 ]
  br i1 %220, label %221, label %222

221:                                              ; preds = %219
  br label %224

222:                                              ; preds = %219
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 110, ptr noundef @__PRETTY_FUNCTION__._ZN5nasoq10postOrderCEPimS0_S0_i) #10
  unreachable

223:                                              ; No predecessors!
  br label %224

224:                                              ; preds = %223, %221
  %225 = load ptr, ptr %12, align 8, !tbaa !5
  %226 = load i32, ptr %17, align 4, !tbaa !11
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds i32, ptr %225, i64 %227
  %229 = load i32, ptr %228, align 4, !tbaa !11
  %230 = load ptr, ptr %13, align 8, !tbaa !5
  %231 = load i32, ptr %16, align 4, !tbaa !11
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds i32, ptr %230, i64 %232
  store i32 %229, ptr %233, align 4, !tbaa !11
  %234 = load i32, ptr %16, align 4, !tbaa !11
  %235 = load ptr, ptr %12, align 8, !tbaa !5
  %236 = load i32, ptr %17, align 4, !tbaa !11
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds i32, ptr %235, i64 %237
  store i32 %234, ptr %238, align 4, !tbaa !11
  br label %239

239:                                              ; preds = %224
  %240 = load i32, ptr %20, align 4, !tbaa !11
  store i32 %240, ptr %16, align 4, !tbaa !11
  br label %198, !llvm.loop !18

241:                                              ; preds = %198
  br label %242

242:                                              ; preds = %241
  %243 = load i32, ptr %19, align 4, !tbaa !11
  %244 = add nsw i32 %243, -1
  store i32 %244, ptr %19, align 4, !tbaa !11
  br label %189, !llvm.loop !19

245:                                              ; preds = %189
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %246

246:                                              ; preds = %245, %106
  store i32 0, ptr %18, align 4, !tbaa !11
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %247

247:                                              ; preds = %268, %246
  %248 = load i32, ptr %16, align 4, !tbaa !11
  %249 = load i64, ptr %8, align 8, !tbaa !9
  %250 = trunc i64 %249 to i32
  %251 = icmp slt i32 %248, %250
  br i1 %251, label %252, label %271

252:                                              ; preds = %247
  %253 = load ptr, ptr %7, align 8, !tbaa !5
  %254 = load i32, ptr %16, align 4, !tbaa !11
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds i32, ptr %253, i64 %255
  %257 = load i32, ptr %256, align 4, !tbaa !11
  %258 = icmp eq i32 %257, -1
  br i1 %258, label %259, label %267

259:                                              ; preds = %252
  %260 = load i32, ptr %16, align 4, !tbaa !11
  %261 = load i32, ptr %18, align 4, !tbaa !11
  %262 = load ptr, ptr %10, align 8, !tbaa !5
  %263 = load ptr, ptr %12, align 8, !tbaa !5
  %264 = load ptr, ptr %13, align 8, !tbaa !5
  %265 = load ptr, ptr %14, align 8, !tbaa !5
  %266 = call noundef i32 @_ZN5nasoq4dfsCEiiPiS0_S0_S0_(i32 noundef %260, i32 noundef %261, ptr noundef %262, ptr noundef %263, ptr noundef %264, ptr noundef %265)
  store i32 %266, ptr %18, align 4, !tbaa !11
  br label %267

267:                                              ; preds = %259, %252
  br label %268

268:                                              ; preds = %267
  %269 = load i32, ptr %16, align 4, !tbaa !11
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %16, align 4, !tbaa !11
  br label %247, !llvm.loop !20

271:                                              ; preds = %247
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %272

272:                                              ; preds = %282, %271
  %273 = load i32, ptr %16, align 4, !tbaa !11
  %274 = load i64, ptr %8, align 8, !tbaa !9
  %275 = trunc i64 %274 to i32
  %276 = icmp slt i32 %273, %275
  br i1 %276, label %277, label %285

277:                                              ; preds = %272
  %278 = load ptr, ptr %12, align 8, !tbaa !5
  %279 = load i32, ptr %16, align 4, !tbaa !11
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds i32, ptr %278, i64 %280
  store i32 -1, ptr %281, align 4, !tbaa !11
  br label %282

282:                                              ; preds = %277
  %283 = load i32, ptr %16, align 4, !tbaa !11
  %284 = add nsw i32 %283, 1
  store i32 %284, ptr %16, align 4, !tbaa !11
  br label %272, !llvm.loop !21

285:                                              ; preds = %272
  %286 = load ptr, ptr %15, align 8, !tbaa !5
  %287 = icmp eq ptr %286, null
  br i1 %287, label %289, label %288

288:                                              ; preds = %285
  call void @_ZdaPv(ptr noundef %286) #11
  br label %289

289:                                              ; preds = %288, %285
  %290 = load i32, ptr %18, align 4, !tbaa !11
  store i32 %290, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %291

291:                                              ; preds = %289, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  %292 = load i32, ptr %6, align 4
  ret i32 %292
}

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

declare noundef i64 @_ZN5nasoq11mult_size_tEmmPi(i64 noundef, i64 noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

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

declare noundef i32 @_ZN5nasoq4dfsCEiiPiS0_S0_S0_(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #7

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


; 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 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@__PRETTY_FUNCTION__._ZN5nasoq10postOrderCEPimS0_S0_i = external hidden unnamed_addr constant [56 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5nasoq10postOrderCEPimS0_S0_i(ptr nocapture noundef readonly %0, i64 noundef %1, ptr noundef readonly %2, ptr noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  store i32 1, ptr %6, align 4, !tbaa !5
  %7 = call noundef i64 @_ZN5nasoq11mult_size_tEmmPi(i64 noundef %1, i64 noundef 3, ptr noundef nonnull %6)
  %8 = load i32, ptr %6, align 4, !tbaa !5
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %103, label %9

9:                                                ; preds = %5
  %10 = add i64 %7, 1
  %11 = icmp ugt i64 %10, 4611686018427387903
  %12 = shl nuw i64 %10, 2
  %13 = select i1 %11, i64 -1, i64 %12
  %14 = call noalias noundef nonnull ptr @_Znam(i64 noundef %13) #9
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %14, i8 0, i64 %13, i1 false)
  %15 = getelementptr inbounds i32, ptr %14, i64 %1
  %16 = getelementptr inbounds i8, ptr %15, i64 4
  %.idx = shl i64 %1, 3
  %17 = getelementptr i8, ptr %14, i64 %.idx
  %18 = getelementptr i8, ptr %17, i64 4
  %.not143 = icmp eq i64 %1, -1
  br i1 %.not143, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %9
  %19 = shl i64 %1, 2
  %20 = add i64 %19, 4
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %14, i8 -1, i64 %20, i1 false), !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %9
  %21 = icmp eq ptr %2, null
  %22 = trunc i64 %1 to i32
  br i1 %21, label %24, label %.preheader116

.preheader116:                                    ; preds = %._crit_edge
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph122, label %.preheader115..preheader113_crit_edge

24:                                               ; preds = %._crit_edge
  %.097130 = add i32 %22, -1
  %25 = icmp sgt i32 %.097130, -1
  br i1 %25, label %.lr.ph133.preheader, label %._crit_edge142

.lr.ph133.preheader:                              ; preds = %24
  %26 = zext nneg i32 %.097130 to i64
  %27 = and i64 %26, 1
  %lcmp.mod.not.not = icmp eq i64 %27, 0
  br i1 %lcmp.mod.not.not, label %.lr.ph133.prol, label %.lr.ph133.prol.loopexit

.lr.ph133.prol:                                   ; preds = %.lr.ph133.preheader
  %28 = getelementptr inbounds i32, ptr %0, i64 %26
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, -1
  %31 = icmp slt i32 %29, %22
  %or.cond.prol = and i1 %30, %31
  br i1 %or.cond.prol, label %32, label %.lr.ph133.prol.loopexit.unr-lcssa

32:                                               ; preds = %.lr.ph133.prol
  %33 = zext nneg i32 %29 to i64
  %34 = getelementptr inbounds i32, ptr %14, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = getelementptr inbounds i32, ptr %16, i64 %26
  store i32 %35, ptr %36, align 4, !tbaa !5
  store i32 %.097130, ptr %34, align 4, !tbaa !5
  br label %.lr.ph133.prol.loopexit.unr-lcssa

.lr.ph133.prol.loopexit.unr-lcssa:                ; preds = %32, %.lr.ph133.prol
  %indvars.iv.next152.prol = add nsw i64 %26, -1
  br label %.lr.ph133.prol.loopexit

.lr.ph133.prol.loopexit:                          ; preds = %.lr.ph133.prol.loopexit.unr-lcssa, %.lr.ph133.preheader
  %indvars.iv151.unr = phi i64 [ %26, %.lr.ph133.preheader ], [ %indvars.iv.next152.prol, %.lr.ph133.prol.loopexit.unr-lcssa ]
  %37 = icmp eq i32 %.097130, 0
  br i1 %37, label %.loopexit, label %.lr.ph133

.lr.ph133:                                        ; preds = %.lr.ph133.prol.loopexit, %58
  %indvars.iv151 = phi i64 [ %indvars.iv.next152.1, %58 ], [ %indvars.iv151.unr, %.lr.ph133.prol.loopexit ]
  %38 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv151
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = icmp sgt i32 %39, -1
  %41 = icmp slt i32 %39, %22
  %or.cond = and i1 %40, %41
  br i1 %or.cond, label %42, label %.lr.ph133.1

42:                                               ; preds = %.lr.ph133
  %43 = zext nneg i32 %39 to i64
  %44 = getelementptr inbounds i32, ptr %14, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv151
  store i32 %45, ptr %46, align 4, !tbaa !5
  %47 = trunc nuw nsw i64 %indvars.iv151 to i32
  store i32 %47, ptr %44, align 4, !tbaa !5
  br label %.lr.ph133.1

.lr.ph133.1:                                      ; preds = %.lr.ph133, %42
  %indvars.iv.next152 = add nsw i64 %indvars.iv151, -1
  %48 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next152
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp sgt i32 %49, -1
  %51 = icmp slt i32 %49, %22
  %or.cond.1 = and i1 %50, %51
  br i1 %or.cond.1, label %52, label %58

52:                                               ; preds = %.lr.ph133.1
  %53 = zext nneg i32 %49 to i64
  %54 = getelementptr inbounds i32, ptr %14, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = getelementptr i32, ptr %15, i64 %indvars.iv151
  store i32 %55, ptr %56, align 4, !tbaa !5
  %57 = trunc nuw nsw i64 %indvars.iv.next152 to i32
  store i32 %57, ptr %54, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %52, %.lr.ph133.1
  %indvars.iv.next152.1 = add nsw i64 %indvars.iv151, -2
  %59 = icmp sgt i64 %indvars.iv151, 1
  br i1 %59, label %.lr.ph133, label %.loopexit, !llvm.loop !9

.preheader115..preheader113_crit_edge:            ; preds = %.preheader116
  %.pre = add i32 %22, -1
  br label %.preheader113

.lr.ph122:                                        ; preds = %.preheader116
  %60 = shl i64 %1, 2
  %61 = and i64 %60, 8589934588
  call void @llvm.memset.p0.i64(ptr align 4 %18, i8 -1, i64 %61, i1 false), !tbaa !5
  %62 = add nsw i32 %22, -1
  %wide.trip.count = and i64 %1, 2147483647
  br label %65

.preheader113:                                    ; preds = %78, %.preheader115..preheader113_crit_edge
  %.199127.pre-phi = phi i32 [ %.pre, %.preheader115..preheader113_crit_edge ], [ %62, %78 ]
  %63 = icmp sgt i32 %.199127.pre-phi, -1
  br i1 %63, label %.lr.ph129.preheader, label %.loopexit

.lr.ph129.preheader:                              ; preds = %.preheader113
  %64 = zext nneg i32 %.199127.pre-phi to i64
  br label %.lr.ph129

65:                                               ; preds = %.lr.ph122, %78
  %indvars.iv = phi i64 [ 0, %.lr.ph122 ], [ %indvars.iv.next, %78 ]
  %66 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %or.cond111 = icmp ult i32 %67, %22
  br i1 %or.cond111, label %68, label %78

68:                                               ; preds = %65
  %69 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = call i32 @llvm.smax.i32(i32 %70, i32 0)
  %72 = call i32 @llvm.smin.i32(i32 %71, i32 %62)
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %18, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv
  store i32 %75, ptr %76, align 4, !tbaa !5
  %77 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %77, ptr %74, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %65, %68
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader113, label %65, !llvm.loop !11

.loopexit112:                                     ; preds = %89, %.lr.ph129
  %indvars.iv.next149 = add nsw i64 %indvars.iv148, -1
  %79 = icmp sgt i64 %indvars.iv148, 0
  br i1 %79, label %.lr.ph129, label %.loopexit, !llvm.loop !12

.lr.ph129:                                        ; preds = %.lr.ph129.preheader, %.loopexit112
  %indvars.iv148 = phi i64 [ %64, %.lr.ph129.preheader ], [ %indvars.iv.next149, %.loopexit112 ]
  %80 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv148
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %.not109123 = icmp eq i32 %81, -1
  br i1 %.not109123, label %.loopexit112, label %.lr.ph126

.lr.ph126:                                        ; preds = %.lr.ph129, %89
  %.2124 = phi i32 [ %91, %89 ], [ %81, %.lr.ph129 ]
  %82 = sext i32 %.2124 to i64
  %83 = getelementptr inbounds i32, ptr %0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = icmp sgt i32 %84, -1
  %86 = icmp slt i32 %84, %22
  %87 = and i1 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %.lr.ph126
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 110, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN5nasoq10postOrderCEPimS0_S0_i) #10
  unreachable

89:                                               ; preds = %.lr.ph126
  %90 = getelementptr inbounds i32, ptr %16, i64 %82
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = zext nneg i32 %84 to i64
  %93 = getelementptr inbounds i32, ptr %14, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  store i32 %94, ptr %90, align 4, !tbaa !5
  store i32 %.2124, ptr %93, align 4, !tbaa !5
  %.not109 = icmp eq i32 %91, -1
  br i1 %.not109, label %.loopexit112, label %.lr.ph126, !llvm.loop !13

.loopexit:                                        ; preds = %.loopexit112, %.lr.ph133.prol.loopexit, %58, %.preheader113
  %95 = icmp sgt i32 %22, 0
  br i1 %95, label %.lr.ph137.preheader, label %._crit_edge142

.lr.ph137.preheader:                              ; preds = %.loopexit
  %wide.trip.count157 = and i64 %1, 2147483647
  br label %.lr.ph137

.lr.ph137:                                        ; preds = %.lr.ph137.preheader, %102
  %indvars.iv154 = phi i64 [ 0, %.lr.ph137.preheader ], [ %indvars.iv.next155, %102 ]
  %.0100134 = phi i32 [ 0, %.lr.ph137.preheader ], [ %.1101, %102 ]
  %96 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv154
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = icmp eq i32 %97, -1
  br i1 %98, label %99, label %102

99:                                               ; preds = %.lr.ph137
  %100 = trunc nuw nsw i64 %indvars.iv154 to i32
  %101 = call noundef i32 @_ZN5nasoq4dfsCEiiPiS0_S0_S0_(i32 noundef %100, i32 noundef %.0100134, ptr noundef %3, ptr noundef nonnull %14, ptr noundef nonnull %16, ptr noundef nonnull %18)
  br label %102

102:                                              ; preds = %.lr.ph137, %99
  %.1101 = phi i32 [ %101, %99 ], [ %.0100134, %.lr.ph137 ]
  %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
  %exitcond158.not = icmp eq i64 %indvars.iv.next155, %wide.trip.count157
  br i1 %exitcond158.not, label %._crit_edge142, label %.lr.ph137, !llvm.loop !14

._crit_edge142:                                   ; preds = %102, %.loopexit, %24
  %.0100.lcssa166 = phi i32 [ 0, %24 ], [ 0, %.loopexit ], [ %.1101, %102 ]
  call void @_ZdaPv(ptr noundef nonnull %14) #11
  br label %103

103:                                              ; preds = %5, %._crit_edge142
  %.0 = phi i32 [ %.0100.lcssa166, %._crit_edge142 ], [ -1, %5 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  ret i32 %.0
}

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

declare noundef i64 @_ZN5nasoq11mult_size_tEmmPi(i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

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

declare noundef i32 @_ZN5nasoq4dfsCEiiPiS0_S0_S0_(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #6

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { noreturn nounwind }
attributes #11 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass