; 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 @r82row_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 %157

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 %157

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 %56

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

30:                                               ; preds = %52, %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 %55

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 = mul nsw i32 %38, 2
  %40 = add nsw i32 0, %39
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds double, ptr %37, i64 %41
  %43 = load double, ptr %42, align 8, !tbaa !11
  %44 = load ptr, ptr %6, align 8, !tbaa !9
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = mul nsw i32 %45, 2
  %47 = add nsw i32 1, %46
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds double, ptr %44, i64 %48
  %50 = load double, ptr %49, align 8, !tbaa !11
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.52, i32 noundef %36, double noundef %43, double noundef %50) #3
  br label %52

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

55:                                               ; preds = %30
  br label %156

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

59:                                               ; preds = %56
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %83, %59
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = sub nsw i32 %62, 2
  %64 = icmp slt i32 %61, %63
  br i1 %64, label %65, label %86

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

83:                                               ; preds = %65
  %84 = load i32, ptr %9, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %9, align 4, !tbaa !5
  br label %60, !llvm.loop !15

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

108:                                              ; preds = %56
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %132, %108
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sub nsw i32 %111, 1
  %113 = icmp slt i32 %110, %112
  br i1 %113, label %114, label %135

114:                                              ; preds = %109
  %115 = load ptr, ptr @stdout, align 8, !tbaa !9
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = load ptr, ptr %6, align 8, !tbaa !9
  %118 = load i32, ptr %9, align 4, !tbaa !5
  %119 = mul nsw i32 %118, 2
  %120 = add nsw i32 0, %119
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds double, ptr %117, i64 %121
  %123 = load double, ptr %122, align 8, !tbaa !11
  %124 = load ptr, ptr %6, align 8, !tbaa !9
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = mul nsw i32 %125, 2
  %127 = add nsw i32 1, %126
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds double, ptr %124, i64 %128
  %130 = load double, ptr %129, align 8, !tbaa !11
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef @.str.52, i32 noundef %116, double noundef %123, double noundef %130) #3
  br label %132

132:                                              ; preds = %114
  %133 = load i32, ptr %9, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %9, align 4, !tbaa !5
  br label %109, !llvm.loop !16

135:                                              ; preds = %109
  %136 = load i32, ptr %7, align 4, !tbaa !5
  %137 = sub nsw i32 %136, 1
  store i32 %137, ptr %9, align 4, !tbaa !5
  %138 = load ptr, ptr @stdout, align 8, !tbaa !9
  %139 = load i32, ptr %9, align 4, !tbaa !5
  %140 = load ptr, ptr %6, align 8, !tbaa !9
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = mul nsw i32 %141, 2
  %143 = add nsw i32 0, %142
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds double, ptr %140, i64 %144
  %146 = load double, ptr %145, align 8, !tbaa !11
  %147 = load ptr, ptr %6, align 8, !tbaa !9
  %148 = load i32, ptr %9, align 4, !tbaa !5
  %149 = mul nsw i32 %148, 2
  %150 = add nsw i32 1, %149
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds double, ptr %147, i64 %151
  %153 = load double, ptr %152, align 8, !tbaa !11
  %154 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef @.str.54, i32 noundef %139, double noundef %146, double noundef %153) #3
  br label %155

155:                                              ; preds = %135, %86
  br label %156

156:                                              ; preds = %155, %55
  store i32 1, ptr %10, align 4
  br label %157

157:                                              ; preds = %156, %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 @r82row_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 %23, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %7
  %wide.trip.count = zext nneg i32 %0 to i64
  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 ]
  %14 = load ptr, ptr @stdout, align 8, !tbaa !5
  %15 = shl nuw nsw i64 %indvars.iv, 1
  %16 = getelementptr inbounds double, ptr %1, i64 %15
  %17 = load double, ptr %16, align 8, !tbaa !9
  %18 = or disjoint i64 %15, 1
  %19 = getelementptr inbounds double, ptr %1, i64 %18
  %20 = load double, ptr %19, align 8, !tbaa !9
  %21 = trunc nuw nsw i64 %indvars.iv to i32
  %22 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.52, i32 noundef %21, double noundef %17, double noundef %20) #2
  %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 %.loopexit, label %.lr.ph, !llvm.loop !11

23:                                               ; preds = %7
  %24 = icmp ugt i32 %2, 2
  br i1 %24, label %.lr.ph49.preheader, label %.preheader44

.preheader44:                                     ; preds = %23
  %25 = add nsw i32 %2, -1
  %.not51 = icmp eq i32 %25, 0
  br i1 %.not51, label %54, label %.lr.ph47.split

.lr.ph49.preheader:                               ; preds = %23
  %26 = add nsw i32 %2, -2
  %wide.trip.count58 = zext nneg i32 %26 to i64
  br label %.lr.ph49

.lr.ph49:                                         ; preds = %.lr.ph49.preheader, %.lr.ph49
  %indvars.iv55 = phi i64 [ 0, %.lr.ph49.preheader ], [ %indvars.iv.next56, %.lr.ph49 ]
  %27 = load ptr, ptr @stdout, align 8, !tbaa !5
  %28 = shl nuw nsw i64 %indvars.iv55, 1
  %29 = getelementptr inbounds double, ptr %1, i64 %28
  %30 = load double, ptr %29, align 8, !tbaa !9
  %31 = or disjoint i64 %28, 1
  %32 = getelementptr inbounds double, ptr %1, i64 %31
  %33 = load double, ptr %32, align 8, !tbaa !9
  %34 = trunc nuw nsw i64 %indvars.iv55 to i32
  %35 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str.52, i32 noundef %34, double noundef %30, double noundef %33) #2
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %exitcond59.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count58
  br i1 %exitcond59.not, label %._crit_edge50, label %.lr.ph49, !llvm.loop !13

._crit_edge50:                                    ; preds = %.lr.ph49
  %36 = load ptr, ptr @stdout, align 8, !tbaa !5
  %37 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str.53) #2
  %38 = add nsw i32 %0, -1
  %39 = load ptr, ptr @stdout, align 8, !tbaa !5
  %40 = shl nuw nsw i32 %38, 1
  %41 = zext nneg i32 %40 to i64
  %42 = getelementptr inbounds double, ptr %1, i64 %41
  %43 = load double, ptr %42, align 8, !tbaa !9
  %44 = or disjoint i32 %40, 1
  %45 = zext nneg i32 %44 to i64
  %46 = getelementptr inbounds double, ptr %1, i64 %45
  %47 = load double, ptr %46, align 8, !tbaa !9
  %48 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.52, i32 noundef %38, double noundef %43, double noundef %47) #2
  br label %.loopexit

.lr.ph47.split:                                   ; preds = %.preheader44
  %49 = getelementptr inbounds i8, ptr %1, i64 8
  %50 = load ptr, ptr @stdout, align 8, !tbaa !5
  %51 = load double, ptr %1, align 8, !tbaa !9
  %52 = load double, ptr %49, align 8, !tbaa !9
  %53 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.52, i32 noundef 0, double noundef %51, double noundef %52) #2
  br label %54

54:                                               ; preds = %.lr.ph47.split, %.preheader44
  %55 = load ptr, ptr @stdout, align 8, !tbaa !5
  %56 = shl nuw nsw i32 %25, 1
  %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 = or disjoint i32 %56, 1
  %61 = zext nneg i32 %60 to i64
  %62 = getelementptr inbounds double, ptr %1, i64 %61
  %63 = load double, ptr %62, align 8, !tbaa !9
  %64 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.54, i32 noundef %25, double noundef %59, double noundef %63) #2
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %54, %._crit_edge50, %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,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass