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

; 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.11 = external hidden unnamed_addr constant [49 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
define dso_local void @_ZN2rw3ps29printTEX1Em(i64 noundef %0) #2 {
  %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
  store i64 %0, ptr %2, align 8, !tbaa !5
  %10 = load i64, ptr %2, align 8, !tbaa !5
  %11 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i64 noundef %10)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %12 = load i64, ptr %2, align 8, !tbaa !5
  %13 = and i64 %12, 1
  %14 = trunc i64 %13 to i32
  store i32 %14, ptr %3, align 4, !tbaa !9
  %15 = load i64, ptr %2, align 8, !tbaa !5
  %16 = lshr i64 %15, 2
  store i64 %16, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %17 = load i64, ptr %2, align 8, !tbaa !5
  %18 = and i64 %17, 7
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr %4, align 4, !tbaa !9
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = lshr i64 %20, 3
  store i64 %21, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %22 = load i64, ptr %2, align 8, !tbaa !5
  %23 = and i64 %22, 1
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %5, align 4, !tbaa !9
  %25 = load i64, ptr %2, align 8, !tbaa !5
  %26 = lshr i64 %25, 1
  store i64 %26, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %27 = load i64, ptr %2, align 8, !tbaa !5
  %28 = and i64 %27, 7
  %29 = trunc i64 %28 to i32
  store i32 %29, ptr %6, align 4, !tbaa !9
  %30 = load i64, ptr %2, align 8, !tbaa !5
  %31 = lshr i64 %30, 3
  store i64 %31, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %32 = load i64, ptr %2, align 8, !tbaa !5
  %33 = and i64 %32, 1
  %34 = trunc i64 %33 to i32
  store i32 %34, ptr %7, align 4, !tbaa !9
  %35 = load i64, ptr %2, align 8, !tbaa !5
  %36 = lshr i64 %35, 10
  store i64 %36, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %37 = load i64, ptr %2, align 8, !tbaa !5
  %38 = and i64 %37, 3
  %39 = trunc i64 %38 to i32
  store i32 %39, ptr %8, align 4, !tbaa !9
  %40 = load i64, ptr %2, align 8, !tbaa !5
  %41 = lshr i64 %40, 13
  store i64 %41, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %42 = load i64, ptr %2, align 8, !tbaa !5
  %43 = and i64 %42, 4095
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr %9, align 4, !tbaa !9
  %45 = load i32, ptr %3, align 4, !tbaa !9
  %46 = load i32, ptr %4, align 4, !tbaa !9
  %47 = load i32, ptr %5, align 4, !tbaa !9
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = load i32, ptr %7, align 4, !tbaa !9
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %45, i32 noundef %46, i32 noundef %47, i32 noundef %48, i32 noundef %49, i32 noundef %50, i32 noundef %51)
  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
}

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 = !{!"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.11 = external hidden unnamed_addr constant [49 x i8], align 1

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

; Function Attrs: mustprogress nofree nounwind uwtable
define dso_local void @_ZN2rw3ps29printTEX1Em(i64 noundef %0) local_unnamed_addr #1 {
  %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, 1
  %5 = lshr i32 %3, 2
  %6 = and i32 %5, 7
  %7 = lshr i32 %3, 5
  %8 = and i32 %7, 1
  %9 = lshr i32 %3, 6
  %10 = and i32 %9, 7
  %11 = lshr i32 %3, 9
  %12 = and i32 %11, 1
  %13 = lshr i32 %3, 19
  %14 = and i32 %13, 3
  %15 = lshr i64 %0, 32
  %16 = trunc nuw i64 %15 to i32
  %17 = and i32 %16, 4095
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %4, i32 noundef %6, i32 noundef %8, i32 noundef %10, i32 noundef %12, i32 noundef %14, i32 noundef %17)
  ret void
}

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

!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