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

; 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.16 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [42 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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z14R2ReadXFigFileR7RNArrayIP6R2SpanEPKc(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %1) #2 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 i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca %class.R2Point, align 8
  %16 = alloca %class.R2Point, align 8
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca %class.R2Point, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = 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 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 4, ptr %10) #7
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = call noalias ptr @fopen(ptr noundef %24, ptr noundef @.str.6)
  store ptr %25, ptr %6, align 8, !tbaa !5
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %30, label %28

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

30:                                               ; preds = %2
  br label %31

31:                                               ; preds = %65, %58, %52, %30
  %32 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = call ptr @fgets(ptr noundef %32, i32 noundef 1024, ptr noundef %33)
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %66

36:                                               ; preds = %31
  %37 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  store ptr %37, ptr %8, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %44, %36
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = load i8, ptr %39, align 1, !tbaa !11
  %41 = sext i8 %40 to i32
  %42 = call i32 @isspace(i32 noundef %41) #8
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %47

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

47:                                               ; preds = %38
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = load i8, ptr %48, align 1, !tbaa !11
  %50 = sext i8 %49 to i32
  %51 = icmp eq i32 %50, 35
  br i1 %51, label %52, label %53

52:                                               ; preds = %47
  br label %31, !llvm.loop !14

53:                                               ; preds = %47
  %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, 0
  br i1 %57, label %58, label %59

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

59:                                               ; preds = %53
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %9, align 4, !tbaa !9
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = icmp eq i32 %62, 8
  br i1 %63, label %64, label %65

64:                                               ; preds = %59
  br label %66

65:                                               ; preds = %59
  br label %31, !llvm.loop !14

66:                                               ; preds = %64, %31
  br label %67

67:                                               ; preds = %155, %94, %88, %66
  %68 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = call ptr @fgets(ptr noundef %68, i32 noundef 1024, ptr noundef %69)
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %156

72:                                               ; preds = %67
  %73 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  store ptr %73, ptr %8, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %80, %72
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = load i8, ptr %75, align 1, !tbaa !11
  %77 = sext i8 %76 to i32
  %78 = call i32 @isspace(i32 noundef %77) #8
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %83

80:                                               ; preds = %74
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i32 1
  store ptr %82, ptr %8, align 8, !tbaa !5
  br label %74, !llvm.loop !15

83:                                               ; preds = %74
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = load i8, ptr %84, align 1, !tbaa !11
  %86 = sext i8 %85 to i32
  %87 = icmp eq i32 %86, 35
  br i1 %87, label %88, label %89

88:                                               ; preds = %83
  br label %67, !llvm.loop !16

89:                                               ; preds = %83
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = load i8, ptr %90, align 1, !tbaa !11
  %92 = sext i8 %91 to i32
  %93 = icmp eq i32 %92, 0
  br i1 %93, label %94, label %95

94:                                               ; preds = %89
  br label %67, !llvm.loop !16

95:                                               ; preds = %89
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %96, ptr noundef @.str.16, ptr noundef %10) #7
  %98 = icmp ne i32 %97, 1
  br i1 %98, label %99, label %102

99:                                               ; preds = %95
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.17, ptr noundef %100, ptr noundef %101)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %160

102:                                              ; preds = %95
  %103 = load i32, ptr %10, align 4, !tbaa !9
  %104 = icmp eq i32 %103, 2
  br i1 %104, label %105, label %155

105:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %106, ptr noundef @.str.18, ptr noundef %10, ptr noundef %13, ptr noundef %13, ptr noundef %13, ptr noundef %13, ptr noundef %13, ptr noundef %13, ptr noundef %13, ptr noundef %13, ptr noundef %14, ptr noundef %13, ptr noundef %13, ptr noundef %13, ptr noundef %13, ptr noundef %13, ptr noundef %12) #7
  %108 = icmp ne i32 %107, 16
  br i1 %108, label %109, label %112

109:                                              ; preds = %105
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.19, ptr noundef %110, ptr noundef %111)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %152

112:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  call void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %15)
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #7
  call void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %16)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %113

113:                                              ; preds = %145, %112
  %114 = load i32, ptr %17, align 4, !tbaa !9
  %115 = load i32, ptr %12, align 4, !tbaa !9
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 10, ptr %11, align 4
  br label %148

118:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %119, ptr noundef @.str.20, ptr noundef %18, ptr noundef %19)
  %121 = icmp ne i32 %120, 2
  br i1 %121, label %122, label %124

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

124:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  %125 = load double, ptr %18, align 8, !tbaa !17
  %126 = load double, ptr %19, align 8, !tbaa !17
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %20, double noundef %125, double noundef %126)
  %127 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %20)
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  %128 = load i32, ptr %17, align 4, !tbaa !9
  %129 = icmp sgt i32 %128, 0
  br i1 %129, label %130, label %140

130:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %131 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 80) #9
  invoke void @_ZN6R2SpanC1ERK7R2PointS2_(ptr noundef nonnull align 8 dereferenceable(80) %131, ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %132 unwind label %136

132:                                              ; preds = %130
  store ptr %131, ptr %21, align 8, !tbaa !5
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = load ptr, ptr %21, align 8, !tbaa !5
  %135 = call noundef ptr @_ZN7RNArrayIP6R2SpanE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %133, ptr noundef %134)
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %140

136:                                              ; preds = %130
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %22, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %23, align 4
  call void @_ZdlPvm(ptr noundef %131, i64 noundef 80) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #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 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, 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 %162

140:                                              ; preds = %132, %124
  %141 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %16)
  store i32 0, ptr %11, align 4
  br label %142

142:                                              ; preds = %140, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %143 = load i32, ptr %11, align 4
  switch i32 %143, label %148 [
    i32 0, label %144
  ]

144:                                              ; preds = %142
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %17, align 4, !tbaa !9
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %17, align 4, !tbaa !9
  br label %113, !llvm.loop !19

148:                                              ; preds = %142, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  %149 = load i32, ptr %11, align 4
  switch i32 %149, label %151 [
    i32 10, label %150
  ]

150:                                              ; preds = %148
  store i32 0, ptr %11, align 4
  br label %151

151:                                              ; preds = %150, %148
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  br label %152

152:                                              ; preds = %151, %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  %153 = load i32, ptr %11, align 4
  switch i32 %153, label %160 [
    i32 0, label %154
  ]

154:                                              ; preds = %152
  br label %155

155:                                              ; preds = %154, %102
  br label %67, !llvm.loop !16

156:                                              ; preds = %67
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = call i32 @fclose(ptr noundef %157)
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %159, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %160

160:                                              ; preds = %156, %152, %99, %28
  call void @llvm.lifetime.end.p0(i64 4, 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
  %161 = load ptr, ptr %3, align 8
  ret ptr %161

162:                                              ; preds = %136
  %163 = load ptr, ptr %22, align 8
  %164 = load i32, ptr %23, align 4
  %165 = insertvalue { ptr, i32 } poison, ptr %163, 0
  %166 = insertvalue { ptr, i32 } %165, i32 %164, 1
  resume { ptr, i32 } %166
}

; 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) #1

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

; 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: 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 #1

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 #1

; 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) #2 align 2

declare i32 @fclose(ptr noundef) #1

declare void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) #1

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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}
!19 = distinct !{!19, !13}


; 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.16 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [42 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

declare void @_Z6RNFailPKcz(ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z14R2ReadXFigFileR7RNArrayIP6R2SpanEPKc(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %1) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca [1024 x i8], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca %class.R2Point, align 8
  %9 = alloca %class.R2Point, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca %class.R2Point, align 8
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %13 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.6)
  %.not = icmp eq ptr %13, null
  br i1 %.not, label %15, label %.outer.preheader

.outer.preheader:                                 ; preds = %2
  %14 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not4771 = icmp eq ptr %14, null
  br i1 %.not4771, label %.loopexit, label %.preheader62

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

.preheader62:                                     ; preds = %.outer.preheader, %.preheader62.backedge
  %.037 = phi ptr [ %.037.be, %.preheader62.backedge ], [ %3, %.outer.preheader ]
  %16 = load i8, ptr %.037, align 1, !tbaa !5
  %17 = sext i8 %16 to i32
  %18 = call i32 @isspace(i32 noundef %17) #8
  %.not48 = icmp eq i32 %18, 0
  %19 = getelementptr inbounds i8, ptr %.037, i64 1
  br i1 %.not48, label %20, label %.preheader62.backedge

.preheader62.backedge:                            ; preds = %.preheader62, %.backedge64
  %.037.be = phi ptr [ %19, %.preheader62 ], [ %3, %.backedge64 ]
  br label %.preheader62, !llvm.loop !8

20:                                               ; preds = %.preheader62
  switch i8 %16, label %.outer.1 [
    i8 35, label %.backedge64
    i8 0, label %.backedge64
  ]

.backedge64:                                      ; preds = %20, %20
  %21 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not47 = icmp eq ptr %21, null
  br i1 %.not47, label %.loopexit, label %.preheader62.backedge

.outer.1:                                         ; preds = %20
  %22 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not4771.1 = icmp eq ptr %22, null
  br i1 %.not4771.1, label %.loopexit, label %.preheader62.1

.preheader62.1:                                   ; preds = %.outer.1, %.preheader62.1.backedge
  %.037.1 = phi ptr [ %.037.1.be, %.preheader62.1.backedge ], [ %3, %.outer.1 ]
  %23 = load i8, ptr %.037.1, align 1, !tbaa !5
  %24 = sext i8 %23 to i32
  %25 = call i32 @isspace(i32 noundef %24) #8
  %.not48.1 = icmp eq i32 %25, 0
  %26 = getelementptr inbounds i8, ptr %.037.1, i64 1
  br i1 %.not48.1, label %27, label %.preheader62.1.backedge

.preheader62.1.backedge:                          ; preds = %.preheader62.1, %.backedge64.1
  %.037.1.be = phi ptr [ %26, %.preheader62.1 ], [ %3, %.backedge64.1 ]
  br label %.preheader62.1, !llvm.loop !8

27:                                               ; preds = %.preheader62.1
  switch i8 %23, label %.outer.2 [
    i8 35, label %.backedge64.1
    i8 0, label %.backedge64.1
  ]

.backedge64.1:                                    ; preds = %27, %27
  %28 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not47.1 = icmp eq ptr %28, null
  br i1 %.not47.1, label %.loopexit, label %.preheader62.1.backedge

.outer.2:                                         ; preds = %27
  %29 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not4771.2 = icmp eq ptr %29, null
  br i1 %.not4771.2, label %.loopexit, label %.preheader62.2

.preheader62.2:                                   ; preds = %.outer.2, %.preheader62.2.backedge
  %.037.2 = phi ptr [ %.037.2.be, %.preheader62.2.backedge ], [ %3, %.outer.2 ]
  %30 = load i8, ptr %.037.2, align 1, !tbaa !5
  %31 = sext i8 %30 to i32
  %32 = call i32 @isspace(i32 noundef %31) #8
  %.not48.2 = icmp eq i32 %32, 0
  %33 = getelementptr inbounds i8, ptr %.037.2, i64 1
  br i1 %.not48.2, label %34, label %.preheader62.2.backedge

.preheader62.2.backedge:                          ; preds = %.preheader62.2, %.backedge64.2
  %.037.2.be = phi ptr [ %33, %.preheader62.2 ], [ %3, %.backedge64.2 ]
  br label %.preheader62.2, !llvm.loop !8

34:                                               ; preds = %.preheader62.2
  switch i8 %30, label %.outer.3 [
    i8 35, label %.backedge64.2
    i8 0, label %.backedge64.2
  ]

.backedge64.2:                                    ; preds = %34, %34
  %35 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not47.2 = icmp eq ptr %35, null
  br i1 %.not47.2, label %.loopexit, label %.preheader62.2.backedge

.outer.3:                                         ; preds = %34
  %36 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not4771.3 = icmp eq ptr %36, null
  br i1 %.not4771.3, label %.loopexit, label %.preheader62.3

.preheader62.3:                                   ; preds = %.outer.3, %.preheader62.3.backedge
  %.037.3 = phi ptr [ %.037.3.be, %.preheader62.3.backedge ], [ %3, %.outer.3 ]
  %37 = load i8, ptr %.037.3, align 1, !tbaa !5
  %38 = sext i8 %37 to i32
  %39 = call i32 @isspace(i32 noundef %38) #8
  %.not48.3 = icmp eq i32 %39, 0
  %40 = getelementptr inbounds i8, ptr %.037.3, i64 1
  br i1 %.not48.3, label %41, label %.preheader62.3.backedge

.preheader62.3.backedge:                          ; preds = %.preheader62.3, %.backedge64.3
  %.037.3.be = phi ptr [ %40, %.preheader62.3 ], [ %3, %.backedge64.3 ]
  br label %.preheader62.3, !llvm.loop !8

41:                                               ; preds = %.preheader62.3
  switch i8 %37, label %.outer.4 [
    i8 35, label %.backedge64.3
    i8 0, label %.backedge64.3
  ]

.backedge64.3:                                    ; preds = %41, %41
  %42 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not47.3 = icmp eq ptr %42, null
  br i1 %.not47.3, label %.loopexit, label %.preheader62.3.backedge

.outer.4:                                         ; preds = %41
  %43 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not4771.4 = icmp eq ptr %43, null
  br i1 %.not4771.4, label %.loopexit, label %.preheader62.4

.preheader62.4:                                   ; preds = %.outer.4, %.preheader62.4.backedge
  %.037.4 = phi ptr [ %.037.4.be, %.preheader62.4.backedge ], [ %3, %.outer.4 ]
  %44 = load i8, ptr %.037.4, align 1, !tbaa !5
  %45 = sext i8 %44 to i32
  %46 = call i32 @isspace(i32 noundef %45) #8
  %.not48.4 = icmp eq i32 %46, 0
  %47 = getelementptr inbounds i8, ptr %.037.4, i64 1
  br i1 %.not48.4, label %48, label %.preheader62.4.backedge

.preheader62.4.backedge:                          ; preds = %.preheader62.4, %.backedge64.4
  %.037.4.be = phi ptr [ %47, %.preheader62.4 ], [ %3, %.backedge64.4 ]
  br label %.preheader62.4, !llvm.loop !8

48:                                               ; preds = %.preheader62.4
  switch i8 %44, label %.outer.5 [
    i8 35, label %.backedge64.4
    i8 0, label %.backedge64.4
  ]

.backedge64.4:                                    ; preds = %48, %48
  %49 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not47.4 = icmp eq ptr %49, null
  br i1 %.not47.4, label %.loopexit, label %.preheader62.4.backedge

.outer.5:                                         ; preds = %48
  %50 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not4771.5 = icmp eq ptr %50, null
  br i1 %.not4771.5, label %.loopexit, label %.preheader62.5

.preheader62.5:                                   ; preds = %.outer.5, %.preheader62.5.backedge
  %.037.5 = phi ptr [ %.037.5.be, %.preheader62.5.backedge ], [ %3, %.outer.5 ]
  %51 = load i8, ptr %.037.5, align 1, !tbaa !5
  %52 = sext i8 %51 to i32
  %53 = call i32 @isspace(i32 noundef %52) #8
  %.not48.5 = icmp eq i32 %53, 0
  %54 = getelementptr inbounds i8, ptr %.037.5, i64 1
  br i1 %.not48.5, label %55, label %.preheader62.5.backedge

.preheader62.5.backedge:                          ; preds = %.preheader62.5, %.backedge64.5
  %.037.5.be = phi ptr [ %54, %.preheader62.5 ], [ %3, %.backedge64.5 ]
  br label %.preheader62.5, !llvm.loop !8

55:                                               ; preds = %.preheader62.5
  switch i8 %51, label %.outer.6 [
    i8 35, label %.backedge64.5
    i8 0, label %.backedge64.5
  ]

.backedge64.5:                                    ; preds = %55, %55
  %56 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not47.5 = icmp eq ptr %56, null
  br i1 %.not47.5, label %.loopexit, label %.preheader62.5.backedge

.outer.6:                                         ; preds = %55
  %57 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not4771.6 = icmp eq ptr %57, null
  br i1 %.not4771.6, label %.loopexit, label %.preheader62.6

.preheader62.6:                                   ; preds = %.outer.6, %.preheader62.6.backedge
  %.037.6 = phi ptr [ %.037.6.be, %.preheader62.6.backedge ], [ %3, %.outer.6 ]
  %58 = load i8, ptr %.037.6, align 1, !tbaa !5
  %59 = sext i8 %58 to i32
  %60 = call i32 @isspace(i32 noundef %59) #8
  %.not48.6 = icmp eq i32 %60, 0
  %61 = getelementptr inbounds i8, ptr %.037.6, i64 1
  br i1 %.not48.6, label %62, label %.preheader62.6.backedge

.preheader62.6.backedge:                          ; preds = %.preheader62.6, %.backedge64.6
  %.037.6.be = phi ptr [ %61, %.preheader62.6 ], [ %3, %.backedge64.6 ]
  br label %.preheader62.6, !llvm.loop !8

62:                                               ; preds = %.preheader62.6
  switch i8 %58, label %.outer.7 [
    i8 35, label %.backedge64.6
    i8 0, label %.backedge64.6
  ]

.backedge64.6:                                    ; preds = %62, %62
  %63 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not47.6 = icmp eq ptr %63, null
  br i1 %.not47.6, label %.loopexit, label %.preheader62.6.backedge

.outer.7:                                         ; preds = %62
  %64 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not4771.7 = icmp eq ptr %64, null
  br i1 %.not4771.7, label %.loopexit, label %.preheader62.7

.preheader62.7:                                   ; preds = %.outer.7, %.preheader62.7.backedge
  %.037.7 = phi ptr [ %.037.7.be, %.preheader62.7.backedge ], [ %3, %.outer.7 ]
  %65 = load i8, ptr %.037.7, align 1, !tbaa !5
  %66 = sext i8 %65 to i32
  %67 = call i32 @isspace(i32 noundef %66) #8
  %.not48.7 = icmp eq i32 %67, 0
  %68 = getelementptr inbounds i8, ptr %.037.7, i64 1
  br i1 %.not48.7, label %69, label %.preheader62.7.backedge

.preheader62.7.backedge:                          ; preds = %.preheader62.7, %.backedge64.7
  %.037.7.be = phi ptr [ %68, %.preheader62.7 ], [ %3, %.backedge64.7 ]
  br label %.preheader62.7, !llvm.loop !8

69:                                               ; preds = %.preheader62.7
  switch i8 %65, label %.loopexit [
    i8 35, label %.backedge64.7
    i8 0, label %.backedge64.7
  ]

.backedge64.7:                                    ; preds = %69, %69
  %70 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not47.7 = icmp eq ptr %70, null
  br i1 %.not47.7, label %.loopexit, label %.preheader62.7.backedge

.loopexit:                                        ; preds = %.backedge64, %.backedge64.1, %.backedge64.2, %.backedge64.3, %.backedge64.4, %.backedge64.5, %.backedge64.6, %69, %.backedge64.7, %.outer.preheader, %.outer.1, %.outer.2, %.outer.3, %.outer.4, %.outer.5, %.outer.6, %.outer.7
  %71 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not4974 = icmp eq ptr %71, null
  br i1 %.not4974, label %._crit_edge, label %.preheader

.preheader:                                       ; preds = %.loopexit, %.preheader.backedge
  %.138 = phi ptr [ %.138.be, %.preheader.backedge ], [ %3, %.loopexit ]
  %72 = load i8, ptr %.138, align 1, !tbaa !5
  %73 = sext i8 %72 to i32
  %74 = call i32 @isspace(i32 noundef %73) #8
  %.not50 = icmp eq i32 %74, 0
  %75 = getelementptr inbounds i8, ptr %.138, i64 1
  br i1 %.not50, label %76, label %.preheader.backedge

.preheader.backedge:                              ; preds = %.preheader, %.backedge
  %.138.be = phi ptr [ %75, %.preheader ], [ %3, %.backedge ]
  br label %.preheader, !llvm.loop !10

76:                                               ; preds = %.preheader
  switch i8 %72, label %77 [
    i8 35, label %.backedge
    i8 0, label %.backedge
  ]

77:                                               ; preds = %76
  %78 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %.138, ptr noundef nonnull @.str.16, ptr noundef nonnull %4) #7
  %.not51 = icmp eq i32 %78, 1
  br i1 %.not51, label %80, label %79

79:                                               ; preds = %77
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.17, ptr noundef %1, ptr noundef nonnull %.138)
  br label %108

80:                                               ; preds = %77
  %81 = load i32, ptr %4, align 4, !tbaa !11
  %82 = icmp eq i32 %81, 2
  br i1 %82, label %83, label %.backedge

83:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %84 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %.138, ptr noundef nonnull @.str.18, ptr noundef nonnull %4, ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %5) #7
  %.not52 = icmp eq i32 %84, 16
  br i1 %.not52, label %85, label %.thread56

.thread56:                                        ; preds = %83
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.19, ptr noundef %1, ptr noundef nonnull %.138)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %108

85:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  call void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  call void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %86 = load i32, ptr %5, align 4, !tbaa !11
  %.not5572 = icmp sgt i32 %86, 0
  br i1 %.not5572, label %.lr.ph.preheader, label %.thread59

.lr.ph.preheader:                                 ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %87 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %13, ptr noundef nonnull @.str.20, ptr noundef nonnull %10, ptr noundef nonnull %11)
  %.not53.peel = icmp eq i32 %87, 2
  br i1 %.not53.peel, label %88, label %.loopexit90

88:                                               ; preds = %.lr.ph.preheader
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  %89 = load double, ptr %10, align 8, !tbaa !13
  %90 = load double, ptr %11, align 8, !tbaa !13
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %12, double noundef %89, double noundef %90)
  %91 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %12)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  %92 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  %93 = load i32, ptr %5, align 4, !tbaa !11
  %.not55.peel = icmp sgt i32 %93, 1
  br i1 %.not55.peel, label %.lr.ph, label %.thread59

.thread59:                                        ; preds = %101, %88, %85
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %.backedge

.lr.ph:                                           ; preds = %88, %101
  %.04073 = phi i32 [ %104, %101 ], [ 1, %88 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %94 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %13, ptr noundef nonnull @.str.20, ptr noundef nonnull %10, ptr noundef nonnull %11)
  %.not53 = icmp eq i32 %94, 2
  br i1 %.not53, label %95, label %.loopexit90

95:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  %96 = load double, ptr %10, align 8, !tbaa !13
  %97 = load double, ptr %11, align 8, !tbaa !13
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %12, double noundef %96, double noundef %97)
  %98 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %12)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  %99 = call noalias noundef nonnull dereferenceable(80) ptr @_Znwm(i64 noundef 80) #9
  invoke void @_ZN6R2SpanC1ERK7R2PointS2_(ptr noundef nonnull align 8 dereferenceable(80) %99, ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %101 unwind label %100

100:                                              ; preds = %95
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %99, i64 noundef 80) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #7
  resume { ptr, i32 } %lpad.loopexit

101:                                              ; preds = %95
  %102 = call noundef ptr @_ZN7RNArrayIP6R2SpanE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull %99)
  %103 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  %104 = add nuw nsw i32 %.04073, 1
  %105 = load i32, ptr %5, align 4, !tbaa !11
  %.not55 = icmp slt i32 %104, %105
  br i1 %.not55, label %.lr.ph, label %.thread59, !llvm.loop !15

.loopexit90:                                      ; preds = %.lr.ph.preheader, %.lr.ph
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.21, ptr noundef %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %108

.backedge:                                        ; preds = %80, %.thread59, %76, %76
  %106 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %13)
  %.not49 = icmp eq ptr %106, null
  br i1 %.not49, label %._crit_edge, label %.preheader.backedge

._crit_edge:                                      ; preds = %.backedge, %.loopexit
  %107 = call i32 @fclose(ptr noundef nonnull %13)
  br label %108

108:                                              ; preds = %.loopexit90, %.thread56, %._crit_edge, %79, %15
  %.6 = phi ptr [ null, %79 ], [ null, %.loopexit90 ], [ %0, %._crit_edge ], [ null, %15 ], [ null, %.thread56 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #7
  ret ptr %.6
}

; 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #5

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

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 #1

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

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

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

declare void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !6, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !6, i64 0}
!15 = distinct !{!15, !9, !16}
!16 = !{!"llvm.loop.peeled.count", i32 1}


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