; LLVM IR from ssloy/tinyraycaster :: tinyraycaster/Z11draw_spriteR11FrameBufferRK6SpriteRKSt6vectorIfSaIfEERK6PlayerRK_7eb488ac (spriteR11FrameBufferRK6SpriteRKSt6vectorIfSaIfEERK6PlayerRK7Texture)

; 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.Sprite = type { float, float, i64, float }
%struct.Player = type { float, float, float, float, i32, i32 }
%struct.FrameBuffer = type { i64, i64, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Texture = type { i64, i64, i64, i64, %"class.std::vector" }

; 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 noundef i32 @_ZNK7Texture3getEmmm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef, i64 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11draw_spriteR11FrameBufferRK6SpriteRKSt6vectorIfSaIfEERK6PlayerRK7Texture(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(56) %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca float, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca i8, align 1
  %22 = alloca i8, align 1
  %23 = alloca i8, align 1
  %24 = alloca i8, align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.Sprite, ptr %25, i32 0, i32 1
  %27 = load float, ptr %26, align 4, !tbaa !9
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.Player, ptr %28, i32 0, i32 1
  %30 = load float, ptr %29, align 4, !tbaa !13
  %31 = fsub float %27, %30
  %32 = fpext float %31 to double
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.Sprite, ptr %33, i32 0, i32 0
  %35 = load float, ptr %34, align 8, !tbaa !16
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.Player, ptr %36, i32 0, i32 0
  %38 = load float, ptr %37, align 4, !tbaa !17
  %39 = fsub float %35, %38
  %40 = fpext float %39 to double
  %41 = call double @atan2(double noundef %32, double noundef %40) #6
  %42 = fptrunc double %41 to float
  store float %42, ptr %11, align 4, !tbaa !18
  br label %43

43:                                               ; preds = %51, %5
  %44 = load float, ptr %11, align 4, !tbaa !18
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.Player, ptr %45, i32 0, i32 2
  %47 = load float, ptr %46, align 4, !tbaa !19
  %48 = fsub float %44, %47
  %49 = fpext float %48 to double
  %50 = fcmp ogt double %49, 0x400921FB54442D18
  br i1 %50, label %51, label %56

51:                                               ; preds = %43
  %52 = load float, ptr %11, align 4, !tbaa !18
  %53 = fpext float %52 to double
  %54 = fsub double %53, 0x401921FB54442D18
  %55 = fptrunc double %54 to float
  store float %55, ptr %11, align 4, !tbaa !18
  br label %43, !llvm.loop !20

56:                                               ; preds = %43
  br label %57

57:                                               ; preds = %65, %56
  %58 = load float, ptr %11, align 4, !tbaa !18
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.Player, ptr %59, i32 0, i32 2
  %61 = load float, ptr %60, align 4, !tbaa !19
  %62 = fsub float %58, %61
  %63 = fpext float %62 to double
  %64 = fcmp olt double %63, 0xC00921FB54442D18
  br i1 %64, label %65, label %70

65:                                               ; preds = %57
  %66 = load float, ptr %11, align 4, !tbaa !18
  %67 = fpext float %66 to double
  %68 = fadd double %67, 0x401921FB54442D18
  %69 = fptrunc double %68 to float
  store float %69, ptr %11, align 4, !tbaa !18
  br label %57, !llvm.loop !22

70:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 2000, ptr %13, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.FrameBuffer, ptr %71, i32 0, i32 1
  %73 = load i64, ptr %72, align 8, !tbaa !24
  %74 = uitofp i64 %73 to float
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.Sprite, ptr %75, i32 0, i32 3
  %77 = load float, ptr %76, align 8, !tbaa !30
  %78 = fdiv float %74, %77
  %79 = fptosi float %78 to i32
  store i32 %79, ptr %14, align 4, !tbaa !23
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %81 = load i32, ptr %80, align 4, !tbaa !23
  %82 = sext i32 %81 to i64
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  store i64 %82, ptr %12, align 8, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %83 = load float, ptr %11, align 4, !tbaa !18
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.Player, ptr %84, i32 0, i32 2
  %86 = load float, ptr %85, align 4, !tbaa !19
  %87 = fsub float %83, %86
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.FrameBuffer, ptr %88, i32 0, i32 0
  %90 = load i64, ptr %89, align 8, !tbaa !32
  %91 = udiv i64 %90, 2
  %92 = uitofp i64 %91 to float
  %93 = fmul float %87, %92
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.Player, ptr %94, i32 0, i32 3
  %96 = load float, ptr %95, align 4, !tbaa !33
  %97 = fdiv float %93, %96
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.FrameBuffer, ptr %98, i32 0, i32 0
  %100 = load i64, ptr %99, align 8, !tbaa !32
  %101 = udiv i64 %100, 2
  %102 = udiv i64 %101, 2
  %103 = uitofp i64 %102 to float
  %104 = fadd float %97, %103
  %105 = load i64, ptr %12, align 8, !tbaa !31
  %106 = udiv i64 %105, 2
  %107 = uitofp i64 %106 to float
  %108 = fsub float %104, %107
  %109 = fptosi float %108 to i32
  store i32 %109, ptr %15, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.FrameBuffer, ptr %110, i32 0, i32 1
  %112 = load i64, ptr %111, align 8, !tbaa !24
  %113 = udiv i64 %112, 2
  %114 = load i64, ptr %12, align 8, !tbaa !31
  %115 = udiv i64 %114, 2
  %116 = sub i64 %113, %115
  %117 = trunc i64 %116 to i32
  store i32 %117, ptr %16, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i64 0, ptr %17, align 8, !tbaa !31
  br label %118

118:                                              ; preds = %219, %70
  %119 = load i64, ptr %17, align 8, !tbaa !31
  %120 = load i64, ptr %12, align 8, !tbaa !31
  %121 = icmp ult i64 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 6, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %222

123:                                              ; preds = %118
  %124 = load i32, ptr %15, align 4, !tbaa !23
  %125 = load i64, ptr %17, align 8, !tbaa !31
  %126 = trunc i64 %125 to i32
  %127 = add nsw i32 %124, %126
  %128 = icmp slt i32 %127, 0
  br i1 %128, label %139, label %129

129:                                              ; preds = %123
  %130 = load i32, ptr %15, align 4, !tbaa !23
  %131 = sext i32 %130 to i64
  %132 = load i64, ptr %17, align 8, !tbaa !31
  %133 = add i64 %131, %132
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.FrameBuffer, ptr %134, i32 0, i32 0
  %136 = load i64, ptr %135, align 8, !tbaa !32
  %137 = udiv i64 %136, 2
  %138 = icmp uge i64 %133, %137
  br i1 %138, label %139, label %140

139:                                              ; preds = %129, %123
  br label %219

140:                                              ; preds = %129
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = load i32, ptr %15, align 4, !tbaa !23
  %143 = sext i32 %142 to i64
  %144 = load i64, ptr %17, align 8, !tbaa !31
  %145 = add i64 %143, %144
  %146 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %141, i64 noundef %145) #6
  %147 = load float, ptr %146, align 4, !tbaa !18
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.Sprite, ptr %148, i32 0, i32 3
  %150 = load float, ptr %149, align 8, !tbaa !30
  %151 = fcmp olt float %147, %150
  br i1 %151, label %152, label %153

152:                                              ; preds = %140
  br label %219

153:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 0, ptr %19, align 8, !tbaa !31
  br label %154

154:                                              ; preds = %215, %153
  %155 = load i64, ptr %19, align 8, !tbaa !31
  %156 = load i64, ptr %12, align 8, !tbaa !31
  %157 = icmp ult i64 %155, %156
  br i1 %157, label %159, label %158

158:                                              ; preds = %154
  store i32 9, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %218

159:                                              ; preds = %154
  %160 = load i32, ptr %16, align 4, !tbaa !23
  %161 = load i64, ptr %19, align 8, !tbaa !31
  %162 = trunc i64 %161 to i32
  %163 = add nsw i32 %160, %162
  %164 = icmp slt i32 %163, 0
  br i1 %164, label %174, label %165

165:                                              ; preds = %159
  %166 = load i32, ptr %16, align 4, !tbaa !23
  %167 = sext i32 %166 to i64
  %168 = load i64, ptr %19, align 8, !tbaa !31
  %169 = add i64 %167, %168
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.FrameBuffer, ptr %170, i32 0, i32 1
  %172 = load i64, ptr %171, align 8, !tbaa !24
  %173 = icmp uge i64 %169, %172
  br i1 %173, label %174, label %175

174:                                              ; preds = %165, %159
  br label %215

175:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %176 = load ptr, ptr %10, align 8, !tbaa !5
  %177 = load i64, ptr %17, align 8, !tbaa !31
  %178 = load ptr, ptr %10, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.Texture, ptr %178, i32 0, i32 3
  %180 = load i64, ptr %179, align 8, !tbaa !34
  %181 = mul i64 %177, %180
  %182 = load i64, ptr %12, align 8, !tbaa !31
  %183 = udiv i64 %181, %182
  %184 = load i64, ptr %19, align 8, !tbaa !31
  %185 = load ptr, ptr %10, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.Texture, ptr %185, i32 0, i32 3
  %187 = load i64, ptr %186, align 8, !tbaa !34
  %188 = mul i64 %184, %187
  %189 = load i64, ptr %12, align 8, !tbaa !31
  %190 = udiv i64 %188, %189
  %191 = load ptr, ptr %7, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.Sprite, ptr %191, i32 0, i32 2
  %193 = load i64, ptr %192, align 8, !tbaa !36
  %194 = call noundef i32 @_ZNK7Texture3getEmmm(ptr noundef nonnull align 8 dereferenceable(56) %176, i64 noundef %183, i64 noundef %190, i64 noundef %193)
  store i32 %194, ptr %20, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #6
  call void @_Z12unpack_colorRKjRhS1_S1_S1_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 1 dereferenceable(1) %21, ptr noundef nonnull align 1 dereferenceable(1) %22, ptr noundef nonnull align 1 dereferenceable(1) %23, ptr noundef nonnull align 1 dereferenceable(1) %24)
  %195 = load i8, ptr %24, align 1, !tbaa !37
  %196 = zext i8 %195 to i32
  %197 = icmp sgt i32 %196, 128
  br i1 %197, label %198, label %214

198:                                              ; preds = %175
  %199 = load ptr, ptr %6, align 8, !tbaa !5
  %200 = load ptr, ptr %6, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.FrameBuffer, ptr %200, i32 0, i32 0
  %202 = load i64, ptr %201, align 8, !tbaa !32
  %203 = udiv i64 %202, 2
  %204 = load i32, ptr %15, align 4, !tbaa !23
  %205 = sext i32 %204 to i64
  %206 = add i64 %203, %205
  %207 = load i64, ptr %17, align 8, !tbaa !31
  %208 = add i64 %206, %207
  %209 = load i32, ptr %16, align 4, !tbaa !23
  %210 = sext i32 %209 to i64
  %211 = load i64, ptr %19, align 8, !tbaa !31
  %212 = add i64 %210, %211
  %213 = load i32, ptr %20, align 4, !tbaa !23
  call void @_ZN11FrameBuffer9set_pixelEmmj(ptr noundef nonnull align 8 dereferenceable(40) %199, i64 noundef %208, i64 noundef %212, i32 noundef %213)
  br label %214

214:                                              ; preds = %198, %175
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %215

215:                                              ; preds = %214, %174
  %216 = load i64, ptr %19, align 8, !tbaa !31
  %217 = add i64 %216, 1
  store i64 %217, ptr %19, align 8, !tbaa !31
  br label %154, !llvm.loop !38

218:                                              ; preds = %158
  br label %219

219:                                              ; preds = %218, %152, %139
  %220 = load i64, ptr %17, align 8, !tbaa !31
  %221 = add i64 %220, 1
  store i64 %221, ptr %17, align 8, !tbaa !31
  br label %118, !llvm.loop !39

222:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  ret void
}

; Function Attrs: nounwind
declare double @atan2(double noundef, double noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #5 align 2

declare void @_Z12unpack_colorRKjRhS1_S1_S1_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) #1

declare void @_ZN11FrameBuffer9set_pixelEmmj(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, i64 noundef, i32 noundef) #1

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 "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 = { inlinehint mustprogress 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 #5 = { mustprogress 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 #6 = { 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++ TBAA"}
!9 = !{!10, !11, i64 4}
!10 = !{!"_ZTS6Sprite", !11, i64 0, !11, i64 4, !12, i64 8, !11, i64 16}
!11 = !{!"float", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !11, i64 4}
!14 = !{!"_ZTS6Player", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !15, i64 16, !15, i64 20}
!15 = !{!"int", !7, i64 0}
!16 = !{!10, !11, i64 0}
!17 = !{!14, !11, i64 0}
!18 = !{!11, !11, i64 0}
!19 = !{!14, !11, i64 8}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = !{!15, !15, i64 0}
!24 = !{!25, !12, i64 8}
!25 = !{!"_ZTS11FrameBuffer", !12, i64 0, !12, i64 8, !26, i64 16}
!26 = !{!"_ZTSSt6vectorIjSaIjEE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!10, !11, i64 16}
!31 = !{!12, !12, i64 0}
!32 = !{!25, !12, i64 0}
!33 = !{!14, !11, i64 12}
!34 = !{!35, !12, i64 24}
!35 = !{!"_ZTS7Texture", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !26, i64 32}
!36 = !{!10, !12, i64 8}
!37 = !{!7, !7, i64 0}
!38 = distinct !{!38, !21}
!39 = distinct !{!39, !21}


; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

declare noundef i32 @_ZNK7Texture3getEmmm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11draw_spriteR11FrameBufferRK6SpriteRKSt6vectorIfSaIfEERK6PlayerRK7Texture(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr nocapture noundef nonnull readonly align 4 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(56) %4) local_unnamed_addr #2 {
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca i8, align 1
  %13 = getelementptr inbounds i8, ptr %1, i64 4
  %14 = load float, ptr %13, align 4, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %3, i64 4
  %16 = load float, ptr %15, align 4, !tbaa !11
  %17 = fsub float %14, %16
  %18 = fpext float %17 to double
  %19 = load float, ptr %1, align 8, !tbaa !14
  %20 = load float, ptr %3, align 4, !tbaa !15
  %21 = fsub float %19, %20
  %22 = fpext float %21 to double
  %23 = tail call double @atan2(double noundef %18, double noundef %22) #6
  %24 = getelementptr inbounds i8, ptr %3, i64 8
  %25 = load float, ptr %24, align 4, !tbaa !16
  %.05461 = fptrunc double %23 to float
  %26 = fsub float %.05461, %25
  %27 = fpext float %26 to double
  %28 = fcmp ogt double %27, 0x400921FB54442D18
  br i1 %28, label %.lr.ph, label %.preheader59

.preheader59:                                     ; preds = %.lr.ph, %5
  %.pre-phi75 = phi double [ %27, %5 ], [ %33, %.lr.ph ]
  %.054.lcssa = phi float [ %.05461, %5 ], [ %.054, %.lr.ph ]
  %29 = fcmp olt double %.pre-phi75, 0xC00921FB54442D18
  br i1 %29, label %.lr.ph65, label %._crit_edge

.lr.ph:                                           ; preds = %5, %.lr.ph
  %.05462 = phi float [ %.054, %.lr.ph ], [ %.05461, %5 ]
  %30 = fpext float %.05462 to double
  %31 = fadd double %30, 0xC01921FB54442D18
  %.054 = fptrunc double %31 to float
  %32 = fsub float %.054, %25
  %33 = fpext float %32 to double
  %34 = fcmp ogt double %33, 0x400921FB54442D18
  br i1 %34, label %.lr.ph, label %.preheader59, !llvm.loop !17

.lr.ph65:                                         ; preds = %.preheader59, %.lr.ph65
  %.164 = phi float [ %37, %.lr.ph65 ], [ %.054.lcssa, %.preheader59 ]
  %35 = fpext float %.164 to double
  %36 = fadd double %35, 0x401921FB54442D18
  %37 = fptrunc double %36 to float
  %38 = fsub float %37, %25
  %39 = fpext float %38 to double
  %40 = fcmp olt double %39, 0xC00921FB54442D18
  br i1 %40, label %.lr.ph65, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph65, %.preheader59
  %.1.lcssa = phi float [ %.054.lcssa, %.preheader59 ], [ %37, %.lr.ph65 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 2000, ptr %6, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %41 = getelementptr inbounds i8, ptr %0, i64 8
  %42 = load i64, ptr %41, align 8, !tbaa !21
  %43 = uitofp i64 %42 to float
  %44 = getelementptr inbounds i8, ptr %1, i64 16
  %45 = load float, ptr %44, align 8, !tbaa !28
  %46 = fdiv float %43, %45
  %47 = fptosi float %46 to i32
  store i32 %47, ptr %7, align 4, !tbaa !20
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %49 = load i32, ptr %48, align 4, !tbaa !20
  %50 = sext i32 %49 to i64
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %51 = load float, ptr %24, align 4, !tbaa !16
  %52 = fsub float %.1.lcssa, %51
  %53 = load i64, ptr %0, align 8, !tbaa !29
  %54 = lshr i64 %53, 1
  %55 = uitofp nneg i64 %54 to float
  %56 = fmul float %52, %55
  %57 = getelementptr inbounds i8, ptr %3, i64 12
  %58 = load float, ptr %57, align 4, !tbaa !30
  %59 = fdiv float %56, %58
  %60 = lshr i64 %53, 2
  %61 = uitofp nneg i64 %60 to float
  %62 = fadd float %59, %61
  %63 = lshr i64 %50, 1
  %64 = uitofp nneg i64 %63 to float
  %65 = fsub float %62, %64
  %66 = fptosi float %65 to i32
  %67 = load i64, ptr %41, align 8, !tbaa !21
  %68 = lshr i64 %67, 1
  %69 = sub nsw i64 %68, %63
  %70 = trunc i64 %69 to i32
  %.not72 = icmp eq i32 %49, 0
  br i1 %.not72, label %._crit_edge71, label %.lr.ph70

.lr.ph70:                                         ; preds = %._crit_edge
  %71 = sext i32 %66 to i64
  %sext = shl i64 %69, 32
  %72 = ashr exact i64 %sext, 32
  %73 = getelementptr inbounds i8, ptr %4, i64 24
  %74 = getelementptr inbounds i8, ptr %1, i64 8
  br label %75

._crit_edge71:                                    ; preds = %.loopexit, %._crit_edge
  ret void

75:                                               ; preds = %.lr.ph70, %.loopexit
  %.05368 = phi i64 [ 0, %.lr.ph70 ], [ %112, %.loopexit ]
  %76 = trunc i64 %.05368 to i32
  %77 = add nsw i32 %76, %66
  %78 = icmp slt i32 %77, 0
  br i1 %78, label %.loopexit, label %79

79:                                               ; preds = %75
  %80 = add i64 %.05368, %71
  %81 = load i64, ptr %0, align 8, !tbaa !29
  %82 = lshr i64 %81, 1
  %.not = icmp ult i64 %80, %82
  br i1 %.not, label %83, label %.loopexit

83:                                               ; preds = %79
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %80) #6
  %85 = load float, ptr %84, align 4, !tbaa !31
  %86 = load float, ptr %44, align 8, !tbaa !28
  %87 = fcmp olt float %85, %86
  br i1 %87, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %83, %110
  %.067 = phi i64 [ %111, %110 ], [ 0, %83 ]
  %88 = trunc i64 %.067 to i32
  %89 = add nsw i32 %88, %70
  %90 = icmp slt i32 %89, 0
  br i1 %90, label %110, label %91

91:                                               ; preds = %.preheader
  %92 = add i64 %.067, %72
  %93 = load i64, ptr %41, align 8, !tbaa !21
  %.not58 = icmp ult i64 %92, %93
  br i1 %.not58, label %94, label %110

94:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %95 = load i64, ptr %73, align 8, !tbaa !32
  %96 = mul i64 %95, %.05368
  %97 = udiv i64 %96, %50
  %98 = mul i64 %95, %.067
  %99 = udiv i64 %98, %50
  %100 = load i64, ptr %74, align 8, !tbaa !34
  %101 = call noundef i32 @_ZNK7Texture3getEmmm(ptr noundef nonnull align 8 dereferenceable(56) %4, i64 noundef %97, i64 noundef %99, i64 noundef %100)
  store i32 %101, ptr %8, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #6
  call void @_Z12unpack_colorRKjRhS1_S1_S1_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 1 dereferenceable(1) %9, ptr noundef nonnull align 1 dereferenceable(1) %10, ptr noundef nonnull align 1 dereferenceable(1) %11, ptr noundef nonnull align 1 dereferenceable(1) %12)
  %102 = load i8, ptr %12, align 1, !tbaa !35
  %103 = icmp ugt i8 %102, -128
  br i1 %103, label %104, label %109

104:                                              ; preds = %94
  %105 = load i64, ptr %0, align 8, !tbaa !29
  %106 = lshr i64 %105, 1
  %107 = add i64 %80, %106
  %108 = load i32, ptr %8, align 4, !tbaa !20
  call void @_ZN11FrameBuffer9set_pixelEmmj(ptr noundef nonnull align 8 dereferenceable(40) %0, i64 noundef %107, i64 noundef %92, i32 noundef %108)
  br label %109

109:                                              ; preds = %104, %94
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  br label %110

110:                                              ; preds = %.preheader, %91, %109
  %111 = add nuw i64 %.067, 1
  %exitcond.not = icmp eq i64 %111, %50
  br i1 %exitcond.not, label %.loopexit, label %.preheader, !llvm.loop !36

.loopexit:                                        ; preds = %110, %83, %75, %79
  %112 = add nuw i64 %.05368, 1
  %exitcond74.not = icmp eq i64 %112, %50
  br i1 %exitcond74.not, label %._crit_edge71, label %75, !llvm.loop !37
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #5 align 2

declare void @_Z12unpack_colorRKjRhS1_S1_S1_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1

declare void @_ZN11FrameBuffer9set_pixelEmmj(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress 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 = { 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 = { inlinehint mustprogress 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 #5 = { mustprogress 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 #6 = { 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 = !{!"_ZTS6Sprite", !7, i64 0, !7, i64 4, !10, i64 8, !7, i64 16}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!12, !7, i64 4}
!12 = !{!"_ZTS6Player", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !13, i64 16, !13, i64 20}
!13 = !{!"int", !8, i64 0}
!14 = !{!6, !7, i64 0}
!15 = !{!12, !7, i64 0}
!16 = !{!12, !7, i64 8}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!13, !13, i64 0}
!21 = !{!22, !10, i64 8}
!22 = !{!"_ZTS11FrameBuffer", !10, i64 0, !10, i64 8, !23, i64 16}
!23 = !{!"_ZTSSt6vectorIjSaIjEE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !27, i64 0, !27, i64 8, !27, i64 16}
!27 = !{!"any pointer", !8, i64 0}
!28 = !{!6, !7, i64 16}
!29 = !{!22, !10, i64 0}
!30 = !{!12, !7, i64 12}
!31 = !{!7, !7, i64 0}
!32 = !{!33, !10, i64 24}
!33 = !{!"_ZTS7Texture", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !23, i64 32}
!34 = !{!6, !10, i64 8}
!35 = !{!8, !8, i64 0}
!36 = distinct !{!36, !18}
!37 = distinct !{!37, !18}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass