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

%struct._MatNd = type { ptr, i32, i32, i32, i8 }

@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [3 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
@.str.36 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [23 x i8], align 1
@__func__.MatNd_gnuplot = external hidden unnamed_addr constant [14 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [106 x i8], align 1

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @MatNd_toFile(ptr noundef, ptr noundef) #2

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

declare i32 @fclose(ptr noundef) #3

declare ptr @File_createUniqueName(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @fflush(ptr noundef) #3

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

declare i32 @system(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @MatNd_gnuplot(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [256 x i8], align 16
  %7 = alloca [256 x i8], align 16
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca [512 x i8], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca [256 x i8], align 16
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 256, ptr %7) #4
  %16 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %17 = call ptr @File_createUniqueName(ptr noundef %16, ptr noundef @.str.36, ptr noundef @.str.37)
  %18 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %19 = call ptr @File_createUniqueName(ptr noundef %18, ptr noundef @.str.36, ptr noundef @.str.42)
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #4
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %22 = call zeroext i1 @MatNd_toFile(ptr noundef %20, ptr noundef %21)
  %23 = zext i1 %22 to i8
  store i8 %23, ptr %8, align 1, !tbaa !9
  %24 = load i8, ptr %8, align 1, !tbaa !9, !range !11, !noundef !12
  %25 = trunc i8 %24 to i1
  %26 = zext i1 %25 to i32
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %2
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %164

29:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %30 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %31 = call noalias ptr @fopen(ptr noundef %30, ptr noundef @.str.24)
  store ptr %31, ptr %10, align 8, !tbaa !5
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %55

34:                                               ; preds = %29
  br label %35

35:                                               ; preds = %34
  %36 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %41

38:                                               ; preds = %35
  %39 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %40 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  call void (i32, ptr, ptr, i32, ptr, ...) %39(i32 noundef 4, ptr noundef @.str.1, ptr noundef @__func__.MatNd_gnuplot, i32 noundef 685, ptr noundef @.str.48, ptr noundef %40)
  br label %41

41:                                               ; preds = %38, %35
  %42 = load i32, ptr @RcsLogLevel, align 4, !tbaa !13
  %43 = icmp sle i32 4, %42
  br i1 %43, label %44, label %52

44:                                               ; preds = %41
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef @.str.26, ptr noundef @.str.1, ptr noundef @__func__.MatNd_gnuplot, i32 noundef 685) #4
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.48, ptr noundef %48) #4
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef @.str.4) #4
  br label %52

52:                                               ; preds = %44, %41
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %163

55:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 512, ptr %11) #4
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %62

58:                                               ; preds = %55
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef @.str.38, ptr noundef %60) #4
  br label %65

62:                                               ; preds = %55
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef @.str.39) #4
  br label %65

65:                                               ; preds = %62, %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 1, ptr %12, align 4, !tbaa !13
  br label %66

66:                                               ; preds = %122, %65
  %67 = load i32, ptr %12, align 4, !tbaa !13
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._MatNd, ptr %68, i32 0, i32 2
  %70 = load i32, ptr %69, align 4, !tbaa !15
  %71 = icmp ule i32 %67, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %66
  store i32 4, ptr %9, align 4
  br label %125

73:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %74 = getelementptr inbounds [512 x i8], ptr %11, i64 0, i64 0
  %75 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %76 = load i32, ptr %12, align 4, !tbaa !13
  %77 = load i32, ptr %12, align 4, !tbaa !13
  %78 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %74, i64 noundef 512, ptr noundef @.str.40, ptr noundef %75, i32 noundef %76, i32 noundef %77) #4
  store i32 %78, ptr %13, align 4, !tbaa !13
  %79 = load i32, ptr %13, align 4, !tbaa !13
  %80 = icmp sge i32 %79, 512
  br i1 %80, label %81, label %106

81:                                               ; preds = %73
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %84 = icmp ne ptr %83, null
  br i1 %84, label %85, label %89

85:                                               ; preds = %82
  %86 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %87 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %88 = load i32, ptr %13, align 4, !tbaa !13
  call void (i32, ptr, ptr, i32, ptr, ...) %86(i32 noundef 4, ptr noundef @.str.1, ptr noundef @__func__.MatNd_gnuplot, i32 noundef 706, ptr noundef @.str.55, ptr noundef %87, i32 noundef %88)
  br label %89

89:                                               ; preds = %85, %82
  %90 = load i32, ptr @RcsLogLevel, align 4, !tbaa !13
  %91 = icmp sle i32 4, %90
  br i1 %91, label %92, label %101

92:                                               ; preds = %89
  %93 = load ptr, ptr @stderr, align 8, !tbaa !5
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %93, ptr noundef @.str.26, ptr noundef @.str.1, ptr noundef @__func__.MatNd_gnuplot, i32 noundef 706) #4
  %95 = load ptr, ptr @stderr, align 8, !tbaa !5
  %96 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %97 = load i32, ptr %13, align 4, !tbaa !13
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef @.str.55, ptr noundef %96, i32 noundef %97) #4
  %99 = load ptr, ptr @stderr, align 8, !tbaa !5
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef @.str.4) #4
  br label %101

101:                                              ; preds = %92, %89
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = call i32 @fclose(ptr noundef %104)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %119

106:                                              ; preds = %73
  %107 = load ptr, ptr %10, align 8, !tbaa !5
  %108 = getelementptr inbounds [512 x i8], ptr %11, i64 0, i64 0
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef @.str.49, ptr noundef %108) #4
  %110 = load i32, ptr %12, align 4, !tbaa !13
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._MatNd, ptr %111, i32 0, i32 2
  %113 = load i32, ptr %112, align 4, !tbaa !15
  %114 = icmp ne i32 %110, %113
  br i1 %114, label %115, label %118

115:                                              ; preds = %106
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef @.str.41) #4
  br label %118

118:                                              ; preds = %115, %106
  store i32 0, ptr %9, align 4
  br label %119

119:                                              ; preds = %118, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  %120 = load i32, ptr %9, align 4
  switch i32 %120, label %125 [
    i32 0, label %121
  ]

121:                                              ; preds = %119
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %12, align 4, !tbaa !13
  %124 = add i32 %123, 1
  store i32 %124, ptr %12, align 4, !tbaa !13
  br label %66, !llvm.loop !17

125:                                              ; preds = %119, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %126 = load i32, ptr %9, align 4
  switch i32 %126, label %162 [
    i32 4, label %127
  ]

127:                                              ; preds = %125
  %128 = load ptr, ptr %10, align 8, !tbaa !5
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %128, ptr noundef @.str.4) #4
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = call i32 @fflush(ptr noundef %130)
  %132 = load ptr, ptr %10, align 8, !tbaa !5
  %133 = call i32 @fclose(ptr noundef %132)
  call void @llvm.lifetime.start.p0(i64 256, ptr %14) #4
  %134 = getelementptr inbounds [256 x i8], ptr %14, i64 0, i64 0
  %135 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %136 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %134, ptr noundef @.str.51, ptr noundef %135) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %137 = getelementptr inbounds [256 x i8], ptr %14, i64 0, i64 0
  %138 = call i32 @system(ptr noundef %137)
  store i32 %138, ptr %15, align 4, !tbaa !13
  %139 = load i32, ptr %15, align 4, !tbaa !13
  %140 = icmp eq i32 %139, -1
  br i1 %140, label %141, label %160

141:                                              ; preds = %127
  br label %142

142:                                              ; preds = %141
  %143 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %144 = icmp ne ptr %143, null
  br i1 %144, label %145, label %147

145:                                              ; preds = %142
  %146 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %146(i32 noundef 4, ptr noundef @.str.1, ptr noundef @__func__.MatNd_gnuplot, i32 noundef 734, ptr noundef @.str.53)
  br label %147

147:                                              ; preds = %145, %142
  %148 = load i32, ptr @RcsLogLevel, align 4, !tbaa !13
  %149 = icmp sle i32 4, %148
  br i1 %149, label %150, label %157

150:                                              ; preds = %147
  %151 = load ptr, ptr @stderr, align 8, !tbaa !5
  %152 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %151, ptr noundef @.str.26, ptr noundef @.str.1, ptr noundef @__func__.MatNd_gnuplot, i32 noundef 734) #4
  %153 = load ptr, ptr @stderr, align 8, !tbaa !5
  %154 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %153, ptr noundef @.str.53) #4
  %155 = load ptr, ptr @stderr, align 8, !tbaa !5
  %156 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %155, ptr noundef @.str.4) #4
  br label %157

157:                                              ; preds = %150, %147
  br label %158

158:                                              ; preds = %157
  br label %159

159:                                              ; preds = %158
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %161

160:                                              ; preds = %127
  store i1 true, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %161

161:                                              ; preds = %160, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 256, ptr %14) #4
  br label %162

162:                                              ; preds = %161, %125
  call void @llvm.lifetime.end.p0(i64 512, ptr %11) #4
  br label %163

163:                                              ; preds = %162, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %164

164:                                              ; preds = %163, %28
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 256, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 256, ptr %6) #4
  %165 = load i1, ptr %3, align 1
  ret i1 %165
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 }

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


; 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.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [3 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
@.str.36 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [23 x i8], align 1
@__func__.MatNd_gnuplot = external hidden unnamed_addr constant [14 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [106 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @MatNd_toFile(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #0

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

declare ptr @File_createUniqueName(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: nofree
declare noundef i32 @system(ptr nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @MatNd_gnuplot(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca [256 x i8], align 16
  %4 = alloca [256 x i8], align 16
  %5 = alloca [512 x i8], align 16
  %6 = alloca [256 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #5
  %7 = call ptr @File_createUniqueName(ptr noundef nonnull %3, ptr noundef nonnull @.str.36, ptr noundef nonnull @.str.37) #5
  %8 = call ptr @File_createUniqueName(ptr noundef nonnull %4, ptr noundef nonnull @.str.36, ptr noundef nonnull @.str.42) #5
  %9 = call zeroext i1 @MatNd_toFile(ptr noundef %1, ptr noundef nonnull %3)
  br i1 %9, label %10, label %80

10:                                               ; preds = %2
  %11 = call noalias ptr @fopen(ptr noundef nonnull %4, ptr noundef nonnull @.str.24)
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %26

13:                                               ; preds = %10
  %14 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not40 = icmp eq ptr %14, null
  br i1 %.not40, label %16, label %15

15:                                               ; preds = %13
  call void (i32, ptr, ptr, i32, ptr, ...) %14(i32 noundef 4, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_gnuplot, i32 noundef 685, ptr noundef nonnull @.str.48, ptr noundef nonnull %4) #5
  br label %16

16:                                               ; preds = %15, %13
  %17 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %18 = icmp sgt i32 %17, 3
  br i1 %18, label %19, label %80

19:                                               ; preds = %16
  %20 = load ptr, ptr @stderr, align 8, !tbaa !5
  %21 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_gnuplot, i32 noundef 685) #6
  %22 = load ptr, ptr @stderr, align 8, !tbaa !5
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.48, ptr noundef nonnull %4) #6
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.4) #6
  br label %80

26:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %5) #5
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %29, label %27

27:                                               ; preds = %26
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %11, ptr noundef nonnull @.str.38, ptr noundef nonnull %0) #5
  br label %31

29:                                               ; preds = %26
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %11, ptr noundef nonnull @.str.39) #5
  br label %31

31:                                               ; preds = %29, %27
  %32 = getelementptr inbounds i8, ptr %1, i64 12
  %33 = load i32, ptr %32, align 4, !tbaa !11
  %.not3641 = icmp eq i32 %33, 0
  br i1 %.not3641, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %31, %54
  %.02942 = phi i32 [ %56, %54 ], [ 1, %31 ]
  %34 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %5, i64 noundef 512, ptr noundef nonnull @.str.40, ptr noundef nonnull %3, i32 noundef %.02942, i32 noundef %.02942) #5
  %35 = icmp slt i32 %34, 512
  br i1 %35, label %49, label %36

36:                                               ; preds = %.lr.ph
  %37 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not38 = icmp eq ptr %37, null
  br i1 %.not38, label %39, label %38

38:                                               ; preds = %36
  call void (i32, ptr, ptr, i32, ptr, ...) %37(i32 noundef 4, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_gnuplot, i32 noundef 706, ptr noundef nonnull @.str.55, ptr noundef nonnull %4, i32 noundef %34) #5
  br label %39

39:                                               ; preds = %38, %36
  %40 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %41 = icmp sgt i32 %40, 3
  br i1 %41, label %42, label %57

42:                                               ; preds = %39
  %43 = load ptr, ptr @stderr, align 8, !tbaa !5
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_gnuplot, i32 noundef 706) #6
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.55, ptr noundef nonnull %4, i32 noundef %34) #6
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.4) #6
  br label %57

49:                                               ; preds = %.lr.ph
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %11, ptr noundef nonnull @.str.49, ptr noundef nonnull %5) #5
  %51 = load i32, ptr %32, align 4, !tbaa !11
  %.not37 = icmp eq i32 %.02942, %51
  br i1 %.not37, label %54, label %52

52:                                               ; preds = %49
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %11, ptr noundef nonnull @.str.41) #5
  %.pre = load i32, ptr %32, align 4, !tbaa !11
  br label %54

54:                                               ; preds = %49, %52
  %55 = phi i32 [ %.02942, %49 ], [ %.pre, %52 ]
  %56 = add i32 %.02942, 1
  %.not36 = icmp ugt i32 %56, %55
  br i1 %.not36, label %.critedge, label %.lr.ph, !llvm.loop !14

57:                                               ; preds = %42, %39
  %58 = call i32 @fclose(ptr noundef nonnull %11)
  br label %79

.critedge:                                        ; preds = %54, %31
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %11, ptr noundef nonnull @.str.4) #5
  %60 = call i32 @fflush(ptr noundef nonnull %11)
  %61 = call i32 @fclose(ptr noundef nonnull %11)
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %6) #5
  %62 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str.51, ptr noundef nonnull %4) #5
  %63 = call i32 @system(ptr noundef nonnull %6) #5
  %64 = icmp ne i32 %63, -1
  br i1 %64, label %78, label %65

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

67:                                               ; preds = %65
  call void (i32, ptr, ptr, i32, ptr, ...) %66(i32 noundef 4, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_gnuplot, i32 noundef 734, ptr noundef nonnull @.str.53) #5
  br label %68

68:                                               ; preds = %67, %65
  %69 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %70 = icmp sgt i32 %69, 3
  br i1 %70, label %71, label %78

71:                                               ; preds = %68
  %72 = load ptr, ptr @stderr, align 8, !tbaa !5
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_gnuplot, i32 noundef 734) #6
  %74 = load ptr, ptr @stderr, align 8, !tbaa !5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.53) #6
  %76 = load ptr, ptr @stderr, align 8, !tbaa !5
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef nonnull @.str.4) #6
  br label %78

78:                                               ; preds = %.critedge, %68, %71
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %6) #5
  br label %79

79:                                               ; preds = %57, %78
  %.4 = phi i1 [ %64, %78 ], [ false, %57 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %5) #5
  br label %80

80:                                               ; preds = %79, %19, %16, %2
  %.6 = phi i1 [ false, %2 ], [ %.4, %79 ], [ false, %19 ], [ false, %16 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %3) #5
  ret i1 %.6
}

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { nofree "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 = { cold 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 12}
!12 = !{!"_MatNd", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !13, i64 20}
!13 = !{!"_Bool", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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