; LLVM IR from Dovyski/opengl-demos :: libs/glm-0.9.9.3/test/core/core_func_integer_bit_count.ll (Z4pop5j)

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z7rotatelji(i32 noundef, i32 noundef) #0

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

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

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

6:                                                ; preds = %15, %1
  %7 = load i32, ptr %3, align 4, !tbaa !5
  %8 = icmp sle i32 %7, 31
  br i1 %8, label %9, label %18

9:                                                ; preds = %6
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = call noundef i32 @_Z7rotatelji(i32 noundef %10, i32 noundef 1)
  store i32 %11, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr %4, align 4, !tbaa !5
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = add i32 %12, %13
  store i32 %14, ptr %4, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %9
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = add nsw i32 %16, 1
  store i32 %17, ptr %3, align 4, !tbaa !5
  br label %6, !llvm.loop !9

18:                                               ; preds = %6
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = sub nsw i32 0, %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret i32 %20
}

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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"

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z7rotatelji(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -2147483647, -2147483648) i32 @_Z4pop5j(i32 noundef %0) local_unnamed_addr #0 {
  %2 = tail call noundef i32 @_Z7rotatelji(i32 noundef %0, i32 noundef 1)
  %3 = add i32 %2, %0
  %4 = tail call noundef i32 @_Z7rotatelji(i32 noundef %2, i32 noundef 1)
  %5 = add i32 %4, %3
  %6 = tail call noundef i32 @_Z7rotatelji(i32 noundef %4, i32 noundef 1)
  %7 = add i32 %6, %5
  %8 = tail call noundef i32 @_Z7rotatelji(i32 noundef %6, i32 noundef 1)
  %9 = add i32 %8, %7
  %10 = tail call noundef i32 @_Z7rotatelji(i32 noundef %8, i32 noundef 1)
  %11 = add i32 %10, %9
  %12 = tail call noundef i32 @_Z7rotatelji(i32 noundef %10, i32 noundef 1)
  %13 = add i32 %12, %11
  %14 = tail call noundef i32 @_Z7rotatelji(i32 noundef %12, i32 noundef 1)
  %15 = add i32 %14, %13
  %16 = tail call noundef i32 @_Z7rotatelji(i32 noundef %14, i32 noundef 1)
  %17 = add i32 %16, %15
  %18 = tail call noundef i32 @_Z7rotatelji(i32 noundef %16, i32 noundef 1)
  %19 = add i32 %18, %17
  %20 = tail call noundef i32 @_Z7rotatelji(i32 noundef %18, i32 noundef 1)
  %21 = add i32 %20, %19
  %22 = tail call noundef i32 @_Z7rotatelji(i32 noundef %20, i32 noundef 1)
  %23 = add i32 %22, %21
  %24 = tail call noundef i32 @_Z7rotatelji(i32 noundef %22, i32 noundef 1)
  %25 = add i32 %24, %23
  %26 = tail call noundef i32 @_Z7rotatelji(i32 noundef %24, i32 noundef 1)
  %27 = add i32 %26, %25
  %28 = tail call noundef i32 @_Z7rotatelji(i32 noundef %26, i32 noundef 1)
  %29 = add i32 %28, %27
  %30 = tail call noundef i32 @_Z7rotatelji(i32 noundef %28, i32 noundef 1)
  %31 = add i32 %30, %29
  %32 = tail call noundef i32 @_Z7rotatelji(i32 noundef %30, i32 noundef 1)
  %33 = add i32 %32, %31
  %34 = tail call noundef i32 @_Z7rotatelji(i32 noundef %32, i32 noundef 1)
  %35 = add i32 %34, %33
  %36 = tail call noundef i32 @_Z7rotatelji(i32 noundef %34, i32 noundef 1)
  %37 = add i32 %36, %35
  %38 = tail call noundef i32 @_Z7rotatelji(i32 noundef %36, i32 noundef 1)
  %39 = add i32 %38, %37
  %40 = tail call noundef i32 @_Z7rotatelji(i32 noundef %38, i32 noundef 1)
  %41 = add i32 %40, %39
  %42 = tail call noundef i32 @_Z7rotatelji(i32 noundef %40, i32 noundef 1)
  %43 = add i32 %42, %41
  %44 = tail call noundef i32 @_Z7rotatelji(i32 noundef %42, i32 noundef 1)
  %45 = add i32 %44, %43
  %46 = tail call noundef i32 @_Z7rotatelji(i32 noundef %44, i32 noundef 1)
  %47 = add i32 %46, %45
  %48 = tail call noundef i32 @_Z7rotatelji(i32 noundef %46, i32 noundef 1)
  %49 = add i32 %48, %47
  %50 = tail call noundef i32 @_Z7rotatelji(i32 noundef %48, i32 noundef 1)
  %51 = add i32 %50, %49
  %52 = tail call noundef i32 @_Z7rotatelji(i32 noundef %50, i32 noundef 1)
  %53 = add i32 %52, %51
  %54 = tail call noundef i32 @_Z7rotatelji(i32 noundef %52, i32 noundef 1)
  %55 = add i32 %54, %53
  %56 = tail call noundef i32 @_Z7rotatelji(i32 noundef %54, i32 noundef 1)
  %57 = add i32 %56, %55
  %58 = tail call noundef i32 @_Z7rotatelji(i32 noundef %56, i32 noundef 1)
  %59 = add i32 %58, %57
  %60 = tail call noundef i32 @_Z7rotatelji(i32 noundef %58, i32 noundef 1)
  %61 = add i32 %60, %59
  %62 = tail call noundef i32 @_Z7rotatelji(i32 noundef %60, i32 noundef 1)
  %63 = add i32 %62, %61
  %64 = sub nsw i32 0, %63
  ret i32 %64
}

attributes #0 = { 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,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass