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

; 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.R2Polygon = type <{ %class.R2Solid, ptr, i32, [4 x i8], %class.R2Box, i32, [4 x i8] }>
%class.R2Solid = type { %class.R2Shape }
%class.R2Shape = type { ptr }
%class.R2Box = type { %class.R2Solid, %class.R2Point, %class.R2Point }
%class.R2Point = type { [2 x double] }

@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [46 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #0

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9R2Polygon13ReadTheraFileEPKc(ptr noundef nonnull align 8 dereferenceable(68) %0, ptr noundef %1) unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %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 double, align 8
  %10 = alloca double, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca double, 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) #8
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call noalias ptr @fopen(ptr noundef %17, ptr noundef @.str.4)
  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.5, ptr noundef %23) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %109

25:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %class.R2Polygon, ptr %16, i32 0, i32 2
  %28 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %26, ptr noundef @.str.6, ptr noundef %8, ptr noundef %27, ptr noundef %9, ptr noundef %10)
  %29 = icmp ne i32 %28, 4
  br i1 %29, label %30, label %34

30:                                               ; preds = %25
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.7, ptr noundef %32) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %108

34:                                               ; preds = %25
  %35 = getelementptr inbounds %class.R2Polygon, ptr %16, i32 0, i32 2
  %36 = load i32, ptr %35, align 8, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %37, i64 16)
  %39 = extractvalue { i64, i1 } %38, 1
  %40 = extractvalue { i64, i1 } %38, 0
  %41 = select i1 %39, i64 -1, i64 %40
  %42 = call noalias noundef nonnull ptr @_Znam(i64 noundef %41) #9
  %43 = icmp eq i64 %37, 0
  br i1 %43, label %51, label %44

44:                                               ; preds = %34
  %45 = getelementptr inbounds %class.R2Point, ptr %42, i64 %37
  br label %46

46:                                               ; preds = %48, %44
  %47 = phi ptr [ %42, %44 ], [ %49, %48 ]
  invoke void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %47)
          to label %48 unwind label %60

48:                                               ; preds = %46
  %49 = getelementptr inbounds %class.R2Point, ptr %47, i64 1
  %50 = icmp eq ptr %49, %45
  br i1 %50, label %51, label %46

51:                                               ; preds = %48, %34
  %52 = getelementptr inbounds %class.R2Polygon, ptr %16, i32 0, i32 1
  store ptr %42, ptr %52, align 8, !tbaa !16
  %53 = getelementptr inbounds %class.R2Polygon, ptr %16, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  %55 = icmp ne ptr %54, null
  br i1 %55, label %64, label %56

56:                                               ; preds = %51
  %57 = load ptr, ptr @stderr, align 8, !tbaa !5
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef @.str.8, ptr noundef %58) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %108

60:                                               ; preds = %46
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %11, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %12, align 4
  call void @_ZdaPvm(ptr noundef %42, i64 noundef %41) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %111

64:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !17
  br label %65

65:                                               ; preds = %98, %64
  %66 = load i32, ptr %13, align 4, !tbaa !17
  %67 = getelementptr inbounds %class.R2Polygon, ptr %16, i32 0, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !9
  %69 = icmp slt i32 %66, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %65
  store i32 2, ptr %7, align 4
  br label %101

71:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %72, ptr noundef @.str.9, ptr noundef %14, ptr noundef %15)
  %74 = icmp ne i32 %73, 2
  br i1 %74, label %75, label %81

75:                                               ; preds = %71
  %76 = load ptr, ptr @stderr, align 8, !tbaa !5
  %77 = getelementptr inbounds %class.R2Polygon, ptr %16, i32 0, i32 2
  %78 = load i32, ptr %77, align 8, !tbaa !9
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef @.str.10, i32 noundef %78, ptr noundef %79) #8
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %95

81:                                               ; preds = %71
  %82 = getelementptr inbounds %class.R2Polygon, ptr %16, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !16
  %84 = load i32, ptr %13, align 4, !tbaa !17
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds %class.R2Point, ptr %83, i64 %85
  %87 = load double, ptr %14, align 8, !tbaa !18
  %88 = load double, ptr %15, align 8, !tbaa !18
  call void @_ZN7R2Point5ResetEdd(ptr noundef nonnull align 8 dereferenceable(16) %86, double noundef %87, double noundef %88)
  %89 = getelementptr inbounds %class.R2Polygon, ptr %16, i32 0, i32 4
  %90 = getelementptr inbounds %class.R2Polygon, ptr %16, i32 0, i32 1
  %91 = load ptr, ptr %90, align 8, !tbaa !16
  %92 = load i32, ptr %13, align 4, !tbaa !17
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds %class.R2Point, ptr %91, i64 %93
  call void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %89, ptr noundef nonnull align 8 dereferenceable(16) %94)
  store i32 0, ptr %7, align 4
  br label %95

95:                                               ; preds = %81, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  %96 = load i32, ptr %7, align 4
  switch i32 %96, label %101 [
    i32 0, label %97
  ]

97:                                               ; preds = %95
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %13, align 4, !tbaa !17
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %13, align 4, !tbaa !17
  br label %65, !llvm.loop !20

101:                                              ; preds = %95, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  %102 = load i32, ptr %7, align 4
  switch i32 %102, label %108 [
    i32 2, label %103
  ]

103:                                              ; preds = %101
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = call i32 @fclose(ptr noundef %104)
  %106 = getelementptr inbounds %class.R2Polygon, ptr %16, i32 0, i32 2
  %107 = load i32, ptr %106, align 8, !tbaa !9
  store i32 %107, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %108

108:                                              ; preds = %103, %101, %56, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %109

109:                                              ; preds = %108, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  %110 = load i32, ptr %3, align 4
  ret i32 %110

111:                                              ; preds = %60
  %112 = load ptr, ptr %11, align 8
  %113 = load i32, ptr %12, align 4
  %114 = insertvalue { ptr, i32 } poison, ptr %112, 0
  %115 = insertvalue { ptr, i32 } %114, i32 %113, 1
  resume { ptr, i32 } %115
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7R2Point5ResetEdd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) #7 align 2

declare i32 @fclose(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #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 = { 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 #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #7 = { inlinehint 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 #8 = { nounwind }
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, !13, i64 16}
!10 = !{!"_ZTS9R2Polygon", !11, i64 0, !6, i64 8, !13, i64 16, !14, i64 24, !13, i64 64}
!11 = !{!"_ZTS7R2Solid", !12, i64 0}
!12 = !{!"_ZTS7R2Shape"}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS5R2Box", !11, i64 0, !15, i64 8, !15, i64 24}
!15 = !{!"_ZTS7R2Point", !7, i64 0}
!16 = !{!10, !6, i64 8}
!17 = !{!13, !13, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"double", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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

%class.R2Point = type { [2 x double] }

@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [46 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9R2Polygon13ReadTheraFileEPKc(ptr noundef nonnull align 8 dereferenceable(68) %0, ptr noundef %1) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.4)
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %9, label %12

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

12:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %8, ptr noundef nonnull @.str.6, ptr noundef nonnull %3, ptr noundef nonnull %13, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %.not25 = icmp eq i32 %14, 4
  br i1 %.not25, label %18, label %15

15:                                               ; preds = %12
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.7, ptr noundef %1) #7
  br label %56

18:                                               ; preds = %12
  %19 = load i32, ptr %13, align 8, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = icmp slt i32 %19, 0
  %22 = shl nsw i64 %20, 4
  %23 = select i1 %21, i64 -1, i64 %22
  %24 = call noalias noundef nonnull ptr @_Znam(i64 noundef %23) #9
  %25 = icmp eq i32 %19, 0
  br i1 %25, label %.loopexit.thread, label %27

.loopexit.thread:                                 ; preds = %18
  %26 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %24, ptr %26, align 8, !tbaa !16
  br label %.critedge

27:                                               ; preds = %18
  %28 = getelementptr inbounds %class.R2Point, ptr %24, i64 %20
  br label %29

29:                                               ; preds = %31, %27
  %30 = phi ptr [ %24, %27 ], [ %32, %31 ]
  invoke void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %30)
          to label %31 unwind label %37

31:                                               ; preds = %29
  %32 = getelementptr inbounds i8, ptr %30, i64 16
  %33 = icmp eq ptr %32, %28
  br i1 %33, label %.loopexit, label %29

.loopexit:                                        ; preds = %31
  %.pre = load i32, ptr %13, align 8, !tbaa !9
  %34 = icmp sgt i32 %.pre, 0
  %35 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %24, ptr %35, align 8, !tbaa !16
  br i1 %34, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %.loopexit
  %36 = getelementptr inbounds i8, ptr %0, i64 24
  br label %39

37:                                               ; preds = %29
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdaPvm(ptr noundef nonnull %24, i64 noundef %23) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  resume { ptr, i32 } %38

39:                                               ; preds = %.lr.ph, %41
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %41 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %40 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %8, ptr noundef nonnull @.str.9, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %.not26 = icmp eq i32 %40, 2
  br i1 %.not26, label %41, label %50

41:                                               ; preds = %39
  %42 = load ptr, ptr %35, align 8, !tbaa !16
  %43 = getelementptr inbounds %class.R2Point, ptr %42, i64 %indvars.iv
  %44 = load double, ptr %6, align 8, !tbaa !17
  %45 = load double, ptr %7, align 8, !tbaa !17
  call void @_ZN7R2Point5ResetEdd(ptr noundef nonnull align 8 dereferenceable(16) %43, double noundef %44, double noundef %45)
  %46 = load ptr, ptr %35, align 8, !tbaa !16
  %47 = getelementptr inbounds %class.R2Point, ptr %46, i64 %indvars.iv
  call void @_ZN5R2Box5UnionERK7R2Point(ptr noundef nonnull align 8 dereferenceable(40) %36, ptr noundef nonnull align 8 dereferenceable(16) %47)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = load i32, ptr %13, align 8, !tbaa !9
  %49 = sext i32 %48 to i64
  %.not27 = icmp slt i64 %indvars.iv.next, %49
  br i1 %.not27, label %39, label %.critedge, !llvm.loop !19

50:                                               ; preds = %39
  %51 = load ptr, ptr @stderr, align 8, !tbaa !5
  %52 = load i32, ptr %13, align 8, !tbaa !9
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.10, i32 noundef %52, ptr noundef %1) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br label %56

.critedge:                                        ; preds = %41, %.loopexit.thread, %.loopexit
  %54 = call i32 @fclose(ptr noundef nonnull %8)
  %55 = load i32, ptr %13, align 8, !tbaa !9
  br label %56

56:                                               ; preds = %50, %.critedge, %15
  %.3 = phi i32 [ 0, %15 ], [ %55, %.critedge ], [ 0, %50 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %57

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7R2Point5ResetEdd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) local_unnamed_addr #6 align 2

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

attributes #0 = { 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 #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 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { inlinehint 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 #7 = { cold nounwind }
attributes #8 = { nounwind }
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, !13, i64 16}
!10 = !{!"_ZTS9R2Polygon", !11, i64 0, !6, i64 8, !13, i64 16, !14, i64 24, !13, i64 64}
!11 = !{!"_ZTS7R2Solid", !12, i64 0}
!12 = !{!"_ZTS7R2Shape"}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS5R2Box", !11, i64 0, !15, i64 8, !15, i64 24}
!15 = !{!"_ZTS7R2Point", !7, i64 0}
!16 = !{!10, !6, i64 8}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


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