; LLVM IR from aap/librw :: src/ps2/ps2raster.ll (ZN2rw3ps29printTEX0Em)

; 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.9 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [90 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw3ps29printTEX0Em(i64 noundef %0) #1 {
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i64 %0, ptr %2, align 8, !tbaa !5
  %15 = load i64, ptr %2, align 8, !tbaa !5
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i64 noundef %15)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %17 = load i64, ptr %2, align 8, !tbaa !5
  %18 = and i64 %17, 16383
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr %3, align 4, !tbaa !9
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = lshr i64 %20, 14
  store i64 %21, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %22 = load i64, ptr %2, align 8, !tbaa !5
  %23 = and i64 %22, 63
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %4, align 4, !tbaa !9
  %25 = load i64, ptr %2, align 8, !tbaa !5
  %26 = lshr i64 %25, 6
  store i64 %26, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %27 = load i64, ptr %2, align 8, !tbaa !5
  %28 = and i64 %27, 63
  %29 = trunc i64 %28 to i32
  store i32 %29, ptr %5, align 4, !tbaa !9
  %30 = load i64, ptr %2, align 8, !tbaa !5
  %31 = lshr i64 %30, 6
  store i64 %31, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %32 = load i64, ptr %2, align 8, !tbaa !5
  %33 = and i64 %32, 15
  %34 = trunc i64 %33 to i32
  store i32 %34, ptr %6, align 4, !tbaa !9
  %35 = load i64, ptr %2, align 8, !tbaa !5
  %36 = lshr i64 %35, 4
  store i64 %36, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %37 = load i64, ptr %2, align 8, !tbaa !5
  %38 = and i64 %37, 15
  %39 = trunc i64 %38 to i32
  store i32 %39, ptr %7, align 4, !tbaa !9
  %40 = load i64, ptr %2, align 8, !tbaa !5
  %41 = lshr i64 %40, 4
  store i64 %41, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %42 = load i64, ptr %2, align 8, !tbaa !5
  %43 = and i64 %42, 1
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr %8, align 4, !tbaa !9
  %45 = load i64, ptr %2, align 8, !tbaa !5
  %46 = lshr i64 %45, 1
  store i64 %46, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %47 = load i64, ptr %2, align 8, !tbaa !5
  %48 = and i64 %47, 3
  %49 = trunc i64 %48 to i32
  store i32 %49, ptr %9, align 4, !tbaa !9
  %50 = load i64, ptr %2, align 8, !tbaa !5
  %51 = lshr i64 %50, 2
  store i64 %51, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %52 = load i64, ptr %2, align 8, !tbaa !5
  %53 = and i64 %52, 16383
  %54 = trunc i64 %53 to i32
  store i32 %54, ptr %10, align 4, !tbaa !9
  %55 = load i64, ptr %2, align 8, !tbaa !5
  %56 = lshr i64 %55, 14
  store i64 %56, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %57 = load i64, ptr %2, align 8, !tbaa !5
  %58 = and i64 %57, 15
  %59 = trunc i64 %58 to i32
  store i32 %59, ptr %11, align 4, !tbaa !9
  %60 = load i64, ptr %2, align 8, !tbaa !5
  %61 = lshr i64 %60, 4
  store i64 %61, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %62 = load i64, ptr %2, align 8, !tbaa !5
  %63 = and i64 %62, 1
  %64 = trunc i64 %63 to i32
  store i32 %64, ptr %12, align 4, !tbaa !9
  %65 = load i64, ptr %2, align 8, !tbaa !5
  %66 = lshr i64 %65, 1
  store i64 %66, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %67 = load i64, ptr %2, align 8, !tbaa !5
  %68 = and i64 %67, 31
  %69 = trunc i64 %68 to i32
  store i32 %69, ptr %13, align 4, !tbaa !9
  %70 = load i64, ptr %2, align 8, !tbaa !5
  %71 = lshr i64 %70, 5
  store i64 %71, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %72 = load i64, ptr %2, align 8, !tbaa !5
  %73 = and i64 %72, 7
  %74 = trunc i64 %73 to i32
  store i32 %74, ptr %14, align 4, !tbaa !9
  %75 = load i32, ptr %3, align 4, !tbaa !9
  %76 = load i32, ptr %4, align 4, !tbaa !9
  %77 = load i32, ptr %5, align 4, !tbaa !9
  %78 = load i32, ptr %6, align 4, !tbaa !9
  %79 = load i32, ptr %7, align 4, !tbaa !9
  %80 = load i32, ptr %8, align 4, !tbaa !9
  %81 = load i32, ptr %9, align 4, !tbaa !9
  %82 = load i32, ptr %10, align 4, !tbaa !9
  %83 = load i32, ptr %11, align 4, !tbaa !9
  %84 = load i32, ptr %12, align 4, !tbaa !9
  %85 = load i32, ptr %13, align 4, !tbaa !9
  %86 = load i32, ptr %14, align 4, !tbaa !9
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %75, i32 noundef %76, i32 noundef %77, i32 noundef %78, i32 noundef %79, i32 noundef %80, i32 noundef %81, i32 noundef %82, i32 noundef %83, i32 noundef %84, i32 noundef %85, i32 noundef %86)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret void
}

declare i32 @printf(ptr 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 = { "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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"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"

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

; Function Attrs: mustprogress nofree nounwind uwtable
define dso_local void @_ZN2rw3ps29printTEX0Em(i64 noundef %0) local_unnamed_addr #0 {
  %2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i64 noundef %0)
  %3 = trunc i64 %0 to i32
  %4 = and i32 %3, 16383
  %5 = lshr i32 %3, 14
  %6 = and i32 %5, 63
  %7 = lshr i32 %3, 20
  %8 = and i32 %7, 63
  %9 = lshr i32 %3, 26
  %10 = and i32 %9, 15
  %11 = lshr i64 %0, 30
  %12 = trunc i64 %11 to i32
  %13 = and i32 %12, 15
  %14 = lshr i64 %0, 34
  %15 = trunc nuw nsw i64 %14 to i32
  %16 = and i32 %15, 1
  %17 = lshr i64 %0, 35
  %18 = trunc nuw nsw i64 %17 to i32
  %19 = and i32 %18, 3
  %20 = lshr i64 %0, 37
  %21 = trunc nuw nsw i64 %20 to i32
  %22 = and i32 %21, 16383
  %23 = lshr i64 %0, 51
  %24 = trunc nuw nsw i64 %23 to i32
  %25 = and i32 %24, 15
  %26 = lshr i64 %0, 55
  %27 = trunc nuw nsw i64 %26 to i32
  %28 = and i32 %27, 1
  %29 = lshr i64 %0, 56
  %30 = trunc nuw nsw i64 %29 to i32
  %31 = and i32 %30, 31
  %32 = lshr i64 %0, 61
  %33 = trunc nuw nsw i64 %32 to i32
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %4, i32 noundef %6, i32 noundef %8, i32 noundef %10, i32 noundef %13, i32 noundef %16, i32 noundef %19, i32 noundef %22, i32 noundef %25, i32 noundef %28, i32 noundef %31, i32 noundef %33)
  ret void
}

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

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

!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,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass