; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R2Shapes/R2Io.ll (Z14R2ReadWiseFileR7RNArrayIP6R2SpanEPKc)

; 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.R2Point = type { [2 x double] }

@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [25 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 uwtable
define dso_local noundef ptr @_Z14R2ReadWiseFileR7RNArrayIP6R2SpanEPKc(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [1024 x i8], align 16
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca [64 x i8], align 16
  %11 = alloca [64 x i8], align 16
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca %class.R2Point, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca %class.R2Point, align 8
  %27 = alloca i1, align 1
  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 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 1024, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call noalias ptr @fopen(ptr noundef %28, ptr noundef @.str.6)
  store ptr %29, ptr %6, align 8, !tbaa !5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %34, label %32

32:                                               ; preds = %2
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.7, ptr noundef %33)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %21, align 4
  br label %165

34:                                               ; preds = %2
  br label %35

35:                                               ; preds = %64, %58, %34
  %36 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = call ptr @fgets(ptr noundef %36, i32 noundef 1024, ptr noundef %37)
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %87

40:                                               ; preds = %35
  %41 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  store ptr %41, ptr %8, align 8, !tbaa !5
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %9, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %50, %40
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = load i8, ptr %45, align 1, !tbaa !11
  %47 = sext i8 %46 to i32
  %48 = call i32 @isspace(i32 noundef %47) #8
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %53

50:                                               ; preds = %44
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %51, i32 1
  store ptr %52, ptr %8, align 8, !tbaa !5
  br label %44, !llvm.loop !12

53:                                               ; preds = %44
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = load i8, ptr %54, align 1, !tbaa !11
  %56 = sext i8 %55 to i32
  %57 = icmp eq i32 %56, 35
  br i1 %57, label %58, label %59

58:                                               ; preds = %53
  br label %35, !llvm.loop !14

59:                                               ; preds = %53
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = load i8, ptr %60, align 1, !tbaa !11
  %62 = sext i8 %61 to i32
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %59
  br label %35, !llvm.loop !14

65:                                               ; preds = %59
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  %68 = getelementptr inbounds [64 x i8], ptr %11, i64 0, i64 0
  %69 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %66, ptr noundef @.str.8, ptr noundef %67, ptr noundef %68) #7
  %70 = icmp ne i32 %69, 2
  br i1 %70, label %71, label %74

71:                                               ; preds = %65
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.9, i32 noundef %72, ptr noundef %73)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %21, align 4
  br label %165

74:                                               ; preds = %65
  %75 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  %76 = call i32 @strcmp(ptr noundef %75, ptr noundef @.str.10) #8
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %80

78:                                               ; preds = %74
  %79 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.11, ptr noundef %79)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %21, align 4
  br label %165

80:                                               ; preds = %74
  %81 = getelementptr inbounds [64 x i8], ptr %11, i64 0, i64 0
  %82 = call i32 @strcmp(ptr noundef %81, ptr noundef @.str.12) #8
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %86

84:                                               ; preds = %80
  %85 = getelementptr inbounds [64 x i8], ptr %11, i64 0, i64 0
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.13, ptr noundef %85)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %21, align 4
  br label %165

86:                                               ; preds = %80
  br label %87

87:                                               ; preds = %86, %35
  br label %88

88:                                               ; preds = %160, %130, %117, %111, %87
  %89 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = call ptr @fgets(ptr noundef %89, i32 noundef 1024, ptr noundef %90)
  %92 = icmp ne ptr %91, null
  br i1 %92, label %93, label %161

93:                                               ; preds = %88
  %94 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  store ptr %94, ptr %8, align 8, !tbaa !5
  %95 = load i32, ptr %9, align 4, !tbaa !9
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %9, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %103, %93
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = load i8, ptr %98, align 1, !tbaa !11
  %100 = sext i8 %99 to i32
  %101 = call i32 @isspace(i32 noundef %100) #8
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %106

103:                                              ; preds = %97
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i32 1
  store ptr %105, ptr %8, align 8, !tbaa !5
  br label %97, !llvm.loop !15

106:                                              ; preds = %97
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = load i8, ptr %107, align 1, !tbaa !11
  %109 = sext i8 %108 to i32
  %110 = icmp eq i32 %109, 35
  br i1 %110, label %111, label %112

111:                                              ; preds = %106
  br label %88, !llvm.loop !16

112:                                              ; preds = %106
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = load i8, ptr %113, align 1, !tbaa !11
  %115 = sext i8 %114 to i32
  %116 = icmp eq i32 %115, 0
  br i1 %116, label %117, label %118

117:                                              ; preds = %112
  br label %88, !llvm.loop !16

118:                                              ; preds = %112
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  %121 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %119, ptr noundef @.str.14, ptr noundef %120, ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18, ptr noundef %19, ptr noundef %20) #7
  %122 = icmp ne i32 %121, 10
  br i1 %122, label %123, label %126

123:                                              ; preds = %118
  %124 = load i32, ptr %9, align 4, !tbaa !9
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.9, i32 noundef %124, ptr noundef %125)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %21, align 4
  br label %165

126:                                              ; preds = %118
  %127 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  %128 = call i32 @strcmp(ptr noundef %127, ptr noundef @.str.12) #8
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %132

130:                                              ; preds = %126
  %131 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  call void (ptr, ...) @_Z9RNWarningPKcz(ptr noundef @.str.15, ptr noundef %131)
  br label %88, !llvm.loop !16

132:                                              ; preds = %126
  %133 = load double, ptr %15, align 8, !tbaa !17
  %134 = load double, ptr %18, align 8, !tbaa !17
  %135 = fcmp une double %133, %134
  br i1 %135, label %136, label %160

136:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %137 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 80) #9
  store i1 true, ptr %27, align 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  %138 = load double, ptr %13, align 8, !tbaa !17
  %139 = load double, ptr %14, align 8, !tbaa !17
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %23, double noundef %138, double noundef %139)
          to label %140 unwind label %148

140:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #7
  %141 = load double, ptr %16, align 8, !tbaa !17
  %142 = load double, ptr %17, align 8, !tbaa !17
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %26, double noundef %141, double noundef %142)
          to label %143 unwind label %152

143:                                              ; preds = %140
  invoke void @_ZN6R2SpanC1ERK7R2PointS2_(ptr noundef nonnull align 8 dereferenceable(80) %137, ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(16) %26)
          to label %144 unwind label %152

144:                                              ; preds = %143
  store i1 false, ptr %27, align 1
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  store ptr %137, ptr %22, align 8, !tbaa !5
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = load ptr, ptr %22, align 8, !tbaa !5
  %147 = call noundef ptr @_ZN7RNArrayIP6R2SpanE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %145, ptr noundef %146)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %160

148:                                              ; preds = %136
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %24, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %25, align 4
  br label %156

152:                                              ; preds = %143, %140
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %24, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #7
  br label %156

156:                                              ; preds = %152, %148
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  %157 = load i1, ptr %27, align 1
  br i1 %157, label %158, label %159

158:                                              ; preds = %156
  call void @_ZdlPvm(ptr noundef %137, i64 noundef 80) #10
  br label %159

159:                                              ; preds = %158, %156
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %167

160:                                              ; preds = %144, %132
  br label %88, !llvm.loop !16

161:                                              ; preds = %88
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = call i32 @fclose(ptr noundef %162)
  %164 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %164, ptr %3, align 8
  store i32 1, ptr %21, align 4
  br label %165

165:                                              ; preds = %161, %123, %84, %78, %71, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %166 = load ptr, ptr %3, align 8
  ret ptr %166

167:                                              ; preds = %159
  %168 = load ptr, ptr %24, align 8
  %169 = load i32, ptr %25, align 4
  %170 = insertvalue { ptr, i32 } poison, ptr %168, 0
  %171 = insertvalue { ptr, i32 } %170, i32 %169, 1
  resume { ptr, i32 } %171
}

declare void @_Z6RNFailPKcz(ptr noundef, ...) #2

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

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

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @isspace(i32 noundef) #3

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #4

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

declare void @_Z9RNWarningPKcz(ptr noundef, ...) #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #5

declare void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

declare void @_ZN6R2SpanC1ERK7R2PointS2_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN7RNArrayIP6R2SpanE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #1 align 2

declare i32 @fclose(ptr noundef) #2

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


; 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.R2Point = type { [2 x double] }

@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [25 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 uwtable
define dso_local noundef ptr @_Z14R2ReadWiseFileR7RNArrayIP6R2SpanEPKc(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca [1024 x i8], align 16
  %4 = alloca [64 x i8], align 16
  %5 = alloca [64 x i8], align 16
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca %class.R2Point, align 8
  %16 = alloca %class.R2Point, align 8
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #8
  %17 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.6)
  %.not = icmp eq ptr %17, null
  br i1 %.not, label %19, label %.preheader

.preheader:                                       ; preds = %2
  %18 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %17)
  %.not3554 = icmp eq ptr %18, null
  br i1 %.not3554, label %.loopexit, label %.lr.ph

19:                                               ; preds = %2
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.7, ptr noundef %1)
  br label %72

.lr.ph:                                           ; preds = %.preheader, %.backedge45
  %.03055 = phi i32 [ %26, %.backedge45 ], [ 0, %.preheader ]
  br label %20

20:                                               ; preds = %20, %.lr.ph
  %.031 = phi ptr [ %3, %.lr.ph ], [ %24, %20 ]
  %21 = load i8, ptr %.031, align 1, !tbaa !5
  %22 = sext i8 %21 to i32
  %23 = call i32 @isspace(i32 noundef %22) #9
  %.not36 = icmp eq i32 %23, 0
  %24 = getelementptr inbounds i8, ptr %.031, i64 1
  br i1 %.not36, label %25, label %20, !llvm.loop !8

25:                                               ; preds = %20
  %26 = add nuw nsw i32 %.03055, 1
  switch i8 %21, label %28 [
    i8 35, label %.backedge45
    i8 0, label %.backedge45
  ]

.backedge45:                                      ; preds = %25, %25
  %27 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %17)
  %.not35 = icmp eq ptr %27, null
  br i1 %.not35, label %.loopexit, label %.lr.ph

28:                                               ; preds = %25
  %29 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %.031, ptr noundef nonnull @.str.8, ptr noundef nonnull %4, ptr noundef nonnull %5) #8
  %.not37 = icmp eq i32 %29, 2
  br i1 %.not37, label %31, label %30

30:                                               ; preds = %28
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.9, i32 noundef %26, ptr noundef %1)
  br label %72

31:                                               ; preds = %28
  %32 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.10) #9
  %.not38 = icmp eq i32 %32, 0
  br i1 %.not38, label %34, label %33

33:                                               ; preds = %31
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.11, ptr noundef nonnull %4)
  br label %72

34:                                               ; preds = %31
  %35 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.12) #9
  %.not39 = icmp eq i32 %35, 0
  br i1 %.not39, label %.loopexit, label %36

36:                                               ; preds = %34
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.13, ptr noundef nonnull %5)
  br label %72

.loopexit:                                        ; preds = %.backedge45, %.preheader, %34
  %.1 = phi i32 [ %26, %34 ], [ 0, %.preheader ], [ %26, %.backedge45 ]
  %37 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %17)
  %.not4056 = icmp eq ptr %37, null
  br i1 %.not4056, label %._crit_edge, label %.lr.ph58

.lr.ph58:                                         ; preds = %.loopexit, %.backedge
  %.257 = phi i32 [ %44, %.backedge ], [ %.1, %.loopexit ]
  br label %38

38:                                               ; preds = %38, %.lr.ph58
  %.132 = phi ptr [ %3, %.lr.ph58 ], [ %42, %38 ]
  %39 = load i8, ptr %.132, align 1, !tbaa !5
  %40 = sext i8 %39 to i32
  %41 = call i32 @isspace(i32 noundef %40) #9
  %.not41 = icmp eq i32 %41, 0
  %42 = getelementptr inbounds i8, ptr %.132, i64 1
  br i1 %.not41, label %43, label %38, !llvm.loop !10

43:                                               ; preds = %38
  %44 = add nsw i32 %.257, 1
  switch i8 %39, label %45 [
    i8 35, label %.backedge
    i8 0, label %.backedge
  ]

45:                                               ; preds = %43
  %46 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %.132, ptr noundef nonnull @.str.14, ptr noundef nonnull %4, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %14) #8
  %.not42 = icmp eq i32 %46, 10
  br i1 %.not42, label %48, label %47

47:                                               ; preds = %45
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.9, i32 noundef %44, ptr noundef %1)
  br label %72

48:                                               ; preds = %45
  %49 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.12) #9
  %.not43 = icmp eq i32 %49, 0
  br i1 %.not43, label %52, label %50

50:                                               ; preds = %48
  call void (ptr, ...) @_Z9RNWarningPKcz(ptr noundef nonnull @.str.15, ptr noundef nonnull %4)
  br label %.backedge

.backedge:                                        ; preds = %52, %64, %50, %43, %43
  %51 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %17)
  %.not40 = icmp eq ptr %51, null
  br i1 %.not40, label %._crit_edge, label %.lr.ph58, !llvm.loop !11

52:                                               ; preds = %48
  %53 = load double, ptr %9, align 8, !tbaa !12
  %54 = load double, ptr %12, align 8, !tbaa !12
  %55 = fcmp une double %53, %54
  br i1 %55, label %56, label %.backedge

56:                                               ; preds = %52
  %57 = call noalias noundef nonnull dereferenceable(80) ptr @_Znwm(i64 noundef 80) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #8
  %58 = load double, ptr %7, align 8, !tbaa !12
  %59 = load double, ptr %8, align 8, !tbaa !12
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %15, double noundef %58, double noundef %59)
          to label %60 unwind label %66

60:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #8
  %61 = load double, ptr %10, align 8, !tbaa !12
  %62 = load double, ptr %11, align 8, !tbaa !12
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %16, double noundef %61, double noundef %62)
          to label %63 unwind label %68

63:                                               ; preds = %60
  invoke void @_ZN6R2SpanC1ERK7R2PointS2_(ptr noundef nonnull align 8 dereferenceable(80) %57, ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %64 unwind label %68

64:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #8
  %65 = call noundef ptr @_ZN7RNArrayIP6R2SpanE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull %57)
  br label %.backedge

66:                                               ; preds = %56
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %70

68:                                               ; preds = %63, %60
  %69 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #8
  br label %70

70:                                               ; preds = %68, %66
  %.pn = phi { ptr, i32 } [ %69, %68 ], [ %67, %66 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #8
  call void @_ZdlPvm(ptr noundef nonnull %57, i64 noundef 80) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn

._crit_edge:                                      ; preds = %.backedge, %.loopexit
  %71 = call i32 @fclose(ptr noundef nonnull %17)
  br label %72

72:                                               ; preds = %._crit_edge, %47, %36, %33, %30, %19
  %.029 = phi ptr [ null, %30 ], [ null, %33 ], [ null, %36 ], [ null, %47 ], [ %0, %._crit_edge ], [ null, %19 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #8
  ret ptr %.029
}

declare void @_Z6RNFailPKcz(ptr noundef, ...) local_unnamed_addr #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: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @isspace(i32 noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5

declare void @_Z9RNWarningPKcz(ptr noundef, ...) local_unnamed_addr #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #6

declare void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

declare void @_ZN6R2SpanC1ERK7R2PointS2_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #7

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN7RNArrayIP6R2SpanE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #1 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 #4 = { mustprogress nofree nounwind willreturn memory(read) "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 nofree nounwind willreturn memory(argmem: read) "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 #6 = { nobuiltin allocsize(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 #7 = { nobuiltin 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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !6, i64 0}


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