; LLVM IR from Stephane-D/SGDK :: sample/bitmap/cube-3D/src (main)

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

%struct.Transformation3D = type { i16, ptr, ptr, %struct.Mat3D_f16, %struct.Mat3D_f16, %struct.Vect3D_f16, %struct.Vect3D_f16 }
%struct.Mat3D_f16 = type { %struct.Vect3D_f16, %struct.Vect3D_f16, %struct.Vect3D_f16 }
%struct.Vect3D_f16 = type { i16, i16, i16 }

@pts_3D = external dso_local global ptr, align 8
@pts_2D = external dso_local global ptr, align 8
@vtab_3D = external dso_local global ptr, align 8
@vtab_2D = external dso_local global ptr, align 8
@camdist = external dso_local global i16, align 2
@transformation = external dso_local global %struct.Transformation3D, align 8
@rotstep = external dso_local global %struct.Vect3D_f16, align 2
@translation = external dso_local global %struct.Vect3D_f16, align 2
@rotation = external dso_local global %struct.Vect3D_f16, align 2
@flatDrawing = external dso_local global i16, align 2
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [16 x i8], align 16
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %2) #3
  call void @VDP_setScreenWidth256()
  call void @VDP_setHInterrupt(i8 noundef zeroext 0)
  call void @VDP_setHilightShadow(i8 noundef zeroext 0)
  call void @DMA_setBufferSize(i16 noundef zeroext 2048)
  call void @MEM_pack()
  call void @JOY_setSupport(i16 noundef zeroext 0, i16 noundef zeroext 2)
  call void @JOY_setSupport(i16 noundef zeroext 1, i16 noundef zeroext 0)
  call void @JOY_setEventHandler(ptr noundef @handleJoyEvent)
  call void @BMP_init(i16 noundef zeroext 1, i32 noundef 0, i16 noundef zeroext 0, i16 noundef zeroext 0)
  %3 = call ptr @MEM_alloc(i16 noundef zeroext 1536)
  store ptr %3, ptr @pts_3D, align 8, !tbaa !5
  %4 = call ptr @MEM_alloc(i16 noundef zeroext 1024)
  store ptr %4, ptr @pts_2D, align 8, !tbaa !5
  %5 = call ptr @MEM_alloc(i16 noundef zeroext 1536)
  store ptr %5, ptr @vtab_3D, align 8, !tbaa !5
  %6 = call ptr @MEM_alloc(i16 noundef zeroext 1024)
  store ptr %6, ptr @vtab_2D, align 8, !tbaa !5
  store i16 960, ptr @camdist, align 2, !tbaa !9
  call void @M3D_reset()
  %7 = load i16, ptr @camdist, align 2, !tbaa !9
  call void @M3D_setCamDistance(i16 noundef signext %7)
  call void @M3D_setLightEnabled(i16 noundef zeroext 1)
  call void @M3D_setLightXYZ(i16 noundef signext 57, i16 noundef signext 57, i16 noundef signext -57)
  call void @memset(ptr noundef @transformation, i8 noundef zeroext 0, i16 noundef zeroext 72)
  call void @memset(ptr noundef @rotstep, i8 noundef zeroext 0, i16 noundef zeroext 6)
  call void @M3D_setTransform(ptr noundef @transformation, ptr noundef @translation, ptr noundef @rotation)
  call void @M3D_setTranslation(ptr noundef @transformation, i16 noundef signext 0, i16 noundef signext 0, i16 noundef signext 1280)
  call void @M3D_setRotation(ptr noundef @transformation, i16 noundef signext 0, i16 noundef signext 0, i16 noundef signext 0)
  store i16 0, ptr @flatDrawing, align 2, !tbaa !9
  br label %8

8:                                                ; preds = %83, %0
  br label %9

9:                                                ; preds = %8
  call void @JOY_update()
  %10 = call zeroext i16 @JOY_readJoypad(i16 noundef zeroext 0)
  call void @doActionJoy(i8 noundef zeroext 0, i16 noundef zeroext %10)
  %11 = load i16, ptr @camdist, align 2, !tbaa !9
  call void @M3D_setCamDistance(i16 noundef signext %11)
  %12 = load i16, ptr @rotstep, align 2, !tbaa !11
  %13 = sext i16 %12 to i32
  %14 = load i16, ptr @rotation, align 2, !tbaa !11
  %15 = sext i16 %14 to i32
  %16 = add nsw i32 %15, %13
  %17 = trunc i32 %16 to i16
  store i16 %17, ptr @rotation, align 2, !tbaa !11
  %18 = load i16, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotstep, i32 0, i32 1), align 2, !tbaa !13
  %19 = sext i16 %18 to i32
  %20 = load i16, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 1), align 2, !tbaa !13
  %21 = sext i16 %20 to i32
  %22 = add nsw i32 %21, %19
  %23 = trunc i32 %22 to i16
  store i16 %23, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 1), align 2, !tbaa !13
  %24 = load i16, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotstep, i32 0, i32 2), align 2, !tbaa !14
  %25 = sext i16 %24 to i32
  %26 = load i16, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 2), align 2, !tbaa !14
  %27 = sext i16 %26 to i32
  %28 = add nsw i32 %27, %25
  %29 = trunc i32 %28 to i16
  store i16 %29, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 2), align 2, !tbaa !14
  %30 = load i16, ptr @rotation, align 2, !tbaa !11
  %31 = sext i16 %30 to i32
  %32 = icmp sge i32 %31, 23040
  br i1 %32, label %33, label %38

33:                                               ; preds = %9
  %34 = load i16, ptr @rotation, align 2, !tbaa !11
  %35 = sext i16 %34 to i32
  %36 = sub nsw i32 %35, 23040
  %37 = trunc i32 %36 to i16
  store i16 %37, ptr @rotation, align 2, !tbaa !11
  br label %38

38:                                               ; preds = %33, %9
  %39 = load i16, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 1), align 2, !tbaa !13
  %40 = sext i16 %39 to i32
  %41 = icmp sge i32 %40, 23040
  br i1 %41, label %42, label %47

42:                                               ; preds = %38
  %43 = load i16, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 1), align 2, !tbaa !13
  %44 = sext i16 %43 to i32
  %45 = sub nsw i32 %44, 23040
  %46 = trunc i32 %45 to i16
  store i16 %46, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 1), align 2, !tbaa !13
  br label %47

47:                                               ; preds = %42, %38
  %48 = load i16, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 2), align 2, !tbaa !14
  %49 = sext i16 %48 to i32
  %50 = icmp sge i32 %49, 23040
  br i1 %50, label %51, label %56

51:                                               ; preds = %47
  %52 = load i16, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 2), align 2, !tbaa !14
  %53 = sext i16 %52 to i32
  %54 = sub nsw i32 %53, 23040
  %55 = trunc i32 %54 to i16
  store i16 %55, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 2), align 2, !tbaa !14
  br label %56

56:                                               ; preds = %51, %47
  %57 = load i16, ptr @rotation, align 2, !tbaa !11
  %58 = sext i16 %57 to i32
  %59 = icmp slt i32 %58, 0
  br i1 %59, label %60, label %65

60:                                               ; preds = %56
  %61 = load i16, ptr @rotation, align 2, !tbaa !11
  %62 = sext i16 %61 to i32
  %63 = add nsw i32 %62, 23040
  %64 = trunc i32 %63 to i16
  store i16 %64, ptr @rotation, align 2, !tbaa !11
  br label %65

65:                                               ; preds = %60, %56
  %66 = load i16, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 1), align 2, !tbaa !13
  %67 = sext i16 %66 to i32
  %68 = icmp slt i32 %67, 0
  br i1 %68, label %69, label %74

69:                                               ; preds = %65
  %70 = load i16, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 1), align 2, !tbaa !13
  %71 = sext i16 %70 to i32
  %72 = add nsw i32 %71, 23040
  %73 = trunc i32 %72 to i16
  store i16 %73, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 1), align 2, !tbaa !13
  br label %74

74:                                               ; preds = %69, %65
  %75 = load i16, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 2), align 2, !tbaa !14
  %76 = sext i16 %75 to i32
  %77 = icmp slt i32 %76, 0
  br i1 %77, label %78, label %83

78:                                               ; preds = %74
  %79 = load i16, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 2), align 2, !tbaa !14
  %80 = sext i16 %79 to i32
  %81 = add nsw i32 %80, 23040
  %82 = trunc i32 %81 to i16
  store i16 %82, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @rotation, i32 0, i32 2), align 2, !tbaa !14
  br label %83

83:                                               ; preds = %78, %74
  store i16 1, ptr @transformation, align 8, !tbaa !15
  call void @updatePointsPos()
  call void @BMP_showFPS(i16 noundef zeroext 1, i16 noundef zeroext 1, i16 noundef zeroext 1)
  call void @BMP_clear()
  call void @drawPoints(i8 noundef zeroext -1)
  call void @BMP_drawText(ptr noundef @.str, i16 noundef zeroext 0, i16 noundef zeroext 2)
  %84 = load i16, ptr getelementptr inbounds (%struct.Vect3D_f16, ptr @translation, i32 0, i32 2), align 2, !tbaa !14
  %85 = getelementptr inbounds [16 x i8], ptr %2, i64 0, i64 0
  call void @fix16ToStr(i16 noundef signext %84, ptr noundef %85, i16 noundef zeroext 2)
  %86 = getelementptr inbounds [16 x i8], ptr %2, i64 0, i64 0
  call void @BMP_drawText(ptr noundef %86, i16 noundef zeroext 10, i16 noundef zeroext 2)
  call void @BMP_drawText(ptr noundef @.str.1, i16 noundef zeroext 0, i16 noundef zeroext 3)
  %87 = load i16, ptr @camdist, align 2, !tbaa !9
  %88 = getelementptr inbounds [16 x i8], ptr %2, i64 0, i64 0
  call void @fix16ToStr(i16 noundef signext %87, ptr noundef %88, i16 noundef zeroext 2)
  %89 = getelementptr inbounds [16 x i8], ptr %2, i64 0, i64 0
  call void @BMP_drawText(ptr noundef %89, i16 noundef zeroext 11, i16 noundef zeroext 3)
  %90 = call zeroext i16 @BMP_flip(i16 noundef zeroext 1)
  br label %8
}

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

declare void @VDP_setScreenWidth256() #2

declare void @VDP_setHInterrupt(i8 noundef zeroext) #2

declare void @VDP_setHilightShadow(i8 noundef zeroext) #2

declare void @DMA_setBufferSize(i16 noundef zeroext) #2

declare void @MEM_pack() #2

declare void @JOY_setSupport(i16 noundef zeroext, i16 noundef zeroext) #2

declare void @JOY_setEventHandler(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @handleJoyEvent(i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) #0

declare void @BMP_init(i16 noundef zeroext, i32 noundef, i16 noundef zeroext, i16 noundef zeroext) #2

declare ptr @MEM_alloc(i16 noundef zeroext) #2

declare void @M3D_reset() #2

declare void @M3D_setCamDistance(i16 noundef signext) #2

declare void @M3D_setLightEnabled(i16 noundef zeroext) #2

declare void @M3D_setLightXYZ(i16 noundef signext, i16 noundef signext, i16 noundef signext) #2

declare void @memset(ptr noundef, i8 noundef zeroext, i16 noundef zeroext) #2

declare void @M3D_setTransform(ptr noundef, ptr noundef, ptr noundef) #2

declare void @M3D_setTranslation(ptr noundef, i16 noundef signext, i16 noundef signext, i16 noundef signext) #2

declare void @M3D_setRotation(ptr noundef, i16 noundef signext, i16 noundef signext, i16 noundef signext) #2

declare void @JOY_update() #2

; Function Attrs: nounwind uwtable
declare dso_local void @doActionJoy(i8 noundef zeroext, i16 noundef zeroext) #0

declare zeroext i16 @JOY_readJoypad(i16 noundef zeroext) #2

declare void @BMP_showFPS(i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) #2

declare void @BMP_clear() #2

; Function Attrs: nounwind uwtable
declare dso_local void @drawPoints(i8 noundef zeroext) #0

declare void @BMP_drawText(ptr noundef, i16 noundef zeroext, i16 noundef zeroext) #2

declare void @fix16ToStr(i16 noundef signext, ptr noundef, i16 noundef zeroext) #2

declare zeroext i16 @BMP_flip(i16 noundef zeroext) #2

; Function Attrs: nounwind uwtable
declare dso_local void @updatePointsPos() #0

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"", !10, i64 0, !10, i64 2, !10, i64 4}
!13 = !{!12, !10, i64 2}
!14 = !{!12, !10, i64 4}
!15 = !{!16, !10, i64 0}
!16 = !{!"", !10, i64 0, !6, i64 8, !6, i64 16, !17, i64 24, !17, i64 42, !12, i64 60, !12, i64 66}
!17 = !{!"", !12, i64 0, !12, i64 6, !12, i64 12}


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

%struct.Transformation3D = type { i16, ptr, ptr, %struct.Mat3D_f16, %struct.Mat3D_f16, %struct.Vect3D_f16, %struct.Vect3D_f16 }
%struct.Mat3D_f16 = type { %struct.Vect3D_f16, %struct.Vect3D_f16, %struct.Vect3D_f16 }
%struct.Vect3D_f16 = type { i16, i16, i16 }

@pts_3D = external dso_local local_unnamed_addr global ptr, align 8
@pts_2D = external dso_local local_unnamed_addr global ptr, align 8
@vtab_3D = external dso_local local_unnamed_addr global ptr, align 8
@vtab_2D = external dso_local local_unnamed_addr global ptr, align 8
@camdist = external dso_local local_unnamed_addr global i16, align 2
@transformation = external dso_local global %struct.Transformation3D, align 8
@rotstep = external dso_local global %struct.Vect3D_f16, align 2
@translation = external dso_local global %struct.Vect3D_f16, align 2
@rotation = external dso_local global %struct.Vect3D_f16, align 2
@flatDrawing = external dso_local local_unnamed_addr global i16, align 2
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #4
  tail call void @VDP_setScreenWidth256() #4
  tail call void @VDP_setHInterrupt(i8 noundef zeroext 0) #4
  tail call void @VDP_setHilightShadow(i8 noundef zeroext 0) #4
  tail call void @DMA_setBufferSize(i16 noundef zeroext 2048) #4
  tail call void @MEM_pack() #4
  tail call void @JOY_setSupport(i16 noundef zeroext 0, i16 noundef zeroext 2) #4
  tail call void @JOY_setSupport(i16 noundef zeroext 1, i16 noundef zeroext 0) #4
  tail call void @JOY_setEventHandler(ptr noundef nonnull @handleJoyEvent) #4
  tail call void @BMP_init(i16 noundef zeroext 1, i32 noundef 0, i16 noundef zeroext 0, i16 noundef zeroext 0) #4
  %2 = tail call ptr @MEM_alloc(i16 noundef zeroext 1536) #4
  store ptr %2, ptr @pts_3D, align 8, !tbaa !5
  %3 = tail call ptr @MEM_alloc(i16 noundef zeroext 1024) #4
  store ptr %3, ptr @pts_2D, align 8, !tbaa !5
  %4 = tail call ptr @MEM_alloc(i16 noundef zeroext 1536) #4
  store ptr %4, ptr @vtab_3D, align 8, !tbaa !5
  %5 = tail call ptr @MEM_alloc(i16 noundef zeroext 1024) #4
  store ptr %5, ptr @vtab_2D, align 8, !tbaa !5
  store i16 960, ptr @camdist, align 2, !tbaa !9
  tail call void @M3D_reset() #4
  %6 = load i16, ptr @camdist, align 2, !tbaa !9
  tail call void @M3D_setCamDistance(i16 noundef signext %6) #4
  tail call void @M3D_setLightEnabled(i16 noundef zeroext 1) #4
  tail call void @M3D_setLightXYZ(i16 noundef signext 57, i16 noundef signext 57, i16 noundef signext -57) #4
  tail call void @memset(ptr noundef nonnull @transformation, i8 noundef zeroext 0, i16 noundef zeroext 72) #4
  tail call void @memset(ptr noundef nonnull @rotstep, i8 noundef zeroext 0, i16 noundef zeroext 6) #4
  tail call void @M3D_setTransform(ptr noundef nonnull @transformation, ptr noundef nonnull @translation, ptr noundef nonnull @rotation) #4
  tail call void @M3D_setTranslation(ptr noundef nonnull @transformation, i16 noundef signext 0, i16 noundef signext 0, i16 noundef signext 1280) #4
  tail call void @M3D_setRotation(ptr noundef nonnull @transformation, i16 noundef signext 0, i16 noundef signext 0, i16 noundef signext 0) #4
  store i16 0, ptr @flatDrawing, align 2, !tbaa !9
  br label %7

7:                                                ; preds = %41, %0
  call void @JOY_update() #4
  %8 = call zeroext i16 @JOY_readJoypad(i16 noundef zeroext 0) #4
  call void @doActionJoy(i8 noundef zeroext 0, i16 noundef zeroext %8)
  %9 = load i16, ptr @camdist, align 2, !tbaa !9
  call void @M3D_setCamDistance(i16 noundef signext %9) #4
  %10 = load <2 x i16>, ptr @rotstep, align 2, !tbaa !9
  %11 = load <2 x i16>, ptr @rotation, align 2, !tbaa !9
  %12 = add <2 x i16> %11, %10
  store <2 x i16> %12, ptr @rotation, align 2, !tbaa !9
  %13 = load i16, ptr getelementptr inbounds (i8, ptr @rotstep, i64 4), align 2, !tbaa !11
  %14 = load i16, ptr getelementptr inbounds (i8, ptr @rotation, i64 4), align 2, !tbaa !11
  %15 = add i16 %14, %13
  store i16 %15, ptr getelementptr inbounds (i8, ptr @rotation, i64 4), align 2, !tbaa !11
  %16 = extractelement <2 x i16> %12, i64 0
  %17 = icmp sgt i16 %16, 23039
  br i1 %17, label %18, label %20

18:                                               ; preds = %7
  %19 = add nsw i16 %16, -23040
  store i16 %19, ptr @rotation, align 2, !tbaa !13
  br label %20

20:                                               ; preds = %18, %7
  %21 = phi i16 [ %19, %18 ], [ %16, %7 ]
  %22 = extractelement <2 x i16> %12, i64 1
  %23 = icmp sgt i16 %22, 23039
  br i1 %23, label %24, label %26

24:                                               ; preds = %20
  %25 = add nsw i16 %22, -23040
  store i16 %25, ptr getelementptr inbounds (i8, ptr @rotation, i64 2), align 2, !tbaa !14
  br label %26

26:                                               ; preds = %24, %20
  %27 = phi i16 [ %25, %24 ], [ %22, %20 ]
  %28 = icmp sgt i16 %15, 23039
  br i1 %28, label %29, label %31

29:                                               ; preds = %26
  %30 = add nsw i16 %15, -23040
  store i16 %30, ptr getelementptr inbounds (i8, ptr @rotation, i64 4), align 2, !tbaa !11
  br label %31

31:                                               ; preds = %29, %26
  %32 = phi i16 [ %30, %29 ], [ %15, %26 ]
  %33 = icmp slt i16 %21, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %31
  %narrow = add nsw i16 %21, 23040
  store i16 %narrow, ptr @rotation, align 2, !tbaa !13
  br label %35

35:                                               ; preds = %34, %31
  %36 = icmp slt i16 %27, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %35
  %narrow6 = add nsw i16 %27, 23040
  store i16 %narrow6, ptr getelementptr inbounds (i8, ptr @rotation, i64 2), align 2, !tbaa !14
  br label %38

38:                                               ; preds = %37, %35
  %39 = icmp slt i16 %32, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %38
  %narrow7 = add nsw i16 %32, 23040
  store i16 %narrow7, ptr getelementptr inbounds (i8, ptr @rotation, i64 4), align 2, !tbaa !11
  br label %41

41:                                               ; preds = %40, %38
  store i16 1, ptr @transformation, align 8, !tbaa !15
  call void @updatePointsPos()
  call void @BMP_showFPS(i16 noundef zeroext 1, i16 noundef zeroext 1, i16 noundef zeroext 1) #4
  call void @BMP_clear() #4
  call void @drawPoints(i8 noundef zeroext -1)
  call void @BMP_drawText(ptr noundef nonnull @.str, i16 noundef zeroext 0, i16 noundef zeroext 2) #4
  %42 = load i16, ptr getelementptr inbounds (i8, ptr @translation, i64 4), align 2, !tbaa !11
  call void @fix16ToStr(i16 noundef signext %42, ptr noundef nonnull %1, i16 noundef zeroext 2) #4
  call void @BMP_drawText(ptr noundef nonnull %1, i16 noundef zeroext 10, i16 noundef zeroext 2) #4
  call void @BMP_drawText(ptr noundef nonnull @.str.1, i16 noundef zeroext 0, i16 noundef zeroext 3) #4
  %43 = load i16, ptr @camdist, align 2, !tbaa !9
  call void @fix16ToStr(i16 noundef signext %43, ptr noundef nonnull %1, i16 noundef zeroext 2) #4
  call void @BMP_drawText(ptr noundef nonnull %1, i16 noundef zeroext 11, i16 noundef zeroext 3) #4
  %44 = call zeroext i16 @BMP_flip(i16 noundef zeroext 1) #4
  br label %7
}

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

declare void @VDP_setScreenWidth256() local_unnamed_addr #2

declare void @VDP_setHInterrupt(i8 noundef zeroext) local_unnamed_addr #2

declare void @VDP_setHilightShadow(i8 noundef zeroext) local_unnamed_addr #2

declare void @DMA_setBufferSize(i16 noundef zeroext) local_unnamed_addr #2

declare void @MEM_pack() local_unnamed_addr #2

declare void @JOY_setSupport(i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #2

declare void @JOY_setEventHandler(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @handleJoyEvent(i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) #3

declare void @BMP_init(i16 noundef zeroext, i32 noundef, i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #2

declare ptr @MEM_alloc(i16 noundef zeroext) local_unnamed_addr #2

declare void @M3D_reset() local_unnamed_addr #2

declare void @M3D_setCamDistance(i16 noundef signext) local_unnamed_addr #2

declare void @M3D_setLightEnabled(i16 noundef zeroext) local_unnamed_addr #2

declare void @M3D_setLightXYZ(i16 noundef signext, i16 noundef signext, i16 noundef signext) local_unnamed_addr #2

declare void @memset(ptr noundef, i8 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #2

declare void @M3D_setTransform(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @M3D_setTranslation(ptr noundef, i16 noundef signext, i16 noundef signext, i16 noundef signext) local_unnamed_addr #2

declare void @M3D_setRotation(ptr noundef, i16 noundef signext, i16 noundef signext, i16 noundef signext) local_unnamed_addr #2

declare void @JOY_update() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @doActionJoy(i8 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #3

declare zeroext i16 @JOY_readJoypad(i16 noundef zeroext) local_unnamed_addr #2

declare void @BMP_showFPS(i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #2

declare void @BMP_clear() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @drawPoints(i8 noundef zeroext) local_unnamed_addr #3

declare void @BMP_drawText(ptr noundef, i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #2

declare void @fix16ToStr(i16 noundef signext, ptr noundef, i16 noundef zeroext) local_unnamed_addr #2

declare zeroext i16 @BMP_flip(i16 noundef zeroext) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @updatePointsPos() local_unnamed_addr #3

attributes #0 = { noreturn 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #4 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !10, i64 4}
!12 = !{!"", !10, i64 0, !10, i64 2, !10, i64 4}
!13 = !{!12, !10, i64 0}
!14 = !{!12, !10, i64 2}
!15 = !{!16, !10, i64 0}
!16 = !{!"", !10, i64 0, !6, i64 8, !6, i64 16, !17, i64 24, !17, i64 42, !12, i64 60, !12, i64 66}
!17 = !{!"", !12, i64 0, !12, i64 6, !12, i64 12}


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