; LLVM IR from openxrlab/xrsfm :: 3rdparty/apriltag/common (pnm)

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

%struct.pnm = type { i32, i32, i32, i32, i32, ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [80 x i8], align 1
@__PRETTY_FUNCTION__.pnm_create_from_file = external hidden unnamed_addr constant [42 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @pnm_create_from_file(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca [1024 x i8], align 16
  %8 = alloca i32, align 4
  %9 = alloca [3 x i32], align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = call noalias ptr @fopen(ptr noundef %15, ptr noundef @.str)
  store ptr %16, ptr %4, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %20

19:                                               ; preds = %1
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %351

20:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %21 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 32) #8
  store ptr %21, ptr %6, align 8, !tbaa !5
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.pnm, ptr %22, i32 0, i32 2
  store i32 -1, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1024, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #7
  br label %24

24:                                               ; preds = %150, %51, %20
  %25 = load i32, ptr %8, align 4, !tbaa !12
  %26 = icmp slt i32 %25, 3
  br i1 %26, label %27, label %38

27:                                               ; preds = %24
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.pnm, ptr %28, i32 0, i32 2
  %30 = load i32, ptr %29, align 8, !tbaa !9
  %31 = icmp eq i32 %30, 4
  br i1 %31, label %32, label %35

32:                                               ; preds = %27
  %33 = load i32, ptr %8, align 4, !tbaa !12
  %34 = icmp eq i32 %33, 2
  br label %35

35:                                               ; preds = %32, %27
  %36 = phi i1 [ false, %27 ], [ %34, %32 ]
  %37 = xor i1 %36, true
  br label %38

38:                                               ; preds = %35, %24
  %39 = phi i1 [ false, %24 ], [ %37, %35 ]
  br i1 %39, label %40, label %151

40:                                               ; preds = %38
  %41 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = call ptr @fgets(ptr noundef %41, i32 noundef 1024, ptr noundef %42)
  %44 = icmp eq ptr %43, null
  br i1 %44, label %45, label %46

45:                                               ; preds = %40
  br label %339

46:                                               ; preds = %40
  %47 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  %48 = load i8, ptr %47, align 16, !tbaa !13
  %49 = sext i8 %48 to i32
  %50 = icmp eq i32 %49, 35
  br i1 %50, label %51, label %52

51:                                               ; preds = %46
  br label %24, !llvm.loop !14

52:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %53 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  store ptr %53, ptr %10, align 8, !tbaa !5
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.pnm, ptr %54, i32 0, i32 2
  %56 = load i32, ptr %55, align 8, !tbaa !9
  %57 = icmp eq i32 %56, -1
  br i1 %57, label %58, label %88

58:                                               ; preds = %52
  %59 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  %60 = load i8, ptr %59, align 16, !tbaa !13
  %61 = sext i8 %60 to i32
  %62 = icmp eq i32 %61, 80
  br i1 %62, label %63, label %88

63:                                               ; preds = %58
  %64 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 1
  %65 = load i8, ptr %64, align 1, !tbaa !13
  %66 = sext i8 %65 to i32
  %67 = sub nsw i32 %66, 48
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.pnm, ptr %68, i32 0, i32 2
  store i32 %67, ptr %69, align 8, !tbaa !9
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.pnm, ptr %70, i32 0, i32 2
  %72 = load i32, ptr %71, align 8, !tbaa !9
  %73 = icmp eq i32 %72, 5
  br i1 %73, label %84, label %74

74:                                               ; preds = %63
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.pnm, ptr %75, i32 0, i32 2
  %77 = load i32, ptr %76, align 8, !tbaa !9
  %78 = icmp eq i32 %77, 6
  br i1 %78, label %84, label %79

79:                                               ; preds = %74
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.pnm, ptr %80, i32 0, i32 2
  %82 = load i32, ptr %81, align 8, !tbaa !9
  %83 = icmp eq i32 %82, 4
  br i1 %83, label %84, label %85

84:                                               ; preds = %79, %74, %63
  br label %86

85:                                               ; preds = %79
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 60, ptr noundef @__PRETTY_FUNCTION__.pnm_create_from_file) #9
  unreachable

86:                                               ; preds = %84
  %87 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 2
  store ptr %87, ptr %10, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %86, %58, %52
  br label %89

89:                                               ; preds = %142, %88
  %90 = load i32, ptr %8, align 4, !tbaa !12
  %91 = icmp slt i32 %90, 3
  br i1 %91, label %92, label %97

92:                                               ; preds = %89
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = load i8, ptr %93, align 1, !tbaa !13
  %95 = sext i8 %94 to i32
  %96 = icmp ne i32 %95, 0
  br label %97

97:                                               ; preds = %92, %89
  %98 = phi i1 [ false, %89 ], [ %96, %92 ]
  br i1 %98, label %99, label %150

99:                                               ; preds = %97
  br label %100

100:                                              ; preds = %105, %99
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = load i8, ptr %101, align 1, !tbaa !13
  %103 = sext i8 %102 to i32
  %104 = icmp eq i32 %103, 32
  br i1 %104, label %105, label %108

105:                                              ; preds = %100
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  %107 = getelementptr inbounds i8, ptr %106, i32 1
  store ptr %107, ptr %10, align 8, !tbaa !5
  br label %100, !llvm.loop !16

108:                                              ; preds = %100
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = load i8, ptr %109, align 1, !tbaa !13
  %111 = sext i8 %110 to i32
  %112 = icmp slt i32 %111, 48
  br i1 %112, label %118, label %113

113:                                              ; preds = %108
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  %115 = load i8, ptr %114, align 1, !tbaa !13
  %116 = sext i8 %115 to i32
  %117 = icmp sgt i32 %116, 57
  br i1 %117, label %118, label %119

118:                                              ; preds = %113, %108
  br label %150

119:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !12
  br label %120

120:                                              ; preds = %132, %119
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = load i8, ptr %121, align 1, !tbaa !13
  %123 = sext i8 %122 to i32
  %124 = icmp sge i32 %123, 48
  br i1 %124, label %125, label %130

125:                                              ; preds = %120
  %126 = load ptr, ptr %10, align 8, !tbaa !5
  %127 = load i8, ptr %126, align 1, !tbaa !13
  %128 = sext i8 %127 to i32
  %129 = icmp sle i32 %128, 57
  br label %130

130:                                              ; preds = %125, %120
  %131 = phi i1 [ false, %120 ], [ %129, %125 ]
  br i1 %131, label %132, label %142

132:                                              ; preds = %130
  %133 = load i32, ptr %11, align 4, !tbaa !12
  %134 = mul nsw i32 %133, 10
  %135 = load ptr, ptr %10, align 8, !tbaa !5
  %136 = load i8, ptr %135, align 1, !tbaa !13
  %137 = sext i8 %136 to i32
  %138 = add nsw i32 %134, %137
  %139 = sub nsw i32 %138, 48
  store i32 %139, ptr %11, align 4, !tbaa !12
  %140 = load ptr, ptr %10, align 8, !tbaa !5
  %141 = getelementptr inbounds i8, ptr %140, i32 1
  store ptr %141, ptr %10, align 8, !tbaa !5
  br label %120, !llvm.loop !17

142:                                              ; preds = %130
  %143 = load i32, ptr %11, align 4, !tbaa !12
  %144 = load i32, ptr %8, align 4, !tbaa !12
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %8, align 4, !tbaa !12
  %146 = sext i32 %144 to i64
  %147 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 %146
  store i32 %143, ptr %147, align 4, !tbaa !12
  %148 = load ptr, ptr %10, align 8, !tbaa !5
  %149 = getelementptr inbounds i8, ptr %148, i32 1
  store ptr %149, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %89, !llvm.loop !18

150:                                              ; preds = %118, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %24, !llvm.loop !14

151:                                              ; preds = %38
  %152 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 0
  %153 = load i32, ptr %152, align 4, !tbaa !12
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.pnm, ptr %154, i32 0, i32 0
  store i32 %153, ptr %155, align 8, !tbaa !19
  %156 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 1
  %157 = load i32, ptr %156, align 4, !tbaa !12
  %158 = load ptr, ptr %6, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.pnm, ptr %158, i32 0, i32 1
  store i32 %157, ptr %159, align 4, !tbaa !20
  %160 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 2
  %161 = load i32, ptr %160, align 4, !tbaa !12
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.pnm, ptr %162, i32 0, i32 3
  store i32 %161, ptr %163, align 4, !tbaa !21
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.pnm, ptr %164, i32 0, i32 2
  %166 = load i32, ptr %165, align 8, !tbaa !9
  switch i32 %166, label %338 [
    i32 4, label %167
    i32 5, label %210
    i32 6, label %273
  ]

167:                                              ; preds = %151
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.pnm, ptr %168, i32 0, i32 3
  store i32 1, ptr %169, align 4, !tbaa !21
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.pnm, ptr %170, i32 0, i32 1
  %172 = load i32, ptr %171, align 4, !tbaa !20
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.pnm, ptr %173, i32 0, i32 0
  %175 = load i32, ptr %174, align 8, !tbaa !19
  %176 = add nsw i32 %175, 7
  %177 = sdiv i32 %176, 8
  %178 = mul nsw i32 %172, %177
  %179 = load ptr, ptr %6, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.pnm, ptr %179, i32 0, i32 4
  store i32 %178, ptr %180, align 8, !tbaa !22
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.pnm, ptr %181, i32 0, i32 4
  %183 = load i32, ptr %182, align 8, !tbaa !22
  %184 = zext i32 %183 to i64
  %185 = call noalias ptr @malloc(i64 noundef %184) #10
  %186 = load ptr, ptr %6, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.pnm, ptr %186, i32 0, i32 5
  store ptr %185, ptr %187, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %188 = load ptr, ptr %6, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.pnm, ptr %188, i32 0, i32 5
  %190 = load ptr, ptr %189, align 8, !tbaa !23
  %191 = load ptr, ptr %6, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.pnm, ptr %191, i32 0, i32 4
  %193 = load i32, ptr %192, align 8, !tbaa !22
  %194 = zext i32 %193 to i64
  %195 = load ptr, ptr %4, align 8, !tbaa !5
  %196 = call i64 @fread(ptr noundef %190, i64 noundef 1, i64 noundef %194, ptr noundef %195)
  store i64 %196, ptr %12, align 8, !tbaa !24
  %197 = load i64, ptr %12, align 8, !tbaa !24
  %198 = load ptr, ptr %6, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.pnm, ptr %198, i32 0, i32 4
  %200 = load i32, ptr %199, align 8, !tbaa !22
  %201 = zext i32 %200 to i64
  %202 = icmp ne i64 %197, %201
  br i1 %202, label %203, label %204

203:                                              ; preds = %167
  store i32 4, ptr %5, align 4
  br label %208

204:                                              ; preds = %167
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = call i32 @fclose(ptr noundef %205)
  %207 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %207, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %208

208:                                              ; preds = %204, %203
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %209 = load i32, ptr %5, align 4
  switch i32 %209, label %350 [
    i32 4, label %339
  ]

210:                                              ; preds = %151
  %211 = load ptr, ptr %6, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.pnm, ptr %211, i32 0, i32 3
  %213 = load i32, ptr %212, align 4, !tbaa !21
  %214 = icmp eq i32 %213, 255
  br i1 %214, label %215, label %225

215:                                              ; preds = %210
  %216 = load ptr, ptr %6, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.pnm, ptr %216, i32 0, i32 0
  %218 = load i32, ptr %217, align 8, !tbaa !19
  %219 = load ptr, ptr %6, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.pnm, ptr %219, i32 0, i32 1
  %221 = load i32, ptr %220, align 4, !tbaa !20
  %222 = mul nsw i32 %218, %221
  %223 = load ptr, ptr %6, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.pnm, ptr %223, i32 0, i32 4
  store i32 %222, ptr %224, align 8, !tbaa !22
  br label %243

225:                                              ; preds = %210
  %226 = load ptr, ptr %6, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.pnm, ptr %226, i32 0, i32 3
  %228 = load i32, ptr %227, align 4, !tbaa !21
  %229 = icmp eq i32 %228, 65535
  br i1 %229, label %230, label %241

230:                                              ; preds = %225
  %231 = load ptr, ptr %6, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.pnm, ptr %231, i32 0, i32 0
  %233 = load i32, ptr %232, align 8, !tbaa !19
  %234 = mul nsw i32 2, %233
  %235 = load ptr, ptr %6, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.pnm, ptr %235, i32 0, i32 1
  %237 = load i32, ptr %236, align 4, !tbaa !20
  %238 = mul nsw i32 %234, %237
  %239 = load ptr, ptr %6, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.pnm, ptr %239, i32 0, i32 4
  store i32 %238, ptr %240, align 8, !tbaa !22
  br label %242

241:                                              ; preds = %225
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.2, i32 noundef 109, ptr noundef @__PRETTY_FUNCTION__.pnm_create_from_file) #9
  unreachable

242:                                              ; preds = %230
  br label %243

243:                                              ; preds = %242, %215
  %244 = load ptr, ptr %6, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.pnm, ptr %244, i32 0, i32 4
  %246 = load i32, ptr %245, align 8, !tbaa !22
  %247 = zext i32 %246 to i64
  %248 = call noalias ptr @malloc(i64 noundef %247) #10
  %249 = load ptr, ptr %6, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.pnm, ptr %249, i32 0, i32 5
  store ptr %248, ptr %250, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %251 = load ptr, ptr %6, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.pnm, ptr %251, i32 0, i32 5
  %253 = load ptr, ptr %252, align 8, !tbaa !23
  %254 = load ptr, ptr %6, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.pnm, ptr %254, i32 0, i32 4
  %256 = load i32, ptr %255, align 8, !tbaa !22
  %257 = zext i32 %256 to i64
  %258 = load ptr, ptr %4, align 8, !tbaa !5
  %259 = call i64 @fread(ptr noundef %253, i64 noundef 1, i64 noundef %257, ptr noundef %258)
  store i64 %259, ptr %13, align 8, !tbaa !24
  %260 = load i64, ptr %13, align 8, !tbaa !24
  %261 = load ptr, ptr %6, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.pnm, ptr %261, i32 0, i32 4
  %263 = load i32, ptr %262, align 8, !tbaa !22
  %264 = zext i32 %263 to i64
  %265 = icmp ne i64 %260, %264
  br i1 %265, label %266, label %267

266:                                              ; preds = %243
  store i32 4, ptr %5, align 4
  br label %271

267:                                              ; preds = %243
  %268 = load ptr, ptr %4, align 8, !tbaa !5
  %269 = call i32 @fclose(ptr noundef %268)
  %270 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %270, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %271

271:                                              ; preds = %267, %266
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  %272 = load i32, ptr %5, align 4
  switch i32 %272, label %350 [
    i32 4, label %339
  ]

273:                                              ; preds = %151
  %274 = load ptr, ptr %6, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.pnm, ptr %274, i32 0, i32 3
  %276 = load i32, ptr %275, align 4, !tbaa !21
  %277 = icmp eq i32 %276, 255
  br i1 %277, label %278, label %289

278:                                              ; preds = %273
  %279 = load ptr, ptr %6, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.pnm, ptr %279, i32 0, i32 0
  %281 = load i32, ptr %280, align 8, !tbaa !19
  %282 = load ptr, ptr %6, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.pnm, ptr %282, i32 0, i32 1
  %284 = load i32, ptr %283, align 4, !tbaa !20
  %285 = mul nsw i32 %281, %284
  %286 = mul nsw i32 %285, 3
  %287 = load ptr, ptr %6, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct.pnm, ptr %287, i32 0, i32 4
  store i32 %286, ptr %288, align 8, !tbaa !22
  br label %308

289:                                              ; preds = %273
  %290 = load ptr, ptr %6, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.pnm, ptr %290, i32 0, i32 3
  %292 = load i32, ptr %291, align 4, !tbaa !21
  %293 = icmp eq i32 %292, 65535
  br i1 %293, label %294, label %306

294:                                              ; preds = %289
  %295 = load ptr, ptr %6, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.pnm, ptr %295, i32 0, i32 0
  %297 = load i32, ptr %296, align 8, !tbaa !19
  %298 = mul nsw i32 2, %297
  %299 = load ptr, ptr %6, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.pnm, ptr %299, i32 0, i32 1
  %301 = load i32, ptr %300, align 4, !tbaa !20
  %302 = mul nsw i32 %298, %301
  %303 = mul nsw i32 %302, 3
  %304 = load ptr, ptr %6, align 8, !tbaa !5
  %305 = getelementptr inbounds %struct.pnm, ptr %304, i32 0, i32 4
  store i32 %303, ptr %305, align 8, !tbaa !22
  br label %307

306:                                              ; preds = %289
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.2, i32 noundef 126, ptr noundef @__PRETTY_FUNCTION__.pnm_create_from_file) #9
  unreachable

307:                                              ; preds = %294
  br label %308

308:                                              ; preds = %307, %278
  %309 = load ptr, ptr %6, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.pnm, ptr %309, i32 0, i32 4
  %311 = load i32, ptr %310, align 8, !tbaa !22
  %312 = zext i32 %311 to i64
  %313 = call noalias ptr @malloc(i64 noundef %312) #10
  %314 = load ptr, ptr %6, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.pnm, ptr %314, i32 0, i32 5
  store ptr %313, ptr %315, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %316 = load ptr, ptr %6, align 8, !tbaa !5
  %317 = getelementptr inbounds %struct.pnm, ptr %316, i32 0, i32 5
  %318 = load ptr, ptr %317, align 8, !tbaa !23
  %319 = load ptr, ptr %6, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct.pnm, ptr %319, i32 0, i32 4
  %321 = load i32, ptr %320, align 8, !tbaa !22
  %322 = zext i32 %321 to i64
  %323 = load ptr, ptr %4, align 8, !tbaa !5
  %324 = call i64 @fread(ptr noundef %318, i64 noundef 1, i64 noundef %322, ptr noundef %323)
  store i64 %324, ptr %14, align 8, !tbaa !24
  %325 = load i64, ptr %14, align 8, !tbaa !24
  %326 = load ptr, ptr %6, align 8, !tbaa !5
  %327 = getelementptr inbounds %struct.pnm, ptr %326, i32 0, i32 4
  %328 = load i32, ptr %327, align 8, !tbaa !22
  %329 = zext i32 %328 to i64
  %330 = icmp ne i64 %325, %329
  br i1 %330, label %331, label %332

331:                                              ; preds = %308
  store i32 4, ptr %5, align 4
  br label %336

332:                                              ; preds = %308
  %333 = load ptr, ptr %4, align 8, !tbaa !5
  %334 = call i32 @fclose(ptr noundef %333)
  %335 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %335, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %336

336:                                              ; preds = %332, %331
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %337 = load i32, ptr %5, align 4
  switch i32 %337, label %350 [
    i32 4, label %339
  ]

338:                                              ; preds = %151
  br label %339

339:                                              ; preds = %338, %336, %271, %208, %45
  %340 = load ptr, ptr %4, align 8, !tbaa !5
  %341 = call i32 @fclose(ptr noundef %340)
  %342 = load ptr, ptr %6, align 8, !tbaa !5
  %343 = icmp ne ptr %342, null
  br i1 %343, label %344, label %349

344:                                              ; preds = %339
  %345 = load ptr, ptr %6, align 8, !tbaa !5
  %346 = getelementptr inbounds %struct.pnm, ptr %345, i32 0, i32 5
  %347 = load ptr, ptr %346, align 8, !tbaa !23
  call void @free(ptr noundef %347) #7
  %348 = load ptr, ptr %6, align 8, !tbaa !5
  call void @free(ptr noundef %348) #7
  br label %349

349:                                              ; preds = %344, %339
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %350

350:                                              ; preds = %349, %336, %271, %208
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %351

351:                                              ; preds = %350, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  %352 = load ptr, ptr %2, align 8
  ret ptr %352
}

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #3

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

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

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

declare i32 @fclose(ptr noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #6

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { nounwind allocsize(0,1) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind 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 #6 = { 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 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }
attributes #9 = { noreturn nounwind }
attributes #10 = { nounwind allocsize(0) }

!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/C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"pnm", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = !{!10, !11, i64 0}
!20 = !{!10, !11, i64 4}
!21 = !{!10, !11, i64 12}
!22 = !{!10, !11, i64 16}
!23 = !{!10, !6, i64 24}
!24 = !{!25, !25, i64 0}
!25 = !{!"long", !7, i64 0}


; 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 [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [80 x i8], align 1
@__PRETTY_FUNCTION__.pnm_create_from_file = external hidden unnamed_addr constant [42 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @pnm_create_from_file(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = alloca [1024 x i8], align 16
  %3 = alloca [3 x i32], align 4
  %4 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str)
  %5 = icmp eq ptr %4, null
  br i1 %5, label %108, label %6

6:                                                ; preds = %1
  %7 = tail call noalias dereferenceable_or_null(32) ptr @calloc(i64 noundef 1, i64 noundef 32) #8
  %8 = getelementptr inbounds i8, ptr %7, i64 8
  store i32 -1, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %2) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #9
  %9 = getelementptr inbounds i8, ptr %2, i64 1
  %10 = getelementptr inbounds i8, ptr %2, i64 2
  br label %.outer.split

.outer.split:                                     ; preds = %6, %.critedge7
  %.096.ph173 = phi i32 [ 0, %6 ], [ %.197.lcssa.ph, %.critedge7 ]
  %11 = phi i32 [ -1, %6 ], [ %34, %.critedge7 ]
  %12 = icmp ne i32 %.096.ph173, 2
  %13 = icmp ne i32 %11, 4
  %.not110 = or i1 %12, %13
  br i1 %.not110, label %.outer.split.split, label %.critedge.split.thread

.critedge.split.thread:                           ; preds = %.outer.split
  %14 = load i32, ptr %3, align 4, !tbaa !11
  store i32 %14, ptr %7, align 8, !tbaa !12
  %15 = getelementptr inbounds i8, ptr %3, i64 4
  %16 = load i32, ptr %15, align 4, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %7, i64 4
  store i32 %16, ptr %17, align 4, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %3, i64 8
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = getelementptr inbounds i8, ptr %7, i64 12
  store i32 %19, ptr %20, align 4, !tbaa !14
  br label %63

.outer.split.split:                               ; preds = %.outer.split, %23
  %21 = call ptr @fgets(ptr noundef nonnull %2, i32 noundef 1024, ptr noundef nonnull %4)
  %22 = icmp eq ptr %21, null
  br i1 %22, label %.loopexit, label %23

23:                                               ; preds = %.outer.split.split
  %24 = load i8, ptr %2, align 16
  %25 = icmp eq i8 %24, 35
  br i1 %25, label %.outer.split.split, label %26, !llvm.loop !15

26:                                               ; preds = %23
  %27 = icmp eq i32 %11, -1
  %28 = icmp eq i8 %24, 80
  %or.cond = and i1 %27, %28
  br i1 %or.cond, label %29, label %.lr.ph136.preheader

29:                                               ; preds = %26
  %30 = load i8, ptr %9, align 1, !tbaa !17
  %31 = sext i8 %30 to i32
  %32 = add nsw i32 %31, -48
  store i32 %32, ptr %8, align 8, !tbaa !5
  %.off = add nsw i32 %31, -52
  %switch = icmp ult i32 %.off, 3
  br i1 %switch, label %.lr.ph136.preheader, label %33

33:                                               ; preds = %29
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 60, ptr noundef nonnull @__PRETTY_FUNCTION__.pnm_create_from_file) #10
  unreachable

.lr.ph136.preheader:                              ; preds = %26, %29
  %34 = phi i32 [ %11, %26 ], [ %32, %29 ]
  %.099 = phi ptr [ %2, %26 ], [ %10, %29 ]
  %35 = sext i32 %.096.ph173 to i64
  %smax = call i32 @llvm.smax.i32(i32 %.096.ph173, i32 2)
  %36 = add nuw i32 %smax, 1
  br label %.lr.ph136

.lr.ph136:                                        ; preds = %.lr.ph136.preheader, %.critedge9
  %indvars.iv = phi i64 [ %35, %.lr.ph136.preheader ], [ %indvars.iv.next, %.critedge9 ]
  %.1100133 = phi ptr [ %.099, %.lr.ph136.preheader ], [ %51, %.critedge9 ]
  %37 = load i8, ptr %.1100133, align 1, !tbaa !17
  switch i8 %37, label %._crit_edge [
    i8 0, label %.critedge7.split.loop.exit
    i8 32, label %.lr.ph
  ]

.lr.ph:                                           ; preds = %.lr.ph136, %.lr.ph
  %.2101125 = phi ptr [ %38, %.lr.ph ], [ %.1100133, %.lr.ph136 ]
  %38 = getelementptr inbounds i8, ptr %.2101125, i64 1
  %.pr = load i8, ptr %38, align 1, !tbaa !17
  %39 = icmp eq i8 %.pr, 32
  br i1 %39, label %.lr.ph, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph136
  %40 = phi i8 [ %37, %.lr.ph136 ], [ %.pr, %.lr.ph ]
  %.2101.lcssa = phi ptr [ %.1100133, %.lr.ph136 ], [ %38, %.lr.ph ]
  %41 = add i8 %40, -58
  %or.cond114 = icmp ult i8 %41, -10
  br i1 %or.cond114, label %.critedge7.split.loop.exit154, label %.lr.ph130

.lr.ph130:                                        ; preds = %._crit_edge, %.lr.ph130
  %42 = phi i8 [ %48, %.lr.ph130 ], [ %40, %._crit_edge ]
  %.098129 = phi i32 [ %46, %.lr.ph130 ], [ 0, %._crit_edge ]
  %.3102128 = phi ptr [ %47, %.lr.ph130 ], [ %.2101.lcssa, %._crit_edge ]
  %43 = zext nneg i8 %42 to i32
  %44 = mul nsw i32 %.098129, 10
  %45 = add i32 %44, -48
  %46 = add i32 %45, %43
  %47 = getelementptr inbounds i8, ptr %.3102128, i64 1
  %48 = load i8, ptr %47, align 1, !tbaa !17
  %49 = add i8 %48, -48
  %or.cond115 = icmp ult i8 %49, 10
  br i1 %or.cond115, label %.lr.ph130, label %.critedge9, !llvm.loop !19

.critedge9:                                       ; preds = %.lr.ph130
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %50 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 %indvars.iv
  store i32 %46, ptr %50, align 4, !tbaa !11
  %51 = getelementptr inbounds i8, ptr %.3102128, i64 2
  %52 = icmp slt i64 %indvars.iv, 2
  br i1 %52, label %.lr.ph136, label %.critedge7, !llvm.loop !20

.critedge7.split.loop.exit:                       ; preds = %.lr.ph136
  %53 = trunc nsw i64 %indvars.iv to i32
  br label %.critedge7

.critedge7.split.loop.exit154:                    ; preds = %._crit_edge
  %54 = trunc nsw i64 %indvars.iv to i32
  br label %.critedge7

.critedge7:                                       ; preds = %.critedge9, %.critedge7.split.loop.exit154, %.critedge7.split.loop.exit
  %.197.lcssa.ph = phi i32 [ %53, %.critedge7.split.loop.exit ], [ %54, %.critedge7.split.loop.exit154 ], [ %36, %.critedge9 ]
  %55 = icmp slt i32 %.197.lcssa.ph, 3
  br i1 %55, label %.outer.split, label %.critedge.split, !llvm.loop !15

.critedge.split:                                  ; preds = %.critedge7
  %56 = load i32, ptr %3, align 4, !tbaa !11
  store i32 %56, ptr %7, align 8, !tbaa !12
  %57 = getelementptr inbounds i8, ptr %3, i64 4
  %58 = load i32, ptr %57, align 4, !tbaa !11
  %59 = getelementptr inbounds i8, ptr %7, i64 4
  store i32 %58, ptr %59, align 4, !tbaa !13
  %60 = getelementptr inbounds i8, ptr %3, i64 8
  %61 = load i32, ptr %60, align 4, !tbaa !11
  %62 = getelementptr inbounds i8, ptr %7, i64 12
  store i32 %61, ptr %62, align 4, !tbaa !14
  switch i32 %34, label %.loopexit [
    i32 4, label %63
    i32 5, label %77
    i32 6, label %92
  ]

63:                                               ; preds = %.critedge.split.thread, %.critedge.split
  %64 = phi ptr [ %20, %.critedge.split.thread ], [ %62, %.critedge.split ]
  %65 = phi i32 [ %16, %.critedge.split.thread ], [ %58, %.critedge.split ]
  %66 = phi i32 [ %14, %.critedge.split.thread ], [ %56, %.critedge.split ]
  store i32 1, ptr %64, align 4, !tbaa !14
  %67 = add nsw i32 %66, 7
  %68 = sdiv i32 %67, 8
  %69 = mul nsw i32 %65, %68
  %70 = getelementptr inbounds i8, ptr %7, i64 16
  store i32 %69, ptr %70, align 8, !tbaa !21
  %71 = zext i32 %69 to i64
  %72 = call noalias ptr @malloc(i64 noundef %71) #11
  %73 = getelementptr inbounds i8, ptr %7, i64 24
  store ptr %72, ptr %73, align 8, !tbaa !22
  %74 = call i64 @fread(ptr noundef %72, i64 noundef 1, i64 noundef %71, ptr noundef nonnull %4)
  %.not.not112 = icmp eq i64 %74, %71
  br i1 %.not.not112, label %75, label %.loopexit

75:                                               ; preds = %63
  %76 = call i32 @fclose(ptr noundef nonnull %4)
  br label %107

77:                                               ; preds = %.critedge.split
  switch i32 %61, label %83 [
    i32 255, label %78
    i32 65535, label %80
  ]

78:                                               ; preds = %77
  %79 = mul nsw i32 %58, %56
  br label %84

80:                                               ; preds = %77
  %81 = mul i32 %58, %56
  %82 = shl i32 %81, 1
  br label %84

83:                                               ; preds = %77
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef 109, ptr noundef nonnull @__PRETTY_FUNCTION__.pnm_create_from_file) #10
  unreachable

84:                                               ; preds = %80, %78
  %.sink = phi i32 [ %82, %80 ], [ %79, %78 ]
  %85 = getelementptr inbounds i8, ptr %7, i64 16
  store i32 %.sink, ptr %85, align 8, !tbaa !21
  %86 = zext i32 %.sink to i64
  %87 = call noalias ptr @malloc(i64 noundef %86) #11
  %88 = getelementptr inbounds i8, ptr %7, i64 24
  store ptr %87, ptr %88, align 8, !tbaa !22
  %89 = call i64 @fread(ptr noundef %87, i64 noundef 1, i64 noundef %86, ptr noundef nonnull %4)
  %.not.not111 = icmp eq i64 %89, %86
  br i1 %.not.not111, label %90, label %.loopexit

90:                                               ; preds = %84
  %91 = call i32 @fclose(ptr noundef nonnull %4)
  br label %107

92:                                               ; preds = %.critedge.split
  switch i32 %61, label %94 [
    i32 255, label %95
    i32 65535, label %93
  ]

93:                                               ; preds = %92
  br label %95

94:                                               ; preds = %92
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef 126, ptr noundef nonnull @__PRETTY_FUNCTION__.pnm_create_from_file) #10
  unreachable

