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

; 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 }

@rampPoits = external dso_local global [6 x i32], align 16

; 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 { i64, i32 } @TPE_envBox(i64, i32, i64, i32, i64, i32, ptr noundef byval(%struct.TPE_Vec3) align 8) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local { i64, i32 } @TPE_envAATriPrism(i64, i32, i64, i32, ptr noundef, i32 noundef, i8 noundef zeroext) #1

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

88:                                               ; preds = %3
  %89 = getelementptr inbounds %struct.TPE_Vec3, ptr %4, i32 0, i32 1
  %90 = load i32, ptr %89, align 4, !tbaa !11
  %91 = getelementptr inbounds %struct.TPE_Vec3, ptr %5, i32 0, i32 1
  %92 = load i32, ptr %91, align 4, !tbaa !11
  %93 = icmp eq i32 %90, %92
  br i1 %93, label %94, label %101

94:                                               ; preds = %88
  %95 = getelementptr inbounds %struct.TPE_Vec3, ptr %4, i32 0, i32 2
  %96 = load i32, ptr %95, align 4, !tbaa !12
  %97 = getelementptr inbounds %struct.TPE_Vec3, ptr %5, i32 0, i32 2
  %98 = load i32, ptr %97, align 4, !tbaa !12
  %99 = icmp eq i32 %96, %98
  br i1 %99, label %100, label %101

100:                                              ; preds = %94
  store i32 1, ptr %21, align 4
  br label %226

101:                                              ; preds = %94, %88, %3
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #4
  %102 = call { i64, i32 } @TPE_vec3(i32 noundef 100, i32 noundef 200, i32 noundef -10)
  store { i64, i32 } %102, ptr %24, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 8 %24, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %5, i64 12, i1 false)
  %103 = getelementptr inbounds { i64, i32 }, ptr %25, i32 0, i32 0
  %104 = load i64, ptr %103, align 4
  %105 = getelementptr inbounds { i64, i32 }, ptr %25, i32 0, i32 1
  %106 = load i32, ptr %105, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %23, i64 12, i1 false)
  %107 = getelementptr inbounds { i64, i32 }, ptr %26, i32 0, i32 0
  %108 = load i64, ptr %107, align 4
  %109 = getelementptr inbounds { i64, i32 }, ptr %26, i32 0, i32 1
  %110 = load i32, ptr %109, align 4
  %111 = call { i64, i32 } @TPE_envAATriPrism(i64 %104, i32 %106, i64 %108, i32 %110, ptr noundef @rampPoits, i32 noundef 3000, i8 noundef zeroext 2)
  store { i64, i32 } %111, ptr %27, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 8 %27, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %22, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %16, i64 12, i1 false)
  %112 = getelementptr inbounds { i64, i32 }, ptr %28, i32 0, i32 0
  %113 = load i64, ptr %112, align 4
  %114 = getelementptr inbounds { i64, i32 }, ptr %28, i32 0, i32 1
  %115 = load i32, ptr %114, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %5, i64 12, i1 false)
  %116 = getelementptr inbounds { i64, i32 }, ptr %29, i32 0, i32 0
  %117 = load i64, ptr %116, align 4
  %118 = getelementptr inbounds { i64, i32 }, ptr %29, i32 0, i32 1
  %119 = load i32, ptr %118, align 4
  %120 = call i32 @TPE_dist(i64 %113, i32 %115, i64 %117, i32 %119)
  store i32 %120, ptr %20, align 4, !tbaa !5
  %121 = load i32, ptr %20, align 4, !tbaa !5
  %122 = load i32, ptr %17, align 4, !tbaa !5
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %124, label %126

124:                                              ; preds = %101
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 4 %16, i64 12, i1 false), !tbaa.struct !13
  %125 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %125, ptr %17, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %124, %101
  %127 = getelementptr inbounds %struct.TPE_Vec3, ptr %4, i32 0, i32 0
  %128 = load i32, ptr %127, align 4, !tbaa !9
  %129 = getelementptr inbounds %struct.TPE_Vec3, ptr %5, i32 0, i32 0
  %130 = load i32, ptr %129, align 4, !tbaa !9
  %131 = icmp eq i32 %128, %130
  br i1 %131, label %132, label %145

132:                                              ; preds = %126
  %133 = getelementptr inbounds %struct.TPE_Vec3, ptr %4, i32 0, i32 1
  %134 = load i32, ptr %133, align 4, !tbaa !11
  %135 = getelementptr inbounds %struct.TPE_Vec3, ptr %5, i32 0, i32 1
  %136 = load i32, ptr %135, align 4, !tbaa !11
  %137 = icmp eq i32 %134, %136
  br i1 %137, label %138, label %145

138:                                              ; preds = %132
  %139 = getelementptr inbounds %struct.TPE_Vec3, ptr %4, i32 0, i32 2
  %140 = load i32, ptr %139, align 4, !tbaa !12
  %141 = getelementptr inbounds %struct.TPE_Vec3, ptr %5, i32 0, i32 2
  %142 = load i32, ptr %141, align 4, !tbaa !12
  %143 = icmp eq i32 %140, %142
  br i1 %143, label %144, label %145

144:                                              ; preds = %138
  store i32 1, ptr %21, align 4
  br label %226

145:                                              ; preds = %138, %132, %126
  call void @llvm.lifetime.start.p0(i64 12, ptr %30) #4
  %146 = call { i64, i32 } @TPE_vec3(i32 noundef 30, i32 noundef 200, i32 noundef -10)
  store { i64, i32 } %146, ptr %32, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 8 %32, i64 12, i1 false)
  %147 = call { i64, i32 } @TPE_vec3(i32 noundef 500, i32 noundef 600, i32 noundef 700)
  store { i64, i32 } %147, ptr %34, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 8 %34, i64 12, i1 false)
  %148 = call { i64, i32 } @TPE_vec3(i32 noundef 10, i32 noundef 20, i32 noundef 30)
  store { i64, i32 } %148, ptr %36, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 8 %36, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %37, ptr align 4 %5, i64 12, i1 false)
  %149 = getelementptr inbounds { i64, i32 }, ptr %37, i32 0, i32 0
  %150 = load i64, ptr %149, align 4
  %151 = getelementptr inbounds { i64, i32 }, ptr %37, i32 0, i32 1
  %152 = load i32, ptr %151, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %38, ptr align 4 %31, i64 12, i1 false)
  %153 = getelementptr inbounds { i64, i32 }, ptr %38, i32 0, i32 0
  %154 = load i64, ptr %153, align 4
  %155 = getelementptr inbounds { i64, i32 }, ptr %38, i32 0, i32 1
  %156 = load i32, ptr %155, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %39, ptr align 4 %33, i64 12, i1 false)
  %157 = getelementptr inbounds { i64, i32 }, ptr %39, i32 0, i32 0
  %158 = load i64, ptr %157, align 4
  %159 = getelementptr inbounds { i64, i32 }, ptr %39, i32 0, i32 1
  %160 = load i32, ptr %159, align 4
  %161 = call { i64, i32 } @TPE_envBox(i64 %150, i32 %152, i64 %154, i32 %156, i64 %158, i32 %160, ptr noundef byval(%struct.TPE_Vec3) align 8 %35)
  store { i64, i32 } %161, ptr %40, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 8 %40, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %30, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %41, ptr align 4 %16, i64 12, i1 false)
  %162 = getelementptr inbounds { i64, i32 }, ptr %41, i32 0, i32 0
  %163 = load i64, ptr %162, align 4
  %164 = getelementptr inbounds { i64, i32 }, ptr %41, i32 0, i32 1
  %165 = load i32, ptr %164, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %42, ptr align 4 %5, i64 12, i1 false)
  %166 = getelementptr inbounds { i64, i32 }, ptr %42, i32 0, i32 0
  %167 = load i64, ptr %166, align 4
  %168 = getelementptr inbounds { i64, i32 }, ptr %42, i32 0, i32 1
  %169 = load i32, ptr %168, align 4
  %170 = call i32 @TPE_dist(i64 %163, i32 %165, i64 %167, i32 %169)
  store i32 %170, ptr %20, align 4, !tbaa !5
  %171 = load i32, ptr %20, align 4, !tbaa !5
  %172 = load i32, ptr %17, align 4, !tbaa !5
  %173 = icmp slt i32 %171, %172
  br i1 %173, label %174, label %176

174:                                              ; preds = %145
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 4 %16, i64 12, i1 false), !tbaa.struct !13
  %175 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %175, ptr %17, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %174, %145
  %177 = getelementptr inbounds %struct.TPE_Vec3, ptr %4, i32 0, i32 0
  %178 = load i32, ptr %177, align 4, !tbaa !9
  %179 = getelementptr inbounds %struct.TPE_Vec3, ptr %5, i32 0, i32 0
  %180 = load i32, ptr %179, align 4, !tbaa !9
  %181 = icmp eq i32 %178, %180
  br i1 %181, label %182, label %195

182:                                              ; preds = %176
  %183 = getelementptr inbounds %struct.TPE_Vec3, ptr %4, i32 0, i32 1
  %184 = load i32, ptr %183, align 4, !tbaa !11
  %185 = getelementptr inbounds %struct.TPE_Vec3, ptr %5, i32 0, i32 1
  %186 = load i32, ptr %185, align 4, !tbaa !11
  %187 = icmp eq i32 %184, %186
  br i1 %187, label %188, label %195

188:                                              ; preds = %182
  %189 = getelementptr inbounds %struct.TPE_Vec3, ptr %4, i32 0, i32 2
  %190 = load i32, ptr %189, align 4, !tbaa !12
  %191 = getelementptr inbounds %struct.TPE_Vec3, ptr %5, i32 0, i32 2
  %192 = load i32, ptr %191, align 4, !tbaa !12
  %193 = icmp eq i32 %190, %192
  br i1 %193, label %194, label %195

194:                                              ; preds = %188
  store i32 1, ptr %21, align 4
  br label %226

195:                                              ; preds = %188, %182, %176
  call void @llvm.lifetime.start.p0(i64 12, ptr %43) #4
  %196 = call { i64, i32 } @TPE_vec3(i32 noundef -100, i32 noundef 300, i32 noundef 200)
  store { i64, i32 } %196, ptr %45, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %44, ptr align 8 %45, i64 12, i1 false)
  %197 = call { i64, i32 } @TPE_vec3(i32 noundef 500, i32 noundef 600, i32 noundef 700)
  store { i64, i32 } %197, ptr %47, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %46, ptr align 8 %47, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %48, ptr align 4 %5, i64 12, i1 false)
  %198 = getelementptr inbounds { i64, i32 }, ptr %48, i32 0, i32 0
  %199 = load i64, ptr %198, align 4
  %200 = getelementptr inbounds { i64, i32 }, ptr %48, i32 0, i32 1
  %201 = load i32, ptr %200, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %49, ptr align 4 %44, i64 12, i1 false)
  %202 = getelementptr inbounds { i64, i32 }, ptr %49, i32 0, i32 0
  %203 = load i64, ptr %202, align 4
  %204 = getelementptr inbounds { i64, i32 }, ptr %49, i32 0, i32 1
  %205 = load i32, ptr %204, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %50, ptr align 4 %46, i64 12, i1 false)
  %206 = getelementptr inbounds { i64, i32 }, ptr %50, i32 0, i32 0
  %207 = load i64, ptr %206, align 4
  %208 = getelementptr inbounds { i64, i32 }, ptr %50, i32 0, i32 1
  %209 = load i32, ptr %208, align 4
  %210 = call { i64, i32 } @TPE_envAABox(i64 %199, i32 %201, i64 %203, i32 %205, i64 %207, i32 %209)
  store { i64, i32 } %210, ptr %51, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %43, ptr align 8 %51, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %43, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 12, ptr %43) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %52, ptr align 4 %16, i64 12, i1 false)
  %211 = getelementptr inbounds { i64, i32 }, ptr %52, i32 0, i32 0
  %212 = load i64, ptr %211, align 4
  %213 = getelementptr inbounds { i64, i32 }, ptr %52, i32 0, i32 1
  %214 = load i32, ptr %213, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %53, ptr align 4 %5, i64 12, i1 false)
  %215 = getelementptr inbounds { i64, i32 }, ptr %53, i32 0, i32 0
  %216 = load i64, ptr %215, align 4
  %217 = getelementptr inbounds { i64, i32 }, ptr %53, i32 0, i32 1
  %218 = load i32, ptr %217, align 4
  %219 = call i32 @TPE_dist(i64 %212, i32 %214, i64 %216, i32 %218)
  store i32 %219, ptr %20, align 4, !tbaa !5
  %220 = load i32, ptr %20, align 4, !tbaa !5
  %221 = load i32, ptr %17, align 4, !tbaa !5
  %222 = icmp slt i32 %220, %221
  br i1 %222, label %223, label %225

223:                                              ; preds = %195
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 4 %16, i64 12, i1 false), !tbaa.struct !13
  %224 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %224, ptr %17, align 4, !tbaa !5
  br label %225

225:                                              ; preds = %223, %195
  store i32 1, ptr %21, align 4
  br label %226

226:                                              ; preds = %225, %194, %144, %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %54, ptr align 4 %4, i64 12, i1 false)
  %227 = load { i64, i32 }, ptr %54, align 8
  ret { i64, i32 } %227
}

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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 4}
!12 = !{!10, !6, i64 8}
!13 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}


; 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 }

@rampPoits = external dso_local global [6 x i32], align 16

; 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 { i64, i32 } @TPE_envBox(i64, i32, i64, i32, i64, i32, ptr noundef byval(%struct.TPE_Vec3) align 8) local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local { i64, i32 } @envFunc(i64 %0, i32 %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct.TPE_Vec3, align 8
  %.sroa.0125.0.extract.trunc = trunc i64 %0 to i32
  %.sroa.12.0.extract.shift = lshr i64 %0, 32
  %.sroa.12.0.extract.trunc = trunc nuw i64 %.sroa.12.0.extract.shift to i32
  %5 = tail call { i64, i32 } @TPE_vec3(i32 noundef 0, i32 noundef 1000, i32 noundef 0)
  %.fca.0.extract117 = extractvalue { i64, i32 } %5, 0
  %.fca.1.extract118 = extractvalue { i64, i32 } %5, 1
  %6 = tail call { i64, i32 } @TPE_vec3(i32 noundef 7000, i32 noundef 6000, i32 noundef 7000)
  %.fca.0.extract111 = extractvalue { i64, i32 } %6, 0
  %.fca.1.extract112 = extractvalue { i64, i32 } %6, 1
  %7 = tail call { i64, i32 } @TPE_envAABoxInside(i64 %0, i32 %1, i64 %.fca.0.extract117, i32 %.fca.1.extract118, i64 %.fca.0.extract111, i32 %.fca.1.extract112)
  %.fca.0.extract101 = extractvalue { i64, i32 } %7, 0
  %.fca.1.extract102 = extractvalue { i64, i32 } %7, 1
  %.sroa.0189.0.extract.trunc197 = trunc i64 %.fca.0.extract101 to i32
  %.sroa.9.0.extract.shift206 = lshr i64 %.fca.0.extract101, 32
  %.sroa.9.0.extract.trunc207 = trunc nuw i64 %.sroa.9.0.extract.shift206 to i32
  %8 = tail call i32 @TPE_dist(i64 %.fca.0.extract101, i32 %.fca.1.extract102, i64 %0, i32 %1)
  %9 = icmp eq i32 %.sroa.0189.0.extract.trunc197, %.sroa.0125.0.extract.trunc
  %10 = icmp eq i64 %.sroa.9.0.extract.shift206, %.sroa.12.0.extract.shift
  %or.cond = and i1 %9, %10
  %11 = icmp eq i32 %.fca.1.extract102, %1
  %or.cond218 = select i1 %or.cond, i1 %11, i1 false
  br i1 %or.cond218, label %40, label %12

12:                                               ; preds = %3
  %13 = tail call { i64, i32 } @TPE_vec3(i32 noundef 100, i32 noundef 200, i32 noundef -10)
  %.fca.0.extract70 = extractvalue { i64, i32 } %13, 0
  %.fca.1.extract71 = extractvalue { i64, i32 } %13, 1
  %14 = tail call { i64, i32 } @TPE_envAATriPrism(i64 %0, i32 %1, i64 %.fca.0.extract70, i32 %.fca.1.extract71, ptr noundef nonnull @rampPoits, i32 noundef 3000, i8 noundef zeroext 2)
  %.fca.0.extract62 = extractvalue { i64, i32 } %14, 0
  %.fca.1.extract63 = extractvalue { i64, i32 } %14, 1
  %15 = tail call i32 @TPE_dist(i64 %.fca.0.extract62, i32 %.fca.1.extract63, i64 %0, i32 %1)
  %16 = icmp slt i32 %15, %8
  br i1 %16, label %17, label %18

17:                                               ; preds = %12
  %.sroa.0189.0.extract.trunc = trunc i64 %.fca.0.extract62 to i32
  %.sroa.9.0.extract.shift = lshr i64 %.fca.0.extract62, 32
  %.sroa.9.0.extract.trunc = trunc nuw i64 %.sroa.9.0.extract.shift to i32
  br label %18

18:                                               ; preds = %17, %12
  %.0 = phi i32 [ %15, %17 ], [ %8, %12 ]
  %.sroa.0189.0 = phi i32 [ %.sroa.0189.0.extract.trunc, %17 ], [ %.sroa.0189.0.extract.trunc197, %12 ]
  %.sroa.9.0 = phi i32 [ %.sroa.9.0.extract.trunc, %17 ], [ %.sroa.9.0.extract.trunc207, %12 ]
  %.sroa.12210.0 = phi i32 [ %.fca.1.extract63, %17 ], [ %.fca.1.extract102, %12 ]
  %19 = icmp eq i32 %.sroa.0189.0, %.sroa.0125.0.extract.trunc
  %20 = icmp eq i32 %.sroa.9.0, %.sroa.12.0.extract.trunc
  %or.cond219 = select i1 %19, i1 %20, i1 false
  %21 = icmp eq i32 %.sroa.12210.0, %1
  %or.cond220 = select i1 %or.cond219, i1 %21, i1 false
  br i1 %or.cond220, label %40, label %22

22:                                               ; preds = %18
  %23 = tail call { i64, i32 } @TPE_vec3(i32 noundef 30, i32 noundef 200, i32 noundef -10)
  %.fca.0.extract50 = extractvalue { i64, i32 } %23, 0
  %.fca.1.extract51 = extractvalue { i64, i32 } %23, 1
  %24 = tail call { i64, i32 } @TPE_vec3(i32 noundef 500, i32 noundef 600, i32 noundef 700)
  %.fca.0.extract44 = extractvalue { i64, i32 } %24, 0
  %.fca.1.extract45 = extractvalue { i64, i32 } %24, 1
  %25 = tail call { i64, i32 } @TPE_vec3(i32 noundef 10, i32 noundef 20, i32 noundef 30)
  %.fca.0.extract40 = extractvalue { i64, i32 } %25, 0
  %.fca.1.extract41 = extractvalue { i64, i32 } %25, 1
  store i64 %.fca.0.extract40, ptr %4, align 8
  %.sroa.243.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  store i32 %.fca.1.extract41, ptr %.sroa.243.0..sroa_idx, align 8
  %26 = tail call { i64, i32 } @TPE_envBox(i64 %0, i32 %1, i64 %.fca.0.extract50, i32 %.fca.1.extract51, i64 %.fca.0.extract44, i32 %.fca.1.extract45, ptr noundef nonnull byval(%struct.TPE_Vec3) align 8 %4)
  %.fca.0.extract30 = extractvalue { i64, i32 } %26, 0
  %.fca.1.extract31 = extractvalue { i64, i32 } %26, 1
  %27 = tail call i32 @TPE_dist(i64 %.fca.0.extract30, i32 %.fca.1.extract31, i64 %0, i32 %1)
  %28 = icmp slt i32 %27, %.0
  br i1 %28, label %29, label %30

29:                                               ; preds = %22
  %.sroa.0189.0.extract.trunc195 = trunc i64 %.fca.0.extract30 to i32
  %.sroa.9.0.extract.shift202 = lshr i64 %.fca.0.extract30, 32
  %.sroa.9.0.extract.trunc203 = trunc nuw i64 %.sroa.9.0.extract.shift202 to i32
  br label %30

30:                                               ; preds = %29, %22
  %.1 = phi i32 [ %27, %29 ], [ %.0, %22 ]
  %.sroa.0189.1 = phi i32 [ %.sroa.0189.0.extract.trunc195, %29 ], [ %.sroa.0189.0, %22 ]
  %.sroa.9.1 = phi i32 [ %.sroa.9.0.extract.trunc203, %29 ], [ %.sroa.9.0, %22 ]
  %.sroa.12210.1 = phi i32 [ %.fca.1.extract31, %29 ], [ %.sroa.12210.0, %22 ]
  %31 = icmp eq i32 %.sroa.0189.1, %.sroa.0125.0.extract.trunc
  %32 = icmp eq i32 %.sroa.9.1, %.sroa.12.0.extract.trunc
  %or.cond221 = select i1 %31, i1 %32, i1 false
  %33 = icmp eq i32 %.sroa.12210.1, %1
  %or.cond222 = select i1 %or.cond221, i1 %33, i1 false
  br i1 %or.cond222, label %40, label %34

34:                                               ; preds = %30
  %35 = tail call { i64, i32 } @TPE_vec3(i32 noundef -100, i32 noundef 300, i32 noundef 200)
  %.fca.0.extract19 = extractvalue { i64, i32 } %35, 0
  %.fca.1.extract20 = extractvalue { i64, i32 } %35, 1
  %36 = tail call { i64, i32 } @TPE_vec3(i32 noundef 500, i32 noundef 600, i32 noundef 700)
  %.fca.0.extract13 = extractvalue { i64, i32 } %36, 0
  %.fca.1.extract14 = extractvalue { i64, i32 } %36, 1
  %37 = tail call { i64, i32 } @TPE_envAABox(i64 %0, i32 %1, i64 %.fca.0.extract19, i32 %.fca.1.extract20, i64 %.fca.0.extract13, i32 %.fca.1.extract14)
  %.fca.0.extract = extractvalue { i64, i32 } %37, 0
  %.fca.1.extract = extractvalue { i64, i32 } %37, 1
  %38 = tail call i32 @TPE_dist(i64 %.fca.0.extract, i32 %.fca.1.extract, i64 %0, i32 %1)
  %39 = icmp slt i32 %38, %.1
  %.sroa.0189.0.extract.trunc196 = trunc i64 %.fca.0.extract to i32
  %.sroa.9.0.extract.shift204 = lshr i64 %.fca.0.extract, 32
  %.sroa.9.0.extract.trunc205 = trunc nuw i64 %.sroa.9.0.extract.shift204 to i32
  %.sroa.0189.2 = select i1 %39, i32 %.sroa.0189.0.extract.trunc196, i32 %.sroa.0189.1
  %.sroa.9.2 = select i1 %39, i32 %.sroa.9.0.extract.trunc205, i32 %.sroa.9.1
  %.sroa.12210.2 = select i1 %39, i32 %.fca.1.extract, i32 %.sroa.12210.1
  br label %40

40:                                               ; preds = %30, %18, %3, %34
  %.sroa.0189.3 = phi i32 [ %.sroa.0189.2, %34 ], [ %.sroa.0125.0.extract.trunc, %3 ], [ %.sroa.0125.0.extract.trunc, %18 ], [ %.sroa.0125.0.extract.trunc, %30 ]
  %.sroa.9.3 = phi i32 [ %.sroa.9.2, %34 ], [ %.sroa.9.0.extract.trunc207, %3 ], [ %.sroa.12.0.extract.trunc, %18 ], [ %.sroa.12.0.extract.trunc, %30 ]
  %.sroa.12210.3 = phi i32 [ %.sroa.12210.2, %34 ], [ %1, %3 ], [ %1, %18 ], [ %1, %30 ]
  %.sroa.9.0.insert.ext = zext i32 %.sroa.9.3 to i64
  %.sroa.9.0.insert.shift = shl nuw i64 %.sroa.9.0.insert.ext, 32
  %.sroa.0189.0.insert.ext = zext i32 %.sroa.0189.3 to i64
  %.sroa.0189.0.insert.insert = or disjoint i64 %.sroa.9.0.insert.shift, %.sroa.0189.0.insert.ext
  %.fca.0.insert = insertvalue { i64, i32 } poison, i64 %.sroa.0189.0.insert.insert, 0
  %.fca.1.insert = insertvalue { i64, i32 } %.fca.0.insert, i32 %.sroa.12210.3, 1
  ret { i64, i32 } %.fca.1.insert
}

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" }

!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)"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass