; LLVM IR from chrr/libECP :: example (ex1)

; 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 [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @loadBS(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #0 {
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %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 i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca [512 x i8], align 16
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = call noalias ptr @fopen(ptr noundef %29, ptr noundef @.str)
  store ptr %30, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  store i32 0, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  store i32 0, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = call noalias ptr @calloc(i64 noundef %32, i64 noundef 4) #5
  store ptr %33, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 512, ptr %28) #4
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %82, %7
  %35 = load i32, ptr %16, align 4, !tbaa !9
  %36 = load i32, ptr %9, align 4, !tbaa !9
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %38, label %85

38:                                               ; preds = %34
  %39 = load ptr, ptr %15, align 8, !tbaa !5
  %40 = load ptr, ptr %23, align 8, !tbaa !5
  %41 = load i32, ptr %16, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %40, i64 %42
  %44 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %39, ptr noundef @.str.1, ptr noundef %20, ptr noundef %43)
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %71, %38
  %46 = load i32, ptr %17, align 4, !tbaa !9
  %47 = load ptr, ptr %23, align 8, !tbaa !5
  %48 = load i32, ptr %16, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds i32, ptr %47, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %52 = icmp slt i32 %46, %51
  br i1 %52, label %53, label %74

53:                                               ; preds = %45
  %54 = load ptr, ptr %15, align 8, !tbaa !5
  %55 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %54, ptr noundef @.str.1, ptr noundef %19, ptr noundef %20)
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %64, %53
  %57 = load i32, ptr %18, align 4, !tbaa !9
  %58 = load i32, ptr %20, align 4, !tbaa !9
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %60, label %67

60:                                               ; preds = %56
  %61 = getelementptr inbounds [512 x i8], ptr %28, i64 0, i64 0
  %62 = load ptr, ptr %15, align 8, !tbaa !5
  %63 = call ptr @fgets(ptr noundef %61, i32 noundef 512, ptr noundef %62)
  br label %64

64:                                               ; preds = %60
  %65 = load i32, ptr %18, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %18, align 4, !tbaa !9
  br label %56, !llvm.loop !11

67:                                               ; preds = %56
  %68 = load i32, ptr %20, align 4, !tbaa !9
  %69 = load i32, ptr %22, align 4, !tbaa !9
  %70 = add nsw i32 %69, %68
  store i32 %70, ptr %22, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %67
  %72 = load i32, ptr %17, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %17, align 4, !tbaa !9
  br label %45, !llvm.loop !13

74:                                               ; preds = %45
  %75 = load ptr, ptr %23, align 8, !tbaa !5
  %76 = load i32, ptr %16, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr %75, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !9
  %80 = load i32, ptr %21, align 4, !tbaa !9
  %81 = add nsw i32 %80, %79
  store i32 %81, ptr %21, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %74
  %83 = load i32, ptr %16, align 4, !tbaa !9
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %16, align 4, !tbaa !9
  br label %34, !llvm.loop !14

85:                                               ; preds = %34
  %86 = load ptr, ptr %15, align 8, !tbaa !5
  call void @rewind(ptr noundef %86)
  %87 = load ptr, ptr %23, align 8, !tbaa !5
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %87, ptr %88, align 8, !tbaa !5
  %89 = load i32, ptr %21, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = call noalias ptr @calloc(i64 noundef %90, i64 noundef 4) #5
  store ptr %91, ptr %24, align 8, !tbaa !5
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %91, ptr %92, align 8, !tbaa !5
  %93 = load i32, ptr %21, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = call noalias ptr @calloc(i64 noundef %94, i64 noundef 4) #5
  store ptr %95, ptr %25, align 8, !tbaa !5
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %95, ptr %96, align 8, !tbaa !5
  %97 = load i32, ptr %22, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = call noalias ptr @calloc(i64 noundef %98, i64 noundef 8) #5
  store ptr %99, ptr %27, align 8, !tbaa !5
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %99, ptr %100, align 8, !tbaa !5
  %101 = load i32, ptr %22, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = call noalias ptr @calloc(i64 noundef %102, i64 noundef 8) #5
  store ptr %103, ptr %26, align 8, !tbaa !5
  %104 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %103, ptr %104, align 8, !tbaa !5
  store i32 0, ptr %22, align 4, !tbaa !9
  store i32 0, ptr %21, align 4, !tbaa !9
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %105

105:                                              ; preds = %195, %85
  %106 = load i32, ptr %16, align 4, !tbaa !9
  %107 = load i32, ptr %9, align 4, !tbaa !9
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %198

109:                                              ; preds = %105
  %110 = load ptr, ptr %15, align 8, !tbaa !5
  %111 = load ptr, ptr %23, align 8, !tbaa !5
  %112 = load i32, ptr %16, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds i32, ptr %111, i64 %113
  %115 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %110, ptr noundef @.str.1, ptr noundef %20, ptr noundef %114)
  %116 = load i32, ptr %20, align 4, !tbaa !9
  %117 = load ptr, ptr %23, align 8, !tbaa !5
  %118 = load i32, ptr %16, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i32, ptr %117, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !9
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %116, i32 noundef %121)
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %191, %109
  %124 = load i32, ptr %17, align 4, !tbaa !9
  %125 = load ptr, ptr %23, align 8, !tbaa !5
  %126 = load i32, ptr %16, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i32, ptr %125, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !9
  %130 = icmp slt i32 %124, %129
  br i1 %130, label %131, label %194

131:                                              ; preds = %123
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = load ptr, ptr %24, align 8, !tbaa !5
  %134 = load i32, ptr %21, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds i32, ptr %133, i64 %135
  %137 = load ptr, ptr %25, align 8, !tbaa !5
  %138 = load i32, ptr %21, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds i32, ptr %137, i64 %139
  %141 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %132, ptr noundef @.str.1, ptr noundef %136, ptr noundef %140)
  %142 = load ptr, ptr %24, align 8, !tbaa !5
  %143 = load i32, ptr %21, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %142, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !9
  %147 = load ptr, ptr %25, align 8, !tbaa !5
  %148 = load i32, ptr %21, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds i32, ptr %147, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !9
  %152 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %146, i32 noundef %151)
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %153

153:                                              ; preds = %185, %131
  %154 = load i32, ptr %18, align 4, !tbaa !9
  %155 = load ptr, ptr %25, align 8, !tbaa !5
  %156 = load i32, ptr %21, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds i32, ptr %155, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !9
  %160 = icmp slt i32 %154, %159
  br i1 %160, label %161, label %188

161:                                              ; preds = %153
  %162 = load ptr, ptr %15, align 8, !tbaa !5
  %163 = load ptr, ptr %27, align 8, !tbaa !5
  %164 = load i32, ptr %22, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds double, ptr %163, i64 %165
  %167 = load ptr, ptr %26, align 8, !tbaa !5
  %168 = load i32, ptr %22, align 4, !tbaa !9
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds double, ptr %167, i64 %169
  %171 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %162, ptr noundef @.str.4, ptr noundef %20, ptr noundef %166, ptr noundef %170)
  %172 = load ptr, ptr %27, align 8, !tbaa !5
  %173 = load i32, ptr %22, align 4, !tbaa !9
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds double, ptr %172, i64 %174
  %176 = load double, ptr %175, align 8, !tbaa !15
  %177 = load ptr, ptr %26, align 8, !tbaa !5
  %178 = load i32, ptr %22, align 4, !tbaa !9
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds double, ptr %177, i64 %179
  %181 = load double, ptr %180, align 8, !tbaa !15
  %182 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, double noundef %176, double noundef %181)
  %183 = load i32, ptr %22, align 4, !tbaa !9
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %22, align 4, !tbaa !9
  br label %185

185:                                              ; preds = %161
  %186 = load i32, ptr %18, align 4, !tbaa !9
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %18, align 4, !tbaa !9
  br label %153, !llvm.loop !17

188:                                              ; preds = %153
  %189 = load i32, ptr %21, align 4, !tbaa !9
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %21, align 4, !tbaa !9
  br label %191

191:                                              ; preds = %188
  %192 = load i32, ptr %17, align 4, !tbaa !9
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %17, align 4, !tbaa !9
  br label %123, !llvm.loop !18

194:                                              ; preds = %123
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %16, align 4, !tbaa !9
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %16, align 4, !tbaa !9
  br label %105, !llvm.loop !19

198:                                              ; preds = %105
  %199 = load ptr, ptr %15, align 8, !tbaa !5
  %200 = call i32 @fclose(ptr noundef %199)
  %201 = load i32, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 512, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  ret i32 %201
}

; 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 i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) #2

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

declare void @rewind(ptr noundef) #2

declare i32 @printf(ptr noundef, ...) #2

declare i32 @fclose(ptr noundef) #2

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

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 = { nounwind }
attributes #5 = { nounwind allocsize(0,1) }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


; 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 [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @loadBS(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3, ptr nocapture noundef writeonly %4, ptr nocapture noundef writeonly %5, ptr nocapture noundef writeonly %6) local_unnamed_addr #0 {
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca [512 x i8], align 16
  %11 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  %12 = sext i32 %1 to i64
  %13 = tail call noalias ptr @calloc(i64 noundef %12, i64 noundef 4) #6
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %10) #5
  %14 = icmp sgt i32 %1, 0
  br i1 %14, label %.lr.ph93.preheader, label %._crit_edge94

.lr.ph93.preheader:                               ; preds = %7
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %.lr.ph93

.lr.ph93:                                         ; preds = %.lr.ph93.preheader, %._crit_edge86
  %indvars.iv = phi i64 [ 0, %.lr.ph93.preheader ], [ %indvars.iv.next, %._crit_edge86 ]
  %.07290 = phi i32 [ 0, %.lr.ph93.preheader ], [ %30, %._crit_edge86 ]
  %.07489 = phi i32 [ 0, %.lr.ph93.preheader ], [ %.175.lcssa, %._crit_edge86 ]
  %15 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv
  %16 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %11, ptr noundef nonnull @.str.1, ptr noundef nonnull %9, ptr noundef %15) #5
  %17 = load i32, ptr %15, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph85, label %._crit_edge86

.lr.ph85:                                         ; preds = %.lr.ph93, %._crit_edge
  %.06883 = phi i32 [ %27, %._crit_edge ], [ 0, %.lr.ph93 ]
  %.17582 = phi i32 [ %26, %._crit_edge ], [ %.07489, %.lr.ph93 ]
  %19 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %11, ptr noundef nonnull @.str.1, ptr noundef nonnull %8, ptr noundef nonnull %9) #5
  %20 = load i32, ptr %9, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph85, %.lr.ph
  %.07081 = phi i32 [ %23, %.lr.ph ], [ 0, %.lr.ph85 ]
  %22 = call ptr @fgets(ptr noundef nonnull %10, i32 noundef 512, ptr noundef %11)
  %23 = add nuw nsw i32 %.07081, 1
  %24 = load i32, ptr %9, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph85
  %.lcssa = phi i32 [ %20, %.lr.ph85 ], [ %24, %.lr.ph ]
  %26 = add nsw i32 %.lcssa, %.17582
  %27 = add nuw nsw i32 %.06883, 1
  %28 = load i32, ptr %15, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %.lr.ph85, label %._crit_edge86, !llvm.loop !11

._crit_edge86:                                    ; preds = %._crit_edge, %.lr.ph93
  %.175.lcssa = phi i32 [ %.07489, %.lr.ph93 ], [ %26, %._crit_edge ]
  %.lcssa80 = phi i32 [ %17, %.lr.ph93 ], [ %28, %._crit_edge ]
  %30 = add nsw i32 %.lcssa80, %.07290
  %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 %._crit_edge94.loopexit, label %.lr.ph93, !llvm.loop !12

._crit_edge94.loopexit:                           ; preds = %._crit_edge86
  %31 = sext i32 %30 to i64
  %32 = sext i32 %.175.lcssa to i64
  br label %._crit_edge94

._crit_edge94:                                    ; preds = %._crit_edge94.loopexit, %7
  %.074.lcssa = phi i64 [ 0, %7 ], [ %32, %._crit_edge94.loopexit ]
  %.072.lcssa = phi i64 [ 0, %7 ], [ %31, %._crit_edge94.loopexit ]
  call void @rewind(ptr noundef %11)
  store ptr %13, ptr %2, align 8, !tbaa !13
  %33 = call noalias ptr @calloc(i64 noundef %.072.lcssa, i64 noundef 4) #6
  store ptr %33, ptr %3, align 8, !tbaa !13
  %34 = call noalias ptr @calloc(i64 noundef %.072.lcssa, i64 noundef 4) #6
  store ptr %34, ptr %4, align 8, !tbaa !13
  %35 = call noalias ptr @calloc(i64 noundef %.074.lcssa, i64 noundef 8) #6
  store ptr %35, ptr %5, align 8, !tbaa !13
  %36 = call noalias ptr @calloc(i64 noundef %.074.lcssa, i64 noundef 8) #6
  store ptr %36, ptr %6, align 8, !tbaa !13
  br i1 %14, label %.lr.ph115.preheader, label %._crit_edge116

.lr.ph115.preheader:                              ; preds = %._crit_edge94
  %wide.trip.count134 = zext nneg i32 %1 to i64
  br label %.lr.ph115

.lr.ph115:                                        ; preds = %.lr.ph115.preheader, %._crit_edge108
  %indvars.iv131 = phi i64 [ 0, %.lr.ph115.preheader ], [ %indvars.iv.next132, %._crit_edge108 ]
  %.173112 = phi i32 [ 0, %.lr.ph115.preheader ], [ %.2.lcssa, %._crit_edge108 ]
  %.276111 = phi i32 [ 0, %.lr.ph115.preheader ], [ %.3.lcssa, %._crit_edge108 ]
  %37 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv131
  %38 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %11, ptr noundef nonnull @.str.1, ptr noundef nonnull %9, ptr noundef %37) #5
  %39 = load i32, ptr %9, align 4, !tbaa !5
  %40 = load i32, ptr %37, align 4, !tbaa !5
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %39, i32 noundef %40)
  %42 = load i32, ptr %37, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %.lr.ph107.preheader, label %._crit_edge108

.lr.ph107.preheader:                              ; preds = %.lr.ph115
  %44 = sext i32 %.173112 to i64
  br label %.lr.ph107

.lr.ph107:                                        ; preds = %.lr.ph107.preheader, %._crit_edge101
  %indvars.iv128 = phi i64 [ %44, %.lr.ph107.preheader ], [ %indvars.iv.next129, %._crit_edge101 ]
  %.169105 = phi i32 [ 0, %.lr.ph107.preheader ], [ %64, %._crit_edge101 ]
  %.3103 = phi i32 [ %.276111, %.lr.ph107.preheader ], [ %.4.lcssa, %._crit_edge101 ]
  %45 = getelementptr inbounds i32, ptr %33, i64 %indvars.iv128
  %46 = getelementptr inbounds i32, ptr %34, i64 %indvars.iv128
  %47 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %11, ptr noundef nonnull @.str.1, ptr noundef %45, ptr noundef %46) #5
  %48 = load i32, ptr %45, align 4, !tbaa !5
  %49 = load i32, ptr %46, align 4, !tbaa !5
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %48, i32 noundef %49)
  %51 = load i32, ptr %46, align 4, !tbaa !5
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph100.preheader, label %._crit_edge101

.lr.ph100.preheader:                              ; preds = %.lr.ph107
  %53 = sext i32 %.3103 to i64
  br label %.lr.ph100

.lr.ph100:                                        ; preds = %.lr.ph100.preheader, %.lr.ph100
  %indvars.iv125 = phi i64 [ %53, %.lr.ph100.preheader ], [ %indvars.iv.next126, %.lr.ph100 ]
  %.17198 = phi i32 [ 0, %.lr.ph100.preheader ], [ %60, %.lr.ph100 ]
  %54 = getelementptr inbounds double, ptr %35, i64 %indvars.iv125
  %55 = getelementptr inbounds double, ptr %36, i64 %indvars.iv125
  %56 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %11, ptr noundef nonnull @.str.4, ptr noundef nonnull %9, ptr noundef %54, ptr noundef %55) #5
  %57 = load double, ptr %54, align 8, !tbaa !15
  %58 = load double, ptr %55, align 8, !tbaa !15
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, double noundef %57, double noundef %58)
  %indvars.iv.next126 = add nsw i64 %indvars.iv125, 1
  %60 = add nuw nsw i32 %.17198, 1
  %61 = load i32, ptr %46, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %.lr.ph100, label %._crit_edge101.loopexit, !llvm.loop !17

._crit_edge101.loopexit:                          ; preds = %.lr.ph100
  %63 = trunc nsw i64 %indvars.iv.next126 to i32
  br label %._crit_edge101

._crit_edge101:                                   ; preds = %._crit_edge101.loopexit, %.lr.ph107
  %.4.lcssa = phi i32 [ %.3103, %.lr.ph107 ], [ %63, %._crit_edge101.loopexit ]
  %indvars.iv.next129 = add nsw i64 %indvars.iv128, 1
  %64 = add nuw nsw i32 %.169105, 1
  %65 = load i32, ptr %37, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %.lr.ph107, label %._crit_edge108.loopexit, !llvm.loop !18

._crit_edge108.loopexit:                          ; preds = %._crit_edge101
  %67 = trunc nsw i64 %indvars.iv.next129 to i32
  br label %._crit_edge108

._crit_edge108:                                   ; preds = %._crit_edge108.loopexit, %.lr.ph115
  %.3.lcssa = phi i32 [ %.276111, %.lr.ph115 ], [ %.4.lcssa, %._crit_edge108.loopexit ]
  %.2.lcssa = phi i32 [ %.173112, %.lr.ph115 ], [ %67, %._crit_edge108.loopexit ]
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %exitcond135.not = icmp eq i64 %indvars.iv.next132, %wide.trip.count134
  br i1 %exitcond135.not, label %._crit_edge116, label %.lr.ph115, !llvm.loop !19

._crit_edge116:                                   ; preds = %._crit_edge108, %._crit_edge94
  %.173.lcssa = phi i32 [ 0, %._crit_edge94 ], [ %.2.lcssa, %._crit_edge108 ]
  %68 = call i32 @fclose(ptr noundef %11)
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  ret i32 %.173.lcssa
}

; 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

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #4

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

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

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

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

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

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 = { "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 }
attributes #6 = { nounwind allocsize(0,1) }

!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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


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