95:                                               ; preds = %92, %93
  %.sink164 = phi i32 [ %56, %93 ], [ 3, %92 ]
  %.sink163 = phi i32 [ 6, %93 ], [ %56, %92 ]
  %96 = mul i32 %58, %.sink164
  %97 = mul i32 %96, %.sink163
  %98 = getelementptr inbounds i8, ptr %7, i64 16
  store i32 %97, ptr %98, align 8, !tbaa !21
  %99 = zext i32 %97 to i64
  %100 = call noalias ptr @malloc(i64 noundef %99) #11
  %101 = getelementptr inbounds i8, ptr %7, i64 24
  store ptr %100, ptr %101, align 8, !tbaa !22
  %102 = call i64 @fread(ptr noundef %100, i64 noundef 1, i64 noundef %99, ptr noundef nonnull %4)
  %.not.not = icmp eq i64 %102, %99
  br i1 %.not.not, label %103, label %.loopexit

103:                                              ; preds = %95
  %104 = call i32 @fclose(ptr noundef nonnull %4)
  br label %107

.loopexit:                                        ; preds = %.outer.split.split, %.critedge.split, %63, %84, %95
  %105 = phi ptr [ null, %.critedge.split ], [ %72, %63 ], [ %87, %84 ], [ %100, %95 ], [ null, %.outer.split.split ]
  %106 = call i32 @fclose(ptr noundef nonnull %4)
  call void @free(ptr noundef %105) #9
  call void @free(ptr noundef nonnull %7) #9
  br label %107

107:                                              ; preds = %103, %90, %75, %.loopexit
  %.3 = phi ptr [ %7, %103 ], [ %7, %90 ], [ %7, %75 ], [ null, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %2) #9
  br label %108

108:                                              ; preds = %1, %107
  %.4 = phi ptr [ %.3, %107 ], [ null, %1 ]
  ret ptr %.4
}

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree 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 #3 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 allocsize(0,1) }
attributes #9 = { nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind allocsize(0) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"pnm", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !7, i64 4}
!14 = !{!6, !7, i64 12}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!8, !8, i64 0}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}
!21 = !{!6, !7, i64 16}
!22 = !{!6, !10, i64 24}


; Effective O3 passes: ADCEPass,BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass