; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_MatNd)

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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@Rcs_calloc = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@RCS_GLOBAL_RLOG_CB = external global ptr, align 8
@RcsLogLevel = external global i32, align 4
@.str.26 = external hidden unnamed_addr constant [16 x i8], align 1
@__func__.MatNd_arraySizeFromFile = external hidden unnamed_addr constant [24 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [294 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #0

declare void @print_trace() #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

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

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

; Function Attrs: noreturn nounwind
declare void @abort() #2

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @MatNd_arraySizeFromFile(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #4 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = call i32 @fseek(ptr noundef %17, i64 noundef 0, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = call i64 @ftell(ptr noundef %19)
  %21 = add nsw i64 %20, 1
  store i64 %21, ptr %10, align 8, !tbaa !9
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  call void @rewind(ptr noundef %22)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %23 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %24 = load i64, ptr %10, align 8, !tbaa !9
  %25 = call ptr %23(i64 noundef %24, i64 noundef 1)
  store ptr %25, ptr %11, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %4
  %27 = load ptr, ptr %11, align 8, !tbaa !5
  %28 = icmp ne ptr %27, null
  br i1 %28, label %37, label %29

29:                                               ; preds = %26
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @__func__.MatNd_arraySizeFromFile, i32 noundef 767, ptr noundef @.str.56) #6
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = load i64, ptr %10, align 8, !tbaa !9
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.57, i64 noundef %33) #6
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.4) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

37:                                               ; preds = %26
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 -1, ptr %13, align 4, !tbaa !11
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %40, align 4, !tbaa !11
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 0, ptr %41, align 4, !tbaa !11
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 0, ptr %42, align 4, !tbaa !11
  br label %43

43:                                               ; preds = %236, %39
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = load i64, ptr %10, align 8, !tbaa !9
  %46 = trunc i64 %45 to i32
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = call ptr @fgets(ptr noundef %44, i32 noundef %46, ptr noundef %47)
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %237

50:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #6
  store i8 1, ptr %14, align 1, !tbaa !13
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %51

51:                                               ; preds = %139, %50
  %52 = load i32, ptr %12, align 4, !tbaa !11
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = call i64 @strlen(ptr noundef %53) #8
  %55 = sub i64 %54, 1
  %56 = trunc i64 %55 to i32
  %57 = icmp slt i32 %52, %56
  br i1 %57, label %58, label %142

58:                                               ; preds = %51
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = load i32, ptr %12, align 4, !tbaa !11
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i8, ptr %59, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !15
  %64 = sext i8 %63 to i32
  %65 = icmp sgt i32 %64, 47
  br i1 %65, label %66, label %74

66:                                               ; preds = %58
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = load i32, ptr %12, align 4, !tbaa !11
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i8, ptr %67, i64 %69
  %71 = load i8, ptr %70, align 1, !tbaa !15
  %72 = sext i8 %71 to i32
  %73 = icmp slt i32 %72, 58
  br i1 %73, label %114, label %74

74:                                               ; preds = %66, %58
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = load i32, ptr %12, align 4, !tbaa !11
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds i8, ptr %75, i64 %77
  %79 = load i8, ptr %78, align 1, !tbaa !15
  %80 = sext i8 %79 to i32
  %81 = icmp eq i32 %80, 32
  br i1 %81, label %114, label %82

82:                                               ; preds = %74
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = load i32, ptr %12, align 4, !tbaa !11
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i8, ptr %83, i64 %85
  %87 = load i8, ptr %86, align 1, !tbaa !15
  %88 = sext i8 %87 to i32
  %89 = icmp eq i32 %88, 43
  br i1 %89, label %114, label %90

90:                                               ; preds = %82
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = load i32, ptr %12, align 4, !tbaa !11
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i8, ptr %91, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !15
  %96 = sext i8 %95 to i32
  %97 = icmp eq i32 %96, 45
  br i1 %97, label %114, label %98

98:                                               ; preds = %90
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = load i32, ptr %12, align 4, !tbaa !11
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i8, ptr %99, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !15
  %104 = sext i8 %103 to i32
  %105 = icmp eq i32 %104, 46
  br i1 %105, label %114, label %106

106:                                              ; preds = %98
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = load i32, ptr %12, align 4, !tbaa !11
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i8, ptr %107, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !15
  %112 = sext i8 %111 to i32
  %113 = icmp eq i32 %112, 101
  br i1 %113, label %114, label %115

114:                                              ; preds = %106, %98, %90, %82, %74, %66
  br label %138

115:                                              ; preds = %106
  store i8 0, ptr %14, align 1, !tbaa !13
  br label %116

116:                                              ; preds = %115
  %117 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %118 = icmp ne ptr %117, null
  br i1 %118, label %119, label %123

119:                                              ; preds = %116
  %120 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %121 = load i32, ptr %12, align 4, !tbaa !11
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %120(i32 noundef 0, ptr noundef @.str.1, ptr noundef @__func__.MatNd_arraySizeFromFile, i32 noundef 795, ptr noundef @.str.58, i32 noundef %121, ptr noundef %122)
  br label %123

123:                                              ; preds = %119, %116
  %124 = load i32, ptr @RcsLogLevel, align 4, !tbaa !11
  %125 = icmp sle i32 0, %124
  br i1 %125, label %126, label %135

126:                                              ; preds = %123
  %127 = load ptr, ptr @stderr, align 8, !tbaa !5
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.26, ptr noundef @.str.1, ptr noundef @__func__.MatNd_arraySizeFromFile, i32 noundef 795) #6
  %129 = load ptr, ptr @stderr, align 8, !tbaa !5
  %130 = load i32, ptr %12, align 4, !tbaa !11
  %131 = load ptr, ptr %11, align 8, !tbaa !5
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %129, ptr noundef @.str.58, i32 noundef %130, ptr noundef %131) #6
  %133 = load ptr, ptr @stderr, align 8, !tbaa !5
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef @.str.4) #6
  br label %135

135:                                              ; preds = %126, %123
  br label %136

136:                                              ; preds = %135
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137, %114
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %12, align 4, !tbaa !11
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %12, align 4, !tbaa !11
  br label %51, !llvm.loop !16

142:                                              ; preds = %51
  %143 = load i8, ptr %14, align 1, !tbaa !13, !range !18, !noundef !19
  %144 = trunc i8 %143 to i1
  br i1 %144, label %177, label %145

145:                                              ; preds = %142
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = load i32, ptr %146, align 4, !tbaa !11
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %146, align 4, !tbaa !11
  br label %149

149:                                              ; preds = %145
  %150 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %151 = icmp ne ptr %150, null
  br i1 %151, label %152, label %159

152:                                              ; preds = %149
  %153 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %154 = load ptr, ptr %9, align 8, !tbaa !5
  %155 = load i32, ptr %154, align 4, !tbaa !11
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = load i32, ptr %156, align 4, !tbaa !11
  %158 = load ptr, ptr %11, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %153(i32 noundef 0, ptr noundef @.str.1, ptr noundef @__func__.MatNd_arraySizeFromFile, i32 noundef 803, ptr noundef @.str.59, i32 noundef %155, i32 noundef %157, ptr noundef %158)
  br label %159

159:                                              ; preds = %152, %149
  %160 = load i32, ptr @RcsLogLevel, align 4, !tbaa !11
  %161 = icmp sle i32 0, %160
  br i1 %161, label %162, label %174

162:                                              ; preds = %159
  %163 = load ptr, ptr @stderr, align 8, !tbaa !5
  %164 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %163, ptr noundef @.str.26, ptr noundef @.str.1, ptr noundef @__func__.MatNd_arraySizeFromFile, i32 noundef 803) #6
  %165 = load ptr, ptr @stderr, align 8, !tbaa !5
  %166 = load ptr, ptr %9, align 8, !tbaa !5
  %167 = load i32, ptr %166, align 4, !tbaa !11
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = load i32, ptr %168, align 4, !tbaa !11
  %170 = load ptr, ptr %11, align 8, !tbaa !5
  %171 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %165, ptr noundef @.str.59, i32 noundef %167, i32 noundef %169, ptr noundef %170) #6
  %172 = load ptr, ptr @stderr, align 8, !tbaa !5
  %173 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %172, ptr noundef @.str.4) #6
  br label %174

174:                                              ; preds = %162, %159
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  br label %233

177:                                              ; preds = %142
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  %179 = call i32 @String_countSubStrings(ptr noundef %178, ptr noundef @.str.60)
  %180 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %179, ptr %180, align 4, !tbaa !11
  %181 = load i32, ptr %13, align 4, !tbaa !11
  %182 = icmp ne i32 %181, -1
  br i1 %182, label %183, label %225

183:                                              ; preds = %177
  %184 = load i32, ptr %13, align 4, !tbaa !11
  %185 = load ptr, ptr %8, align 8, !tbaa !5
  %186 = load i32, ptr %185, align 4, !tbaa !11
  %187 = icmp ne i32 %184, %186
  br i1 %187, label %188, label %224

188:                                              ; preds = %183
  br label %189

189:                                              ; preds = %188
  %190 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %191 = icmp ne ptr %190, null
  br i1 %191, label %192, label %202

192:                                              ; preds = %189
  %193 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %194 = load ptr, ptr %7, align 8, !tbaa !5
  %195 = load i32, ptr %194, align 4, !tbaa !11
  %196 = sub nsw i32 %195, 1
  %197 = load i32, ptr %13, align 4, !tbaa !11
  %198 = load ptr, ptr %7, align 8, !tbaa !5
  %199 = load i32, ptr %198, align 4, !tbaa !11
  %200 = load ptr, ptr %8, align 8, !tbaa !5
  %201 = load i32, ptr %200, align 4, !tbaa !11
  call void (i32, ptr, ptr, i32, ptr, ...) %193(i32 noundef 1, ptr noundef @.str.1, ptr noundef @__func__.MatNd_arraySizeFromFile, i32 noundef 819, ptr noundef @.str.61, i32 noundef %196, i32 noundef %197, i32 noundef %199, i32 noundef %201)
  br label %202

202:                                              ; preds = %192, %189
  %203 = load i32, ptr @RcsLogLevel, align 4, !tbaa !11
  %204 = icmp sle i32 1, %203
  br i1 %204, label %205, label %220

205:                                              ; preds = %202
  %206 = load ptr, ptr @stderr, align 8, !tbaa !5
  %207 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %206, ptr noundef @.str.26, ptr noundef @.str.1, ptr noundef @__func__.MatNd_arraySizeFromFile, i32 noundef 819) #6
  %208 = load ptr, ptr @stderr, align 8, !tbaa !5
  %209 = load ptr, ptr %7, align 8, !tbaa !5
  %210 = load i32, ptr %209, align 4, !tbaa !11
  %211 = sub nsw i32 %210, 1
  %212 = load i32, ptr %13, align 4, !tbaa !11
  %213 = load ptr, ptr %7, align 8, !tbaa !5
  %214 = load i32, ptr %213, align 4, !tbaa !11
  %215 = load ptr, ptr %8, align 8, !tbaa !5
  %216 = load i32, ptr %215, align 4, !tbaa !11
  %217 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %208, ptr noundef @.str.61, i32 noundef %211, i32 noundef %212, i32 noundef %214, i32 noundef %216) #6
  %218 = load ptr, ptr @stderr, align 8, !tbaa !5
  %219 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %218, ptr noundef @.str.4) #6
  br label %220

220:                                              ; preds = %205, %202
  br label %221

221:                                              ; preds = %220
  br label %222

222:                                              ; preds = %221
  %223 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %223) #6
  store i1 false, ptr %5, align 1
  store i32 1, ptr %15, align 4
  br label %234

224:                                              ; preds = %183
  br label %225

225:                                              ; preds = %224, %177
  %226 = load ptr, ptr %8, align 8, !tbaa !5
  %227 = load i32, ptr %226, align 4, !tbaa !11
  store i32 %227, ptr %13, align 4, !tbaa !11
  %228 = load ptr, ptr %7, align 8, !tbaa !5
  %229 = load i32, ptr %228, align 4, !tbaa !11
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %228, align 4, !tbaa !11
  %231 = load ptr, ptr %11, align 8, !tbaa !5
  %232 = getelementptr inbounds i8, ptr %231, i64 0
  store i8 0, ptr %232, align 1, !tbaa !15
  br label %233

233:                                              ; preds = %225, %176
  store i32 0, ptr %15, align 4
  br label %234

234:                                              ; preds = %233, %222
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #6
  %235 = load i32, ptr %15, align 4
  switch i32 %235, label %264 [
    i32 0, label %236
  ]

236:                                              ; preds = %234
  br label %43, !llvm.loop !20

237:                                              ; preds = %43
  %238 = load ptr, ptr %6, align 8, !tbaa !5
  call void @rewind(ptr noundef %238)
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %239

239:                                              ; preds = %259, %237
  %240 = load i32, ptr %12, align 4, !tbaa !11
  %241 = load ptr, ptr %9, align 8, !tbaa !5
  %242 = load i32, ptr %241, align 4, !tbaa !11
  %243 = icmp slt i32 %240, %242
  br i1 %243, label %244, label %262

244:                                              ; preds = %239
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %245 = load ptr, ptr %11, align 8, !tbaa !5
  %246 = load i64, ptr %10, align 8, !tbaa !9
  %247 = trunc i64 %246 to i32
  %248 = load ptr, ptr %6, align 8, !tbaa !5
  %249 = call ptr @fgets(ptr noundef %245, i32 noundef %247, ptr noundef %248)
  store ptr %249, ptr %16, align 8, !tbaa !5
  br label %250

250:                                              ; preds = %244
  %251 = load ptr, ptr %16, align 8, !tbaa !5
  %252 = icmp ne ptr %251, null
  br i1 %252, label %256, label %253

253:                                              ; preds = %250
  %254 = load ptr, ptr @stderr, align 8, !tbaa !5
  %255 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %254, ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @__func__.MatNd_arraySizeFromFile, i32 noundef 838, ptr noundef @.str.62) #6
  call void @print_trace()
  call void @abort() #7
  unreachable

256:                                              ; preds = %250
  br label %257

257:                                              ; preds = %256
  br label %258

258:                                              ; preds = %257
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %259

259:                                              ; preds = %258
  %260 = load i32, ptr %12, align 4, !tbaa !11
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %12, align 4, !tbaa !11
  br label %239, !llvm.loop !21

262:                                              ; preds = %239
  %263 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %263) #6
  store i1 true, ptr %5, align 1
  store i32 1, ptr %15, align 4
  br label %264

264:                                              ; preds = %262, %234
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %265 = load i1, ptr %5, align 1
  ret i1 %265
}

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #1

declare i64 @ftell(ptr noundef) #1

declare void @rewind(ptr noundef) #1

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #5

declare i32 @String_countSubStrings(ptr noundef, ptr noundef) #1

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

!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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@Rcs_calloc = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@RCS_GLOBAL_RLOG_CB = external local_unnamed_addr global ptr, align 8
@RcsLogLevel = external local_unnamed_addr global i32, align 4
@.str.26 = external hidden unnamed_addr constant [16 x i8], align 1
@__func__.MatNd_arraySizeFromFile = external hidden unnamed_addr constant [24 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [294 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #0

declare void @print_trace() local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @abort() 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 #3

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @MatNd_arraySizeFromFile(ptr nocapture noundef %0, ptr nocapture noundef %1, ptr nocapture noundef %2, ptr nocapture noundef %3) local_unnamed_addr #4 {
  %5 = tail call i32 @fseek(ptr noundef %0, i64 noundef 0, i32 noundef 2)
  %6 = tail call i64 @ftell(ptr noundef %0)
  %7 = add nsw i64 %6, 1
  tail call void @rewind(ptr noundef %0)
  %8 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %9 = tail call ptr %8(i64 noundef %7, i64 noundef 1) #6
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %10, label %17

10:                                               ; preds = %4
  %11 = load ptr, ptr @stderr, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_arraySizeFromFile, i32 noundef 767, ptr noundef nonnull @.str.56) #7
  %13 = load ptr, ptr @stderr, align 8, !tbaa !5
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.57, i64 noundef %7) #7
  %15 = load ptr, ptr @stderr, align 8, !tbaa !5
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.4) #7
  tail call void @print_trace() #6
  tail call void @exit(i32 noundef 1) #8
  unreachable

17:                                               ; preds = %4
  store i32 0, ptr %1, align 4, !tbaa !9
  store i32 0, ptr %2, align 4, !tbaa !9
  store i32 0, ptr %3, align 4, !tbaa !9
  %18 = trunc i64 %7 to i32
  %19 = tail call ptr @fgets(ptr noundef nonnull %9, i32 noundef %18, ptr noundef %0)
  %.not83100 = icmp eq ptr %19, null
  br i1 %.not83100, label %._crit_edge103, label %.preheader

.preheader:                                       ; preds = %17, %88
  %.071101 = phi i32 [ %.273, %88 ], [ -1, %17 ]
  %20 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %9) #9
  %21 = trunc i64 %20 to i32
  %22 = add i32 %21, -1
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %.preheader, %43
  %indvars.iv = phi i64 [ %indvars.iv.next, %43 ], [ 0, %.preheader ]
  %.06999 = phi i1 [ %.170, %43 ], [ true, %.preheader ]
  %24 = getelementptr inbounds i8, ptr %9, i64 %indvars.iv
  %25 = load i8, ptr %24, align 1, !tbaa !11
  %26 = add i8 %25, -48
  %or.cond = icmp ult i8 %26, 10
  br i1 %or.cond, label %43, label %27

27:                                               ; preds = %.lr.ph
  switch i8 %25, label %28 [
    i8 32, label %43
    i8 43, label %43
    i8 45, label %43
    i8 46, label %43
    i8 101, label %43
  ]

28:                                               ; preds = %27
  %29 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not89 = icmp eq ptr %29, null
  br i1 %.not89, label %32, label %30

30:                                               ; preds = %28
  %31 = trunc nuw nsw i64 %indvars.iv to i32
  tail call void (i32, ptr, ptr, i32, ptr, ...) %29(i32 noundef 0, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_arraySizeFromFile, i32 noundef 795, ptr noundef nonnull @.str.58, i32 noundef %31, ptr noundef nonnull %9) #6
  br label %32

32:                                               ; preds = %30, %28
  %33 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %34 = icmp sgt i32 %33, -1
  br i1 %34, label %35, label %43

35:                                               ; preds = %32
  %36 = load ptr, ptr @stderr, align 8, !tbaa !5
  %37 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_arraySizeFromFile, i32 noundef 795) #7
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = trunc nuw nsw i64 %indvars.iv to i32
  %40 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.58, i32 noundef %39, ptr noundef nonnull %9) #7
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef nonnull @.str.4) #7
  br label %43

43:                                               ; preds = %27, %27, %27, %27, %27, %.lr.ph, %35, %32
  %.170 = phi i1 [ %.06999, %27 ], [ false, %35 ], [ false, %32 ], [ %.06999, %.lr.ph ], [ %.06999, %27 ], [ %.06999, %27 ], [ %.06999, %27 ], [ %.06999, %27 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %9) #9
  %45 = shl i64 %44, 32
  %sext = add i64 %45, -4294967296
  %46 = ashr exact i64 %sext, 32
  %47 = icmp slt i64 %indvars.iv.next, %46
  br i1 %47, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %43
  br i1 %.170, label %.critedge, label %48

48:                                               ; preds = %._crit_edge
  %49 = load i32, ptr %3, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %3, align 4, !tbaa !9
  %51 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not85 = icmp eq ptr %51, null
  br i1 %.not85, label %54, label %52

52:                                               ; preds = %48
  %53 = load i32, ptr %1, align 4, !tbaa !9
  tail call void (i32, ptr, ptr, i32, ptr, ...) %51(i32 noundef 0, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_arraySizeFromFile, i32 noundef 803, ptr noundef nonnull @.str.59, i32 noundef %50, i32 noundef %53, ptr noundef nonnull %9) #6
  br label %54

54:                                               ; preds = %52, %48
  %55 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %56 = icmp sgt i32 %55, -1
  br i1 %56, label %57, label %88

57:                                               ; preds = %54
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_arraySizeFromFile, i32 noundef 803) #7
  %60 = load ptr, ptr @stderr, align 8, !tbaa !5
  %61 = load i32, ptr %3, align 4, !tbaa !9
  %62 = load i32, ptr %1, align 4, !tbaa !9
  %63 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.59, i32 noundef %61, i32 noundef %62, ptr noundef nonnull %9) #7
  %64 = load ptr, ptr @stderr, align 8, !tbaa !5
  %65 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef nonnull @.str.4) #7
  br label %88

.critedge:                                        ; preds = %.preheader, %._crit_edge
  %66 = tail call i32 @String_countSubStrings(ptr noundef nonnull %9, ptr noundef nonnull @.str.60) #6
  store i32 %66, ptr %2, align 4, !tbaa !9
  %.not86 = icmp eq i32 %.071101, -1
  %.not87 = icmp eq i32 %.071101, %66
  %or.cond90 = select i1 %.not86, i1 true, i1 %.not87
  br i1 %or.cond90, label %85, label %67

67:                                               ; preds = %.critedge
  %68 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not88 = icmp eq ptr %68, null
  br i1 %.not88, label %72, label %69

69:                                               ; preds = %67
  %70 = load i32, ptr %1, align 4, !tbaa !9
  %71 = add nsw i32 %70, -1
  tail call void (i32, ptr, ptr, i32, ptr, ...) %68(i32 noundef 1, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_arraySizeFromFile, i32 noundef 819, ptr noundef nonnull @.str.61, i32 noundef %71, i32 noundef %.071101, i32 noundef %70, i32 noundef %66) #6
  br label %72

72:                                               ; preds = %69, %67
  %73 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %75, label %.thread

75:                                               ; preds = %72
  %76 = load ptr, ptr @stderr, align 8, !tbaa !5
  %77 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_arraySizeFromFile, i32 noundef 819) #7
  %78 = load ptr, ptr @stderr, align 8, !tbaa !5
  %79 = load i32, ptr %1, align 4, !tbaa !9
  %80 = add nsw i32 %79, -1
  %81 = load i32, ptr %2, align 4, !tbaa !9
  %82 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef nonnull @.str.61, i32 noundef %80, i32 noundef %.071101, i32 noundef %79, i32 noundef %81) #7
  %83 = load ptr, ptr @stderr, align 8, !tbaa !5
  %84 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef nonnull @.str.4) #7
  br label %.thread

85:                                               ; preds = %.critedge
  %86 = load i32, ptr %1, align 4, !tbaa !9
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %1, align 4, !tbaa !9
  store i8 0, ptr %9, align 1, !tbaa !11
  br label %88

88:                                               ; preds = %85, %57, %54
  %.273 = phi i32 [ %66, %85 ], [ %.071101, %57 ], [ %.071101, %54 ]
  %89 = tail call ptr @fgets(ptr noundef nonnull %9, i32 noundef %18, ptr noundef %0)
  %.not83 = icmp eq ptr %89, null
  br i1 %.not83, label %._crit_edge103, label %.preheader, !llvm.loop !14

._crit_edge103:                                   ; preds = %88, %17
  tail call void @rewind(ptr noundef %0)
  %90 = load i32, ptr %3, align 4, !tbaa !9
  %91 = icmp sgt i32 %90, 0
  br i1 %91, label %.lr.ph108, label %.thread

92:                                               ; preds = %.lr.ph108
  %93 = add nuw nsw i32 %.175106, 1
  %94 = load i32, ptr %3, align 4, !tbaa !9
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %.lr.ph108, label %.thread, !llvm.loop !15

.lr.ph108:                                        ; preds = %._crit_edge103, %92
  %.175106 = phi i32 [ %93, %92 ], [ 0, %._crit_edge103 ]
  %96 = tail call ptr @fgets(ptr noundef nonnull %9, i32 noundef %18, ptr noundef %0)
  %.not84 = icmp eq ptr %96, null
  br i1 %.not84, label %97, label %92

97:                                               ; preds = %.lr.ph108
  %98 = load ptr, ptr @stderr, align 8, !tbaa !5
  %99 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_arraySizeFromFile, i32 noundef 838, ptr noundef nonnull @.str.62) #7
  tail call void @print_trace() #6
  tail call void @abort() #8
  unreachable

.thread:                                          ; preds = %92, %._crit_edge103, %75, %72
  %.not8394 = phi i1 [ false, %72 ], [ false, %75 ], [ true, %._crit_edge103 ], [ true, %92 ]
  tail call void @free(ptr noundef %9) #6
  ret i1 %.not8394
}

; Function Attrs: nofree nounwind
declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i64 @ftell(ptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare void @rewind(ptr nocapture noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5

declare i32 @String_countSubStrings(ptr noundef, ptr noundef) local_unnamed_addr #1

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

!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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


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