; LLVM IR from ESPboy-edu/ESPboy_tinyphysicsengine :: programs (hello)

; 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.TPE_Vec3 = type { i32, i32, i32 }

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: nounwind uwtable
declare dso_local { i64, i32 } @TPE_vec3(i32 noundef, i32 noundef, i32 noundef) #1

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @TPE_dist(i64, i32, i64, i32) #3

; Function Attrs: nounwind uwtable
declare dso_local void @TPE_vec3Normalize(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local { i64, i32 } @TPE_vec3Plus(i64, i32, i64, i32) #1

; Function Attrs: nounwind uwtable
declare dso_local { i64, i32 } @TPE_vec3Times(i64, i32, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local { i64, i32 } @TPE_castEnvironmentRay(i64 %0, i32 %1, i64 %2, i32 %3, ptr noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7) #1 {
  %9 = alloca %struct.TPE_Vec3, align 4
  %10 = alloca %struct.TPE_Vec3, align 4
  %11 = alloca { i64, i32 }, align 4
  %12 = alloca %struct.TPE_Vec3, align 4
  %13 = alloca { i64, i32 }, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %struct.TPE_Vec3, align 4
  %19 = alloca %struct.TPE_Vec3, align 4
  %20 = alloca { i64, i32 }, align 4
  %21 = alloca { i64, i32 }, align 8
  %22 = alloca i32, align 4
  %23 = alloca i8, align 1
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca { i64, i32 }, align 4
  %28 = alloca { i64, i32 }, align 4
  %29 = alloca %struct.TPE_Vec3, align 4
  %30 = alloca %struct.TPE_Vec3, align 4
  %31 = alloca { i64, i32 }, align 4
  %32 = alloca { i64, i32 }, align 8
  %33 = alloca { i64, i32 }, align 4
  %34 = alloca { i64, i32 }, align 4
  %35 = alloca { i64, i32 }, align 8
  %36 = alloca %struct.TPE_Vec3, align 4
  %37 = alloca { i64, i32 }, align 4
  %38 = alloca { i64, i32 }, align 8
  %39 = alloca i32, align 4
  %40 = alloca %struct.TPE_Vec3, align 4
  %41 = alloca %struct.TPE_Vec3, align 4
  %42 = alloca { i64, i32 }, align 4
  %43 = alloca { i64, i32 }, align 8
  %44 = alloca { i64, i32 }, align 4
  %45 = alloca { i64, i32 }, align 4
  %46 = alloca { i64, i32 }, align 8
  %47 = alloca %struct.TPE_Vec3, align 4
  %48 = alloca { i64, i32 }, align 4
  %49 = alloca { i64, i32 }, align 8
  %50 = alloca i8, align 1
  %51 = alloca %struct.TPE_Vec3, align 4
  %52 = alloca { i64, i32 }, align 4
  %53 = alloca { i64, i32 }, align 4
  %54 = alloca { i64, i32 }, align 8
  %55 = alloca %struct.TPE_Vec3, align 4
  %56 = alloca { i64, i32 }, align 4
  %57 = alloca { i64, i32 }, align 8
  %58 = alloca { i64, i32 }, align 8
  %59 = alloca { i64, i32 }, align 8
  %60 = getelementptr inbounds { i64, i32 }, ptr %11, i32 0, i32 0
  store i64 %0, ptr %60, align 4
  %61 = getelementptr inbounds { i64, i32 }, ptr %11, i32 0, i32 1
  store i32 %1, ptr %61, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %11, i64 12, i1 false)
  %62 = getelementptr inbounds { i64, i32 }, ptr %13, i32 0, i32 0
  store i64 %2, ptr %62, align 4
  %63 = getelementptr inbounds { i64, i32 }, ptr %13, i32 0, i32 1
  store i32 %3, ptr %63, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %13, i64 12, i1 false)
  store ptr %4, ptr %14, align 8, !tbaa !5
  store i32 %5, ptr %15, align 4, !tbaa !9
  store i32 %6, ptr %16, align 4, !tbaa !9
  store i32 %7, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %10, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #4
  %64 = load ptr, ptr %14, align 8, !tbaa !5
  %65 = load i32, ptr %16, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %10, i64 12, i1 false)
  %66 = getelementptr inbounds { i64, i32 }, ptr %20, i32 0, i32 0
  %67 = load i64, ptr %66, align 4
  %68 = getelementptr inbounds { i64, i32 }, ptr %20, i32 0, i32 1
  %69 = load i32, ptr %68, align 4
  %70 = call { i64, i32 } %64(i64 %67, i32 %69, i32 noundef %65)
  store { i64, i32 } %70, ptr %21, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 8 %21, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  store i32 0, ptr %22, align 4, !tbaa !9
  call void @TPE_vec3Normalize(ptr noundef %12)
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #4
  store i8 0, ptr %23, align 1, !tbaa !12
  %71 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 0
  %72 = load i32, ptr %71, align 4, !tbaa !13
  %73 = getelementptr inbounds %struct.TPE_Vec3, ptr %18, i32 0, i32 0
  %74 = load i32, ptr %73, align 4, !tbaa !13
  %75 = icmp ne i32 %72, %74
  br i1 %75, label %88, label %76

76:                                               ; preds = %8
  %77 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 1
  %78 = load i32, ptr %77, align 4, !tbaa !15
  %79 = getelementptr inbounds %struct.TPE_Vec3, ptr %18, i32 0, i32 1
  %80 = load i32, ptr %79, align 4, !tbaa !15
  %81 = icmp ne i32 %78, %80
  br i1 %81, label %88, label %82

82:                                               ; preds = %76
  %83 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 2
  %84 = load i32, ptr %83, align 4, !tbaa !16
  %85 = getelementptr inbounds %struct.TPE_Vec3, ptr %18, i32 0, i32 2
  %86 = load i32, ptr %85, align 4, !tbaa !16
  %87 = icmp ne i32 %84, %86
  br i1 %87, label %88, label %186

88:                                               ; preds = %82, %76, %8
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %180, %88
  %90 = load i32, ptr %24, align 4, !tbaa !9
  %91 = load i32, ptr %17, align 4, !tbaa !9
  %92 = icmp ult i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 2, ptr %25, align 4
  br label %183

94:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %18, i64 12, i1 false)
  %95 = getelementptr inbounds { i64, i32 }, ptr %27, i32 0, i32 0
  %96 = load i64, ptr %95, align 4
  %97 = getelementptr inbounds { i64, i32 }, ptr %27, i32 0, i32 1
  %98 = load i32, ptr %97, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %19, i64 12, i1 false)
  %99 = getelementptr inbounds { i64, i32 }, ptr %28, i32 0, i32 0
  %100 = load i64, ptr %99, align 4
  %101 = getelementptr inbounds { i64, i32 }, ptr %28, i32 0, i32 1
  %102 = load i32, ptr %101, align 4
  %103 = call i32 @TPE_dist(i64 %96, i32 %98, i64 %100, i32 %102)
  store i32 %103, ptr %26, align 4, !tbaa !9
  %104 = load i32, ptr %26, align 4, !tbaa !9
  %105 = load i32, ptr %16, align 4, !tbaa !9
  %106 = icmp sgt i32 %104, %105
  br i1 %106, label %107, label %109

107:                                              ; preds = %94
  %108 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %108, ptr %26, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %107, %94
  %110 = load i32, ptr %26, align 4, !tbaa !9
  %111 = load i32, ptr %22, align 4, !tbaa !9
  %112 = add nsw i32 %111, %110
  store i32 %112, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #4
  %113 = load i32, ptr %22, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %12, i64 12, i1 false)
  %114 = getelementptr inbounds { i64, i32 }, ptr %31, i32 0, i32 0
  %115 = load i64, ptr %114, align 4
  %116 = getelementptr inbounds { i64, i32 }, ptr %31, i32 0, i32 1
  %117 = load i32, ptr %116, align 4
  %118 = call { i64, i32 } @TPE_vec3Times(i64 %115, i32 %117, i32 noundef %113)
  store { i64, i32 } %118, ptr %32, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 8 %32, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %10, i64 12, i1 false)
  %119 = getelementptr inbounds { i64, i32 }, ptr %33, i32 0, i32 0
  %120 = load i64, ptr %119, align 4
  %121 = getelementptr inbounds { i64, i32 }, ptr %33, i32 0, i32 1
  %122 = load i32, ptr %121, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %34, ptr align 4 %30, i64 12, i1 false)
  %123 = getelementptr inbounds { i64, i32 }, ptr %34, i32 0, i32 0
  %124 = load i64, ptr %123, align 4
  %125 = getelementptr inbounds { i64, i32 }, ptr %34, i32 0, i32 1
  %126 = load i32, ptr %125, align 4
  %127 = call { i64, i32 } @TPE_vec3Plus(i64 %120, i32 %122, i64 %124, i32 %126)
  store { i64, i32 } %127, ptr %35, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 8 %35, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %29, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #4
  %128 = load i32, ptr %26, align 4, !tbaa !9
  %129 = icmp eq i32 %128, 0
  br i1 %129, label %148, label %130

130:                                              ; preds = %109
  %131 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 0
  %132 = load i32, ptr %131, align 4, !tbaa !13
  %133 = getelementptr inbounds %struct.TPE_Vec3, ptr %18, i32 0, i32 0
  %134 = load i32, ptr %133, align 4, !tbaa !13
  %135 = icmp eq i32 %132, %134
  br i1 %135, label %136, label %149

136:                                              ; preds = %130
  %137 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 1
  %138 = load i32, ptr %137, align 4, !tbaa !15
  %139 = getelementptr inbounds %struct.TPE_Vec3, ptr %18, i32 0, i32 1
  %140 = load i32, ptr %139, align 4, !tbaa !15
  %141 = icmp eq i32 %138, %140
  br i1 %141, label %142, label %149

142:                                              ; preds = %136
  %143 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 2
  %144 = load i32, ptr %143, align 4, !tbaa !16
  %145 = getelementptr inbounds %struct.TPE_Vec3, ptr %18, i32 0, i32 2
  %146 = load i32, ptr %145, align 4, !tbaa !16
  %147 = icmp eq i32 %144, %146
  br i1 %147, label %148, label %149

148:                                              ; preds = %142, %109
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %19, i64 12, i1 false), !tbaa.struct !11
  store i32 1, ptr %25, align 4
  br label %177

149:                                              ; preds = %142, %136, %130
  call void @llvm.lifetime.start.p0(i64 12, ptr %36) #4
  %150 = load ptr, ptr %14, align 8, !tbaa !5
  %151 = load i32, ptr %16, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %37, ptr align 4 %19, i64 12, i1 false)
  %152 = getelementptr inbounds { i64, i32 }, ptr %37, i32 0, i32 0
  %153 = load i64, ptr %152, align 4
  %154 = getelementptr inbounds { i64, i32 }, ptr %37, i32 0, i32 1
  %155 = load i32, ptr %154, align 4
  %156 = call { i64, i32 } %150(i64 %153, i32 %155, i32 noundef %151)
  store { i64, i32 } %156, ptr %38, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %36, ptr align 8 %38, i64 12, i1 false)
  %157 = getelementptr inbounds %struct.TPE_Vec3, ptr %36, i32 0, i32 0
  %158 = load i32, ptr %157, align 4, !tbaa !13
  %159 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 0
  %160 = load i32, ptr %159, align 4, !tbaa !13
  %161 = icmp eq i32 %158, %160
  br i1 %161, label %162, label %175

162:                                              ; preds = %149
  %163 = getelementptr inbounds %struct.TPE_Vec3, ptr %36, i32 0, i32 1
  %164 = load i32, ptr %163, align 4, !tbaa !15
  %165 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 1
  %166 = load i32, ptr %165, align 4, !tbaa !15
  %167 = icmp eq i32 %164, %166
  br i1 %167, label %168, label %175

168:                                              ; preds = %162
  %169 = getelementptr inbounds %struct.TPE_Vec3, ptr %36, i32 0, i32 2
  %170 = load i32, ptr %169, align 4, !tbaa !16
  %171 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 2
  %172 = load i32, ptr %171, align 4, !tbaa !16
  %173 = icmp eq i32 %170, %172
  br i1 %173, label %174, label %175

174:                                              ; preds = %168
  store i8 1, ptr %23, align 1, !tbaa !12
  store i32 2, ptr %25, align 4
  br label %176

175:                                              ; preds = %168, %162, %149
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %19, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %36, i64 12, i1 false), !tbaa.struct !11
  store i32 0, ptr %25, align 4
  br label %176

176:                                              ; preds = %175, %174
  call void @llvm.lifetime.end.p0(i64 12, ptr %36) #4
  br label %177

177:                                              ; preds = %176, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  %178 = load i32, ptr %25, align 4
  switch i32 %178, label %183 [
    i32 0, label %179
  ]

179:                                              ; preds = %177
  br label %180

180:                                              ; preds = %179
  %181 = load i32, ptr %24, align 4, !tbaa !9
  %182 = add i32 %181, 1
  store i32 %182, ptr %24, align 4, !tbaa !9
  br label %89, !llvm.loop !17

183:                                              ; preds = %177, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  %184 = load i32, ptr %25, align 4
  switch i32 %184, label %363 [
    i32 2, label %185
  ]

185:                                              ; preds = %183
  br label %248

186:                                              ; preds = %82
  %187 = load i32, ptr %15, align 4, !tbaa !9
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %189, label %247

189:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #4
  store i32 0, ptr %39, align 4, !tbaa !9
  br label %190

190:                                              ; preds = %242, %189
  %191 = load i32, ptr %39, align 4, !tbaa !9
  %192 = load i32, ptr %17, align 4, !tbaa !9
  %193 = icmp ult i32 %191, %192
  br i1 %193, label %195, label %194

194:                                              ; preds = %190
  store i32 5, ptr %25, align 4
  br label %245

195:                                              ; preds = %190
  %196 = load i32, ptr %15, align 4, !tbaa !9
  %197 = load i32, ptr %22, align 4, !tbaa !9
  %198 = add nsw i32 %197, %196
  store i32 %198, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %40) #4
  %199 = load i32, ptr %22, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %42, ptr align 4 %12, i64 12, i1 false)
  %200 = getelementptr inbounds { i64, i32 }, ptr %42, i32 0, i32 0
  %201 = load i64, ptr %200, align 4
  %202 = getelementptr inbounds { i64, i32 }, ptr %42, i32 0, i32 1
  %203 = load i32, ptr %202, align 4
  %204 = call { i64, i32 } @TPE_vec3Times(i64 %201, i32 %203, i32 noundef %199)
  store { i64, i32 } %204, ptr %43, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %41, ptr align 8 %43, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %44, ptr align 4 %10, i64 12, i1 false)
  %205 = getelementptr inbounds { i64, i32 }, ptr %44, i32 0, i32 0
  %206 = load i64, ptr %205, align 4
  %207 = getelementptr inbounds { i64, i32 }, ptr %44, i32 0, i32 1
  %208 = load i32, ptr %207, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %45, ptr align 4 %41, i64 12, i1 false)
  %209 = getelementptr inbounds { i64, i32 }, ptr %45, i32 0, i32 0
  %210 = load i64, ptr %209, align 4
  %211 = getelementptr inbounds { i64, i32 }, ptr %45, i32 0, i32 1
  %212 = load i32, ptr %211, align 4
  %213 = call { i64, i32 } @TPE_vec3Plus(i64 %206, i32 %208, i64 %210, i32 %212)
  store { i64, i32 } %213, ptr %46, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %40, ptr align 8 %46, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %40, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %40) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr %47) #4
  %214 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %48, ptr align 4 %19, i64 12, i1 false)
  %215 = getelementptr inbounds { i64, i32 }, ptr %48, i32 0, i32 0
  %216 = load i64, ptr %215, align 4
  %217 = getelementptr inbounds { i64, i32 }, ptr %48, i32 0, i32 1
  %218 = load i32, ptr %217, align 4
  %219 = call { i64, i32 } %214(i64 %216, i32 %218, i32 noundef 16)
  store { i64, i32 } %219, ptr %49, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %47, ptr align 8 %49, i64 12, i1 false)
  %220 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 0
  %221 = load i32, ptr %220, align 4, !tbaa !13
  %222 = getelementptr inbounds %struct.TPE_Vec3, ptr %47, i32 0, i32 0
  %223 = load i32, ptr %222, align 4, !tbaa !13
  %224 = icmp ne i32 %221, %223
  br i1 %224, label %237, label %225

225:                                              ; preds = %195
  %226 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 1
  %227 = load i32, ptr %226, align 4, !tbaa !15
  %228 = getelementptr inbounds %struct.TPE_Vec3, ptr %47, i32 0, i32 1
  %229 = load i32, ptr %228, align 4, !tbaa !15
  %230 = icmp ne i32 %227, %229
  br i1 %230, label %237, label %231

231:                                              ; preds = %225
  %232 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 2
  %233 = load i32, ptr %232, align 4, !tbaa !16
  %234 = getelementptr inbounds %struct.TPE_Vec3, ptr %47, i32 0, i32 2
  %235 = load i32, ptr %234, align 4, !tbaa !16
  %236 = icmp ne i32 %233, %235
  br i1 %236, label %237, label %238

237:                                              ; preds = %231, %225, %195
  store i8 2, ptr %23, align 1, !tbaa !12
  store i32 5, ptr %25, align 4
  br label %239

238:                                              ; preds = %231
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %19, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %47, i64 12, i1 false), !tbaa.struct !11
  store i32 0, ptr %25, align 4
  br label %239

239:                                              ; preds = %238, %237
  call void @llvm.lifetime.end.p0(i64 12, ptr %47) #4
  %240 = load i32, ptr %25, align 4
  switch i32 %240, label %245 [
    i32 0, label %241
  ]

241:                                              ; preds = %239
  br label %242

242:                                              ; preds = %241
  %243 = load i32, ptr %39, align 4, !tbaa !9
  %244 = add i32 %243, 1
  store i32 %244, ptr %39, align 4, !tbaa !9
  br label %190, !llvm.loop !19

245:                                              ; preds = %239, %194
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #4
  br label %246

246:                                              ; preds = %245
  br label %247

247:                                              ; preds = %246, %186
  br label %248

248:                                              ; preds = %247, %185
  %249 = load i8, ptr %23, align 1, !tbaa !12
  %250 = icmp ne i8 %249, 0
  br i1 %250, label %251, label %361

251:                                              ; preds = %248
  call void @llvm.lifetime.start.p0(i64 1, ptr %50) #4
  store i8 0, ptr %50, align 1, !tbaa !12
  br label %252

252:                                              ; preds = %350, %251
  %253 = load i8, ptr %50, align 1, !tbaa !12
  %254 = zext i8 %253 to i32
  %255 = icmp slt i32 %254, 128
  br i1 %255, label %257, label %256

256:                                              ; preds = %252
  store i32 8, ptr %25, align 4
  br label %353

257:                                              ; preds = %252
  call void @llvm.lifetime.start.p0(i64 12, ptr %51) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %52, ptr align 4 %18, i64 12, i1 false)
  %258 = getelementptr inbounds { i64, i32 }, ptr %52, i32 0, i32 0
  %259 = load i64, ptr %258, align 4
  %260 = getelementptr inbounds { i64, i32 }, ptr %52, i32 0, i32 1
  %261 = load i32, ptr %260, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %53, ptr align 4 %19, i64 12, i1 false)
  %262 = getelementptr inbounds { i64, i32 }, ptr %53, i32 0, i32 0
  %263 = load i64, ptr %262, align 4
  %264 = getelementptr inbounds { i64, i32 }, ptr %53, i32 0, i32 1
  %265 = load i32, ptr %264, align 4
  %266 = call { i64, i32 } @TPE_vec3Plus(i64 %259, i32 %261, i64 %263, i32 %265)
  store { i64, i32 } %266, ptr %54, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %51, ptr align 8 %54, i64 12, i1 false)
  %267 = getelementptr inbounds %struct.TPE_Vec3, ptr %51, i32 0, i32 0
  %268 = load i32, ptr %267, align 4, !tbaa !13
  %269 = sdiv i32 %268, 2
  store i32 %269, ptr %267, align 4, !tbaa !13
  %270 = getelementptr inbounds %struct.TPE_Vec3, ptr %51, i32 0, i32 1
  %271 = load i32, ptr %270, align 4, !tbaa !15
  %272 = sdiv i32 %271, 2
  store i32 %272, ptr %270, align 4, !tbaa !15
  %273 = getelementptr inbounds %struct.TPE_Vec3, ptr %51, i32 0, i32 2
  %274 = load i32, ptr %273, align 4, !tbaa !16
  %275 = sdiv i32 %274, 2
  store i32 %275, ptr %273, align 4, !tbaa !16
  %276 = getelementptr inbounds %struct.TPE_Vec3, ptr %51, i32 0, i32 0
  %277 = load i32, ptr %276, align 4, !tbaa !13
  %278 = getelementptr inbounds %struct.TPE_Vec3, ptr %18, i32 0, i32 0
  %279 = load i32, ptr %278, align 4, !tbaa !13
  %280 = icmp eq i32 %277, %279
  br i1 %280, label %281, label %293

281:                                              ; preds = %257
  %282 = getelementptr inbounds %struct.TPE_Vec3, ptr %51, i32 0, i32 1
  %283 = load i32, ptr %282, align 4, !tbaa !15
  %284 = getelementptr inbounds %struct.TPE_Vec3, ptr %18, i32 0, i32 1
  %285 = load i32, ptr %284, align 4, !tbaa !15
  %286 = icmp eq i32 %283, %285
  br i1 %286, label %287, label %293

287:                                              ; preds = %281
  %288 = getelementptr inbounds %struct.TPE_Vec3, ptr %51, i32 0, i32 2
  %289 = load i32, ptr %288, align 4, !tbaa !16
  %290 = getelementptr inbounds %struct.TPE_Vec3, ptr %18, i32 0, i32 2
  %291 = load i32, ptr %290, align 4, !tbaa !16
  %292 = icmp eq i32 %289, %291
  br i1 %292, label %311, label %293

293:                                              ; preds = %287, %281, %257
  %294 = getelementptr inbounds %struct.TPE_Vec3, ptr %51, i32 0, i32 0
  %295 = load i32, ptr %294, align 4, !tbaa !13
  %296 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 0
  %297 = load i32, ptr %296, align 4, !tbaa !13
  %298 = icmp eq i32 %295, %297
  br i1 %298, label %299, label %312

299:                                              ; preds = %293
  %300 = getelementptr inbounds %struct.TPE_Vec3, ptr %51, i32 0, i32 1
  %301 = load i32, ptr %300, align 4, !tbaa !15
  %302 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 1
  %303 = load i32, ptr %302, align 4, !tbaa !15
  %304 = icmp eq i32 %301, %303
  br i1 %304, label %305, label %312

305:                                              ; preds = %299
  %306 = getelementptr inbounds %struct.TPE_Vec3, ptr %51, i32 0, i32 2
  %307 = load i32, ptr %306, align 4, !tbaa !16
  %308 = getelementptr inbounds %struct.TPE_Vec3, ptr %19, i32 0, i32 2
  %309 = load i32, ptr %308, align 4, !tbaa !16
  %310 = icmp eq i32 %307, %309
  br i1 %310, label %311, label %312

311:                                              ; preds = %305, %287
  store i32 8, ptr %25, align 4
  br label %347

312:                                              ; preds = %305, %299, %293
  call void @llvm.lifetime.start.p0(i64 12, ptr %55) #4
  %313 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %56, ptr align 4 %51, i64 12, i1 false)
  %314 = getelementptr inbounds { i64, i32 }, ptr %56, i32 0, i32 0
  %315 = load i64, ptr %314, align 4
  %316 = getelementptr inbounds { i64, i32 }, ptr %56, i32 0, i32 1
  %317 = load i32, ptr %316, align 4
  %318 = call { i64, i32 } %313(i64 %315, i32 %317, i32 noundef 16)
  store { i64, i32 } %318, ptr %57, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %55, ptr align 8 %57, i64 12, i1 false)
  %319 = load i8, ptr %23, align 1, !tbaa !12
  %320 = zext i8 %319 to i32
  %321 = icmp eq i32 %320, 1
  %322 = zext i1 %321 to i32
  %323 = getelementptr inbounds %struct.TPE_Vec3, ptr %55, i32 0, i32 0
  %324 = load i32, ptr %323, align 4, !tbaa !13
  %325 = getelementptr inbounds %struct.TPE_Vec3, ptr %51, i32 0, i32 0
  %326 = load i32, ptr %325, align 4, !tbaa !13
  %327 = icmp eq i32 %324, %326
  br i1 %327, label %328, label %340

328:                                              ; preds = %312
  %329 = getelementptr inbounds %struct.TPE_Vec3, ptr %55, i32 0, i32 1
  %330 = load i32, ptr %329, align 4, !tbaa !15
  %331 = getelementptr inbounds %struct.TPE_Vec3, ptr %51, i32 0, i32 1
  %332 = load i32, ptr %331, align 4, !tbaa !15
  %333 = icmp eq i32 %330, %332
  br i1 %333, label %334, label %340

334:                                              ; preds = %328
  %335 = getelementptr inbounds %struct.TPE_Vec3, ptr %55, i32 0, i32 2
  %336 = load i32, ptr %335, align 4, !tbaa !16
  %337 = getelementptr inbounds %struct.TPE_Vec3, ptr %51, i32 0, i32 2
  %338 = load i32, ptr %337, align 4, !tbaa !16
  %339 = icmp eq i32 %336, %338
  br label %340

340:                                              ; preds = %334, %328, %312
  %341 = phi i1 [ false, %328 ], [ false, %312 ], [ %339, %334 ]
  %342 = zext i1 %341 to i32
  %343 = icmp eq i32 %322, %342
  br i1 %343, label %344, label %345

344:                                              ; preds = %340
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %51, i64 12, i1 false), !tbaa.struct !11
  br label %346

345:                                              ; preds = %340
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %51, i64 12, i1 false), !tbaa.struct !11
  br label %346

346:                                              ; preds = %345, %344
  call void @llvm.lifetime.end.p0(i64 12, ptr %55) #4
  store i32 0, ptr %25, align 4
  br label %347

347:                                              ; preds = %346, %311
  call void @llvm.lifetime.end.p0(i64 12, ptr %51) #4
  %348 = load i32, ptr %25, align 4
  switch i32 %348, label %353 [
    i32 0, label %349
  ]

349:                                              ; preds = %347
  br label %350

350:                                              ; preds = %349
  %351 = load i8, ptr %50, align 1, !tbaa !12
  %352 = add i8 %351, 1
  store i8 %352, ptr %50, align 1, !tbaa !12
  br label %252, !llvm.loop !20

353:                                              ; preds = %347, %256
  call void @llvm.lifetime.end.p0(i64 1, ptr %50) #4
  br label %354

354:                                              ; preds = %353
  %355 = load i8, ptr %23, align 1, !tbaa !12
  %356 = zext i8 %355 to i32
  %357 = icmp eq i32 %356, 1
  br i1 %357, label %358, label %359

358:                                              ; preds = %354
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %18, i64 12, i1 false), !tbaa.struct !11
  br label %360

359:                                              ; preds = %354
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %19, i64 12, i1 false), !tbaa.struct !11
  br label %360

360:                                              ; preds = %359, %358
  store i32 1, ptr %25, align 4
  br label %363

361:                                              ; preds = %248
  %362 = call { i64, i32 } @TPE_vec3(i32 noundef 2147483647, i32 noundef 2147483647, i32 noundef 2147483647)
  store { i64, i32 } %362, ptr %58, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 8 %58, i64 12, i1 false)
  store i32 1, ptr %25, align 4
  br label %363

363:                                              ; preds = %361, %360, %183
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %59, ptr align 4 %9, i64 12, i1 false)
  %364 = load { i64, i32 }, ptr %59, align 8
  ret { i64, i32 } %364
}

attributes #0 = { nocallback nofree 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 willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!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 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8}
!15 = !{!14, !10, i64 4}
!16 = !{!14, !10, i64 8}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.TPE_Vec3 = type { i32, i32, i32 }

; Function Attrs: nounwind uwtable
declare dso_local { i64, i32 } @TPE_vec3(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @TPE_dist(i64, i32, i64, i32) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @TPE_vec3Normalize(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local { i64, i32 } @TPE_vec3Plus(i64, i32, i64, i32) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local { i64, i32 } @TPE_vec3Times(i64, i32, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local { i64, i32 } @TPE_castEnvironmentRay(i64 %0, i32 %1, i64 %2, i32 %3, ptr nocapture noundef readonly %4, i32 noundef %5, i32 noundef %6, i32 noundef %7) local_unnamed_addr #0 {
  %9 = alloca %struct.TPE_Vec3, align 8
  store i64 %2, ptr %9, align 8
  %.sroa.2275.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  store i32 %3, ptr %.sroa.2275.0..sroa_idx, align 8
  %.sroa.0226.sroa.0.0.extract.trunc245 = trunc i64 %0 to i32
  %.sroa.0226.sroa.12.0.extract.shift257 = lshr i64 %0, 32
  %.sroa.0226.sroa.12.0.extract.trunc258 = trunc nuw i64 %.sroa.0226.sroa.12.0.extract.shift257 to i32
  %10 = tail call { i64, i32 } %4(i64 %0, i32 %1, i32 noundef %6) #3
  %.fca.0.extract126 = extractvalue { i64, i32 } %10, 0
  %.fca.1.extract127 = extractvalue { i64, i32 } %10, 1
  %.sroa.0132.sroa.0.0.extract.trunc175 = trunc i64 %.fca.0.extract126 to i32
  %.sroa.0132.sroa.21.0.extract.shift208 = lshr i64 %.fca.0.extract126, 32
  call void @TPE_vec3Normalize(ptr noundef nonnull %9)
  %.not = icmp eq i32 %.sroa.0132.sroa.0.0.extract.trunc175, %.sroa.0226.sroa.0.0.extract.trunc245
  %.not303 = icmp eq i64 %.sroa.0132.sroa.21.0.extract.shift208, %.sroa.0226.sroa.12.0.extract.shift257
  %or.cond = and i1 %.not, %.not303
  %.not304 = icmp eq i32 %.fca.1.extract127, %1
  %or.cond310 = select i1 %or.cond, i1 %.not304, i1 false
  br i1 %or.cond310, label %27, label %.preheader385

.preheader385:                                    ; preds = %8
  %.not422 = icmp eq i32 %7, 0
  br i1 %.not422, label %.thread333, label %.lr.ph

11:                                               ; preds = %22
  %12 = add nuw i32 %.0290400, 1
  %exitcond.not = icmp eq i32 %12, %7
  br i1 %exitcond.not, label %.thread333, label %.lr.ph, !llvm.loop !5

.lr.ph:                                           ; preds = %.preheader385, %11
  %.sroa.0226.sroa.12.0407 = phi i32 [ %.sroa.0132.sroa.21.0.extract.trunc203, %11 ], [ %.sroa.0226.sroa.12.0.extract.trunc258, %.preheader385 ]
  %.sroa.0226.sroa.0.0406 = phi i32 [ %.sroa.0132.sroa.0.0.extract.trunc171, %11 ], [ %.sroa.0226.sroa.0.0.extract.trunc245, %.preheader385 ]
  %.sroa.15.0405 = phi i32 [ %.fca.1.extract89, %11 ], [ %1, %.preheader385 ]
  %.sroa.0132.sroa.21.0.in404 = phi i64 [ %.sroa.086.sroa.5.0.extract.shift, %11 ], [ %.sroa.0132.sroa.21.0.extract.shift208, %.preheader385 ]
  %.sroa.0132.sroa.0.0403 = phi i64 [ %.fca.0.extract80, %11 ], [ %.fca.0.extract126, %.preheader385 ]
  %.sroa.26.0402 = phi i32 [ %.fca.1.extract81, %11 ], [ %.fca.1.extract127, %.preheader385 ]
  %.0401 = phi i32 [ %14, %11 ], [ 0, %.preheader385 ]
  %.0290400 = phi i32 [ %12, %11 ], [ 0, %.preheader385 ]
  %.sroa.0226.sroa.12.0.insert.ext249 = zext i32 %.sroa.0226.sroa.12.0407 to i64
  %.sroa.0226.sroa.12.0.insert.shift250 = shl nuw i64 %.sroa.0226.sroa.12.0.insert.ext249, 32
  %.sroa.0226.sroa.0.0.insert.ext240 = zext i32 %.sroa.0226.sroa.0.0406 to i64
  %.sroa.0226.sroa.0.0.insert.insert242 = or disjoint i64 %.sroa.0226.sroa.12.0.insert.shift250, %.sroa.0226.sroa.0.0.insert.ext240
  %.sroa.0132.sroa.21.0.insert.shift205 = shl nuw i64 %.sroa.0132.sroa.21.0.in404, 32
  %.sroa.0132.sroa.0.0.insert.ext172 = and i64 %.sroa.0132.sroa.0.0403, 4294967295
  %.sroa.0132.sroa.0.0.insert.insert174 = or disjoint i64 %.sroa.0132.sroa.21.0.insert.shift205, %.sroa.0132.sroa.0.0.insert.ext172
  %13 = call i32 @TPE_dist(i64 %.sroa.0226.sroa.0.0.insert.insert242, i32 %.sroa.15.0405, i64 %.sroa.0132.sroa.0.0.insert.insert174, i32 %.sroa.26.0402)
  %spec.select = call i32 @llvm.smin.i32(i32 %13, i32 %6)
  %14 = add nsw i32 %spec.select, %.0401
  %.sroa.0100.0.copyload = load i64, ptr %9, align 8
  %.sroa.2101.0.copyload = load i32, ptr %.sroa.2275.0..sroa_idx, align 8
  %15 = call { i64, i32 } @TPE_vec3Times(i64 %.sroa.0100.0.copyload, i32 %.sroa.2101.0.copyload, i32 noundef %14)
  %.fca.0.extract96 = extractvalue { i64, i32 } %15, 0
  %.fca.1.extract97 = extractvalue { i64, i32 } %15, 1
  %16 = call { i64, i32 } @TPE_vec3Plus(i64 %0, i32 %1, i64 %.fca.0.extract96, i32 %.fca.1.extract97)
  %.fca.0.extract88 = extractvalue { i64, i32 } %16, 0
  %.fca.1.extract89 = extractvalue { i64, i32 } %16, 1
  %.sroa.0132.sroa.0.0.extract.trunc171 = trunc i64 %.fca.0.extract88 to i32
  %.sroa.0132.sroa.21.0.extract.shift202 = lshr i64 %.fca.0.extract88, 32
  %.sroa.0132.sroa.21.0.extract.trunc203 = trunc nuw i64 %.sroa.0132.sroa.21.0.extract.shift202 to i32
  %17 = icmp eq i32 %spec.select, 0
  br i1 %17, label %.thread343, label %18

18:                                               ; preds = %.lr.ph
  %19 = icmp eq i32 %.sroa.0226.sroa.0.0406, %.sroa.0132.sroa.0.0.extract.trunc171
  %20 = icmp eq i32 %.sroa.0226.sroa.12.0407, %.sroa.0132.sroa.21.0.extract.trunc203
  %or.cond311 = select i1 %19, i1 %20, i1 false
  %21 = icmp eq i32 %.fca.1.extract89, %.sroa.15.0405
  %or.cond312 = select i1 %or.cond311, i1 %21, i1 false
  br i1 %or.cond312, label %.thread343, label %22

22:                                               ; preds = %18
  %23 = call { i64, i32 } %4(i64 %.fca.0.extract88, i32 %.fca.1.extract89, i32 noundef %6) #3
  %.fca.0.extract80 = extractvalue { i64, i32 } %23, 0
  %.fca.1.extract81 = extractvalue { i64, i32 } %23, 1
  %.sroa.086.sroa.0.0.extract.trunc = trunc i64 %.fca.0.extract80 to i32
  %24 = icmp eq i32 %.sroa.086.sroa.0.0.extract.trunc, %.sroa.0132.sroa.0.0.extract.trunc171
  %.sroa.086.sroa.5.0.extract.shift = lshr i64 %.fca.0.extract80, 32
  %25 = icmp eq i64 %.sroa.086.sroa.5.0.extract.shift, %.sroa.0132.sroa.21.0.extract.shift202
  %or.cond313 = and i1 %24, %25
  %26 = icmp eq i32 %.fca.1.extract81, %.fca.1.extract89
  %or.cond314 = select i1 %or.cond313, i1 %26, i1 false
  br i1 %or.cond314, label %.loopexit.preheader, label %11

27:                                               ; preds = %8
  %.not305 = icmp ne i32 %5, 0
  %28 = icmp ne i32 %7, 0
  %or.cond421 = and i1 %.not305, %28
  br i1 %or.cond421, label %.lr.ph413, label %.thread333

29:                                               ; preds = %.lr.ph413
  %30 = add nuw i32 %.0297408, 1
  %exitcond444.not = icmp eq i32 %30, %7
  br i1 %exitcond444.not, label %.thread333, label %.lr.ph413, !llvm.loop !7

.lr.ph413:                                        ; preds = %27, %29
  %.sroa.0226.sroa.12.4412 = phi i32 [ %.sroa.0226.sroa.12.0.extract.trunc256, %29 ], [ %.sroa.0226.sroa.12.0.extract.trunc258, %27 ]
  %.sroa.0226.sroa.0.4411 = phi i32 [ %.sroa.0132.sroa.0.0.extract.trunc166, %29 ], [ %.sroa.0226.sroa.0.0.extract.trunc245, %27 ]
  %.sroa.15.4410 = phi i32 [ %.fca.1.extract62, %29 ], [ %1, %27 ]
  %.1409 = phi i32 [ %31, %29 ], [ 0, %27 ]
  %.0297408 = phi i32 [ %30, %29 ], [ 0, %27 ]
  %31 = add nsw i32 %.1409, %5
  %.sroa.073.0.copyload = load i64, ptr %9, align 8
  %.sroa.274.0.copyload = load i32, ptr %.sroa.2275.0..sroa_idx, align 8
  %32 = call { i64, i32 } @TPE_vec3Times(i64 %.sroa.073.0.copyload, i32 %.sroa.274.0.copyload, i32 noundef %31)
  %.fca.0.extract69 = extractvalue { i64, i32 } %32, 0
  %.fca.1.extract70 = extractvalue { i64, i32 } %32, 1
  %33 = call { i64, i32 } @TPE_vec3Plus(i64 %0, i32 %1, i64 %.fca.0.extract69, i32 %.fca.1.extract70)
  %.fca.0.extract61 = extractvalue { i64, i32 } %33, 0
  %.fca.1.extract62 = extractvalue { i64, i32 } %33, 1
  %.sroa.0132.sroa.0.0.extract.trunc166 = trunc i64 %.fca.0.extract61 to i32
  %.sroa.0132.sroa.21.0.extract.shift194 = lshr i64 %.fca.0.extract61, 32
  %34 = call { i64, i32 } %4(i64 %.fca.0.extract61, i32 %.fca.1.extract62, i32 noundef 16) #3
  %.fca.0.extract54 = extractvalue { i64, i32 } %34, 0
  %.fca.1.extract55 = extractvalue { i64, i32 } %34, 1
  %.sroa.060.sroa.0.0.extract.trunc = trunc i64 %.fca.0.extract54 to i32
  %.not306 = icmp eq i32 %.sroa.0132.sroa.0.0.extract.trunc166, %.sroa.060.sroa.0.0.extract.trunc
  %.sroa.060.sroa.5.0.extract.shift = lshr i64 %.fca.0.extract54, 32
  %.not307 = icmp eq i64 %.sroa.0132.sroa.21.0.extract.shift194, %.sroa.060.sroa.5.0.extract.shift
  %or.cond315 = and i1 %.not306, %.not307
  %.not308 = icmp eq i32 %.fca.1.extract62, %.fca.1.extract55
  %or.cond316 = select i1 %or.cond315, i1 %.not308, i1 false
  %.sroa.0226.sroa.12.0.extract.trunc256 = trunc nuw i64 %.sroa.0132.sroa.21.0.extract.shift194 to i32
  br i1 %or.cond316, label %29, label %.loopexit.preheader

.loopexit.preheader:                              ; preds = %22, %.lr.ph413
  %.sroa.0226.sroa.12.8420.ph = phi i32 [ %.sroa.0226.sroa.12.4412, %.lr.ph413 ], [ %.sroa.0226.sroa.12.0407, %22 ]
  %.sroa.0226.sroa.0.8419.ph = phi i32 [ %.sroa.0226.sroa.0.4411, %.lr.ph413 ], [ %.sroa.0226.sroa.0.0406, %22 ]
  %.sroa.15.8418.ph = phi i32 [ %.sroa.15.4410, %.lr.ph413 ], [ %.sroa.15.0405, %22 ]
  %.sroa.0132.sroa.21.8417.ph = phi i32 [ %.sroa.0226.sroa.12.0.extract.trunc256, %.lr.ph413 ], [ %.sroa.0132.sroa.21.0.extract.trunc203, %22 ]
  %.sroa.0132.sroa.0.8416.ph = phi i32 [ %.sroa.0132.sroa.0.0.extract.trunc166, %.lr.ph413 ], [ %.sroa.0132.sroa.0.0.extract.trunc171, %22 ]
  %.sroa.26.8415.ph = phi i32 [ %.fca.1.extract62, %.lr.ph413 ], [ %.fca.1.extract89, %22 ]
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.preheader, %52
  %.sroa.0226.sroa.12.8420 = phi i32 [ %.sroa.0226.sroa.12.8., %52 ], [ %.sroa.0226.sroa.12.8420.ph, %.loopexit.preheader ]
  %.sroa.0226.sroa.0.8419 = phi i32 [ %.sroa.0226.sroa.0.8., %52 ], [ %.sroa.0226.sroa.0.8419.ph, %.loopexit.preheader ]
  %.sroa.15.8418 = phi i32 [ %.sroa.15.8., %52 ], [ %.sroa.15.8418.ph, %.loopexit.preheader ]
  %.sroa.0132.sroa.21.8417 = phi i32 [ %..sroa.0132.sroa.21.8, %52 ], [ %.sroa.0132.sroa.21.8417.ph, %.loopexit.preheader ]
  %.sroa.0132.sroa.0.8416 = phi i32 [ %..sroa.0132.sroa.0.8, %52 ], [ %.sroa.0132.sroa.0.8416.ph, %.loopexit.preheader ]
  %.sroa.26.8415 = phi i32 [ %..sroa.26.8, %52 ], [ %.sroa.26.8415.ph, %.loopexit.preheader ]
  %.0298414 = phi i8 [ %55, %52 ], [ 0, %.loopexit.preheader ]
  %.sroa.0226.sroa.12.0.insert.ext = zext i32 %.sroa.0226.sroa.12.8420 to i64
  %.sroa.0226.sroa.12.0.insert.shift = shl nuw i64 %.sroa.0226.sroa.12.0.insert.ext, 32
  %.sroa.0226.sroa.0.0.insert.ext = zext i32 %.sroa.0226.sroa.0.8419 to i64
  %.sroa.0226.sroa.0.0.insert.insert = or disjoint i64 %.sroa.0226.sroa.12.0.insert.shift, %.sroa.0226.sroa.0.0.insert.ext
  %.sroa.0132.sroa.21.0.insert.ext = zext i32 %.sroa.0132.sroa.21.8417 to i64
  %.sroa.0132.sroa.21.0.insert.shift = shl nuw i64 %.sroa.0132.sroa.21.0.insert.ext, 32
  %.sroa.0132.sroa.0.0.insert.ext = zext i32 %.sroa.0132.sroa.0.8416 to i64
  %.sroa.0132.sroa.0.0.insert.insert = or disjoint i64 %.sroa.0132.sroa.21.0.insert.shift, %.sroa.0132.sroa.0.0.insert.ext
  %35 = call { i64, i32 } @TPE_vec3Plus(i64 %.sroa.0226.sroa.0.0.insert.insert, i32 %.sroa.15.8418, i64 %.sroa.0132.sroa.0.0.insert.insert, i32 %.sroa.26.8415)
  %.fca.0.extract13 = extractvalue { i64, i32 } %35, 0
  %.fca.1.extract14 = extractvalue { i64, i32 } %35, 1
  %.sroa.021.sroa.0.0.extract.trunc = trunc i64 %.fca.0.extract13 to i32
  %.sroa.021.sroa.11.0.extract.shift = lshr i64 %.fca.0.extract13, 32
  %.sroa.021.sroa.11.0.extract.trunc = trunc nuw i64 %.sroa.021.sroa.11.0.extract.shift to i32
  %36 = sdiv i32 %.sroa.021.sroa.0.0.extract.trunc, 2
  %37 = sdiv i32 %.sroa.021.sroa.11.0.extract.trunc, 2
  %38 = sdiv i32 %.fca.1.extract14, 2
  %39 = icmp eq i32 %36, %.sroa.0226.sroa.0.8419
  %40 = icmp eq i32 %37, %.sroa.0226.sroa.12.8420
  %or.cond317 = select i1 %39, i1 %40, i1 false
  %41 = icmp eq i32 %38, %.sroa.15.8418
  %or.cond318 = select i1 %or.cond317, i1 %41, i1 false
  br i1 %or.cond318, label %.thread377, label %42

42:                                               ; preds = %.loopexit
  %43 = icmp eq i32 %36, %.sroa.0132.sroa.0.8416
  %44 = icmp eq i32 %37, %.sroa.0132.sroa.21.8417
  %or.cond319 = select i1 %43, i1 %44, i1 false
  %45 = icmp eq i32 %38, %.sroa.26.8415
  %or.cond320 = select i1 %or.cond319, i1 %45, i1 false
  br i1 %or.cond320, label %.thread377, label %46

46:                                               ; preds = %42
  %.sroa.021.sroa.11.0.insert.ext = zext i32 %37 to i64
  %.sroa.021.sroa.11.0.insert.shift = shl nuw i64 %.sroa.021.sroa.11.0.insert.ext, 32
  %.sroa.021.sroa.0.0.insert.ext = zext i32 %36 to i64
  %.sroa.021.sroa.0.0.insert.insert = or disjoint i64 %.sroa.021.sroa.11.0.insert.shift, %.sroa.021.sroa.0.0.insert.ext
  %47 = call { i64, i32 } %4(i64 %.sroa.021.sroa.0.0.insert.insert, i32 %38, i32 noundef 16) #3
  %.fca.0.extract6 = extractvalue { i64, i32 } %47, 0
  %.sroa.012.0.extract.trunc = trunc i64 %.fca.0.extract6 to i32
  %48 = icmp eq i32 %36, %.sroa.012.0.extract.trunc
  %.sroa.012.4.extract.shift = lshr i64 %.fca.0.extract6, 32
  %.sroa.012.4.extract.trunc = trunc nuw i64 %.sroa.012.4.extract.shift to i32
  %49 = icmp eq i32 %37, %.sroa.012.4.extract.trunc
  %or.cond321 = select i1 %48, i1 %49, i1 false
  br i1 %or.cond321, label %50, label %52

50:                                               ; preds = %46
  %.fca.1.extract7 = extractvalue { i64, i32 } %47, 1
  %51 = icmp eq i32 %.fca.1.extract7, %38
  br label %52

52:                                               ; preds = %50, %46
  %53 = phi i1 [ false, %46 ], [ %51, %50 ]
  %54 = xor i1 %or.cond310, %53
  %..sroa.26.8 = select i1 %54, i32 %38, i32 %.sroa.26.8415
  %..sroa.0132.sroa.0.8 = select i1 %54, i32 %36, i32 %.sroa.0132.sroa.0.8416
  %..sroa.0132.sroa.21.8 = select i1 %54, i32 %37, i32 %.sroa.0132.sroa.21.8417
  %.sroa.15.8. = select i1 %54, i32 %.sroa.15.8418, i32 %38
  %.sroa.0226.sroa.0.8. = select i1 %54, i32 %.sroa.0226.sroa.0.8419, i32 %36
  %.sroa.0226.sroa.12.8. = select i1 %54, i32 %.sroa.0226.sroa.12.8420, i32 %37
  %55 = add nuw i8 %.0298414, 1
  %exitcond445.not = icmp eq i8 %55, -128
  br i1 %exitcond445.not, label %..thread377_crit_edge, label %.loopexit, !llvm.loop !8

..thread377_crit_edge:                            ; preds = %52
  %.pre = zext i32 %.sroa.0226.sroa.12.8. to i64
  %.pre446 = shl nuw i64 %.pre, 32
  %.pre447 = zext i32 %.sroa.0226.sroa.0.8. to i64
  %.pre448 = or disjoint i64 %.pre446, %.pre447
  %.pre449 = zext i32 %..sroa.0132.sroa.21.8 to i64
  %.pre450 = shl nuw i64 %.pre449, 32
  %.pre451 = zext i32 %..sroa.0132.sroa.0.8 to i64
  %.pre452 = or disjoint i64 %.pre450, %.pre451
  br label %.thread377

.thread377:                                       ; preds = %.loopexit, %42, %..thread377_crit_edge
  %.sroa.0132.sroa.0.0.insert.insert187.pre-phi = phi i64 [ %.pre452, %..thread377_crit_edge ], [ %.sroa.0132.sroa.0.0.insert.insert, %42 ], [ %.sroa.0132.sroa.0.0.insert.insert, %.loopexit ]
  %.sroa.0226.sroa.0.0.insert.insert248.pre-phi = phi i64 [ %.pre448, %..thread377_crit_edge ], [ %.sroa.0226.sroa.0.0.insert.insert, %42 ], [ %.sroa.0226.sroa.0.0.insert.insert, %.loopexit ]
  %.sroa.26.8.lcssa = phi i32 [ %..sroa.26.8, %..thread377_crit_edge ], [ %.sroa.26.8415, %42 ], [ %.sroa.26.8415, %.loopexit ]
  %.sroa.15.8.lcssa = phi i32 [ %.sroa.15.8., %..thread377_crit_edge ], [ %.sroa.15.8418, %42 ], [ %.sroa.15.8418, %.loopexit ]
  %.sroa.0286.3 = select i1 %or.cond310, i64 %.sroa.0132.sroa.0.0.insert.insert187.pre-phi, i64 %.sroa.0226.sroa.0.0.insert.insert248.pre-phi
  %.sroa.5287.3 = select i1 %or.cond310, i32 %.sroa.26.8.lcssa, i32 %.sroa.15.8.lcssa
  br label %.thread343

.thread333:                                       ; preds = %11, %29, %.preheader385, %27
  %56 = call { i64, i32 } @TPE_vec3(i32 noundef 2147483647, i32 noundef 2147483647, i32 noundef 2147483647)
  %.fca.0.extract = extractvalue { i64, i32 } %56, 0
  %.fca.1.extract = extractvalue { i64, i32 } %56, 1
  br label %.thread343

.thread343:                                       ; preds = %18, %.lr.ph, %.thread333, %.thread377
  %.sroa.0286.4 = phi i64 [ %.sroa.0286.3, %.thread377 ], [ %.fca.0.extract, %.thread333 ], [ %.fca.0.extract88, %.lr.ph ], [ %.fca.0.extract88, %18 ]
  %.sroa.5287.4 = phi i32 [ %.sroa.5287.3, %.thread377 ], [ %.fca.1.extract, %.thread333 ], [ %.sroa.15.0405, %18 ], [ %.fca.1.extract89, %.lr.ph ]
  %.fca.0.insert = insertvalue { i64, i32 } poison, i64 %.sroa.0286.4, 0
  %.fca.1.insert = insertvalue { i64, i32 } %.fca.0.insert, i32 %.sroa.5287.4, 1
  ret { i64, i32 } %.fca.1.insert
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}


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