; LLVM IR from simonaertssen/MIT-6.172-Performance-Engineering-of-Software-Systems :: Project 2 - Collision Detection/screensaver (screensaver)

; 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.timespec = type { i64, i64 }

@DEFAULT_INPUT_FILE_PATH = external dso_local global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1
@optind = external global i32, align 4
@.str.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@input_file_path = external dso_local global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @lineMain(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %struct.timespec, align 8
  %14 = alloca %struct.timespec, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #7
  store i8 0, ptr %7, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #7
  store i8 1, ptr %9, align 1, !tbaa !11
  br label %15

15:                                               ; preds = %30, %27, %2
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = load ptr, ptr %5, align 8, !tbaa !9
  %18 = call i32 @getopt(i32 noundef %16, ptr noundef %17, ptr noundef @.str.1) #7
  store i32 %18, ptr %6, align 4, !tbaa !5
  %19 = icmp ne i32 %18, -1
  br i1 %19, label %20, label %31

20:                                               ; preds = %15
  %21 = load i32, ptr %6, align 4, !tbaa !5
  switch i32 %21, label %27 [
    i32 103, label %22
    i32 117, label %23
    i32 111, label %25
  ]

22:                                               ; preds = %20
  store i8 1, ptr %7, align 1, !tbaa !11
  br label %30

23:                                               ; preds = %20
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  store i8 1, ptr %9, align 1, !tbaa !11
  br label %30

25:                                               ; preds = %20
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  store i8 0, ptr %9, align 1, !tbaa !11
  br label %30

27:                                               ; preds = %20
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %28)
  br label %15, !llvm.loop !13

30:                                               ; preds = %25, %23, %22
  br label %15, !llvm.loop !13

31:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = load i32, ptr @optind, align 4, !tbaa !5
  %34 = sub nsw i32 %32, %33
  store i32 %34, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %53, %31
  %36 = load i32, ptr %11, align 4, !tbaa !5
  %37 = load i32, ptr %10, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %56

40:                                               ; preds = %35
  %41 = load ptr, ptr %5, align 8, !tbaa !9
  %42 = load i32, ptr %11, align 4, !tbaa !5
  %43 = load i32, ptr @optind, align 4, !tbaa !5
  %44 = add nsw i32 %42, %43
  %45 = sub nsw i32 %44, 1
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds ptr, ptr %41, i64 %46
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  %49 = load ptr, ptr %5, align 8, !tbaa !9
  %50 = load i32, ptr %11, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds ptr, ptr %49, i64 %51
  store ptr %48, ptr %52, align 8, !tbaa !9
  br label %53

53:                                               ; preds = %40
  %54 = load i32, ptr %11, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %11, align 4, !tbaa !5
  br label %35, !llvm.loop !15

56:                                               ; preds = %39
  %57 = load i32, ptr %10, align 4, !tbaa !5
  %58 = icmp slt i32 %57, 1
  br i1 %58, label %59, label %65

59:                                               ; preds = %56
  %60 = load ptr, ptr %5, align 8, !tbaa !9
  %61 = getelementptr inbounds ptr, ptr %60, i64 0
  %62 = load ptr, ptr %61, align 8, !tbaa !9
  %63 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, ptr noundef %62)
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  call void @exit(i32 noundef -1) #8
  unreachable

65:                                               ; preds = %56
  %66 = load ptr, ptr %5, align 8, !tbaa !9
  %67 = getelementptr inbounds ptr, ptr %66, i64 1
  %68 = load ptr, ptr %67, align 8, !tbaa !9
  %69 = call i32 @atoi(ptr noundef %68) #9
  store i32 %69, ptr %8, align 4, !tbaa !5
  %70 = load i32, ptr %10, align 4, !tbaa !5
  %71 = icmp sgt i32 %70, 1
  br i1 %71, label %72, label %76

72:                                               ; preds = %65
  %73 = load ptr, ptr %5, align 8, !tbaa !9
  %74 = getelementptr inbounds ptr, ptr %73, i64 2
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  store ptr %75, ptr @input_file_path, align 8, !tbaa !9
  br label %78

76:                                               ; preds = %65
  %77 = load ptr, ptr @DEFAULT_INPUT_FILE_PATH, align 8, !tbaa !9
  store ptr %77, ptr @input_file_path, align 8, !tbaa !9
  br label %78

78:                                               ; preds = %76, %72
  %79 = load ptr, ptr @input_file_path, align 8, !tbaa !9
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef %79)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %81 = call ptr (...) @LineDemo_new()
  store ptr %81, ptr %12, align 8, !tbaa !9
  %82 = load ptr, ptr @input_file_path, align 8, !tbaa !9
  call void @LineDemo_setInputFile(ptr noundef %82)
  %83 = load ptr, ptr %12, align 8, !tbaa !9
  call void @LineDemo_initLine(ptr noundef %83)
  %84 = load ptr, ptr %12, align 8, !tbaa !9
  %85 = load i32, ptr %8, align 4, !tbaa !5
  call void @LineDemo_setNumFrames(ptr noundef %84, i32 noundef %85)
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #7
  %86 = call { i64, i64 } @gettime()
  %87 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %88 = extractvalue { i64, i64 } %86, 0
  store i64 %88, ptr %87, align 8
  %89 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %90 = extractvalue { i64, i64 } %86, 1
  store i64 %90, ptr %89, align 8
  %91 = load i8, ptr %7, align 1, !tbaa !11, !range !16, !noundef !17
  %92 = trunc i8 %91 to i1
  br i1 %92, label %93, label %97

93:                                               ; preds = %78
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = load ptr, ptr %5, align 8, !tbaa !9
  %96 = load ptr, ptr %12, align 8, !tbaa !9
  call void @graphicMain(i32 noundef %94, ptr noundef %95, ptr noundef %96, i1 noundef zeroext false)
  br label %99

97:                                               ; preds = %78
  %98 = load ptr, ptr %12, align 8, !tbaa !9
  call void @lineMain(ptr noundef %98)
  br label %99

99:                                               ; preds = %97, %93
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  %100 = call { i64, i64 } @gettime()
  %101 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %102 = extractvalue { i64, i64 } %100, 0
  store i64 %102, ptr %101, align 8
  %103 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %104 = extractvalue { i64, i64 } %100, 1
  store i64 %104, ptr %103, align 8
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %106 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %107 = load i64, ptr %106, align 8
  %108 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %109 = load i64, ptr %108, align 8
  %110 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %111 = load i64, ptr %110, align 8
  %112 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %113 = load i64, ptr %112, align 8
  %114 = call double @tdiff(i64 %107, i64 %109, i64 %111, i64 %113)
  %115 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, double noundef %114)
  %116 = load ptr, ptr %12, align 8, !tbaa !9
  %117 = call i32 @LineDemo_getNumLineWallCollisions(ptr noundef %116)
  %118 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %117)
  %119 = load ptr, ptr %12, align 8, !tbaa !9
  %120 = call i32 @LineDemo_getNumLineLineCollisions(ptr noundef %119)
  %121 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %120)
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  %123 = load ptr, ptr %12, align 8, !tbaa !9
  call void @LineDemo_delete(ptr noundef %123)
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  ret i32 0
}

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

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) #2

declare i32 @printf(ptr noundef, ...) #3

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #5

declare ptr @LineDemo_new(...) #3

declare void @LineDemo_setInputFile(ptr noundef) #3

declare void @LineDemo_initLine(ptr noundef) #3

declare void @LineDemo_setNumFrames(ptr noundef, i32 noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden { i64, i64 } @gettime() #6

declare void @graphicMain(i32 noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden double @tdiff(i64, i64, i64, i64) #6

declare i32 @LineDemo_getNumLineWallCollisions(ptr noundef) #3

declare i32 @LineDemo_getNumLineLineCollisions(ptr noundef) #3

declare void @LineDemo_delete(ptr noundef) #3

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { "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 = { noreturn 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 = { inlinehint nounwind willreturn memory(read) 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 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 = { nounwind }
attributes #8 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i8 0, i8 2}
!17 = !{}


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

@DEFAULT_INPUT_FILE_PATH = external dso_local local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1
@optind = external local_unnamed_addr global i32, align 4
@.str.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@input_file_path = external dso_local local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @lineMain(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  br label %.outer.outer

.outer.outer:                                     ; preds = %3, %2
  %.0.ph.ph = phi i1 [ false, %2 ], [ true, %3 ]
  br label %.outer

.outer:                                           ; preds = %.outer.outer, %.loopexit.sink.split
  br label %3

3:                                                ; preds = %.outer, %5
  %4 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.1) #7
  switch i32 %4, label %5 [
    i32 -1, label %8
    i32 103, label %.outer.outer
    i32 117, label %.loopexit.sink.split
    i32 111, label %.loopexit.sink.split.loopexit42
  ], !llvm.loop !5

5:                                                ; preds = %3
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %4)
  br label %3, !llvm.loop !5

.loopexit.sink.split.loopexit42:                  ; preds = %3
  br label %.loopexit.sink.split

.loopexit.sink.split:                             ; preds = %3, %.loopexit.sink.split.loopexit42
  %.str.3.sink = phi ptr [ @.str.3, %.loopexit.sink.split.loopexit42 ], [ @.str.2, %3 ]
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
  br label %.outer, !llvm.loop !5

8:                                                ; preds = %3
  %9 = load i32, ptr @optind, align 4, !tbaa !7
  %10 = sub nsw i32 %0, %9
  %.not3234 = icmp slt i32 %10, 1
  br i1 %.not3234, label %._crit_edge.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %8
  %invariant.gep = getelementptr i8, ptr %1, i64 -8
  %11 = sext i32 %9 to i64
  %12 = add i32 %0, 1
  %13 = sub i32 %12, %9
  %wide.trip.count = zext i32 %13 to i64
  %invariant.gep38 = getelementptr ptr, ptr %invariant.gep, i64 %11
  %14 = add nsw i64 %wide.trip.count, -1
  %min.iters.check = icmp ult i64 %14, 8
  br i1 %min.iters.check, label %.lr.ph.preheader41, label %vector.memcheck

.lr.ph.preheader41:                               ; preds = %middle.block, %vector.memcheck, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 1, %vector.memcheck ], [ 1, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  %15 = sub nsw i64 %wide.trip.count, %indvars.iv.ph
  %xtraiter = and i64 %15, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader41, %.lr.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.lr.ph.prol ], [ %indvars.iv.ph, %.lr.ph.preheader41 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader41 ]
  %gep39.prol = getelementptr ptr, ptr %invariant.gep38, i64 %indvars.iv.prol
  %16 = load ptr, ptr %gep39.prol, align 8, !tbaa !11
  %17 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv.prol
  store ptr %16, ptr %17, align 8, !tbaa !11
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !13

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader41
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.preheader41 ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %18 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %19 = icmp ugt i64 %18, -4
  br i1 %19, label %._crit_edge, label %.lr.ph

vector.memcheck:                                  ; preds = %.lr.ph.preheader
  %20 = shl nsw i64 %11, 3
  %21 = add nsw i64 %20, 23
  %diff.check = icmp ult i64 %21, 32
  br i1 %diff.check, label %.lr.ph.preheader41, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %14, -4
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %22 = getelementptr ptr, ptr %invariant.gep38, i64 %offset.idx
  %23 = getelementptr i8, ptr %22, i64 16
  %wide.load = load <2 x ptr>, ptr %22, align 8, !tbaa !11
  %wide.load40 = load <2 x ptr>, ptr %23, align 8, !tbaa !11
  %24 = getelementptr inbounds ptr, ptr %1, i64 %offset.idx
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  store <2 x ptr> %wide.load, ptr %24, align 8, !tbaa !11
  store <2 x ptr> %wide.load40, ptr %25, align 8, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %26 = icmp eq i64 %index.next, %n.vec
  br i1 %26, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %14, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader41

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block
  br i1 %.not3234, label %._crit_edge.thread, label %38

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %gep39 = getelementptr ptr, ptr %invariant.gep38, i64 %indvars.iv
  %27 = load ptr, ptr %gep39, align 8, !tbaa !11
  %28 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv
  store ptr %27, ptr %28, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %gep39.1 = getelementptr ptr, ptr %invariant.gep38, i64 %indvars.iv.next
  %29 = load ptr, ptr %gep39.1, align 8, !tbaa !11
  %30 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv.next
  store ptr %29, ptr %30, align 8, !tbaa !11
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %gep39.2 = getelementptr ptr, ptr %invariant.gep38, i64 %indvars.iv.next.1
  %31 = load ptr, ptr %gep39.2, align 8, !tbaa !11
  %32 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv.next.1
  store ptr %31, ptr %32, align 8, !tbaa !11
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %gep39.3 = getelementptr ptr, ptr %invariant.gep38, i64 %indvars.iv.next.2
  %33 = load ptr, ptr %gep39.3, align 8, !tbaa !11
  %34 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv.next.2
  store ptr %33, ptr %34, align 8, !tbaa !11
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %.lr.ph, !llvm.loop !18

._crit_edge.thread:                               ; preds = %8, %._crit_edge
  %35 = load ptr, ptr %1, align 8, !tbaa !11
  %36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef %35)
  %37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  tail call void @exit(i32 noundef -1) #8
  unreachable

38:                                               ; preds = %._crit_edge
  %39 = getelementptr inbounds i8, ptr %1, i64 8
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = tail call i32 @atoi(ptr nocapture noundef %40) #9
  %.not33 = icmp eq i32 %10, 1
  %42 = getelementptr inbounds i8, ptr %1, i64 16
  %storemerge.in = select i1 %.not33, ptr @DEFAULT_INPUT_FILE_PATH, ptr %42
  %storemerge = load ptr, ptr %storemerge.in, align 8, !tbaa !11
  store ptr %storemerge, ptr @input_file_path, align 8, !tbaa !11
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef %storemerge)
  %44 = tail call ptr (...) @LineDemo_new() #7
  %45 = load ptr, ptr @input_file_path, align 8, !tbaa !11
  tail call void @LineDemo_setInputFile(ptr noundef %45) #7
  tail call void @LineDemo_initLine(ptr noundef %44) #7
  tail call void @LineDemo_setNumFrames(ptr noundef %44, i32 noundef %41) #7
  %46 = tail call { i64, i64 } @gettime()
  br i1 %.0.ph.ph, label %47, label %48

47:                                               ; preds = %38
  tail call void @graphicMain(i32 noundef %0, ptr noundef nonnull %1, ptr noundef %44, i1 noundef zeroext false) #7
  br label %49

48:                                               ; preds = %38
  tail call void @lineMain(ptr noundef %44)
  br label %49

49:                                               ; preds = %48, %47
  %50 = extractvalue { i64, i64 } %46, 1
  %51 = extractvalue { i64, i64 } %46, 0
  %52 = tail call { i64, i64 } @gettime()
  %53 = extractvalue { i64, i64 } %52, 0
  %54 = extractvalue { i64, i64 } %52, 1
  %55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %56 = tail call double @tdiff(i64 %51, i64 %50, i64 %53, i64 %54)
  %57 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, double noundef %56)
  %58 = tail call i32 @LineDemo_getNumLineWallCollisions(ptr noundef %44) #7
  %59 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %58)
  %60 = tail call i32 @LineDemo_getNumLineLineCollisions(ptr noundef %44) #7
  %61 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %60)
  %62 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  tail call void @LineDemo_delete(ptr noundef %44) #7
  ret i32 0
}

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #4

declare ptr @LineDemo_new(...) local_unnamed_addr #5

declare void @LineDemo_setInputFile(ptr noundef) local_unnamed_addr #5

declare void @LineDemo_initLine(ptr noundef) local_unnamed_addr #5

declare void @LineDemo_setNumFrames(ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden { i64, i64 } @gettime() local_unnamed_addr #6

declare void @graphicMain(i32 noundef, ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden double @tdiff(i64, i64, i64, i64) local_unnamed_addr #6

declare i32 @LineDemo_getNumLineWallCollisions(ptr noundef) local_unnamed_addr #5

declare i32 @LineDemo_getNumLineLineCollisions(ptr noundef) local_unnamed_addr #5

declare void @LineDemo_delete(ptr noundef) local_unnamed_addr #5

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { noreturn 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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 #5 = { "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 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 = { nounwind }
attributes #8 = { noreturn 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !9, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !6, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !6, !16}


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