; LLVM IR from gulrak/filesystem :: test/filesystem_test.ll (ZN5Catch11SimplePcg32clEv)

; 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.Catch::SimplePcg32" = type { i64 }

; 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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5Catch11SimplePcg32clEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %6 = getelementptr inbounds %"class.Catch::SimplePcg32", ptr %5, i32 0, i32 0
  %7 = load i64, ptr %6, align 8, !tbaa !9
  %8 = lshr i64 %7, 18
  %9 = getelementptr inbounds %"class.Catch::SimplePcg32", ptr %5, i32 0, i32 0
  %10 = load i64, ptr %9, align 8, !tbaa !9
  %11 = xor i64 %8, %10
  %12 = lshr i64 %11, 27
  %13 = trunc i64 %12 to i32
  store i32 %13, ptr %3, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %14 = load i32, ptr %3, align 4, !tbaa !12
  %15 = getelementptr inbounds %"class.Catch::SimplePcg32", ptr %5, i32 0, i32 0
  %16 = load i64, ptr %15, align 8, !tbaa !9
  %17 = lshr i64 %16, 59
  %18 = trunc i64 %17 to i32
  %19 = call noundef i32 @_ZN5Catch12_GLOBAL__N_112rotate_rightEjj(i32 noundef %14, i32 noundef %18)
  store i32 %19, ptr %4, align 4, !tbaa !12
  %20 = getelementptr inbounds %"class.Catch::SimplePcg32", ptr %5, i32 0, i32 0
  %21 = load i64, ptr %20, align 8, !tbaa !9
  %22 = mul i64 %21, 6364136223846793005
  %23 = add i64 %22, 2871635795031566573
  %24 = getelementptr inbounds %"class.Catch::SimplePcg32", ptr %5, i32 0, i32 0
  store i64 %23, ptr %24, align 8, !tbaa !9
  %25 = load i32, ptr %4, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret i32 %25
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN5Catch12_GLOBAL__N_112rotate_rightEjj(i32 noundef, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #2 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN5Catch11SimplePcg32E", !11, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}


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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN5Catch11SimplePcg32clEv(ptr nocapture noundef nonnull align 8 dereferenceable(8) %0) local_unnamed_addr #0 align 2 {
  %2 = load i64, ptr %0, align 8, !tbaa !5
  %3 = lshr i64 %2, 45
  %4 = lshr i64 %2, 27
  %5 = xor i64 %3, %4
  %6 = trunc i64 %5 to i32
  %7 = lshr i64 %2, 59
  %8 = trunc nuw nsw i64 %7 to i32
  %9 = tail call noundef i32 @_ZN5Catch12_GLOBAL__N_112rotate_rightEjj(i32 noundef %6, i32 noundef %8)
  %10 = load i64, ptr %0, align 8, !tbaa !5
  %11 = mul i64 %10, 6364136223846793005
  %12 = add i64 %11, 2871635795031566573
  store i64 %12, ptr %0, align 8, !tbaa !5
  ret i32 %9
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN5Catch12_GLOBAL__N_112rotate_rightEjj(i32 noundef, i32 noundef) local_unnamed_addr #0

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

!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, !7, i64 0}
!6 = !{!"_ZTSN5Catch11SimplePcg32E", !7, i64 0}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass