; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes/R3MeshProperty.ll (ZN14R3MeshProperty8ReadARFFEPKc)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.R3MeshProperty = type { ptr, [1024 x i8], i32, ptr, double, double, double, double, double, double }

@stderr = external global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272)) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14R3MeshProperty14SetVertexValueEid(ptr noundef nonnull align 8 dereferenceable(1096), i32 noundef, double noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14R3MeshProperty7SetNameEPKc(ptr noundef nonnull align 8 dereferenceable(1096), ptr noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14R3MeshProperty8ReadARFFEPKc(ptr noundef nonnull align 8 dereferenceable(1096) %0, ptr noundef %1) #2 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca [32768 x i8], align 16
  %11 = alloca [1024 x i8], align 16
  %12 = alloca [1024 x i8], align 16
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call noalias ptr @fopen(ptr noundef %17, ptr noundef @.str.8)
  store ptr %18, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %25, label %21

21:                                               ; preds = %2
  %22 = load ptr, ptr @stderr, align 8, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef @.str.9, ptr noundef %23) #7
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %139

25:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 32768, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32768, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 1024, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 1024, ptr %12) #7
  br label %26

26:                                               ; preds = %61, %25
  %27 = getelementptr inbounds [32768 x i8], ptr %10, i64 0, i64 0
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = call ptr @fgets(ptr noundef %27, i32 noundef 32768, ptr noundef %28)
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %62

31:                                               ; preds = %26
  %32 = getelementptr inbounds [32768 x i8], ptr %10, i64 0, i64 0
  %33 = call noundef ptr @strstr(ptr noundef %32, ptr noundef @.str.10) #8
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %36

35:                                               ; preds = %31
  br label %62

36:                                               ; preds = %31
  %37 = getelementptr inbounds [32768 x i8], ptr %10, i64 0, i64 0
  %38 = call noundef ptr @strstr(ptr noundef %37, ptr noundef @.str.11) #8
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %60

40:                                               ; preds = %36
  %41 = getelementptr inbounds [32768 x i8], ptr %10, i64 0, i64 0
  %42 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %43 = getelementptr inbounds [1024 x i8], ptr %12, i64 0, i64 0
  %44 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %41, ptr noundef @.str.12, ptr noundef %42, ptr noundef %43) #7
  %45 = icmp eq i32 %44, 2
  br i1 %45, label %46, label %59

46:                                               ; preds = %40
  %47 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %48 = call i32 @strcmp(ptr noundef %47, ptr noundef @.str.11) #8
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %58, label %50

50:                                               ; preds = %46
  %51 = load i32, ptr %8, align 4, !tbaa !9
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %53, label %55

53:                                               ; preds = %50
  %54 = getelementptr inbounds [1024 x i8], ptr %12, i64 0, i64 0
  call void @_ZN14R3MeshProperty7SetNameEPKc(ptr noundef nonnull align 8 dereferenceable(1096) %16, ptr noundef %54)
  br label %55

55:                                               ; preds = %53, %50
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %8, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %55, %46
  br label %59

59:                                               ; preds = %58, %40
  br label %60

60:                                               ; preds = %59, %36
  br label %61

61:                                               ; preds = %60
  br label %26, !llvm.loop !11

62:                                               ; preds = %35, %26
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = icmp eq i32 %63, 0
  br i1 %64, label %65, label %69

65:                                               ; preds = %62
  %66 = load ptr, ptr @stderr, align 8, !tbaa !5
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef @.str.13, ptr noundef %67) #7
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %138

69:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store double 0.000000e+00, ptr %14, align 8, !tbaa !13
  br label %70

70:                                               ; preds = %133, %98, %92, %86, %80, %69
  %71 = getelementptr inbounds [32768 x i8], ptr %10, i64 0, i64 0
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = call ptr @fgets(ptr noundef %71, i32 noundef 32768, ptr noundef %72)
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %134

75:                                               ; preds = %70
  %76 = getelementptr inbounds [32768 x i8], ptr %10, i64 0, i64 0
  %77 = load i8, ptr %76, align 16, !tbaa !15
  %78 = sext i8 %77 to i32
  %79 = icmp eq i32 %78, 35
  br i1 %79, label %80, label %81

80:                                               ; preds = %75
  br label %70, !llvm.loop !16

81:                                               ; preds = %75
  %82 = getelementptr inbounds [32768 x i8], ptr %10, i64 0, i64 0
  %83 = load i8, ptr %82, align 16, !tbaa !15
  %84 = sext i8 %83 to i32
  %85 = icmp eq i32 %84, 64
  br i1 %85, label %86, label %87

86:                                               ; preds = %81
  br label %70, !llvm.loop !16

87:                                               ; preds = %81
  %88 = getelementptr inbounds [32768 x i8], ptr %10, i64 0, i64 0
  %89 = load i8, ptr %88, align 16, !tbaa !15
  %90 = sext i8 %89 to i32
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %87
  br label %70, !llvm.loop !16

93:                                               ; preds = %87
  %94 = getelementptr inbounds [32768 x i8], ptr %10, i64 0, i64 0
  %95 = load i8, ptr %94, align 16, !tbaa !15
  %96 = sext i8 %95 to i32
  %97 = icmp eq i32 %96, 10
  br i1 %97, label %98, label %99

98:                                               ; preds = %93
  br label %70, !llvm.loop !16

99:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %100 = getelementptr inbounds [32768 x i8], ptr %10, i64 0, i64 0
  %101 = call ptr @strtok(ptr noundef %100, ptr noundef @.str.14) #7
  store ptr %101, ptr %15, align 8, !tbaa !5
  %102 = load ptr, ptr %15, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %108, label %104

104:                                              ; preds = %99
  %105 = load ptr, ptr @stderr, align 8, !tbaa !5
  %106 = load i32, ptr %13, align 4, !tbaa !9
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef @.str.15, i32 noundef %106) #7
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %131

108:                                              ; preds = %99
  %109 = load ptr, ptr %15, align 8, !tbaa !5
  %110 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %109, ptr noundef @.str.16, ptr noundef %14) #7
  %111 = icmp ne i32 %110, 1
  br i1 %111, label %112, label %116

112:                                              ; preds = %108
  %113 = load ptr, ptr @stderr, align 8, !tbaa !5
  %114 = load i32, ptr %13, align 4, !tbaa !9
  %115 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %113, ptr noundef @.str.15, i32 noundef %114) #7
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %131

116:                                              ; preds = %108
  %117 = load i32, ptr %13, align 4, !tbaa !9
  %118 = getelementptr inbounds %struct.R3MeshProperty, ptr %16, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !17
  %120 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %119)
  %121 = icmp sge i32 %117, %120
  br i1 %121, label %122, label %126

122:                                              ; preds = %116
  %123 = load ptr, ptr @stderr, align 8, !tbaa !5
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef @.str.17, ptr noundef %124) #7
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %131

126:                                              ; preds = %116
  %127 = load i32, ptr %13, align 4, !tbaa !9
  %128 = load double, ptr %14, align 8, !tbaa !13
  call void @_ZN14R3MeshProperty14SetVertexValueEid(ptr noundef nonnull align 8 dereferenceable(1096) %16, i32 noundef %127, double noundef %128)
  %129 = load i32, ptr %13, align 4, !tbaa !9
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %7, align 4
  br label %131

131:                                              ; preds = %126, %122, %112, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  %132 = load i32, ptr %7, align 4
  switch i32 %132, label %137 [
    i32 0, label %133
  ]

133:                                              ; preds = %131
  br label %70, !llvm.loop !16

134:                                              ; preds = %70
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = call i32 @fclose(ptr noundef %135)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %137

137:                                              ; preds = %134, %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %138

138:                                              ; preds = %137, %65
  call void @llvm.lifetime.end.p0(i64 1024, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 32768, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %139

139:                                              ; preds = %138, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %140 = load i32, ptr %3, align 4
  ret i32 %140
}

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

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

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

; Function Attrs: nounwind willreturn memory(read)
declare noundef ptr @strstr(ptr noundef, ptr noundef) #4

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

; Function Attrs: nounwind
declare ptr @strtok(ptr noundef, ptr noundef) #5

declare i32 @fclose(ptr noundef) #6

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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 = { 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 #6 = { "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) }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !12}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTS14R3MeshProperty", !6, i64 0, !7, i64 8, !10, i64 1032, !6, i64 1040, !14, i64 1048, !14, i64 1056, !14, i64 1064, !14, i64 1072, !14, i64 1080, !14, i64 1088}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@stderr = external local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14R3MeshProperty14SetVertexValueEid(ptr noundef nonnull align 8 dereferenceable(1096), i32 noundef, double noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14R3MeshProperty7SetNameEPKc(ptr noundef nonnull align 8 dereferenceable(1096), ptr noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14R3MeshProperty8ReadARFFEPKc(ptr noundef nonnull align 8 dereferenceable(1096) %0, ptr noundef %1) local_unnamed_addr #2 align 2 {
  %3 = alloca [32768 x i8], align 16
  %4 = alloca [1024 x i8], align 16
  %5 = alloca [1024 x i8], align 16
  %6 = alloca double, align 8
  %7 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.8)
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %8, label %11

8:                                                ; preds = %2
  %9 = load ptr, ptr @stderr, align 8, !tbaa !5
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str.9, ptr noundef %1) #7
  br label %57

11:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 32768, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %5) #8
  %12 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 32768, ptr noundef nonnull %7)
  %.not3851 = icmp eq ptr %12, null
  br i1 %.not3851, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %11, %26
  %.03452 = phi i32 [ %.135, %26 ], [ 0, %11 ]
  %13 = call noundef ptr @strstr(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.10) #9
  %.not39 = icmp eq ptr %13, null
  br i1 %.not39, label %14, label %._crit_edge

14:                                               ; preds = %.lr.ph
  %15 = call noundef ptr @strstr(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.11) #9
  %.not40 = icmp eq ptr %15, null
  br i1 %.not40, label %26, label %16

16:                                               ; preds = %14
  %17 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %3, ptr noundef nonnull @.str.12, ptr noundef nonnull %4, ptr noundef nonnull %5) #8
  %18 = icmp eq i32 %17, 2
  br i1 %18, label %19, label %26

19:                                               ; preds = %16
  %20 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.11) #9
  %.not41 = icmp eq i32 %20, 0
  br i1 %.not41, label %21, label %26

21:                                               ; preds = %19
  %22 = icmp eq i32 %.03452, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %21
  call void @_ZN14R3MeshProperty7SetNameEPKc(ptr noundef nonnull align 8 dereferenceable(1096) %0, ptr noundef nonnull %5)
  br label %24

24:                                               ; preds = %23, %21
  %25 = add nsw i32 %.03452, 1
  br label %26

26:                                               ; preds = %14, %19, %24, %16
  %.135 = phi i32 [ %.03452, %19 ], [ %25, %24 ], [ %.03452, %16 ], [ %.03452, %14 ]
  %27 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 32768, ptr noundef nonnull %7)
  %.not38 = icmp eq ptr %27, null
  br i1 %.not38, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %26, %.lr.ph
  %.034.lcssa.ph = phi i32 [ %.135, %26 ], [ %.03452, %.lr.ph ]
  %28 = icmp eq i32 %.034.lcssa.ph, 0
  br i1 %28, label %._crit_edge.thread, label %31

._crit_edge.thread:                               ; preds = %11, %._crit_edge
  %29 = load ptr, ptr @stderr, align 8, !tbaa !5
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.13, ptr noundef %1) #7
  br label %56

31:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  store double 0.000000e+00, ptr %6, align 8, !tbaa !11
  %32 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 32768, ptr noundef nonnull %7)
  %.not425558 = icmp eq ptr %32, null
  br i1 %.not425558, label %.outer._crit_edge, label %.lr.ph56

.lr.ph56:                                         ; preds = %31, %.outer
  %.031.ph59 = phi i32 [ %53, %.outer ], [ 0, %31 ]
  br label %33

33:                                               ; preds = %.lr.ph56, %.backedge
  %34 = load i8, ptr %3, align 16
  switch i8 %34, label %36 [
    i8 64, label %.backedge
    i8 35, label %.backedge
    i8 10, label %.backedge
    i8 0, label %.backedge
  ]

.backedge:                                        ; preds = %33, %33, %33, %33
  %35 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 32768, ptr noundef nonnull %7)
  %.not42 = icmp eq ptr %35, null
  br i1 %.not42, label %.outer._crit_edge, label %33

36:                                               ; preds = %33
  %37 = call ptr @strtok(ptr noundef nonnull %3, ptr noundef nonnull @.str.14) #8
  %.not43 = icmp eq ptr %37, null
  br i1 %.not43, label %38, label %41

38:                                               ; preds = %36
  %39 = load ptr, ptr @stderr, align 8, !tbaa !5
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.15, i32 noundef %.031.ph59) #7
  br label %.thread

41:                                               ; preds = %36
  %42 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %37, ptr noundef nonnull @.str.16, ptr noundef nonnull %6) #8
  %.not44 = icmp eq i32 %42, 1
  br i1 %.not44, label %46, label %43

43:                                               ; preds = %41
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.15, i32 noundef %.031.ph59) #7
  br label %.thread

46:                                               ; preds = %41
  %47 = load ptr, ptr %0, align 8, !tbaa !13
  %48 = call noundef i32 @_ZNK6R3Mesh9NVerticesEv(ptr noundef nonnull align 8 dereferenceable(272) %47)
  %.not45 = icmp slt i32 %.031.ph59, %48
  br i1 %.not45, label %.outer, label %49

49:                                               ; preds = %46
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.17, ptr noundef %1) #7
  br label %.thread

.outer:                                           ; preds = %46
  %52 = load double, ptr %6, align 8, !tbaa !11
  call void @_ZN14R3MeshProperty14SetVertexValueEid(ptr noundef nonnull align 8 dereferenceable(1096) %0, i32 noundef %.031.ph59, double noundef %52)
  %53 = add nuw nsw i32 %.031.ph59, 1
  %54 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 32768, ptr noundef nonnull %7)
  %.not4255 = icmp eq ptr %54, null
  br i1 %.not4255, label %.outer._crit_edge, label %.lr.ph56, !llvm.loop !16

.outer._crit_edge:                                ; preds = %.outer, %.backedge, %31
  %55 = call i32 @fclose(ptr noundef nonnull %7)
  br label %.thread

.thread:                                          ; preds = %38, %49, %43, %.outer._crit_edge
  %.2 = phi i32 [ 1, %.outer._crit_edge ], [ 0, %43 ], [ 0, %49 ], [ 0, %38 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br label %56

56:                                               ; preds = %.thread, %._crit_edge.thread
  %.3 = phi i32 [ 0, %._crit_edge.thread ], [ %.2, %.thread ]
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 32768, ptr nonnull %3) #8
  br label %57

57:                                               ; preds = %56, %8
  %.4 = phi i32 [ %.3, %56 ], [ 0, %8 ]
  ret i32 %.4
}

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare noundef ptr @strstr(ptr noundef, ptr nocapture 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 #5

; Function Attrs: mustprogress nofree nounwind willreturn
declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) local_unnamed_addr #6

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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 #5 = { 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 #6 = { mustprogress nofree nounwind willreturn "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 = { cold nounwind }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS14R3MeshProperty", !6, i64 0, !7, i64 8, !15, i64 1032, !6, i64 1040, !12, i64 1048, !12, i64 1056, !12, i64 1064, !12, i64 1072, !12, i64 1080, !12, i64 1088}
!15 = !{!"int", !7, i64 0}
!16 = distinct !{!16, !10}


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