; LLVM IR from tezc/sc :: timer (timer_test)

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

@.str.1 = external hidden unnamed_addr constant [60 x i8], align 1
@count = external dso_local global i32, align 4
@ids = external dso_local global [1000 x i64], align 16
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [27 x i8], align 1
@__PRETTY_FUNCTION__.test2 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @time_ms() #0

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @sleep_ms(i64 noundef) #0

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

declare void @sc_timer_init(ptr noundef, i64 noundef) #3

declare i64 @sc_timer_add(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @rand() #4

declare i64 @sc_timer_timeout(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

declare void @sc_timer_term(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @test2() #0 {
  %1 = alloca %struct.sc_timer, align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr %1) #5
  %8 = call i64 @time_ms()
  call void @sc_timer_init(ptr noundef %1, i64 noundef %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %26, %0
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = icmp slt i32 %10, 1000
  br i1 %11, label %13, label %12

12:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %29

13:                                               ; preds = %9
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %15
  store i64 -1, ptr %16, align 8, !tbaa !9
  %17 = call i32 @rand() #5
  %18 = srem i32 %17, 100
  %19 = sext i32 %18 to i64
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = inttoptr i64 %23 to ptr
  %25 = call i64 @sc_timer_add(ptr noundef %1, i64 noundef %19, i64 noundef %21, ptr noundef %24)
  br label %26

26:                                               ; preds = %13
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %2, align 4, !tbaa !5
  br label %9, !llvm.loop !11

29:                                               ; preds = %12
  call void @sc_timer_clear(ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 10000, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  br label %30

30:                                               ; preds = %39, %29
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %33, label %45

33:                                               ; preds = %30
  %34 = call i64 @time_ms()
  %35 = call i64 @sc_timer_timeout(ptr noundef %1, i64 noundef %34, ptr noundef inttoptr (i64 333 to ptr), ptr noundef @callback)
  store i64 %35, ptr %4, align 8, !tbaa !9
  %36 = load i32, ptr @count, align 4, !tbaa !5
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %33
  br label %45

39:                                               ; preds = %33
  %40 = load i64, ptr %4, align 8, !tbaa !9
  %41 = trunc i64 %40 to i32
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sub nsw i32 %42, %41
  store i32 %43, ptr %3, align 4, !tbaa !5
  %44 = load i64, ptr %4, align 8, !tbaa !9
  call void @sleep_ms(i64 noundef %44)
  br label %30, !llvm.loop !13

45:                                               ; preds = %38, %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %59, %45
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = icmp slt i32 %47, 1000
  br i1 %48, label %50, label %49

49:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %62

50:                                               ; preds = %46
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !9
  %55 = icmp eq i64 %54, -1
  br i1 %55, label %56, label %57

56:                                               ; preds = %50
  br label %58

57:                                               ; preds = %50
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 161, ptr noundef @__PRETTY_FUNCTION__.test2) #6
  unreachable

58:                                               ; preds = %56
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %5, align 4, !tbaa !5
  br label %46, !llvm.loop !14

62:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %90, %62
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = icmp slt i32 %64, 1000
  br i1 %65, label %67, label %66

66:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %93

67:                                               ; preds = %63
  %68 = call i32 @rand() #5
  %69 = srem i32 %68, 100
  %70 = sext i32 %69 to i64
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = inttoptr i64 %74 to ptr
  %76 = call i64 @sc_timer_add(ptr noundef %1, i64 noundef %70, i64 noundef %72, ptr noundef %75)
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %78
  store i64 %76, ptr %79, align 8, !tbaa !9
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !9
  %84 = icmp ne i64 %83, -1
  br i1 %84, label %85, label %86

85:                                               ; preds = %67
  br label %87

86:                                               ; preds = %67
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 167, ptr noundef @__PRETTY_FUNCTION__.test2) #6
  unreachable

87:                                               ; preds = %85
  %88 = load i32, ptr @count, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr @count, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %87
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %6, align 4, !tbaa !5
  br label %63, !llvm.loop !15

93:                                               ; preds = %66
  store i32 10000, ptr %3, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %103, %93
  %95 = load i32, ptr %3, align 4, !tbaa !5
  %96 = icmp sgt i32 %95, 0
  br i1 %96, label %97, label %109

97:                                               ; preds = %94
  %98 = call i64 @time_ms()
  %99 = call i64 @sc_timer_timeout(ptr noundef %1, i64 noundef %98, ptr noundef inttoptr (i64 333 to ptr), ptr noundef @callback)
  store i64 %99, ptr %4, align 8, !tbaa !9
  %100 = load i32, ptr @count, align 4, !tbaa !5
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %102, label %103

102:                                              ; preds = %97
  br label %109

103:                                              ; preds = %97
  %104 = load i64, ptr %4, align 8, !tbaa !9
  %105 = trunc i64 %104 to i32
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = sub nsw i32 %106, %105
  store i32 %107, ptr %3, align 4, !tbaa !5
  %108 = load i64, ptr %4, align 8, !tbaa !9
  call void @sleep_ms(i64 noundef %108)
  br label %94, !llvm.loop !16

109:                                              ; preds = %102, %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %123, %109
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = icmp slt i32 %111, 1000
  br i1 %112, label %114, label %113

113:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %126

114:                                              ; preds = %110
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !9
  %119 = icmp eq i64 %118, -1
  br i1 %119, label %120, label %121

120:                                              ; preds = %114
  br label %122

121:                                              ; preds = %114
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 183, ptr noundef @__PRETTY_FUNCTION__.test2) #6
  unreachable

122:                                              ; preds = %120
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %7, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %7, align 4, !tbaa !5
  br label %110, !llvm.loop !17

126:                                              ; preds = %113
  call void @sc_timer_term(ptr noundef %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %1) #5
  ret void
}

declare void @sc_timer_clear(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 = { 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 #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 = { 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 = { nounwind }
attributes #6 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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

%struct.sc_timer = type { i64, i32, i32, ptr }

@.str.1 = external hidden unnamed_addr constant [60 x i8], align 1
@count = external dso_local local_unnamed_addr global i32, align 4
@ids = external dso_local local_unnamed_addr global [1000 x i64], align 16
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [27 x i8], align 1
@__PRETTY_FUNCTION__.test2 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @time_ms() local_unnamed_addr #0

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

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

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

declare void @sc_timer_init(ptr noundef, i64 noundef) local_unnamed_addr #3

declare i64 @sc_timer_add(ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #4

declare i64 @sc_timer_timeout(ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @sc_timer_term(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @test2() local_unnamed_addr #0 {
  %1 = alloca %struct.sc_timer, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #5
  %2 = tail call i64 @time_ms()
  call void @sc_timer_init(ptr noundef nonnull %1, i64 noundef %2) #5
  br label %4

3:                                                ; preds = %4
  call void @sc_timer_clear(ptr noundef nonnull %1) #5
  br label %11

4:                                                ; preds = %0, %4
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %4 ]
  %5 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %indvars.iv
  store i64 -1, ptr %5, align 8, !tbaa !5
  %6 = call i32 @rand() #5
  %7 = srem i32 %6, 100
  %8 = sext i32 %7 to i64
  %9 = inttoptr i64 %indvars.iv to ptr
  %10 = call i64 @sc_timer_add(ptr noundef nonnull %1, i64 noundef %8, i64 noundef %indvars.iv, ptr noundef %9) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 1000
  br i1 %exitcond.not, label %3, label %4, !llvm.loop !9

11:                                               ; preds = %3, %16
  %.02731 = phi i32 [ 10000, %3 ], [ %18, %16 ]
  %12 = call i64 @time_ms()
  %13 = call i64 @sc_timer_timeout(ptr noundef nonnull %1, i64 noundef %12, ptr noundef nonnull inttoptr (i64 333 to ptr), ptr noundef nonnull @callback) #5
  %14 = load i32, ptr @count, align 4, !tbaa !11
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %.preheader50, label %16

16:                                               ; preds = %11
  %17 = trunc i64 %13 to i32
  %18 = sub nsw i32 %.02731, %17
  call void @sleep_ms(i64 noundef %13)
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %11, label %.preheader50, !llvm.loop !13

.preheader50:                                     ; preds = %11, %16
  br label %37

20:                                               ; preds = %37
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %21 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %indvars.iv.next38
  %22 = load i64, ptr %21, align 8, !tbaa !5
  %23 = icmp eq i64 %22, -1
  br i1 %23, label %24, label %41

24:                                               ; preds = %20
  %indvars.iv.next38.1 = add nuw nsw i64 %indvars.iv37, 2
  %25 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %indvars.iv.next38.1
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = icmp eq i64 %26, -1
  br i1 %27, label %28, label %41

28:                                               ; preds = %24
  %indvars.iv.next38.2 = add nuw nsw i64 %indvars.iv37, 3
  %29 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %indvars.iv.next38.2
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = icmp eq i64 %30, -1
  br i1 %31, label %32, label %41

32:                                               ; preds = %28
  %indvars.iv.next38.3 = add nuw nsw i64 %indvars.iv37, 4
  %33 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %indvars.iv.next38.3
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = icmp eq i64 %34, -1
  br i1 %35, label %36, label %41

36:                                               ; preds = %32
  %indvars.iv.next38.4 = add nuw nsw i64 %indvars.iv37, 5
  %exitcond40.not.4 = icmp eq i64 %indvars.iv.next38.4, 1000
  br i1 %exitcond40.not.4, label %.preheader29, label %37, !llvm.loop !14

37:                                               ; preds = %36, %.preheader50
  %indvars.iv37 = phi i64 [ 0, %.preheader50 ], [ %indvars.iv.next38.4, %36 ]
  %38 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %indvars.iv37
  %39 = load i64, ptr %38, align 8, !tbaa !5
  %40 = icmp eq i64 %39, -1
  br i1 %40, label %20, label %41

41:                                               ; preds = %32, %28, %24, %20, %37
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 161, ptr noundef nonnull @__PRETTY_FUNCTION__.test2) #6
  unreachable

.preheader29:                                     ; preds = %36, %49
  %indvars.iv41 = phi i64 [ %indvars.iv.next42, %49 ], [ 0, %36 ]
  %42 = call i32 @rand() #5
  %43 = srem i32 %42, 100
  %44 = sext i32 %43 to i64
  %45 = inttoptr i64 %indvars.iv41 to ptr
  %46 = call i64 @sc_timer_add(ptr noundef nonnull %1, i64 noundef %44, i64 noundef %indvars.iv41, ptr noundef %45) #5
  %47 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %indvars.iv41
  store i64 %46, ptr %47, align 8, !tbaa !5
  %.not = icmp eq i64 %46, -1
  br i1 %.not, label %48, label %49

48:                                               ; preds = %.preheader29
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 167, ptr noundef nonnull @__PRETTY_FUNCTION__.test2) #6
  unreachable

49:                                               ; preds = %.preheader29
  %50 = load i32, ptr @count, align 4, !tbaa !11
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr @count, align 4, !tbaa !11
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %exitcond44.not = icmp eq i64 %indvars.iv.next42, 1000
  br i1 %exitcond44.not, label %.preheader, label %.preheader29, !llvm.loop !15

.preheader:                                       ; preds = %49, %56
  %.134 = phi i32 [ %58, %56 ], [ 10000, %49 ]
  %52 = call i64 @time_ms()
  %53 = call i64 @sc_timer_timeout(ptr noundef nonnull %1, i64 noundef %52, ptr noundef nonnull inttoptr (i64 333 to ptr), ptr noundef nonnull @callback) #5
  %54 = load i32, ptr @count, align 4, !tbaa !11
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %.preheader49, label %56

56:                                               ; preds = %.preheader
  %57 = trunc i64 %53 to i32
  %58 = sub nsw i32 %.134, %57
  call void @sleep_ms(i64 noundef %53)
  %59 = icmp sgt i32 %58, 0
  br i1 %59, label %.preheader, label %.preheader49, !llvm.loop !16

.preheader49:                                     ; preds = %.preheader, %56
  br label %78

60:                                               ; preds = %78
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %61 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %indvars.iv.next46
  %62 = load i64, ptr %61, align 8, !tbaa !5
  %63 = icmp eq i64 %62, -1
  br i1 %63, label %64, label %82

64:                                               ; preds = %60
  %indvars.iv.next46.1 = add nuw nsw i64 %indvars.iv45, 2
  %65 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %indvars.iv.next46.1
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = icmp eq i64 %66, -1
  br i1 %67, label %68, label %82

68:                                               ; preds = %64
  %indvars.iv.next46.2 = add nuw nsw i64 %indvars.iv45, 3
  %69 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %indvars.iv.next46.2
  %70 = load i64, ptr %69, align 8, !tbaa !5
  %71 = icmp eq i64 %70, -1
  br i1 %71, label %72, label %82

72:                                               ; preds = %68
  %indvars.iv.next46.3 = add nuw nsw i64 %indvars.iv45, 4
  %73 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %indvars.iv.next46.3
  %74 = load i64, ptr %73, align 8, !tbaa !5
  %75 = icmp eq i64 %74, -1
  br i1 %75, label %76, label %82

76:                                               ; preds = %72
  %indvars.iv.next46.4 = add nuw nsw i64 %indvars.iv45, 5
  %exitcond48.not.4 = icmp eq i64 %indvars.iv.next46.4, 1000
  br i1 %exitcond48.not.4, label %77, label %78, !llvm.loop !17

77:                                               ; preds = %76
  call void @sc_timer_term(ptr noundef nonnull %1) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #5
  ret void

78:                                               ; preds = %76, %.preheader49
  %indvars.iv45 = phi i64 [ 0, %.preheader49 ], [ %indvars.iv.next46.4, %76 ]
  %79 = getelementptr inbounds [1000 x i64], ptr @ids, i64 0, i64 %indvars.iv45
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = icmp eq i64 %80, -1
  br i1 %81, label %60, label %82

82:                                               ; preds = %72, %68, %64, %60, %78
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 183, ptr noundef nonnull @__PRETTY_FUNCTION__.test2) #6
  unreachable
}

declare void @sc_timer_clear(ptr noundef) local_unnamed_addr #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 = { nounwind }
attributes #6 = { noreturn 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass