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

; 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_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: nounwind uwtable
declare dso_local void @trans(ptr noundef, double noundef, double noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @maps_2d(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 -1, ptr %4, align 4, !tbaa !9
  br label %5

5:                                                ; preds = %218, %1
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.s_data, ptr %6, i32 0, i32 19
  %8 = getelementptr inbounds %struct.s_map_result, ptr %7, i32 0, i32 7
  %9 = load ptr, ptr %8, align 8, !tbaa !11
  %10 = load i32, ptr %4, align 4, !tbaa !9
  %11 = add nsw i32 %10, 1
  store i32 %11, ptr %4, align 4, !tbaa !9
  %12 = sitofp i32 %11 to double
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.s_data, ptr %13, i32 0, i32 2
  %15 = load double, ptr %14, align 8, !tbaa !22
  %16 = fdiv double %12, %15
  %17 = fptosi double %16 to i32
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds ptr, ptr %9, i64 %18
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = ptrtoint ptr %20 to i32
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %219

23:                                               ; preds = %5
  store i32 -1, ptr %3, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %217, %23
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.s_data, ptr %25, i32 0, i32 19
  %27 = getelementptr inbounds %struct.s_map_result, ptr %26, i32 0, i32 7
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = load i32, ptr %4, align 4, !tbaa !9
  %30 = sitofp i32 %29 to double
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.s_data, ptr %31, i32 0, i32 2
  %33 = load double, ptr %32, align 8, !tbaa !22
  %34 = fdiv double %30, %33
  %35 = fptosi double %34 to i32
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds ptr, ptr %28, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = load i32, ptr %3, align 4, !tbaa !9
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %3, align 4, !tbaa !9
  %41 = sitofp i32 %40 to double
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.s_data, ptr %42, i32 0, i32 2
  %44 = load double, ptr %43, align 8, !tbaa !22
  %45 = fdiv double %41, %44
  %46 = fptosi double %45 to i32
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i8, ptr %38, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !23
  %50 = sext i8 %49 to i32
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %218

52:                                               ; preds = %24
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = load i32, ptr %3, align 4, !tbaa !9
  %55 = sitofp i32 %54 to double
  %56 = load i32, ptr %4, align 4, !tbaa !9
  %57 = sitofp i32 %56 to double
  call void @trans(ptr noundef %53, double noundef %55, double noundef %57)
  %58 = load i32, ptr %3, align 4, !tbaa !9
  %59 = sitofp i32 %58 to double
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.s_data, ptr %60, i32 0, i32 0
  %62 = load double, ptr %61, align 8, !tbaa !24
  %63 = fsub double %59, %62
  %64 = load i32, ptr %3, align 4, !tbaa !9
  %65 = sitofp i32 %64 to double
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.s_data, ptr %66, i32 0, i32 0
  %68 = load double, ptr %67, align 8, !tbaa !24
  %69 = fsub double %65, %68
  %70 = load i32, ptr %4, align 4, !tbaa !9
  %71 = sitofp i32 %70 to double
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.s_data, ptr %72, i32 0, i32 1
  %74 = load double, ptr %73, align 8, !tbaa !25
  %75 = fsub double %71, %74
  %76 = load i32, ptr %4, align 4, !tbaa !9
  %77 = sitofp i32 %76 to double
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.s_data, ptr %78, i32 0, i32 1
  %80 = load double, ptr %79, align 8, !tbaa !25
  %81 = fsub double %77, %80
  %82 = fmul double %75, %81
  %83 = call double @llvm.fmuladd.f64(double %63, double %69, double %82)
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.s_data, ptr %84, i32 0, i32 15
  %86 = getelementptr inbounds %struct.s_minimap, ptr %85, i32 0, i32 0
  %87 = load double, ptr %86, align 8, !tbaa !26
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.s_data, ptr %88, i32 0, i32 15
  %90 = getelementptr inbounds %struct.s_minimap, ptr %89, i32 0, i32 0
  %91 = load double, ptr %90, align 8, !tbaa !26
  %92 = fmul double %87, %91
  %93 = fcmp ole double %83, %92
  br i1 %93, label %94, label %217

94:                                               ; preds = %52
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.s_data, ptr %95, i32 0, i32 19
  %97 = getelementptr inbounds %struct.s_map_result, ptr %96, i32 0, i32 7
  %98 = load ptr, ptr %97, align 8, !tbaa !11
  %99 = load i32, ptr %4, align 4, !tbaa !9
  %100 = sitofp i32 %99 to double
  %101 = load ptr, ptr %2, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.s_data, ptr %101, i32 0, i32 2
  %103 = load double, ptr %102, align 8, !tbaa !22
  %104 = fdiv double %100, %103
  %105 = fptosi double %104 to i32
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds ptr, ptr %98, i64 %106
  %108 = load ptr, ptr %107, align 8, !tbaa !5
  %109 = load i32, ptr %3, align 4, !tbaa !9
  %110 = sitofp i32 %109 to double
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.s_data, ptr %111, i32 0, i32 2
  %113 = load double, ptr %112, align 8, !tbaa !22
  %114 = fdiv double %110, %113
  %115 = fptosi double %114 to i32
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds i8, ptr %108, i64 %116
  %118 = load i8, ptr %117, align 1, !tbaa !23
  %119 = sext i8 %118 to i32
  %120 = icmp eq i32 %119, 49
  br i1 %120, label %121, label %134

121:                                              ; preds = %94
  %122 = load ptr, ptr %2, align 8, !tbaa !5
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.s_data, ptr %123, i32 0, i32 15
  %125 = getelementptr inbounds %struct.s_minimap, ptr %124, i32 0, i32 3
  %126 = load double, ptr %125, align 8, !tbaa !27
  %127 = fptosi double %126 to i32
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.s_data, ptr %128, i32 0, i32 15
  %130 = getelementptr inbounds %struct.s_minimap, ptr %129, i32 0, i32 4
  %131 = load double, ptr %130, align 8, !tbaa !28
  %132 = fptosi double %131 to i32
  %133 = call i32 @my_pixel_put(ptr noundef %122, i32 noundef %127, i32 noundef %132, i32 noundef 0)
  br label %216

134:                                              ; preds = %94
  %135 = load ptr, ptr %2, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.s_data, ptr %135, i32 0, i32 19
  %137 = getelementptr inbounds %struct.s_map_result, ptr %136, i32 0, i32 7
  %138 = load ptr, ptr %137, align 8, !tbaa !11
  %139 = load i32, ptr %4, align 4, !tbaa !9
  %140 = sitofp i32 %139 to double
  %141 = load ptr, ptr %2, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.s_data, ptr %141, i32 0, i32 2
  %143 = load double, ptr %142, align 8, !tbaa !22
  %144 = fdiv double %140, %143
  %145 = fptosi double %144 to i32
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds ptr, ptr %138, i64 %146
  %148 = load ptr, ptr %147, align 8, !tbaa !5
  %149 = load i32, ptr %3, align 4, !tbaa !9
  %150 = sitofp i32 %149 to double
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.s_data, ptr %151, i32 0, i32 2
  %153 = load double, ptr %152, align 8, !tbaa !22
  %154 = fdiv double %150, %153
  %155 = fptosi double %154 to i32
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds i8, ptr %148, i64 %156
  %158 = load i8, ptr %157, align 1, !tbaa !23
  %159 = sext i8 %158 to i32
  %160 = icmp eq i32 %159, 50
  br i1 %160, label %161, label %174

161:                                              ; preds = %134
  %162 = load ptr, ptr %2, align 8, !tbaa !5
  %163 = load ptr, ptr %2, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.s_data, ptr %163, i32 0, i32 15
  %165 = getelementptr inbounds %struct.s_minimap, ptr %164, i32 0, i32 3
  %166 = load double, ptr %165, align 8, !tbaa !27
  %167 = fptosi double %166 to i32
  %168 = load ptr, ptr %2, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.s_data, ptr %168, i32 0, i32 15
  %170 = getelementptr inbounds %struct.s_minimap, ptr %169, i32 0, i32 4
  %171 = load double, ptr %170, align 8, !tbaa !28
  %172 = fptosi double %171 to i32
  %173 = call i32 @my_pixel_put(ptr noundef %162, i32 noundef %167, i32 noundef %172, i32 noundef 255)
  br label %215

174:                                              ; preds = %134
  %175 = load ptr, ptr %2, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.s_data, ptr %175, i32 0, i32 19
  %177 = getelementptr inbounds %struct.s_map_result, ptr %176, i32 0, i32 7
  %178 = load ptr, ptr %177, align 8, !tbaa !11
  %179 = load i32, ptr %4, align 4, !tbaa !9
  %180 = sitofp i32 %179 to double
  %181 = load ptr, ptr %2, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.s_data, ptr %181, i32 0, i32 2
  %183 = load double, ptr %182, align 8, !tbaa !22
  %184 = fdiv double %180, %183
  %185 = fptosi double %184 to i32
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds ptr, ptr %178, i64 %186
  %188 = load ptr, ptr %187, align 8, !tbaa !5
  %189 = load i32, ptr %3, align 4, !tbaa !9
  %190 = sitofp i32 %189 to double
  %191 = load ptr, ptr %2, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.s_data, ptr %191, i32 0, i32 2
  %193 = load double, ptr %192, align 8, !tbaa !22
  %194 = fdiv double %190, %193
  %195 = fptosi double %194 to i32
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds i8, ptr %188, i64 %196
  %198 = load i8, ptr %197, align 1, !tbaa !23
  %199 = sext i8 %198 to i32
  %200 = icmp ne i32 %199, 32
  br i1 %200, label %201, label %214

201:                                              ; preds = %174
  %202 = load ptr, ptr %2, align 8, !tbaa !5
  %203 = load ptr, ptr %2, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.s_data, ptr %203, i32 0, i32 15
  %205 = getelementptr inbounds %struct.s_minimap, ptr %204, i32 0, i32 3
  %206 = load double, ptr %205, align 8, !tbaa !27
  %207 = fptosi double %206 to i32
  %208 = load ptr, ptr %2, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.s_data, ptr %208, i32 0, i32 15
  %210 = getelementptr inbounds %struct.s_minimap, ptr %209, i32 0, i32 4
  %211 = load double, ptr %210, align 8, !tbaa !28
  %212 = fptosi double %211 to i32
  %213 = call i32 @my_pixel_put(ptr noundef %202, i32 noundef %207, i32 noundef %212, i32 noundef 16777215)
  br label %214

214:                                              ; preds = %201, %174
  br label %215

215:                                              ; preds = %214, %161
  br label %216

216:                                              ; preds = %215, %121
  br label %217

217:                                              ; preds = %216, %52
  br label %24, !llvm.loop !29

218:                                              ; preds = %24
  br label %5, !llvm.loop !31

219:                                              ; preds = %5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void
}

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

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

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

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 424}
!12 = !{!"s_data", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !10, i64 80, !13, i64 88, !13, i64 96, !6, 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, !6, i64 584}
!13 = !{!"double", !7, i64 0}
!14 = !{!"s_sprites", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!15 = !{!"s_minimap", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32}
!16 = !{!"s_door", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!17 = !{!"s_textures", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !6, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !6, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !6, i64 104, !10, i64 112, !10, i64 116, !10, i64 120}
!18 = !{!"s_hook", !13, i64 0, !10, i64 8, !13, i64 16, !13, i64 24, !13, i64 32}
!19 = !{!"s_map_result", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !7, i64 72}
!20 = !{!"s_rycast", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64}
!21 = !{!"s_mlx", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !10, i64 48}
!22 = !{!12, !13, i64 16}
!23 = !{!7, !7, i64 0}
!24 = !{!12, !13, i64 0}
!25 = !{!12, !13, i64 8}
!26 = !{!12, !13, i64 144}
!27 = !{!12, !13, i64 168}
!28 = !{!12, !13, i64 176}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}


; 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
declare dso_local void @trans(ptr noundef, double noundef, double noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @maps_2d(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 424
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = load double, ptr %3, align 8, !tbaa !20
  %6 = fdiv double 0.000000e+00, %5
  %7 = fptosi double %6 to i32
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds ptr, ptr %4, i64 %8
  %10 = load ptr, ptr %9, align 8, !tbaa !21
  %11 = ptrtoint ptr %10 to i64
  %12 = and i64 %11, 4294967295
  %.not49 = icmp eq i64 %12, 0
  br i1 %.not49, label %._crit_edge, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %1
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = getelementptr inbounds i8, ptr %0, i64 144
  %15 = getelementptr inbounds i8, ptr %0, i64 168
  %16 = getelementptr inbounds i8, ptr %0, i64 176
  br label %.preheader

.loopexit:                                        ; preds = %73, %.preheader
  %17 = phi double [ %28, %.preheader ], [ %75, %73 ]
  %18 = phi ptr [ %29, %.preheader ], [ %74, %73 ]
  %19 = add nuw nsw i32 %31, 1
  %20 = uitofp nneg i32 %19 to double
  %21 = fdiv double %20, %17
  %22 = fptosi double %21 to i32
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds ptr, ptr %18, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !21
  %26 = ptrtoint ptr %25 to i64
  %27 = and i64 %26, 4294967295
  %.not = icmp eq i64 %27, 0
  br i1 %.not, label %._crit_edge, label %.preheader, !llvm.loop !22

.preheader:                                       ; preds = %.preheader.lr.ph, %.loopexit
  %28 = phi double [ %5, %.preheader.lr.ph ], [ %17, %.loopexit ]
  %29 = phi ptr [ %4, %.preheader.lr.ph ], [ %18, %.loopexit ]
  %30 = phi double [ 0.000000e+00, %.preheader.lr.ph ], [ %20, %.loopexit ]
  %31 = phi i32 [ 0, %.preheader.lr.ph ], [ %19, %.loopexit ]
  %32 = fdiv double %30, %28
  %33 = fptosi double %32 to i32
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds ptr, ptr %29, i64 %34
  %36 = load ptr, ptr %35, align 8, !tbaa !21
  %37 = fdiv double 0.000000e+00, %28
  %38 = fptosi double %37 to i32
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i8, ptr %36, i64 %39
  %41 = load i8, ptr %40, align 1, !tbaa !24
  %.not4648 = icmp eq i8 %41, 0
  br i1 %.not4648, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %73
  %42 = phi double [ %82, %73 ], [ 0.000000e+00, %.preheader ]
  %43 = phi i32 [ %81, %73 ], [ 0, %.preheader ]
  tail call void @trans(ptr noundef nonnull %0, double noundef %42, double noundef %30)
  %44 = load double, ptr %0, align 8, !tbaa !25
  %45 = fsub double %42, %44
  %46 = load double, ptr %13, align 8, !tbaa !26
  %47 = fsub double %30, %46
  %48 = fmul double %47, %47
  %49 = tail call double @llvm.fmuladd.f64(double %45, double %45, double %48)
  %50 = load double, ptr %14, align 8, !tbaa !27
  %51 = fmul double %50, %50
  %52 = fcmp ugt double %49, %51
  br i1 %52, label %73, label %53

53:                                               ; preds = %.lr.ph
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = load double, ptr %3, align 8, !tbaa !20
  %56 = fdiv double %30, %55
  %57 = fptosi double %56 to i32
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds ptr, ptr %54, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !21
  %61 = fdiv double %42, %55
  %62 = fptosi double %61 to i32
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i8, ptr %60, i64 %63
  %65 = load i8, ptr %64, align 1, !tbaa !24
  switch i8 %65, label %67 [
    i8 49, label %.sink.split
    i8 50, label %66
    i8 32, label %73
  ]

66:                                               ; preds = %53
  br label %.sink.split

67:                                               ; preds = %53
  br label %.sink.split

.sink.split:                                      ; preds = %53, %66, %67
  %.sink52 = phi i32 [ 16777215, %67 ], [ 255, %66 ], [ 0, %53 ]
  %68 = load double, ptr %15, align 8, !tbaa !28
  %69 = fptosi double %68 to i32
  %70 = load double, ptr %16, align 8, !tbaa !29
  %71 = fptosi double %70 to i32
  %72 = tail call i32 @my_pixel_put(ptr noundef nonnull %0, i32 noundef %69, i32 noundef %71, i32 noundef %.sink52) #3
  br label %73

73:                                               ; preds = %.sink.split, %53, %.lr.ph
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = load double, ptr %3, align 8, !tbaa !20
  %76 = fdiv double %30, %75
  %77 = fptosi double %76 to i32
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds ptr, ptr %74, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !21
  %81 = add nuw nsw i32 %43, 1
  %82 = uitofp nneg i32 %81 to double
  %83 = fdiv double %82, %75
  %84 = fptosi double %83 to i32
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i8, ptr %80, i64 %85
  %87 = load i8, ptr %86, align 1, !tbaa !24
  %.not46 = icmp eq i8 %87, 0
  br i1 %.not46, label %.loopexit, label %.lr.ph, !llvm.loop !30

._crit_edge:                                      ; preds = %.loopexit, %1
  ret void
}

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

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

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 = { "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, !11, i64 424}
!6 = !{!"s_data", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !10, i64 80, !7, i64 88, !7, i64 96, !11, i64 104, !12, i64 112, !13, i64 144, !14, i64 184, !15, i64 208, !16, i64 336, !17, i64 376, !18, i64 456, !19, i64 528, !11, i64 584}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"s_sprites", !11, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!13 = !{!"s_minimap", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!14 = !{!"s_door", !11, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!15 = !{!"s_textures", !10, i64 0, !11, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !11, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !11, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !11, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !11, i64 104, !10, i64 112, !10, i64 116, !10, i64 120}
!16 = !{!"s_hook", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!17 = !{!"s_map_result", !10, i64 0, !10, i64 4, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !8, i64 72}
!18 = !{!"s_rycast", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64}
!19 = !{!"s_mlx", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !10, i64 40, !10, i64 44, !10, i64 48}
!20 = !{!6, !7, i64 16}
!21 = !{!11, !11, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!8, !8, i64 0}
!25 = !{!6, !7, i64 0}
!26 = !{!6, !7, i64 8}
!27 = !{!6, !7, i64 144}
!28 = !{!6, !7, i64 168}
!29 = !{!6, !7, i64 176}
!30 = distinct !{!30, !23}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass