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

; 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
define dso_local double @raycasting_bonus(ptr noundef %0, ptr noundef %1, double noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store double %2, ptr %6, align 8, !tbaa !9
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = load double, ptr %6, align 8, !tbaa !9
  call void @steps(ptr noundef %7, double noundef %8)
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = load double, ptr %6, align 8, !tbaa !9
  call void @inc_smal_steps(ptr noundef %9, ptr noundef %10, double noundef %11)
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = load double, ptr %6, align 8, !tbaa !9
  call void @inc_big_steps(ptr noundef %12, ptr noundef %13, double noundef %14)
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.s_data, ptr %15, i32 0, i32 20
  %17 = getelementptr inbounds %struct.s_rycast, ptr %16, i32 0, i32 7
  %18 = load double, ptr %17, align 8, !tbaa !11
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.s_data, ptr %19, i32 0, i32 20
  %21 = getelementptr inbounds %struct.s_rycast, ptr %20, i32 0, i32 8
  %22 = load double, ptr %21, align 8, !tbaa !22
  %23 = call double @llvm.minnum.f64(double %18, double %22)
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.s_data, ptr %24, i32 0, i32 5
  store double %23, ptr %25, align 8, !tbaa !23
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.s_data, ptr %26, i32 0, i32 20
  %28 = getelementptr inbounds %struct.s_rycast, ptr %27, i32 0, i32 7
  %29 = load double, ptr %28, align 8, !tbaa !11
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.s_data, ptr %30, i32 0, i32 20
  %32 = getelementptr inbounds %struct.s_rycast, ptr %31, i32 0, i32 8
  %33 = load double, ptr %32, align 8, !tbaa !22
  %34 = call double @llvm.minnum.f64(double %29, double %33)
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.s_data, ptr %35, i32 0, i32 3
  %37 = load double, ptr %36, align 8, !tbaa !24
  %38 = load double, ptr %6, align 8, !tbaa !9
  %39 = fsub double %37, %38
  %40 = call double @rad(double noundef %39)
  %41 = call double @cos(double noundef %40) #4
  %42 = fmul double %34, %41
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.s_data, ptr %43, i32 0, i32 6
  store double %42, ptr %44, align 8, !tbaa !25
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.s_data, ptr %45, i32 0, i32 20
  %47 = getelementptr inbounds %struct.s_rycast, ptr %46, i32 0, i32 8
  %48 = load double, ptr %47, align 8, !tbaa !22
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.s_data, ptr %49, i32 0, i32 20
  %51 = getelementptr inbounds %struct.s_rycast, ptr %50, i32 0, i32 7
  %52 = load double, ptr %51, align 8, !tbaa !11
  %53 = fcmp ogt double %48, %52
  br i1 %53, label %54, label %72

54:                                               ; preds = %3
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.s_data, ptr %55, i32 0, i32 20
  %57 = getelementptr inbounds %struct.s_rycast, ptr %56, i32 0, i32 5
  %58 = load double, ptr %57, align 8, !tbaa !26
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.s_data, ptr %59, i32 0, i32 20
  %61 = getelementptr inbounds %struct.s_rycast, ptr %60, i32 0, i32 6
  %62 = load double, ptr %61, align 8, !tbaa !27
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.s_data, ptr %63, i32 0, i32 4
  %65 = load double, ptr %64, align 8, !tbaa !28
  %66 = fadd double %62, %65
  %67 = fcmp ogt double %58, %66
  br i1 %67, label %68, label %72

68:                                               ; preds = %54
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.s_data, ptr %69, i32 0, i32 17
  %71 = getelementptr inbounds %struct.s_textures, ptr %70, i32 0, i32 0
  store i32 8, ptr %71, align 8, !tbaa !29
  br label %159

72:                                               ; preds = %54, %3
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.s_data, ptr %73, i32 0, i32 20
  %75 = getelementptr inbounds %struct.s_rycast, ptr %74, i32 0, i32 8
  %76 = load double, ptr %75, align 8, !tbaa !22
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.s_data, ptr %77, i32 0, i32 20
  %79 = getelementptr inbounds %struct.s_rycast, ptr %78, i32 0, i32 7
  %80 = load double, ptr %79, align 8, !tbaa !11
  %81 = fcmp olt double %76, %80
  br i1 %81, label %82, label %100

82:                                               ; preds = %72
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.s_data, ptr %83, i32 0, i32 20
  %85 = getelementptr inbounds %struct.s_rycast, ptr %84, i32 0, i32 5
  %86 = load double, ptr %85, align 8, !tbaa !26
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.s_data, ptr %87, i32 0, i32 4
  %89 = load double, ptr %88, align 8, !tbaa !28
  %90 = fadd double %86, %89
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.s_data, ptr %91, i32 0, i32 20
  %93 = getelementptr inbounds %struct.s_rycast, ptr %92, i32 0, i32 6
  %94 = load double, ptr %93, align 8, !tbaa !27
  %95 = fcmp olt double %90, %94
  br i1 %95, label %96, label %100

96:                                               ; preds = %82
  %97 = load ptr, ptr %4, 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 0
  store i32 8, ptr %99, align 8, !tbaa !29
  br label %158

100:                                              ; preds = %82, %72
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.s_data, ptr %101, i32 0, i32 20
  %103 = getelementptr inbounds %struct.s_rycast, ptr %102, i32 0, i32 8
  %104 = load double, ptr %103, align 8, !tbaa !22
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.s_data, ptr %105, i32 0, i32 20
  %107 = getelementptr inbounds %struct.s_rycast, ptr %106, i32 0, i32 7
  %108 = load double, ptr %107, align 8, !tbaa !11
  %109 = fcmp ogt double %104, %108
  br i1 %109, label %110, label %128

110:                                              ; preds = %100
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.s_data, ptr %111, i32 0, i32 20
  %113 = getelementptr inbounds %struct.s_rycast, ptr %112, i32 0, i32 5
  %114 = load double, ptr %113, align 8, !tbaa !26
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.s_data, ptr %115, i32 0, i32 4
  %117 = load double, ptr %116, align 8, !tbaa !28
  %118 = fadd double %114, %117
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.s_data, ptr %119, i32 0, i32 20
  %121 = getelementptr inbounds %struct.s_rycast, ptr %120, i32 0, i32 6
  %122 = load double, ptr %121, align 8, !tbaa !27
  %123 = fcmp olt double %118, %122
  br i1 %123, label %124, label %128

124:                                              ; preds = %110
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.s_data, ptr %125, i32 0, i32 17
  %127 = getelementptr inbounds %struct.s_textures, ptr %126, i32 0, i32 0
  store i32 7, ptr %127, align 8, !tbaa !29
  br label %157

128:                                              ; preds = %110, %100
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.s_data, ptr %129, i32 0, i32 20
  %131 = getelementptr inbounds %struct.s_rycast, ptr %130, i32 0, i32 8
  %132 = load double, ptr %131, align 8, !tbaa !22
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.s_data, ptr %133, i32 0, i32 20
  %135 = getelementptr inbounds %struct.s_rycast, ptr %134, i32 0, i32 7
  %136 = load double, ptr %135, align 8, !tbaa !11
  %137 = fcmp olt double %132, %136
  br i1 %137, label %138, label %156

138:                                              ; preds = %128
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.s_data, ptr %139, i32 0, i32 20
  %141 = getelementptr inbounds %struct.s_rycast, ptr %140, i32 0, i32 5
  %142 = load double, ptr %141, align 8, !tbaa !26
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.s_data, ptr %143, i32 0, i32 20
  %145 = getelementptr inbounds %struct.s_rycast, ptr %144, i32 0, i32 6
  %146 = load double, ptr %145, align 8, !tbaa !27
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.s_data, ptr %147, i32 0, i32 4
  %149 = load double, ptr %148, align 8, !tbaa !28
  %150 = fadd double %146, %149
  %151 = fcmp ogt double %142, %150
  br i1 %151, label %152, label %156

152:                                              ; preds = %138
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.s_data, ptr %153, i32 0, i32 17
  %155 = getelementptr inbounds %struct.s_textures, ptr %154, i32 0, i32 0
  store i32 7, ptr %155, align 8, !tbaa !29
  br label %156

156:                                              ; preds = %152, %138, %128
  br label %157

157:                                              ; preds = %156, %124
  br label %158

158:                                              ; preds = %157, %96
  br label %159

159:                                              ; preds = %158, %68
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.s_data, ptr %160, i32 0, i32 0
  %162 = load double, ptr %161, align 8, !tbaa !30
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.s_data, ptr %163, i32 0, i32 5
  %165 = load double, ptr %164, align 8, !tbaa !23
  %166 = load double, ptr %6, align 8, !tbaa !9
  %167 = call double @rad(double noundef %166)
  %168 = call double @cos(double noundef %167) #4
  %169 = call double @llvm.fmuladd.f64(double %165, double %168, double %162)
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.s_data, ptr %170, i32 0, i32 8
  store double %169, ptr %171, align 8, !tbaa !31
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.s_data, ptr %172, i32 0, i32 1
  %174 = load double, ptr %173, align 8, !tbaa !32
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.s_data, ptr %175, i32 0, i32 5
  %177 = load double, ptr %176, align 8, !tbaa !23
  %178 = load double, ptr %6, align 8, !tbaa !9
  %179 = call double @rad(double noundef %178)
  %180 = call double @sin(double noundef %179) #4
  %181 = call double @llvm.fmuladd.f64(double %177, double %180, double %174)
  %182 = load ptr, ptr %4, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.s_data, ptr %182, i32 0, i32 9
  store double %181, ptr %183, align 8, !tbaa !33
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = load ptr, ptr %4, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.s_data, ptr %186, i32 0, i32 5
  %188 = load double, ptr %187, align 8, !tbaa !23
  %189 = call ptr @newdoor(ptr noundef %185, double noundef %188, i32 noundef 22)
  call void @addobjt(ptr noundef %184, ptr noundef %189)
  %190 = load ptr, ptr %4, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.s_data, ptr %190, i32 0, i32 5
  %192 = load double, ptr %191, align 8, !tbaa !23
  ret double %192
}

declare void @steps(ptr noundef, double noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @inc_smal_steps(ptr noundef, ptr noundef, double noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @inc_big_steps(ptr noundef, ptr noundef, double noundef) #0

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

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

declare double @rad(double noundef) #1

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

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

declare void @addobjt(ptr noundef, ptr noundef) #1

declare ptr @newdoor(ptr noundef, double noundef, i32 noundef) #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 = { "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 = { 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, !10, i64 512}
!12 = !{!"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, !13, i64 80, !10, i64 88, !10, 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 = !{!"int", !7, i64 0}
!14 = !{!"s_sprites", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28}
!15 = !{!"s_minimap", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!16 = !{!"s_door", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!17 = !{!"s_textures", !13, i64 0, !6, i64 8, !13, i64 16, !13, i64 20, !13, i64 24, !6, i64 32, !13, i64 40, !13, i64 44, !13, i64 48, !6, i64 56, !13, i64 64, !13, i64 68, !13, i64 72, !6, i64 80, !13, i64 88, !13, i64 92, !13, i64 96, !6, i64 104, !13, i64 112, !13, i64 116, !13, i64 120}
!18 = !{!"s_hook", !10, i64 0, !13, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!19 = !{!"s_map_result", !13, i64 0, !13, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !7, 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", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !13, i64 40, !13, i64 44, !13, i64 48}
!22 = !{!12, !10, i64 520}
!23 = !{!12, !10, i64 40}
!24 = !{!12, !10, i64 24}
!25 = !{!12, !10, i64 48}
!26 = !{!12, !10, i64 496}
!27 = !{!12, !10, i64 504}
!28 = !{!12, !10, i64 32}
!29 = !{!12, !13, i64 208}
!30 = !{!12, !10, i64 0}
!31 = !{!12, !10, i64 64}
!32 = !{!12, !10, i64 8}
!33 = !{!12, !10, i64 72}


; 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 double @raycasting_bonus(ptr noundef %0, ptr noundef %1, double noundef %2) local_unnamed_addr #0 {
  tail call void @steps(ptr noundef %0, double noundef %2) #4
  tail call void @inc_smal_steps(ptr noundef %0, ptr noundef %1, double noundef %2)
  tail call void @inc_big_steps(ptr noundef %0, ptr noundef %1, double noundef %2)
  %4 = getelementptr inbounds i8, ptr %0, i64 512
  %5 = load double, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 520
  %7 = load double, ptr %6, align 8, !tbaa !20
  %8 = tail call double @llvm.minnum.f64(double %5, double %7)
  %9 = getelementptr inbounds i8, ptr %0, i64 40
  store double %8, ptr %9, align 8, !tbaa !21
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = load double, ptr %10, align 8, !tbaa !22
  %12 = fsub double %11, %2
  %13 = tail call double @rad(double noundef %12) #4
  %14 = tail call double @cos(double noundef %13) #4
  %15 = fmul double %8, %14
  %16 = getelementptr inbounds i8, ptr %0, i64 48
  store double %15, ptr %16, align 8, !tbaa !23
  %17 = load double, ptr %6, align 8, !tbaa !20
  %18 = load double, ptr %4, align 8, !tbaa !5
  %19 = fcmp ogt double %17, %18
  br i1 %19, label %20, label %29

20:                                               ; preds = %3
  %21 = getelementptr inbounds i8, ptr %0, i64 496
  %22 = load double, ptr %21, align 8, !tbaa !24
  %23 = getelementptr inbounds i8, ptr %0, i64 504
  %24 = load double, ptr %23, align 8, !tbaa !25
  %25 = getelementptr inbounds i8, ptr %0, i64 32
  %26 = load double, ptr %25, align 8, !tbaa !26
  %27 = fadd double %24, %26
  %28 = fcmp ogt double %22, %27
  br i1 %28, label %.sink.split, label %29

29:                                               ; preds = %20, %3
  %30 = fcmp olt double %17, %18
  br i1 %30, label %31, label %40

31:                                               ; preds = %29
  %32 = getelementptr inbounds i8, ptr %0, i64 496
  %33 = load double, ptr %32, align 8, !tbaa !24
  %34 = getelementptr inbounds i8, ptr %0, i64 32
  %35 = load double, ptr %34, align 8, !tbaa !26
  %36 = fadd double %33, %35
  %37 = getelementptr inbounds i8, ptr %0, i64 504
  %38 = load double, ptr %37, align 8, !tbaa !25
  %39 = fcmp olt double %36, %38
  br i1 %39, label %.sink.split, label %40

40:                                               ; preds = %31, %29
  br i1 %19, label %41, label %50

41:                                               ; preds = %40
  %42 = getelementptr inbounds i8, ptr %0, i64 496
  %43 = load double, ptr %42, align 8, !tbaa !24
  %44 = getelementptr inbounds i8, ptr %0, i64 32
  %45 = load double, ptr %44, align 8, !tbaa !26
  %46 = fadd double %43, %45
  %47 = getelementptr inbounds i8, ptr %0, i64 504
  %48 = load double, ptr %47, align 8, !tbaa !25
  %49 = fcmp olt double %46, %48
  br i1 %49, label %.sink.split, label %50

50:                                               ; preds = %41, %40
  br i1 %30, label %51, label %61

51:                                               ; preds = %50
  %52 = getelementptr inbounds i8, ptr %0, i64 496
  %53 = load double, ptr %52, align 8, !tbaa !24
  %54 = getelementptr inbounds i8, ptr %0, i64 504
  %55 = load double, ptr %54, align 8, !tbaa !25
  %56 = getelementptr inbounds i8, ptr %0, i64 32
  %57 = load double, ptr %56, align 8, !tbaa !26
  %58 = fadd double %55, %57
  %59 = fcmp ogt double %53, %58
  br i1 %59, label %.sink.split, label %61

.sink.split:                                      ; preds = %51, %41, %31, %20
  %.sink = phi i32 [ 8, %20 ], [ 8, %31 ], [ 7, %41 ], [ 7, %51 ]
  %60 = getelementptr inbounds i8, ptr %0, i64 208
  store i32 %.sink, ptr %60, align 8, !tbaa !27
  br label %61

61:                                               ; preds = %.sink.split, %50, %51
  %62 = load double, ptr %0, align 8, !tbaa !28
  %63 = load double, ptr %9, align 8, !tbaa !21
  %64 = tail call double @rad(double noundef %2) #4
  %65 = tail call double @cos(double noundef %64) #4
  %66 = tail call double @llvm.fmuladd.f64(double %63, double %65, double %62)
  %67 = getelementptr inbounds i8, ptr %0, i64 64
  store double %66, ptr %67, align 8, !tbaa !29
  %68 = getelementptr inbounds i8, ptr %0, i64 8
  %69 = load double, ptr %68, align 8, !tbaa !30
  %70 = load double, ptr %9, align 8, !tbaa !21
  %71 = tail call double @rad(double noundef %2) #4
  %72 = tail call double @sin(double noundef %71) #4
  %73 = tail call double @llvm.fmuladd.f64(double %70, double %72, double %69)
  %74 = getelementptr inbounds i8, ptr %0, i64 72
  store double %73, ptr %74, align 8, !tbaa !31
  %75 = load double, ptr %9, align 8, !tbaa !21
  %76 = tail call ptr @newdoor(ptr noundef nonnull %0, double noundef %75, i32 noundef 22) #4
  tail call void @addobjt(ptr noundef %1, ptr noundef %76) #4
  %77 = load double, ptr %9, align 8, !tbaa !21
  ret double %77
}

declare void @steps(ptr noundef, double noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @inc_smal_steps(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @inc_big_steps(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #0

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

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

declare double @rad(double noundef) local_unnamed_addr #1

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

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

declare void @addobjt(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @newdoor(ptr noundef, double noundef, i32 noundef) local_unnamed_addr #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 = { "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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 512}
!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 520}
!21 = !{!6, !7, i64 40}
!22 = !{!6, !7, i64 24}
!23 = !{!6, !7, i64 48}
!24 = !{!6, !7, i64 496}
!25 = !{!6, !7, i64 504}
!26 = !{!6, !7, i64 32}
!27 = !{!6, !10, i64 208}
!28 = !{!6, !7, i64 0}
!29 = !{!6, !7, i64 64}
!30 = !{!6, !7, i64 8}
!31 = !{!6, !7, i64 72}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass