; 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.222 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.223 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.224 = 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 @r8vec2_print_some(i32 noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) #2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 %0, ptr %6, align 4, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %13 = load i32, ptr %9, align 4, !tbaa !5
  %14 = icmp sle i32 %13, 0
  br i1 %14, label %15, label %16

15:                                               ; preds = %5
  store i32 1, ptr %12, align 4
  br label %139

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

19:                                               ; preds = %16
  store i32 1, ptr %12, align 4
  br label %139

20:                                               ; preds = %16
  %21 = load ptr, ptr @stdout, align 8, !tbaa !9
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef @.str) #3
  %23 = load ptr, ptr @stdout, align 8, !tbaa !9
  %24 = load ptr, ptr %10, align 8, !tbaa !9
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef @.str.8, ptr noundef %24) #3
  %26 = load ptr, ptr @stdout, align 8, !tbaa !9
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str) #3
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = load i32, ptr %9, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %31, label %54

31:                                               ; preds = %20
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %50, %31
  %33 = load i32, ptr %11, align 4, !tbaa !5
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %36, label %53

36:                                               ; preds = %32
  %37 = load ptr, ptr @stdout, align 8, !tbaa !9
  %38 = load i32, ptr %11, align 4, !tbaa !5
  %39 = load ptr, ptr %7, align 8, !tbaa !9
  %40 = load i32, ptr %11, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds double, ptr %39, i64 %41
  %43 = load double, ptr %42, align 8, !tbaa !11
  %44 = load ptr, ptr %8, align 8, !tbaa !9
  %45 = load i32, ptr %11, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds double, ptr %44, i64 %46
  %48 = load double, ptr %47, align 8, !tbaa !11
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.222, i32 noundef %38, double noundef %43, double noundef %48) #3
  br label %50

50:                                               ; preds = %36
  %51 = load i32, ptr %11, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %11, align 4, !tbaa !5
  br label %32, !llvm.loop !13

53:                                               ; preds = %32
  br label %138

54:                                               ; preds = %20
  %55 = load i32, ptr %9, align 4, !tbaa !5
  %56 = icmp sle i32 3, %55
  br i1 %56, label %57, label %98

57:                                               ; preds = %54
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %77, %57
  %59 = load i32, ptr %11, align 4, !tbaa !5
  %60 = load i32, ptr %9, align 4, !tbaa !5
  %61 = sub nsw i32 %60, 2
  %62 = icmp slt i32 %59, %61
  br i1 %62, label %63, label %80

63:                                               ; preds = %58
  %64 = load ptr, ptr @stdout, align 8, !tbaa !9
  %65 = load i32, ptr %11, align 4, !tbaa !5
  %66 = load ptr, ptr %7, align 8, !tbaa !9
  %67 = load i32, ptr %11, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds double, ptr %66, i64 %68
  %70 = load double, ptr %69, align 8, !tbaa !11
  %71 = load ptr, ptr %8, align 8, !tbaa !9
  %72 = load i32, ptr %11, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds double, ptr %71, i64 %73
  %75 = load double, ptr %74, align 8, !tbaa !11
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef @.str.222, i32 noundef %65, double noundef %70, double noundef %75) #3
  br label %77

77:                                               ; preds = %63
  %78 = load i32, ptr %11, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %11, align 4, !tbaa !5
  br label %58, !llvm.loop !15

80:                                               ; preds = %58
  %81 = load ptr, ptr @stdout, align 8, !tbaa !9
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef @.str.223) #3
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = sub nsw i32 %83, 1
  store i32 %84, ptr %11, align 4, !tbaa !5
  %85 = load ptr, ptr @stdout, align 8, !tbaa !9
  %86 = load i32, ptr %11, align 4, !tbaa !5
  %87 = load ptr, ptr %7, align 8, !tbaa !9
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds double, ptr %87, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !11
  %92 = load ptr, ptr %8, align 8, !tbaa !9
  %93 = load i32, ptr %11, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds double, ptr %92, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !11
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef @.str.222, i32 noundef %86, double noundef %91, double noundef %96) #3
  br label %137

98:                                               ; preds = %54
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %118, %98
  %100 = load i32, ptr %11, align 4, !tbaa !5
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = sub nsw i32 %101, 1
  %103 = icmp slt i32 %100, %102
  br i1 %103, label %104, label %121

104:                                              ; preds = %99
  %105 = load ptr, ptr @stdout, align 8, !tbaa !9
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = load ptr, ptr %7, align 8, !tbaa !9
  %108 = load i32, ptr %11, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds double, ptr %107, i64 %109
  %111 = load double, ptr %110, align 8, !tbaa !11
  %112 = load ptr, ptr %8, align 8, !tbaa !9
  %113 = load i32, ptr %11, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds double, ptr %112, i64 %114
  %116 = load double, ptr %115, align 8, !tbaa !11
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef @.str.222, i32 noundef %106, double noundef %111, double noundef %116) #3
  br label %118

118:                                              ; preds = %104
  %119 = load i32, ptr %11, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %11, align 4, !tbaa !5
  br label %99, !llvm.loop !16

121:                                              ; preds = %99
  %122 = load i32, ptr %9, align 4, !tbaa !5
  %123 = sub nsw i32 %122, 1
  store i32 %123, ptr %11, align 4, !tbaa !5
  %124 = load ptr, ptr @stdout, align 8, !tbaa !9
  %125 = load i32, ptr %11, align 4, !tbaa !5
  %126 = load ptr, ptr %7, align 8, !tbaa !9
  %127 = load i32, ptr %11, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds double, ptr %126, i64 %128
  %130 = load double, ptr %129, align 8, !tbaa !11
  %131 = load ptr, ptr %8, align 8, !tbaa !9
  %132 = load i32, ptr %11, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds double, ptr %131, i64 %133
  %135 = load double, ptr %134, align 8, !tbaa !11
  %136 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %124, ptr noundef @.str.224, i32 noundef %125, double noundef %130, double noundef %135) #3
  br label %137

137:                                              ; preds = %121, %80
  br label %138

138:                                              ; preds = %137, %53
  store i32 1, ptr %12, align 4
  br label %139

139:                                              ; preds = %138, %19, %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #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.222 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.223 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.224 = 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 @r8vec2_print_some(i32 noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #1 {
  %6 = icmp slt i32 %3, 1
  %7 = icmp slt i32 %0, 1
  %or.cond = or i1 %7, %6
  br i1 %or.cond, label %.loopexit, label %8

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

.lr.ph.preheader:                                 ; preds = %8
  %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 ]
  %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
  %18 = getelementptr inbounds double, ptr %2, i64 %indvars.iv
  %19 = load double, ptr %18, align 8, !tbaa !9
  %20 = trunc nuw nsw i64 %indvars.iv to i32
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.222, i32 noundef %20, double noundef %17, double noundef %19) #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

22:                                               ; preds = %8
  %23 = icmp ugt i32 %3, 2
  br i1 %23, label %.lr.ph49.preheader, label %.preheader44

.preheader44:                                     ; preds = %22
  %24 = add nsw i32 %3, -1
  %.not51 = icmp eq i32 %24, 0
  br i1 %.not51, label %47, label %.lr.ph47.split

.lr.ph49.preheader:                               ; preds = %22
  %25 = add nsw i32 %3, -2
  %wide.trip.count58 = zext nneg i32 %25 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 ]
  %26 = load ptr, ptr @stdout, align 8, !tbaa !5
  %27 = getelementptr inbounds double, ptr %1, i64 %indvars.iv55
  %28 = load double, ptr %27, align 8, !tbaa !9
  %29 = getelementptr inbounds double, ptr %2, i64 %indvars.iv55
  %30 = load double, ptr %29, align 8, !tbaa !9
  %31 = trunc nuw nsw i64 %indvars.iv55 to i32
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef nonnull @.str.222, i32 noundef %31, double noundef %28, double noundef %30) #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
  %33 = load ptr, ptr @stdout, align 8, !tbaa !5
  %34 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str.223) #2
  %35 = add nsw i32 %0, -1
  %36 = load ptr, ptr @stdout, align 8, !tbaa !5
  %37 = zext nneg i32 %35 to i64
  %38 = getelementptr inbounds double, ptr %1, i64 %37
  %39 = load double, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds double, ptr %2, i64 %37
  %41 = load double, ptr %40, align 8, !tbaa !9
  %42 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str.222, i32 noundef %35, double noundef %39, double noundef %41) #2
  br label %.loopexit

.lr.ph47.split:                                   ; preds = %.preheader44
  %43 = load ptr, ptr @stdout, align 8, !tbaa !5
  %44 = load double, ptr %1, align 8, !tbaa !9
  %45 = load double, ptr %2, align 8, !tbaa !9
  %46 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.222, i32 noundef 0, double noundef %44, double noundef %45) #2
  br label %47

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

.loopexit:                                        ; preds = %.lr.ph, %47, %._crit_edge50, %5
  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