; LLVM IR from TheAlgorithms/C-Plus-Plus :: numerical_methods (gram_schmidt)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::array.0" = type { [20 x %"struct.std::array"] }
%"struct.std::array" = type { [10 x double] }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN17numerical_methods12gram_schmidt10projectionERKSt5arrayIdLm10EES4_RKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17numerical_methods12gram_schmidt7displayERKiS2_RKSt5arrayIS3_IdLm10EELm20EE(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(1600)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(80) ptr @_ZNKSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17numerical_methods12gram_schmidt12gram_schmidtEiRKiRKSt5arrayIS3_IdLm10EELm20EES5_(i32 noundef %0, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 8 dereferenceable(1600) %2, ptr noundef byval(%"struct.std::array.0") align 8 %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::array", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::array", align 8
  %14 = alloca double, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !9
  %18 = load ptr, ptr %6, align 8, !tbaa !9
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %22, label %30

22:                                               ; preds = %4
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %24 = load ptr, ptr %6, align 8, !tbaa !9
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %23, i32 noundef %25)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef @.str.4)
  %28 = load ptr, ptr %6, align 8, !tbaa !9
  %29 = load i32, ptr %28, align 4, !tbaa !5
  store i32 %29, ptr %5, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %22, %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %173, %30
  %32 = load i32, ptr %8, align 4, !tbaa !5
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = icmp sle i32 %32, %33
  br i1 %34, label %35, label %176

35:                                               ; preds = %31
  %36 = load i32, ptr %8, align 4, !tbaa !5
  %37 = icmp eq i32 %36, 1
  br i1 %37, label %38, label %60

38:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %56, %38
  %40 = load i32, ptr %9, align 4, !tbaa !5
  %41 = load ptr, ptr %6, align 8, !tbaa !9
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = icmp slt i32 %40, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %59

45:                                               ; preds = %39
  %46 = load ptr, ptr %7, align 8, !tbaa !9
  %47 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNKSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %46, i64 noundef 0) #6
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %47, i64 noundef %49) #6
  %51 = load double, ptr %50, align 8, !tbaa !11
  %52 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %3, i64 noundef 0) #6
  %53 = load i32, ptr %9, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %52, i64 noundef %54) #6
  store double %51, ptr %55, align 8, !tbaa !11
  br label %56

56:                                               ; preds = %45
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %9, align 4, !tbaa !5
  br label %39, !llvm.loop !13

59:                                               ; preds = %44
  br label %173

60:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 80, ptr %10) #6
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 80, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %71, %60
  %62 = load i32, ptr %11, align 4, !tbaa !5
  %63 = load ptr, ptr %6, align 8, !tbaa !9
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = icmp slt i32 %62, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %74

67:                                               ; preds = %61
  %68 = load i32, ptr %11, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %10, i64 noundef %69) #6
  store double 0.000000e+00, ptr %70, align 8, !tbaa !11
  br label %71

71:                                               ; preds = %67
  %72 = load i32, ptr %11, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %11, align 4, !tbaa !5
  br label %61, !llvm.loop !15

74:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %137, %74
  %76 = load i32, ptr %12, align 4, !tbaa !5
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %79, label %140

79:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 80, ptr %13) #6
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 80, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store double 0x7FF8000000000000, ptr %14, align 8, !tbaa !11
  %80 = load ptr, ptr %7, align 8, !tbaa !9
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = sub nsw i32 %81, 1
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNKSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %80, i64 noundef %83) #6
  %85 = load i32, ptr %12, align 4, !tbaa !5
  %86 = sub nsw i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %3, i64 noundef %87) #6
  %89 = load ptr, ptr %6, align 8, !tbaa !9
  %90 = call noundef double @_ZN17numerical_methods12gram_schmidt10projectionERKSt5arrayIdLm10EES4_RKi(ptr noundef nonnull align 8 dereferenceable(80) %84, ptr noundef nonnull align 8 dereferenceable(80) %88, ptr noundef nonnull align 4 dereferenceable(4) %89)
  store double %90, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %111, %79
  %92 = load i32, ptr %15, align 4, !tbaa !5
  %93 = load ptr, ptr %6, align 8, !tbaa !9
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = icmp slt i32 %92, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %114

97:                                               ; preds = %91
  %98 = load i32, ptr %12, align 4, !tbaa !5
  %99 = sub nsw i32 %98, 1
  %100 = sext i32 %99 to i64
  %101 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %3, i64 noundef %100) #6
  %102 = load i32, ptr %15, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %101, i64 noundef %103) #6
  %105 = load double, ptr %104, align 8, !tbaa !11
  %106 = load double, ptr %14, align 8, !tbaa !11
  %107 = fmul double %105, %106
  %108 = load i32, ptr %15, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %13, i64 noundef %109) #6
  store double %107, ptr %110, align 8, !tbaa !11
  br label %111

111:                                              ; preds = %97
  %112 = load i32, ptr %15, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %15, align 4, !tbaa !5
  br label %91, !llvm.loop !16

114:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %134, %114
  %116 = load i32, ptr %16, align 4, !tbaa !5
  %117 = load ptr, ptr %6, align 8, !tbaa !9
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = icmp slt i32 %116, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %137

121:                                              ; preds = %115
  %122 = load i32, ptr %16, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %10, i64 noundef %123) #6
  %125 = load double, ptr %124, align 8, !tbaa !11
  %126 = load i32, ptr %16, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %13, i64 noundef %127) #6
  %129 = load double, ptr %128, align 8, !tbaa !11
  %130 = fadd double %125, %129
  %131 = load i32, ptr %16, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %10, i64 noundef %132) #6
  store double %130, ptr %133, align 8, !tbaa !11
  br label %134

134:                                              ; preds = %121
  %135 = load i32, ptr %16, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %16, align 4, !tbaa !5
  br label %115, !llvm.loop !17

137:                                              ; preds = %120
  %138 = load i32, ptr %12, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %13) #6
  br label %75, !llvm.loop !18

140:                                              ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %169, %140
  %142 = load i32, ptr %17, align 4, !tbaa !5
  %143 = load ptr, ptr %6, align 8, !tbaa !9
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = icmp slt i32 %142, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %172

147:                                              ; preds = %141
  %148 = load ptr, ptr %7, align 8, !tbaa !9
  %149 = load i32, ptr %8, align 4, !tbaa !5
  %150 = sub nsw i32 %149, 1
  %151 = sext i32 %150 to i64
  %152 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNKSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %148, i64 noundef %151) #6
  %153 = load i32, ptr %17, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %152, i64 noundef %154) #6
  %156 = load double, ptr %155, align 8, !tbaa !11
  %157 = load i32, ptr %17, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %10, i64 noundef %158) #6
  %160 = load double, ptr %159, align 8, !tbaa !11
  %161 = fsub double %156, %160
  %162 = load i32, ptr %8, align 4, !tbaa !5
  %163 = sub nsw i32 %162, 1
  %164 = sext i32 %163 to i64
  %165 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %3, i64 noundef %164) #6
  %166 = load i32, ptr %17, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %165, i64 noundef %167) #6
  store double %161, ptr %168, align 8, !tbaa !11
  br label %169

169:                                              ; preds = %147
  %170 = load i32, ptr %17, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %17, align 4, !tbaa !5
  br label %141, !llvm.loop !19

172:                                              ; preds = %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #6
  br label %173

173:                                              ; preds = %172, %59
  %174 = load i32, ptr %8, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %8, align 4, !tbaa !5
  br label %31, !llvm.loop !20

176:                                              ; preds = %31
  %177 = load ptr, ptr %6, align 8, !tbaa !9
  call void @_ZN17numerical_methods12gram_schmidt7displayERKiS2_RKSt5arrayIS3_IdLm10EELm20EE(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %177, ptr noundef nonnull align 8 dereferenceable(1600) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) #1 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress 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 = { inlinehint mustprogress 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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++ 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}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !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"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::array.0" = type { [20 x %"struct.std::array"] }
%"struct.std::array" = type { [10 x double] }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN17numerical_methods12gram_schmidt10projectionERKSt5arrayIdLm10EES4_RKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17numerical_methods12gram_schmidt7displayERKiS2_RKSt5arrayIS3_IdLm10EELm20EE(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(1600)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(80) ptr @_ZNKSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17numerical_methods12gram_schmidt12gram_schmidtEiRKiRKSt5arrayIS3_IdLm10EELm20EES5_(i32 noundef %0, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 8 dereferenceable(1600) %2, ptr noundef byval(%"struct.std::array.0") align 8 %3) local_unnamed_addr #2 {
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::array", align 8
  %7 = alloca %"struct.std::array", align 8
  store i32 %0, ptr %5, align 4, !tbaa !5
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = icmp slt i32 %8, %0
  br i1 %9, label %10, label %16

10:                                               ; preds = %4
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef %12)
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull @.str.4)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %15, ptr %5, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %10, %4
  %17 = phi i32 [ %15, %10 ], [ %8, %4 ]
  %18 = phi i32 [ %15, %10 ], [ %0, %4 ]
  %.not66 = icmp slt i32 %18, 1
  br i1 %.not66, label %._crit_edge71, label %.lr.ph70.preheader

.lr.ph70.preheader:                               ; preds = %16
  %19 = zext nneg i32 %18 to i64
  br label %.lr.ph70

.lr.ph70:                                         ; preds = %.lr.ph70.preheader, %.loopexit
  %20 = phi i32 [ %17, %.lr.ph70.preheader ], [ %80, %.loopexit ]
  %indvars.iv88 = phi i64 [ 1, %.lr.ph70.preheader ], [ %indvars.iv.next89, %.loopexit ]
  %21 = trunc nuw nsw i64 %indvars.iv88 to i32
  %umax = call i32 @llvm.umax.i32(i32 %21, i32 2)
  %22 = icmp eq i64 %indvars.iv88, 1
  br i1 %22, label %.preheader51, label %32

.preheader51:                                     ; preds = %.lr.ph70
  %23 = icmp sgt i32 %20, 0
  br i1 %23, label %.lr.ph65, label %.loopexit

.lr.ph65:                                         ; preds = %.preheader51, %.lr.ph65
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.lr.ph65 ], [ 0, %.preheader51 ]
  %24 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNKSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %2, i64 noundef 0) #7
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %24, i64 noundef %indvars.iv85) #7
  %26 = load double, ptr %25, align 8, !tbaa !9
  %27 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %3, i64 noundef 0) #7
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %27, i64 noundef %indvars.iv85) #7
  store double %26, ptr %28, align 8, !tbaa !9
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next86, %30
  br i1 %31, label %.lr.ph65, label %.loopexit, !llvm.loop !11

32:                                               ; preds = %.lr.ph70
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %6, i8 0, i64 80, i1 false)
  %33 = icmp sgt i32 %20, 0
  br i1 %33, label %.lr.ph, label %.lr.ph60

.lr.ph60:                                         ; preds = %.lr.ph, %32
  %34 = add nsw i64 %indvars.iv88, -1
  %wide.trip.count = zext i32 %umax to i64
  br label %41

.lr.ph:                                           ; preds = %32, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %32 ]
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %6, i64 noundef %indvars.iv) #7
  store double 0.000000e+00, ptr %35, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %36 = load i32, ptr %1, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = icmp slt i64 %indvars.iv.next, %37
  br i1 %38, label %.lr.ph, label %.lr.ph60, !llvm.loop !13

.preheader52:                                     ; preds = %._crit_edge
  %39 = icmp sgt i32 %57, 0
  br i1 %39, label %.lr.ph62, label %._crit_edge63

.lr.ph62:                                         ; preds = %.preheader52
  %40 = add nsw i64 %indvars.iv88, -1
  br label %68

41:                                               ; preds = %.lr.ph60, %._crit_edge
  %indvars.iv79 = phi i64 [ 1, %.lr.ph60 ], [ %indvars.iv.next80, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %7) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %7, i8 0, i64 80, i1 false)
  %42 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNKSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %2, i64 noundef %34) #7
  %43 = add nsw i64 %indvars.iv79, -1
  %44 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %3, i64 noundef %43) #7
  %45 = call noundef double @_ZN17numerical_methods12gram_schmidt10projectionERKSt5arrayIdLm10EES4_RKi(ptr noundef nonnull align 8 dereferenceable(80) %42, ptr noundef nonnull align 8 dereferenceable(80) %44, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %46 = load i32, ptr %1, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph56, label %._crit_edge

.preheader:                                       ; preds = %.lr.ph56
  %48 = icmp sgt i32 %54, 0
  br i1 %48, label %.lr.ph58, label %._crit_edge

.lr.ph56:                                         ; preds = %41, %.lr.ph56
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %.lr.ph56 ], [ 0, %41 ]
  %49 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %3, i64 noundef %43) #7
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %49, i64 noundef %indvars.iv73) #7
  %51 = load double, ptr %50, align 8, !tbaa !9
  %52 = fmul double %45, %51
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %7, i64 noundef %indvars.iv73) #7
  store double %52, ptr %53, align 8, !tbaa !9
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %54 = load i32, ptr %1, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = icmp slt i64 %indvars.iv.next74, %55
  br i1 %56, label %.lr.ph56, label %.preheader, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph58, %41, %.preheader
  %57 = phi i32 [ %54, %.preheader ], [ %46, %41 ], [ %64, %.lr.ph58 ]
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #7
  %exitcond.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count
  br i1 %exitcond.not, label %.preheader52, label %41, !llvm.loop !15

.lr.ph58:                                         ; preds = %.preheader, %.lr.ph58
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %.lr.ph58 ], [ 0, %.preheader ]
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %6, i64 noundef %indvars.iv76) #7
  %59 = load double, ptr %58, align 8, !tbaa !9
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %7, i64 noundef %indvars.iv76) #7
  %61 = load double, ptr %60, align 8, !tbaa !9
  %62 = fadd double %59, %61
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %6, i64 noundef %indvars.iv76) #7
  store double %62, ptr %63, align 8, !tbaa !9
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %64 = load i32, ptr %1, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = icmp slt i64 %indvars.iv.next77, %65
  br i1 %66, label %.lr.ph58, label %._crit_edge, !llvm.loop !16

._crit_edge63:                                    ; preds = %68, %.preheader52
  %67 = phi i32 [ %57, %.preheader52 ], [ %77, %68 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #7
  br label %.loopexit

68:                                               ; preds = %.lr.ph62, %68
  %indvars.iv82 = phi i64 [ 0, %.lr.ph62 ], [ %indvars.iv.next83, %68 ]
  %69 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNKSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %2, i64 noundef %40) #7
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %69, i64 noundef %indvars.iv82) #7
  %71 = load double, ptr %70, align 8, !tbaa !9
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %6, i64 noundef %indvars.iv82) #7
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = fsub double %71, %73
  %75 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600) %3, i64 noundef %40) #7
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %75, i64 noundef %indvars.iv82) #7
  store double %74, ptr %76, align 8, !tbaa !9
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %77 = load i32, ptr %1, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = icmp slt i64 %indvars.iv.next83, %78
  br i1 %79, label %68, label %._crit_edge63, !llvm.loop !17

.loopexit:                                        ; preds = %.lr.ph65, %.preheader51, %._crit_edge63
  %80 = phi i32 [ %20, %.preheader51 ], [ %67, %._crit_edge63 ], [ %29, %.lr.ph65 ]
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %.not.not = icmp ult i64 %indvars.iv88, %19
  br i1 %.not.not, label %.lr.ph70, label %._crit_edge71, !llvm.loop !18

._crit_edge71:                                    ; preds = %.loopexit, %16
  call void @_ZN17numerical_methods12gram_schmidt7displayERKiS2_RKSt5arrayIS3_IdLm10EELm20EE(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 8 dereferenceable(1600) %3)
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5arrayIS_IdLm10EELm20EEixEm(ptr noundef nonnull align 8 dereferenceable(1600), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm10EEixEm(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress 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 = { inlinehint mustprogress 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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