; LLVM IR from CLASS-SZ/class_sz :: class-sz/tools (r8lib)

; 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
@stdout = external global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [39 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @r82col_print_part(i32 noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %11 = load i32, ptr %7, align 4, !tbaa !5
  %12 = icmp sle i32 %11, 0
  br i1 %12, label %13, label %14

13:                                               ; preds = %4
  store i32 1, ptr %10, align 4
  br label %168

14:                                               ; preds = %4
  %15 = load i32, ptr %5, align 4, !tbaa !5
  %16 = icmp sle i32 %15, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %14
  store i32 1, ptr %10, align 4
  br label %168

18:                                               ; preds = %14
  %19 = load ptr, ptr @stdout, align 8, !tbaa !9
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str) #3
  %21 = load ptr, ptr @stdout, align 8, !tbaa !9
  %22 = load ptr, ptr %8, align 8, !tbaa !9
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef @.str.8, ptr noundef %22) #3
  %24 = load ptr, ptr @stdout, align 8, !tbaa !9
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef @.str) #3
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = load i32, ptr %7, align 4, !tbaa !5
  %28 = icmp sle i32 %26, %27
  br i1 %28, label %29, label %58

29:                                               ; preds = %18
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %54, %29
  %31 = load i32, ptr %9, align 4, !tbaa !5
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %34, label %57

34:                                               ; preds = %30
  %35 = load ptr, ptr @stdout, align 8, !tbaa !9
  %36 = load i32, ptr %9, align 4, !tbaa !5
  %37 = load ptr, ptr %6, align 8, !tbaa !9
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = mul nsw i32 0, %39
  %41 = add nsw i32 %38, %40
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds double, ptr %37, i64 %42
  %44 = load double, ptr %43, align 8, !tbaa !11
  %45 = load ptr, ptr %6, align 8, !tbaa !9
  %46 = load i32, ptr %9, align 4, !tbaa !5
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = mul nsw i32 1, %47
  %49 = add nsw i32 %46, %48
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds double, ptr %45, i64 %50
  %52 = load double, ptr %51, align 8, !tbaa !11
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.52, i32 noundef %36, double noundef %44, double noundef %52) #3
  br label %54

54:                                               ; preds = %34
  %55 = load i32, ptr %9, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %9, align 4, !tbaa !5
  br label %30, !llvm.loop !13

57:                                               ; preds = %30
  br label %167

58:                                               ; preds = %18
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = icmp sle i32 3, %59
  br i1 %60, label %61, label %114

61:                                               ; preds = %58
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %87, %61
  %63 = load i32, ptr %9, align 4, !tbaa !5
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = sub nsw i32 %64, 2
  %66 = icmp slt i32 %63, %65
  br i1 %66, label %67, label %90

67:                                               ; preds = %62
  %68 = load ptr, ptr @stdout, align 8, !tbaa !9
  %69 = load i32, ptr %9, align 4, !tbaa !5
  %70 = load ptr, ptr %6, align 8, !tbaa !9
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = mul nsw i32 0, %72
  %74 = add nsw i32 %71, %73
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds double, ptr %70, i64 %75
  %77 = load double, ptr %76, align 8, !tbaa !11
  %78 = load ptr, ptr %6, align 8, !tbaa !9
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = mul nsw i32 1, %80
  %82 = add nsw i32 %79, %81
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds double, ptr %78, i64 %83
  %85 = load double, ptr %84, align 8, !tbaa !11
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef @.str.52, i32 noundef %69, double noundef %77, double noundef %85) #3
  br label %87

87:                                               ; preds = %67
  %88 = load i32, ptr %9, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %9, align 4, !tbaa !5
  br label %62, !llvm.loop !15

90:                                               ; preds = %62
  %91 = load ptr, ptr @stdout, align 8, !tbaa !9
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %91, ptr noundef @.str.53) #3
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = sub nsw i32 %93, 1
  store i32 %94, ptr %9, align 4, !tbaa !5
  %95 = load ptr, ptr @stdout, align 8, !tbaa !9
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = load ptr, ptr %6, align 8, !tbaa !9
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = mul nsw i32 0, %99
  %101 = add nsw i32 %98, %100
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds double, ptr %97, i64 %102
  %104 = load double, ptr %103, align 8, !tbaa !11
  %105 = load ptr, ptr %6, align 8, !tbaa !9
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = load i32, ptr %5, align 4, !tbaa !5
  %108 = mul nsw i32 1, %107
  %109 = add nsw i32 %106, %108
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds double, ptr %105, i64 %110
  %112 = load double, ptr %111, align 8, !tbaa !11
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef @.str.52, i32 noundef %96, double noundef %104, double noundef %112) #3
  br label %166

114:                                              ; preds = %58
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %140, %114
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = sub nsw i32 %117, 1
  %119 = icmp slt i32 %116, %118
  br i1 %119, label %120, label %143

120:                                              ; preds = %115
  %121 = load ptr, ptr @stdout, align 8, !tbaa !9
  %122 = load i32, ptr %9, align 4, !tbaa !5
  %123 = load ptr, ptr %6, align 8, !tbaa !9
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = load i32, ptr %5, align 4, !tbaa !5
  %126 = mul nsw i32 0, %125
  %127 = add nsw i32 %124, %126
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds double, ptr %123, i64 %128
  %130 = load double, ptr %129, align 8, !tbaa !11
  %131 = load ptr, ptr %6, align 8, !tbaa !9
  %132 = load i32, ptr %9, align 4, !tbaa !5
  %133 = load i32, ptr %5, align 4, !tbaa !5
  %134 = mul nsw i32 1, %133
  %135 = add nsw i32 %132, %134
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds double, ptr %131, i64 %136
  %138 = load double, ptr %137, align 8, !tbaa !11
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef @.str.52, i32 noundef %122, double noundef %130, double noundef %138) #3
  br label %140

140:                                              ; preds = %120
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %9, align 4, !tbaa !5
  br label %115, !llvm.loop !16

143:                                              ; preds = %115
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = sub nsw i32 %144, 1
  store i32 %145, ptr %9, align 4, !tbaa !5
  %146 = load ptr, ptr @stdout, align 8, !tbaa !9
  %147 = load i32, ptr %9, align 4, !tbaa !5
  %148 = load ptr, ptr %6, align 8, !tbaa !9
  %149 = load i32, ptr %9, align 4, !tbaa !5
  %150 = load i32, ptr %5, align 4, !tbaa !5
  %151 = mul nsw i32 0, %150
  %152 = add nsw i32 %149, %151
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds double, ptr %148, i64 %153
  %155 = load double, ptr %154, align 8, !tbaa !11
  %156 = load ptr, ptr %6, align 8, !tbaa !9
  %157 = load i32, ptr %9, align 4, !tbaa !5
  %158 = load i32, ptr %9, align 4, !tbaa !5
  %159 = load i32, ptr %5, align 4, !tbaa !5
  %160 = mul nsw i32 %158, %159
  %161 = add nsw i32 %157, %160
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds double, ptr %156, i64 %162
  %164 = load double, ptr %163, align 8, !tbaa !11
  %165 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %146, ptr noundef @.str.54, i32 noundef %147, double noundef %155, double noundef %164) #3
  br label %166

166:                                              ; preds = %143, %90
  br label %167

167:                                              ; preds = %166, %57
  store i32 1, ptr %10, align 4
  br label %168

168:                                              ; preds = %167, %17, %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nounwind }

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

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


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

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [39 x i8], align 1

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

; Function Attrs: nofree nounwind uwtable
define dso_local void @r82col_print_part(i32 noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  %5 = icmp slt i32 %2, 1
  %6 = icmp slt i32 %0, 1
  %or.cond = or i1 %6, %5
  br i1 %or.cond, label %.loopexit, label %7

7:                                                ; preds = %4
  %8 = load ptr, ptr @stdout, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str) #2
  %10 = load ptr, ptr @stdout, align 8, !tbaa !5
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.8, ptr noundef %3) #2
  %12 = load ptr, ptr @stdout, align 8, !tbaa !5
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef nonnull @.str) #2
  %.not = icmp ugt i32 %0, %2
  br i1 %.not, label %21, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %7
  %14 = zext nneg i32 %0 to i64
  %invariant.gep = getelementptr inbounds double, ptr %1, i64 %14
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %15 = load ptr, ptr @stdout, align 8, !tbaa !5
  %16 = getelementptr inbounds double, ptr %1, i64 %indvars.iv
  %17 = load double, ptr %16, align 8, !tbaa !9
  %gep = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv
  %18 = load double, ptr %gep, align 8, !tbaa !9
  %19 = trunc nuw nsw i64 %indvars.iv to i32
  %20 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.52, i32 noundef %19, double noundef %17, double noundef %18) #2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %14
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !11

21:                                               ; preds = %7
  %22 = icmp ugt i32 %2, 2
  br i1 %22, label %.lr.ph60.preheader, label %.preheader55

.preheader55:                                     ; preds = %21
  %23 = add nsw i32 %2, -1
  %.not62 = icmp eq i32 %23, 0
  br i1 %.not62, label %50, label %.lr.ph58.split

.lr.ph60.preheader:                               ; preds = %21
  %24 = add nsw i32 %2, -2
  %25 = zext nneg i32 %0 to i64
  %wide.trip.count69 = zext nneg i32 %24 to i64
  %invariant.gep71 = getelementptr inbounds double, ptr %1, i64 %25
  br label %.lr.ph60

.lr.ph60:                                         ; preds = %.lr.ph60.preheader, %.lr.ph60
  %indvars.iv66 = phi i64 [ 0, %.lr.ph60.preheader ], [ %indvars.iv.next67, %.lr.ph60 ]
  %26 = load ptr, ptr @stdout, align 8, !tbaa !5
  %27 = getelementptr inbounds double, ptr %1, i64 %indvars.iv66
  %28 = load double, ptr %27, align 8, !tbaa !9
  %gep72 = getelementptr inbounds double, ptr %invariant.gep71, i64 %indvars.iv66
  %29 = load double, ptr %gep72, align 8, !tbaa !9
  %30 = trunc nuw nsw i64 %indvars.iv66 to i32
  %31 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef nonnull @.str.52, i32 noundef %30, double noundef %28, double noundef %29) #2
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond70.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count69
  br i1 %exitcond70.not, label %._crit_edge61, label %.lr.ph60, !llvm.loop !13

._crit_edge61:                                    ; preds = %.lr.ph60
  %32 = load ptr, ptr @stdout, align 8, !tbaa !5
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str.53) #2
  %34 = add nsw i32 %0, -1
  %35 = load ptr, ptr @stdout, align 8, !tbaa !5
  %36 = zext nneg i32 %34 to i64
  %37 = getelementptr inbounds double, ptr %1, i64 %36
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = add nuw nsw i32 %34, %0
  %40 = zext nneg i32 %39 to i64
  %41 = getelementptr inbounds double, ptr %1, i64 %40
  %42 = load double, ptr %41, align 8, !tbaa !9
  %43 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef nonnull @.str.52, i32 noundef %34, double noundef %38, double noundef %42) #2
  br label %.loopexit

.lr.ph58.split:                                   ; preds = %.preheader55
  %44 = zext nneg i32 %0 to i64
  %45 = getelementptr inbounds double, ptr %1, i64 %44
  %46 = load ptr, ptr @stdout, align 8, !tbaa !5
  %47 = load double, ptr %1, align 8, !tbaa !9
  %48 = load double, ptr %45, align 8, !tbaa !9
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.52, i32 noundef 0, double noundef %47, double noundef %48) #2
  br label %50

50:                                               ; preds = %.lr.ph58.split, %.preheader55
  %51 = load ptr, ptr @stdout, align 8, !tbaa !5
  %52 = zext nneg i32 %23 to i64
  %53 = getelementptr inbounds double, ptr %1, i64 %52
  %54 = load double, ptr %53, align 8, !tbaa !9
  %55 = add nuw i32 %0, 1
  %56 = mul nuw nsw i32 %23, %55
  %57 = zext nneg i32 %56 to i64
  %58 = getelementptr inbounds double, ptr %1, i64 %57
  %59 = load double, ptr %58, align 8, !tbaa !9
  %60 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.54, i32 noundef %23, double noundef %54, double noundef %59) #2
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %50, %._crit_edge61, %4
  ret void
}

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 = { nofree 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 #2 = { nounwind }

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

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


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