; LLVM IR from jovanlanik/wip :: dungeon.d/src (d_draw)

; 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.wip_obj_t = type { %union.anon.2, %union.anon.4, %union.anon.6 }
%union.anon.2 = type { [3 x float] }
%union.anon.4 = type { [3 x float] }
%union.anon.6 = type { [4 x float] }
%struct.anim = type { %struct.wip_event_t, %struct.wip_event_t, i32, %union.anon.11 }
%struct.wip_event_t = type { double, double }
%union.anon.11 = type { [2 x i32] }
%union.wip_globj_t = type { [16 x float] }
%struct.entity_t = type { i32, i32, i32, %union.anon.8, %union.anon.10 }
%union.anon.8 = type { [2 x i32] }
%union.anon.10 = type { i32 }
%struct.anon.9 = type { i32, i32 }
%struct.anon.12 = type { i32, i32 }
%struct.anon.3 = type { float, float, float }

@drawEnts.object = external hidden global %struct.wip_obj_t, align 4
@entity_anim = external global [0 x %struct.anim], align 8

; 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 double @wip_timeWindow() #1

; Function Attrs: nounwind uwtable
declare dso_local void @drawModel(ptr noundef, ptr noundef, ptr noundef byval(%union.wip_globj_t) align 8, ptr noundef) #2

declare ptr @wip_makeObject(ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @quat_rotate(ptr noundef, float noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @drawEnts(i32 noundef %0, ptr noundef %1, ptr noundef byval(%union.wip_globj_t) align 8 %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca [3 x float], align 4
  %10 = alloca ptr, align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %178, %3
  %12 = load i32, ptr %6, align 4, !tbaa !5
  %13 = icmp slt i32 %12, 512
  br i1 %13, label %15, label %14

14:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %181

15:                                               ; preds = %11
  %16 = load ptr, ptr %5, align 8, !tbaa !9
  %17 = load i32, ptr %6, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds %struct.entity_t, ptr %16, i64 %18
  %20 = getelementptr inbounds %struct.entity_t, ptr %19, i32 0, i32 1
  %21 = load i32, ptr %20, align 4, !tbaa !11
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %32, label %23

23:                                               ; preds = %15
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds %struct.entity_t, ptr %24, i64 %26
  %28 = getelementptr inbounds %struct.entity_t, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 4, !tbaa !13
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = icmp ne i32 %29, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %23, %15
  br label %178

33:                                               ; preds = %23
  %34 = call ptr @wip_makeObject(ptr noundef @drawEnts.object)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store float 0.000000e+00, ptr %7, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store float 0.000000e+00, ptr %8, align 4, !tbaa !14
  %35 = load ptr, ptr %5, align 8, !tbaa !9
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds %struct.entity_t, ptr %35, i64 %37
  %39 = getelementptr inbounds %struct.entity_t, ptr %38, i32 0, i32 4
  %40 = load i32, ptr %39, align 4, !tbaa !16
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %50

42:                                               ; preds = %33
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [0 x %struct.anim], ptr @entity_anim, i64 0, i64 %44
  %46 = getelementptr inbounds %struct.anim, ptr %45, i32 0, i32 2
  %47 = load i32, ptr %46, align 8, !tbaa !17
  %48 = icmp eq i32 %47, 3
  br i1 %48, label %49, label %50

49:                                               ; preds = %42
  store float 0x401921FB60000000, ptr %7, align 4, !tbaa !14
  br label %67

50:                                               ; preds = %42, %33
  %51 = load ptr, ptr %5, align 8, !tbaa !9
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds %struct.entity_t, ptr %51, i64 %53
  %55 = getelementptr inbounds %struct.entity_t, ptr %54, i32 0, i32 4
  %56 = load i32, ptr %55, align 4, !tbaa !16
  %57 = icmp eq i32 %56, 3
  br i1 %57, label %58, label %66

58:                                               ; preds = %50
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [0 x %struct.anim], ptr @entity_anim, i64 0, i64 %60
  %62 = getelementptr inbounds %struct.anim, ptr %61, i32 0, i32 2
  %63 = load i32, ptr %62, align 8, !tbaa !17
  %64 = icmp eq i32 %63, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %58
  store float 0x401921FB60000000, ptr %8, align 4, !tbaa !14
  br label %66

66:                                               ; preds = %65, %58, %50
  br label %67

67:                                               ; preds = %66, %49
  %68 = load ptr, ptr %5, align 8, !tbaa !9
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds %struct.entity_t, ptr %68, i64 %70
  %72 = getelementptr inbounds %struct.entity_t, ptr %71, i32 0, i32 4
  %73 = load i32, ptr %72, align 4, !tbaa !16
  %74 = uitofp i32 %73 to double
  %75 = fmul double 9.000000e+01, %74
  %76 = fmul double %75, 0x400921FB54442D18
  %77 = fdiv double %76, 1.800000e+02
  %78 = load float, ptr %7, align 4, !tbaa !14
  %79 = fpext float %78 to double
  %80 = fadd double %79, %77
  %81 = fptrunc double %80 to float
  store float %81, ptr %7, align 4, !tbaa !14
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [0 x %struct.anim], ptr @entity_anim, i64 0, i64 %83
  %85 = getelementptr inbounds %struct.anim, ptr %84, i32 0, i32 2
  %86 = load i32, ptr %85, align 8, !tbaa !17
  %87 = uitofp i32 %86 to double
  %88 = fmul double 9.000000e+01, %87
  %89 = fmul double %88, 0x400921FB54442D18
  %90 = fdiv double %89, 1.800000e+02
  %91 = load float, ptr %8, align 4, !tbaa !14
  %92 = fpext float %91 to double
  %93 = fadd double %92, %90
  %94 = fptrunc double %93 to float
  store float %94, ptr %8, align 4, !tbaa !14
  %95 = load float, ptr %7, align 4, !tbaa !14
  %96 = fpext float %95 to double
  %97 = load float, ptr %8, align 4, !tbaa !14
  %98 = fpext float %97 to double
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [0 x %struct.anim], ptr @entity_anim, i64 0, i64 %100
  %102 = getelementptr inbounds %struct.anim, ptr %101, i32 0, i32 0
  %103 = call double @wip_eventPart(ptr noundef %102, ptr noundef @wip_easeInOut)
  %104 = call double @wip_interpolate(double noundef %96, double noundef %98, double noundef %103)
  %105 = fptrunc double %104 to float
  store float 0.000000e+00, ptr %9, align 4, !tbaa !14
  %106 = getelementptr inbounds float, ptr %9, i64 1
  store float 0.000000e+00, ptr %106, align 4, !tbaa !14
  %107 = getelementptr inbounds float, ptr %9, i64 2
  store float 1.000000e+00, ptr %107, align 4, !tbaa !14
  %108 = getelementptr inbounds [3 x float], ptr %9, i64 0, i64 0
  call void @quat_rotate(ptr noundef getelementptr inbounds (%struct.wip_obj_t, ptr @drawEnts.object, i32 0, i32 2), float noundef %105, ptr noundef %108)
  %109 = load ptr, ptr %5, align 8, !tbaa !9
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds %struct.entity_t, ptr %109, i64 %111
  %113 = getelementptr inbounds %struct.entity_t, ptr %112, i32 0, i32 3
  %114 = getelementptr inbounds %struct.anon.9, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 4, !tbaa !16
  %116 = mul nsw i32 2, %115
  %117 = sitofp i32 %116 to double
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [0 x %struct.anim], ptr @entity_anim, i64 0, i64 %119
  %121 = getelementptr inbounds %struct.anim, ptr %120, i32 0, i32 3
  %122 = getelementptr inbounds %struct.anon.12, ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 4, !tbaa !16
  %124 = mul nsw i32 2, %123
  %125 = sitofp i32 %124 to double
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [0 x %struct.anim], ptr @entity_anim, i64 0, i64 %127
  %129 = getelementptr inbounds %struct.anim, ptr %128, i32 0, i32 1
  %130 = call double @wip_eventPart(ptr noundef %129, ptr noundef @wip_easeInOut)
  %131 = call double @wip_interpolate(double noundef %117, double noundef %125, double noundef %130)
  %132 = fptrunc double %131 to float
  store float %132, ptr @drawEnts.object, align 4, !tbaa !16
  %133 = load ptr, ptr %5, align 8, !tbaa !9
  %134 = load i32, ptr %6, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds %struct.entity_t, ptr %133, i64 %135
  %137 = getelementptr inbounds %struct.entity_t, ptr %136, i32 0, i32 3
  %138 = getelementptr inbounds %struct.anon.9, ptr %137, i32 0, i32 1
  %139 = load i32, ptr %138, align 4, !tbaa !16
  %140 = mul nsw i32 2, %139
  %141 = sitofp i32 %140 to double
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [0 x %struct.anim], ptr @entity_anim, i64 0, i64 %143
  %145 = getelementptr inbounds %struct.anim, ptr %144, i32 0, i32 3
  %146 = getelementptr inbounds %struct.anon.12, ptr %145, i32 0, i32 1
  %147 = load i32, ptr %146, align 4, !tbaa !16
  %148 = mul nsw i32 2, %147
  %149 = sitofp i32 %148 to double
  %150 = load i32, ptr %6, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [0 x %struct.anim], ptr @entity_anim, i64 0, i64 %151
  %153 = getelementptr inbounds %struct.anim, ptr %152, i32 0, i32 1
  %154 = call double @wip_eventPart(ptr noundef %153, ptr noundef @wip_easeInOut)
  %155 = call double @wip_interpolate(double noundef %141, double noundef %149, double noundef %154)
  %156 = fptrunc double %155 to float
  store float %156, ptr getelementptr inbounds (%struct.anon.3, ptr @drawEnts.object, i32 0, i32 1), align 4, !tbaa !16
  %157 = load ptr, ptr %5, align 8, !tbaa !9
  %158 = load i32, ptr %6, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds %struct.entity_t, ptr %157, i64 %159
  %161 = getelementptr inbounds %struct.entity_t, ptr %160, i32 0, i32 1
  %162 = load i32, ptr %161, align 4, !tbaa !11
  %163 = call i32 @entIsItem(i32 noundef %162)
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %171

165:                                              ; preds = %67
  %166 = call double @wip_timeWindow()
  %167 = fmul double %166, 1.500000e+00
  %168 = call double @sin(double noundef %167) #5
  %169 = fmul double %168, 0x3F999999A0000000
  %170 = fptrunc double %169 to float
  store float %170, ptr getelementptr inbounds (%struct.anon.3, ptr @drawEnts.object, i32 0, i32 2), align 4, !tbaa !16
  br label %171

171:                                              ; preds = %165, %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %172 = load ptr, ptr %5, align 8, !tbaa !9
  %173 = load i32, ptr %6, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds %struct.entity_t, ptr %172, i64 %174
  %176 = call ptr @getEntModel(ptr noundef %175)
  store ptr %176, ptr %10, align 8, !tbaa !9
  %177 = load ptr, ptr %10, align 8, !tbaa !9
  call void @drawModel(ptr noundef @drawEnts.object, ptr noundef %177, ptr noundef byval(%union.wip_globj_t) align 8 %2, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %178

178:                                              ; preds = %171, %32
  %179 = load i32, ptr %6, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %6, align 4, !tbaa !5
  br label %11, !llvm.loop !21

181:                                              ; preds = %14
  ret void
}

declare double @wip_interpolate(double noundef, double noundef, double noundef) #1

declare double @wip_eventPart(ptr noundef, ptr noundef) #1

declare double @wip_easeInOut(double noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @entIsItem(i32 noundef) #2

; Function Attrs: nounwind
declare double @sin(double noundef) #4

; Function Attrs: nounwind uwtable
declare hidden ptr @getEntModel(ptr noundef) #2

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 = { 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 = { inlinehint 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 "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 #5 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !7, i64 12, !7, i64 20}
!13 = !{!12, !6, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !6, i64 32}
!18 = !{!"anim", !19, i64 0, !19, i64 16, !6, i64 32, !7, i64 36}
!19 = !{!"", !20, i64 0, !20, i64 8}
!20 = !{!"double", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"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"

%struct.wip_obj_t = type { %union.anon.2, %union.anon.4, %union.anon.6 }
%union.anon.2 = type { [3 x float] }
%union.anon.4 = type { [3 x float] }
%union.anon.6 = type { [4 x float] }
%struct.anim = type { %struct.wip_event_t, %struct.wip_event_t, i32, %union.anon.11 }
%struct.wip_event_t = type { double, double }
%union.anon.11 = type { [2 x i32] }
%union.wip_globj_t = type { [16 x float] }
%struct.entity_t = type { i32, i32, i32, %union.anon.8, %union.anon.10 }
%union.anon.8 = type { [2 x i32] }
%union.anon.10 = type { i32 }

@drawEnts.object = external hidden global %struct.wip_obj_t, align 4
@entity_anim = external global [0 x %struct.anim], align 8

declare double @wip_timeWindow() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @drawModel(ptr noundef, ptr noundef, ptr noundef byval(%union.wip_globj_t) align 8, ptr noundef) local_unnamed_addr #1

declare ptr @wip_makeObject(ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @quat_rotate(ptr noundef, float noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @drawEnts(i32 noundef %0, ptr noundef %1, ptr noundef byval(%union.wip_globj_t) align 8 %2) local_unnamed_addr #1 {
  %4 = alloca [3 x float], align 8
  %5 = getelementptr inbounds i8, ptr %4, i64 8
  br label %7

6:                                                ; preds = %75
  ret void

7:                                                ; preds = %3, %75
  %indvars.iv = phi i64 [ 0, %3 ], [ %indvars.iv.next, %75 ]
  %8 = getelementptr inbounds %struct.entity_t, ptr %1, i64 %indvars.iv
  %9 = getelementptr inbounds i8, ptr %8, i64 4
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %75, label %12

12:                                               ; preds = %7
  %13 = load i32, ptr %8, align 4, !tbaa !10
  %.not = icmp eq i32 %13, %0
  br i1 %.not, label %14, label %75

14:                                               ; preds = %12
  %15 = call ptr @wip_makeObject(ptr noundef nonnull @drawEnts.object) #4
  %16 = getelementptr inbounds i8, ptr %8, i64 20
  %17 = load i32, ptr %16, align 4, !tbaa !11
  %.phi.trans.insert38 = getelementptr inbounds [0 x %struct.anim], ptr @entity_anim, i64 0, i64 %indvars.iv, i32 2
  %.pre = load i32, ptr %.phi.trans.insert38, align 8, !tbaa !12
  switch i32 %17, label %._crit_edge [
    i32 0, label %18
    i32 3, label %20
  ]

18:                                               ; preds = %14
  %19 = icmp eq i32 %.pre, 3
  br i1 %19, label %._crit_edge, label %.thread

.thread:                                          ; preds = %18
  br label %._crit_edge

20:                                               ; preds = %14
  %21 = icmp eq i32 %.pre, 0
  br i1 %21, label %22, label %._crit_edge

22:                                               ; preds = %20
  br label %._crit_edge

._crit_edge:                                      ; preds = %14, %.thread, %18, %20, %22
  %23 = phi i32 [ 0, %22 ], [ %.pre, %20 ], [ 3, %18 ], [ %.pre, %.thread ], [ %.pre, %14 ]
  %.034 = phi double [ 0.000000e+00, %22 ], [ 0.000000e+00, %20 ], [ 0x401921FB60000000, %18 ], [ 0.000000e+00, %.thread ], [ 0.000000e+00, %14 ]
  %.033 = phi double [ 0x401921FB60000000, %22 ], [ 0.000000e+00, %20 ], [ 0.000000e+00, %18 ], [ 0.000000e+00, %.thread ], [ 0.000000e+00, %14 ]
  %24 = uitofp i32 %17 to double
  %25 = fmul double %24, 9.000000e+01
  %26 = fmul double %25, 0x400921FB54442D18
  %27 = fdiv double %26, 1.800000e+02
  %28 = fadd double %27, %.034
  %29 = fptrunc double %28 to float
  %30 = getelementptr inbounds [0 x %struct.anim], ptr @entity_anim, i64 0, i64 %indvars.iv
  %31 = uitofp i32 %23 to double
  %32 = fmul double %31, 9.000000e+01
  %33 = fmul double %32, 0x400921FB54442D18
  %34 = fdiv double %33, 1.800000e+02
  %35 = fadd double %.033, %34
  %36 = fptrunc double %35 to float
  %37 = fpext float %29 to double
  %38 = fpext float %36 to double
  %39 = call double @wip_eventPart(ptr noundef nonnull %30, ptr noundef nonnull @wip_easeInOut) #4
  %40 = call double @wip_interpolate(double noundef %37, double noundef %38, double noundef %39) #4
  %41 = fptrunc double %40 to float
  store <2 x float> zeroinitializer, ptr %4, align 8, !tbaa !16
  store float 1.000000e+00, ptr %5, align 8, !tbaa !16
  call void @quat_rotate(ptr noundef nonnull getelementptr inbounds (i8, ptr @drawEnts.object, i64 24), float noundef %41, ptr noundef nonnull %4)
  %42 = getelementptr inbounds i8, ptr %8, i64 12
  %43 = load i32, ptr %42, align 4, !tbaa !11
  %44 = shl nsw i32 %43, 1
  %45 = sitofp i32 %44 to double
  %46 = getelementptr inbounds i8, ptr %30, i64 36
  %47 = load i32, ptr %46, align 4, !tbaa !11
  %48 = shl nsw i32 %47, 1
  %49 = sitofp i32 %48 to double
  %50 = getelementptr inbounds i8, ptr %30, i64 16
  %51 = call double @wip_eventPart(ptr noundef nonnull %50, ptr noundef nonnull @wip_easeInOut) #4
  %52 = call double @wip_interpolate(double noundef %45, double noundef %49, double noundef %51) #4
  %53 = fptrunc double %52 to float
  store float %53, ptr @drawEnts.object, align 4, !tbaa !11
  %54 = getelementptr inbounds i8, ptr %8, i64 16
  %55 = load i32, ptr %54, align 4, !tbaa !11
  %56 = shl nsw i32 %55, 1
  %57 = sitofp i32 %56 to double
  %58 = getelementptr inbounds i8, ptr %30, i64 40
  %59 = load i32, ptr %58, align 8, !tbaa !11
  %60 = shl nsw i32 %59, 1
  %61 = sitofp i32 %60 to double
  %62 = call double @wip_eventPart(ptr noundef nonnull %50, ptr noundef nonnull @wip_easeInOut) #4
  %63 = call double @wip_interpolate(double noundef %57, double noundef %61, double noundef %62) #4
  %64 = fptrunc double %63 to float
  store float %64, ptr getelementptr inbounds (i8, ptr @drawEnts.object, i64 4), align 4, !tbaa !11
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = call i32 @entIsItem(i32 noundef %65)
  %.not35 = icmp eq i32 %66, 0
  br i1 %.not35, label %73, label %67

67:                                               ; preds = %._crit_edge
  %68 = call double @wip_timeWindow() #4
  %69 = fmul double %68, 1.500000e+00
  %70 = call double @sin(double noundef %69) #4
  %71 = fmul double %70, 0x3F999999A0000000
  %72 = fptrunc double %71 to float
  store float %72, ptr getelementptr inbounds (i8, ptr @drawEnts.object, i64 8), align 4, !tbaa !11
  br label %73

73:                                               ; preds = %67, %._crit_edge
  %74 = call ptr @getEntModel(ptr noundef nonnull %8)
  call void @drawModel(ptr noundef nonnull @drawEnts.object, ptr noundef %74, ptr noundef nonnull byval(%union.wip_globj_t) align 8 %2, ptr noundef null)
  br label %75

75:                                               ; preds = %7, %12, %73
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 512
  br i1 %exitcond.not, label %6, label %7, !llvm.loop !18
}

declare double @wip_interpolate(double noundef, double noundef, double noundef) local_unnamed_addr #0

declare double @wip_eventPart(ptr noundef, ptr noundef) local_unnamed_addr #0

declare double @wip_easeInOut(double noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @entIsItem(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden ptr @getEntModel(ptr noundef) local_unnamed_addr #1

attributes #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 = { 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 #2 = { inlinehint 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 = { mustprogress nofree nounwind willreturn memory(write) "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, !7, i64 4}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !8, i64 12, !8, i64 20}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 0}
!11 = !{!8, !8, i64 0}
!12 = !{!13, !7, i64 32}
!13 = !{!"anim", !14, i64 0, !14, i64 16, !7, i64 32, !8, i64 36}
!14 = !{!"", !15, i64 0, !15, i64 8}
!15 = !{!"double", !8, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !8, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass