; LLVM IR from yettabaa/cub3D :: bonus (door)

; 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.s_object = type { i32, double, double, double, double, i32, double, double, double, double, double, ptr }
%struct.s_data = type { double, double, double, double, double, double, double, double, double, double, i32, double, double, ptr, %struct.s_sprites, %struct.s_minimap, %struct.s_door, %struct.s_textures, %struct.s_hook, %struct.s_map_result, %struct.s_rycast, %struct.s_mlx, ptr }
%struct.s_sprites = type { ptr, i32, i32, i32, i32, i32, i32 }
%struct.s_minimap = type { double, double, double, double, double }
%struct.s_door = type { ptr, i32, i32, i32 }
%struct.s_textures = type { i32, ptr, i32, i32, i32, ptr, i32, i32, i32, ptr, i32, i32, i32, ptr, i32, i32, i32, ptr, i32, i32, i32 }
%struct.s_hook = type { double, i32, double, double, double }
%struct.s_map_result = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i8 }
%struct.s_rycast = type { double, double, double, double, double, double, double, double, double }
%struct.s_mlx = type { ptr, ptr, ptr, ptr, ptr, i32, i32, i32 }

; 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: nounwind uwtable
define dso_local void @dda_door(ptr noundef %0, ptr noundef %1, double noundef %2, double noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store double %2, ptr %7, align 8, !tbaa !9
  store double %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %14 = load double, ptr %7, align 8, !tbaa !9
  %15 = fcmp olt double %14, 0.000000e+00
  br i1 %15, label %16, label %17

16:                                               ; preds = %4
  store double 0.000000e+00, ptr %7, align 8, !tbaa !9
  br label %17

17:                                               ; preds = %16, %4
  %18 = phi i1 [ false, %4 ], [ false, %16 ]
  %19 = zext i1 %18 to i32
  %20 = load double, ptr %8, align 8, !tbaa !9
  %21 = fcmp ogt double %20, 1.000000e+03
  br i1 %21, label %22, label %23

22:                                               ; preds = %17
  store double 1.000000e+03, ptr %8, align 8, !tbaa !9
  br label %23

23:                                               ; preds = %22, %17
  %24 = phi i1 [ false, %17 ], [ true, %22 ]
  %25 = zext i1 %24 to i32
  %26 = load double, ptr %7, align 8, !tbaa !9
  %27 = load double, ptr %8, align 8, !tbaa !9
  %28 = fsub double %26, %27
  %29 = call double @llvm.fabs.f64(double %28)
  store double %29, ptr %12, align 8, !tbaa !9
  store i32 -1, ptr %9, align 4, !tbaa !11
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.s_object, ptr %30, i32 0, i32 5
  %32 = load i32, ptr %31, align 8, !tbaa !13
  %33 = icmp eq i32 %32, 8
  br i1 %33, label %34, label %54

34:                                               ; preds = %23
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.s_data, ptr %35, i32 0, i32 17
  %37 = getelementptr inbounds %struct.s_textures, ptr %36, i32 0, i32 18
  %38 = load i32, ptr %37, align 8, !tbaa !15
  %39 = sitofp i32 %38 to double
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.s_object, ptr %40, i32 0, i32 2
  %42 = load double, ptr %41, align 8, !tbaa !25
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.s_data, ptr %43, i32 0, i32 2
  %45 = load double, ptr %44, align 8, !tbaa !26
  %46 = call double @fmod(double noundef %42, double noundef %45) #5
  %47 = fmul double %39, %46
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.s_data, ptr %48, i32 0, i32 2
  %50 = load double, ptr %49, align 8, !tbaa !26
  %51 = fdiv double %47, %50
  %52 = fptosi double %51 to i32
  store i32 %52, ptr %10, align 4, !tbaa !11
  %53 = icmp ne i32 %52, 0
  br label %54

54:                                               ; preds = %34, %23
  %55 = phi i1 [ false, %23 ], [ %53, %34 ]
  %56 = zext i1 %55 to i32
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.s_object, ptr %57, i32 0, i32 5
  %59 = load i32, ptr %58, align 8, !tbaa !13
  %60 = icmp eq i32 %59, 7
  br i1 %60, label %61, label %81

61:                                               ; preds = %54
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.s_data, ptr %62, i32 0, i32 17
  %64 = getelementptr inbounds %struct.s_textures, ptr %63, i32 0, i32 18
  %65 = load i32, ptr %64, align 8, !tbaa !15
  %66 = sitofp i32 %65 to double
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.s_object, ptr %67, i32 0, i32 1
  %69 = load double, ptr %68, align 8, !tbaa !27
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.s_data, ptr %70, i32 0, i32 2
  %72 = load double, ptr %71, align 8, !tbaa !26
  %73 = call double @fmod(double noundef %69, double noundef %72) #5
  %74 = fmul double %66, %73
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.s_data, ptr %75, i32 0, i32 2
  %77 = load double, ptr %76, align 8, !tbaa !26
  %78 = fdiv double %74, %77
  %79 = fptosi double %78 to i32
  store i32 %79, ptr %10, align 4, !tbaa !11
  %80 = icmp ne i32 %79, 0
  br label %81

81:                                               ; preds = %61, %54
  %82 = phi i1 [ false, %54 ], [ %80, %61 ]
  %83 = zext i1 %82 to i32
  %84 = load i32, ptr %10, align 4, !tbaa !11
  %85 = icmp slt i32 %84, 0
  br i1 %85, label %86, label %87

86:                                               ; preds = %81
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %87

87:                                               ; preds = %86, %81
  %88 = phi i1 [ false, %81 ], [ false, %86 ]
  %89 = zext i1 %88 to i32
  %90 = load i32, ptr %10, align 4, !tbaa !11
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.s_data, ptr %91, i32 0, i32 17
  %93 = getelementptr inbounds %struct.s_textures, ptr %92, i32 0, i32 18
  %94 = load i32, ptr %93, align 8, !tbaa !15
  %95 = icmp sgt i32 %90, %94
  br i1 %95, label %96, label %102

96:                                               ; preds = %87
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.s_data, ptr %97, i32 0, i32 17
  %99 = getelementptr inbounds %struct.s_textures, ptr %98, i32 0, i32 18
  %100 = load i32, ptr %99, align 8, !tbaa !15
  store i32 %100, ptr %10, align 4, !tbaa !11
  %101 = icmp ne i32 %100, 0
  br label %102

102:                                              ; preds = %96, %87
  %103 = phi i1 [ false, %87 ], [ %101, %96 ]
  %104 = zext i1 %103 to i32
  br label %105

105:                                              ; preds = %194, %102
  %106 = load i32, ptr %9, align 4, !tbaa !11
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %9, align 4, !tbaa !11
  %108 = sitofp i32 %107 to double
  %109 = load double, ptr %12, align 8, !tbaa !9
  %110 = fcmp olt double %108, %109
  br i1 %110, label %111, label %197

111:                                              ; preds = %105
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.s_data, ptr %112, i32 0, i32 17
  %114 = getelementptr inbounds %struct.s_textures, ptr %113, i32 0, i32 19
  %115 = load i32, ptr %114, align 4, !tbaa !28
  %116 = sitofp i32 %115 to double
  %117 = load i32, ptr %9, align 4, !tbaa !11
  %118 = sitofp i32 %117 to double
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.s_data, ptr %119, i32 0, i32 12
  %121 = load double, ptr %120, align 8, !tbaa !29
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.s_data, ptr %122, i32 0, i32 11
  %124 = load double, ptr %123, align 8, !tbaa !30
  %125 = fsub double %121, %124
  %126 = load double, ptr %12, align 8, !tbaa !9
  %127 = fsub double %125, %126
  %128 = call double @llvm.fabs.f64(double %127)
  %129 = fdiv double %128, 2.000000e+00
  %130 = fadd double %118, %129
  %131 = fmul double %116, %130
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.s_data, ptr %132, i32 0, i32 12
  %134 = load double, ptr %133, align 8, !tbaa !29
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.s_data, ptr %135, i32 0, i32 11
  %137 = load double, ptr %136, align 8, !tbaa !30
  %138 = fsub double %134, %137
  %139 = call double @llvm.fabs.f64(double %138)
  %140 = fdiv double %131, %139
  %141 = fptosi double %140 to i32
  store i32 %141, ptr %11, align 4, !tbaa !11
  %142 = load i32, ptr %11, align 4, !tbaa !11
  %143 = icmp slt i32 %142, 0
  br i1 %143, label %144, label %145

144:                                              ; preds = %111
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %145

145:                                              ; preds = %144, %111
  %146 = phi i1 [ false, %111 ], [ false, %144 ]
  %147 = zext i1 %146 to i32
  %148 = load i32, ptr %11, align 4, !tbaa !11
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.s_data, ptr %149, i32 0, i32 17
  %151 = getelementptr inbounds %struct.s_textures, ptr %150, i32 0, i32 19
  %152 = load i32, ptr %151, align 4, !tbaa !28
  %153 = icmp sgt i32 %148, %152
  br i1 %153, label %154, label %160

154:                                              ; preds = %145
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.s_data, ptr %155, i32 0, i32 17
  %157 = getelementptr inbounds %struct.s_textures, ptr %156, i32 0, i32 19
  %158 = load i32, ptr %157, align 4, !tbaa !28
  store i32 %158, ptr %11, align 4, !tbaa !11
  %159 = icmp ne i32 %158, 0
  br label %160

160:                                              ; preds = %154, %145
  %161 = phi i1 [ false, %145 ], [ %159, %154 ]
  %162 = zext i1 %161 to i32
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.s_data, ptr %163, i32 0, i32 17
  %165 = getelementptr inbounds %struct.s_textures, ptr %164, i32 0, i32 17
  %166 = load ptr, ptr %165, align 8, !tbaa !31
  %167 = load i32, ptr %11, align 4, !tbaa !11
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.s_data, ptr %168, i32 0, i32 17
  %170 = getelementptr inbounds %struct.s_textures, ptr %169, i32 0, i32 20
  %171 = load i32, ptr %170, align 8, !tbaa !32
  %172 = sdiv i32 %171, 4
  %173 = mul nsw i32 %167, %172
  %174 = load i32, ptr %10, align 4, !tbaa !11
  %175 = add nsw i32 %173, %174
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds i32, ptr %166, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !11
  store i32 %178, ptr %13, align 4, !tbaa !11
  %179 = load i32, ptr %13, align 4, !tbaa !11
  %180 = lshr i32 %179, 24
  %181 = and i32 %180, 255
  %182 = icmp ne i32 %181, 255
  br i1 %182, label %183, label %194

183:                                              ; preds = %160
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  %185 = load ptr, ptr %5, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.s_data, ptr %185, i32 0, i32 10
  %187 = load i32, ptr %186, align 8, !tbaa !33
  %188 = load double, ptr %7, align 8, !tbaa !9
  %189 = fadd double %188, 1.000000e+00
  store double %189, ptr %7, align 8, !tbaa !9
  %190 = fptosi double %188 to i32
  %191 = load i32, ptr %13, align 4, !tbaa !11
  %192 = call i32 @my_pixel_put(ptr noundef %184, i32 noundef %187, i32 noundef %190, i32 noundef %191)
  %193 = icmp ne i32 %192, 0
  br label %194

194:                                              ; preds = %183, %160
  %195 = phi i1 [ false, %160 ], [ %193, %183 ]
  %196 = zext i1 %195 to i32
  br label %105, !llvm.loop !34

197:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #2

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

declare i32 @my_pixel_put(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 40}
!14 = !{!"s_object", !12, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !12, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !6, i64 88}
!15 = !{!16, !12, i64 320}
!16 = !{!"s_data", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !12, i64 80, !10, i64 88, !10, i64 96, !6, i64 104, !17, i64 112, !18, i64 144, !19, i64 184, !20, i64 208, !21, i64 336, !22, i64 376, !23, i64 456, !24, i64 528, !6, i64 584}
!17 = !{!"s_sprites", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!18 = !{!"s_minimap", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!19 = !{!"s_door", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!20 = !{!"s_textures", !12, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !6, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !6, i64 56, !12, i64 64, !12, i64 68, !12, i64 72, !6, i64 80, !12, i64 88, !12, i64 92, !12, i64 96, !6, i64 104, !12, i64 112, !12, i64 116, !12, i64 120}
!21 = !{!"s_hook", !10, i64 0, !12, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!22 = !{!"s_map_result", !12, i64 0, !12, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !7, i64 72}
!23 = !{!"s_rycast", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!24 = !{!"s_mlx", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !12, i64 44, !12, i64 48}
!25 = !{!14, !10, i64 16}
!26 = !{!16, !10, i64 16}
!27 = !{!14, !10, i64 8}
!28 = !{!16, !12, i64 324}
!29 = !{!16, !10, i64 96}
!30 = !{!16, !10, i64 88}
!31 = !{!16, !6, i64 312}
!32 = !{!16, !12, i64 328}
!33 = !{!16, !12, i64 80}
!34 = distinct !{!34, !35}
!35 = !{!"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"

; Function Attrs: nounwind uwtable
define dso_local void @dda_door(ptr noundef %0, ptr nocapture noundef readonly %1, double noundef %2, double noundef %3) local_unnamed_addr #0 {
  %5 = fcmp olt double %2, 0.000000e+00
  %.0 = select i1 %5, double 0.000000e+00, double %2
  %6 = fcmp ogt double %3, 1.000000e+03
  %.040 = select i1 %6, double 1.000000e+03, double %3
  %7 = fsub double %.0, %.040
  %8 = tail call double @llvm.fabs.f64(double %7)
  %9 = getelementptr inbounds i8, ptr %1, i64 40
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = icmp eq i32 %10, 8
  br i1 %11, label %12, label %25

12:                                               ; preds = %4
  %13 = getelementptr inbounds i8, ptr %0, i64 320
  %14 = load i32, ptr %13, align 8, !tbaa !12
  %15 = sitofp i32 %14 to double
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load double, ptr %16, align 8, !tbaa !22
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = load double, ptr %18, align 8, !tbaa !23
  %20 = tail call double @fmod(double noundef %17, double noundef %19) #5
  %21 = fmul double %20, %15
  %22 = load double, ptr %18, align 8, !tbaa !23
  %23 = fdiv double %21, %22
  %24 = fptosi double %23 to i32
  %.pr = load i32, ptr %9, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %12, %4
  %26 = phi i32 [ %.pr, %12 ], [ %10, %4 ]
  %.042 = phi i32 [ %24, %12 ], [ undef, %4 ]
  %27 = icmp eq i32 %26, 7
  br i1 %27, label %28, label %41

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %0, i64 320
  %30 = load i32, ptr %29, align 8, !tbaa !12
  %31 = sitofp i32 %30 to double
  %32 = getelementptr inbounds i8, ptr %1, i64 8
  %33 = load double, ptr %32, align 8, !tbaa !24
  %34 = getelementptr inbounds i8, ptr %0, i64 16
  %35 = load double, ptr %34, align 8, !tbaa !23
  %36 = tail call double @fmod(double noundef %33, double noundef %35) #5
  %37 = fmul double %36, %31
  %38 = load double, ptr %34, align 8, !tbaa !23
  %39 = fdiv double %37, %38
  %40 = fptosi double %39 to i32
  br label %41

41:                                               ; preds = %28, %25
  %.143 = phi i32 [ %40, %28 ], [ %.042, %25 ]
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %.143, i32 0)
  %42 = getelementptr inbounds i8, ptr %0, i64 320
  %43 = load i32, ptr %42, align 8, !tbaa !12
  %spec.select = tail call i32 @llvm.smin.i32(i32 %spec.store.select, i32 %43)
  %44 = fcmp ueq double %7, 0.000000e+00
  br i1 %44, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %41
  %45 = getelementptr inbounds i8, ptr %0, i64 324
  %46 = getelementptr inbounds i8, ptr %0, i64 96
  %47 = getelementptr inbounds i8, ptr %0, i64 88
  %48 = getelementptr inbounds i8, ptr %0, i64 312
  %49 = getelementptr inbounds i8, ptr %0, i64 328
  %50 = getelementptr inbounds i8, ptr %0, i64 80
  br label %51

51:                                               ; preds = %.lr.ph, %80
  %52 = phi double [ 0.000000e+00, %.lr.ph ], [ %82, %80 ]
  %53 = phi i32 [ 0, %.lr.ph ], [ %81, %80 ]
  %.153 = phi double [ %.0, %.lr.ph ], [ %.2, %80 ]
  %54 = load i32, ptr %45, align 4, !tbaa !25
  %55 = sitofp i32 %54 to double
  %56 = load double, ptr %46, align 8, !tbaa !26
  %57 = load double, ptr %47, align 8, !tbaa !27
  %58 = fsub double %56, %57
  %59 = fsub double %58, %8
  %60 = tail call double @llvm.fabs.f64(double %59)
  %61 = fmul double %60, 5.000000e-01
  %62 = fadd double %52, %61
  %63 = fmul double %62, %55
  %64 = tail call double @llvm.fabs.f64(double %58)
  %65 = fdiv double %63, %64
  %66 = fptosi double %65 to i32
  %spec.store.select1 = tail call i32 @llvm.smax.i32(i32 %66, i32 0)
  %spec.select52 = tail call i32 @llvm.smin.i32(i32 %spec.store.select1, i32 %54)
  %67 = load ptr, ptr %48, align 8, !tbaa !28
  %68 = load i32, ptr %49, align 8, !tbaa !29
  %69 = sdiv i32 %68, 4
  %70 = mul nsw i32 %spec.select52, %69
  %71 = add nsw i32 %70, %spec.select
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds i32, ptr %67, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !30
  %.not = icmp ugt i32 %74, -16777217
  br i1 %.not, label %80, label %75

75:                                               ; preds = %51
  %76 = load i32, ptr %50, align 8, !tbaa !31
  %77 = fadd double %.153, 1.000000e+00
  %78 = fptosi double %.153 to i32
  %79 = tail call i32 @my_pixel_put(ptr noundef nonnull %0, i32 noundef %76, i32 noundef %78, i32 noundef %74) #5
  br label %80

80:                                               ; preds = %75, %51
  %.2 = phi double [ %77, %75 ], [ %.153, %51 ]
  %81 = add nuw nsw i32 %53, 1
  %82 = uitofp nneg i32 %81 to double
  %83 = fcmp ogt double %8, %82
  br i1 %83, label %51, label %._crit_edge, !llvm.loop !32

._crit_edge:                                      ; preds = %80, %41
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #1

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

declare i32 @my_pixel_put(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4

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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !7, i64 40}
!6 = !{!"s_object", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !11, i64 88}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!13, !7, i64 320}
!13 = !{!"s_data", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !7, i64 80, !10, i64 88, !10, i64 96, !11, i64 104, !14, i64 112, !15, i64 144, !16, i64 184, !17, i64 208, !18, i64 336, !19, i64 376, !20, i64 456, !21, i64 528, !11, i64 584}
!14 = !{!"s_sprites", !11, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28}
!15 = !{!"s_minimap", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!16 = !{!"s_door", !11, i64 0, !7, i64 8, !7, i64 12, !7, i64 16}
!17 = !{!"s_textures", !7, i64 0, !11, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !11, i64 32, !7, i64 40, !7, i64 44, !7, i64 48, !11, i64 56, !7, i64 64, !7, i64 68, !7, i64 72, !11, i64 80, !7, i64 88, !7, i64 92, !7, i64 96, !11, i64 104, !7, i64 112, !7, i64 116, !7, i64 120}
!18 = !{!"s_hook", !10, i64 0, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!19 = !{!"s_map_result", !7, i64 0, !7, i64 4, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !8, i64 72}
!20 = !{!"s_rycast", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!21 = !{!"s_mlx", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !7, i64 40, !7, i64 44, !7, i64 48}
!22 = !{!6, !10, i64 16}
!23 = !{!13, !10, i64 16}
!24 = !{!6, !10, i64 8}
!25 = !{!13, !7, i64 324}
!26 = !{!13, !10, i64 96}
!27 = !{!13, !10, i64 88}
!28 = !{!13, !11, i64 312}
!29 = !{!13, !7, i64 328}
!30 = !{!7, !7, i64 0}
!31 = !{!13, !7, i64 80}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass