; LLVM IR from jpvt/Computer_Graphics :: Assignment #3/third_party/glm/test/ext/ext_scalar_integer.ll (ZN12nextMultiple4perfEv)

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

@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12nextMultiple17perf_nextMultipleEj(i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12nextMultiple20perf_nextMultipleModEj(i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12nextMultiple20perf_nextMultipleNegEj(i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12nextMultiple23perf_nextMultipleUFloatEj(i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12nextMultiple22perf_nextMultipleFloatEj(i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN12nextMultiple4perfEv() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 10000, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %4

4:                                                ; preds = %27, %0
  %5 = load i32, ptr %3, align 4, !tbaa !5
  %6 = icmp slt i32 %5, 4
  br i1 %6, label %8, label %7

7:                                                ; preds = %4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %30

8:                                                ; preds = %4
  %9 = load i32, ptr %3, align 4, !tbaa !5
  %10 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %9)
  %11 = call noundef i32 @_ZN12nextMultiple17perf_nextMultipleEj(i32 noundef 10000)
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = add nsw i32 %12, %11
  store i32 %13, ptr %1, align 4, !tbaa !5
  %14 = call noundef i32 @_ZN12nextMultiple20perf_nextMultipleModEj(i32 noundef 10000)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = add nsw i32 %15, %14
  store i32 %16, ptr %1, align 4, !tbaa !5
  %17 = call noundef i32 @_ZN12nextMultiple20perf_nextMultipleNegEj(i32 noundef 10000)
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = add nsw i32 %18, %17
  store i32 %19, ptr %1, align 4, !tbaa !5
  %20 = call noundef i32 @_ZN12nextMultiple23perf_nextMultipleUFloatEj(i32 noundef 10000)
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = add nsw i32 %21, %20
  store i32 %22, ptr %1, align 4, !tbaa !5
  %23 = call noundef i32 @_ZN12nextMultiple22perf_nextMultipleFloatEj(i32 noundef 10000)
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = add nsw i32 %24, %23
  store i32 %25, ptr %1, align 4, !tbaa !5
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  br label %27

27:                                               ; preds = %8
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %3, align 4, !tbaa !5
  br label %4, !llvm.loop !9

30:                                               ; preds = %7
  %31 = load i32, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  ret i32 %31
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"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"

@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12nextMultiple17perf_nextMultipleEj(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12nextMultiple20perf_nextMultipleModEj(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12nextMultiple20perf_nextMultipleNegEj(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12nextMultiple23perf_nextMultipleUFloatEj(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12nextMultiple22perf_nextMultipleFloatEj(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN12nextMultiple4perfEv() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 0)
  %2 = tail call noundef i32 @_ZN12nextMultiple17perf_nextMultipleEj(i32 noundef 10000)
  %3 = tail call noundef i32 @_ZN12nextMultiple20perf_nextMultipleModEj(i32 noundef 10000)
  %4 = add nsw i32 %2, %3
  %5 = tail call noundef i32 @_ZN12nextMultiple20perf_nextMultipleNegEj(i32 noundef 10000)
  %6 = add nsw i32 %4, %5
  %7 = tail call noundef i32 @_ZN12nextMultiple23perf_nextMultipleUFloatEj(i32 noundef 10000)
  %8 = add nsw i32 %6, %7
  %9 = tail call noundef i32 @_ZN12nextMultiple22perf_nextMultipleFloatEj(i32 noundef 10000)
  %10 = add nsw i32 %8, %9
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 1)
  %13 = tail call noundef i32 @_ZN12nextMultiple17perf_nextMultipleEj(i32 noundef 10000)
  %14 = add nsw i32 %13, %10
  %15 = tail call noundef i32 @_ZN12nextMultiple20perf_nextMultipleModEj(i32 noundef 10000)
  %16 = add nsw i32 %14, %15
  %17 = tail call noundef i32 @_ZN12nextMultiple20perf_nextMultipleNegEj(i32 noundef 10000)
  %18 = add nsw i32 %16, %17
  %19 = tail call noundef i32 @_ZN12nextMultiple23perf_nextMultipleUFloatEj(i32 noundef 10000)
  %20 = add nsw i32 %18, %19
  %21 = tail call noundef i32 @_ZN12nextMultiple22perf_nextMultipleFloatEj(i32 noundef 10000)
  %22 = add nsw i32 %20, %21
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 2)
  %25 = tail call noundef i32 @_ZN12nextMultiple17perf_nextMultipleEj(i32 noundef 10000)
  %26 = add nsw i32 %25, %22
  %27 = tail call noundef i32 @_ZN12nextMultiple20perf_nextMultipleModEj(i32 noundef 10000)
  %28 = add nsw i32 %26, %27
  %29 = tail call noundef i32 @_ZN12nextMultiple20perf_nextMultipleNegEj(i32 noundef 10000)
  %30 = add nsw i32 %28, %29
  %31 = tail call noundef i32 @_ZN12nextMultiple23perf_nextMultipleUFloatEj(i32 noundef 10000)
  %32 = add nsw i32 %30, %31
  %33 = tail call noundef i32 @_ZN12nextMultiple22perf_nextMultipleFloatEj(i32 noundef 10000)
  %34 = add nsw i32 %32, %33
  %35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef 3)
  %37 = tail call noundef i32 @_ZN12nextMultiple17perf_nextMultipleEj(i32 noundef 10000)
  %38 = add nsw i32 %37, %34
  %39 = tail call noundef i32 @_ZN12nextMultiple20perf_nextMultipleModEj(i32 noundef 10000)
  %40 = add nsw i32 %38, %39
  %41 = tail call noundef i32 @_ZN12nextMultiple20perf_nextMultipleNegEj(i32 noundef 10000)
  %42 = add nsw i32 %40, %41
  %43 = tail call noundef i32 @_ZN12nextMultiple23perf_nextMultipleUFloatEj(i32 noundef 10000)
  %44 = add nsw i32 %42, %43
  %45 = tail call noundef i32 @_ZN12nextMultiple22perf_nextMultipleFloatEj(i32 noundef 10000)
  %46 = add nsw i32 %44, %45
  %47 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  ret i32 %46
}

attributes #0 = { 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 #1 = { 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" }

!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)"}


; Effective O3 passes: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass