; 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 }
%struct.TPE_Body = type { ptr, i8, ptr, i8, i16, i16, i16, i8, i8 }
%struct.TPE_Connection = type { i8, i8, i16 }
%struct.TPE_Joint = type { %struct.TPE_Vec3, [3 x i16], i8 }

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @TPE_vec3Len(i64, i32) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @TPE_bodyReshape(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i16, align 2
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.TPE_Vec3, align 4
  %10 = alloca { i64, i32 }, align 4
  %11 = alloca { i64, i32 }, align 4
  %12 = alloca { i64, i32 }, align 8
  %13 = alloca %struct.TPE_Vec3, align 4
  %14 = alloca { i64, i32 }, align 4
  %15 = alloca { i64, i32 }, align 4
  %16 = alloca { i64, i32 }, align 8
  %17 = alloca %struct.TPE_Vec3, 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 { i64, i32 }, align 4
  %23 = alloca { i64, i32 }, align 4
  %24 = alloca { i64, i32 }, align 8
  %25 = alloca { i64, i32 }, align 4
  %26 = alloca %struct.TPE_Vec3, align 4
  %27 = alloca %struct.TPE_Vec3, align 4
  %28 = alloca { i64, i32 }, align 4
  %29 = alloca { i64, i32 }, align 8
  %30 = alloca { i64, i32 }, align 4
  %31 = alloca { i64, i32 }, align 4
  %32 = alloca { i64, i32 }, align 8
  %33 = alloca { i64, i32 }, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %5) #3
  store i16 0, ptr %5, align 2, !tbaa !9
  br label %34

34:                                               ; preds = %273, %2
  %35 = load i16, ptr %5, align 2, !tbaa !9
  %36 = zext i16 %35 to i32
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.TPE_Body, ptr %37, i32 0, i32 3
  %39 = load i8, ptr %38, align 8, !tbaa !11
  %40 = zext i8 %39 to i32
  %41 = icmp slt i32 %36, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 2, ptr %5) #3
  br label %276

43:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.TPE_Body, ptr %44, i32 0, i32 2
  %46 = load ptr, ptr %45, align 8, !tbaa !13
  %47 = load i16, ptr %5, align 2, !tbaa !9
  %48 = zext i16 %47 to i64
  %49 = getelementptr inbounds %struct.TPE_Connection, ptr %46, i64 %48
  store ptr %49, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.TPE_Body, ptr %50, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.TPE_Connection, ptr %53, i32 0, i32 0
  %55 = load i8, ptr %54, align 2, !tbaa !15
  %56 = zext i8 %55 to i64
  %57 = getelementptr inbounds %struct.TPE_Joint, ptr %52, i64 %56
  store ptr %57, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.TPE_Body, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !14
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.TPE_Connection, ptr %61, i32 0, i32 1
  %63 = load i8, ptr %62, align 1, !tbaa !17
  %64 = zext i8 %63 to i64
  %65 = getelementptr inbounds %struct.TPE_Joint, ptr %60, i64 %64
  store ptr %65, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #3
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.TPE_Joint, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.TPE_Joint, ptr %68, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %67, i64 12, i1 false)
  %70 = getelementptr inbounds { i64, i32 }, ptr %10, i32 0, i32 0
  %71 = load i64, ptr %70, align 4
  %72 = getelementptr inbounds { i64, i32 }, ptr %10, i32 0, i32 1
  %73 = load i32, ptr %72, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %69, i64 12, i1 false)
  %74 = getelementptr inbounds { i64, i32 }, ptr %11, i32 0, i32 0
  %75 = load i64, ptr %74, align 4
  %76 = getelementptr inbounds { i64, i32 }, ptr %11, i32 0, i32 1
  %77 = load i32, ptr %76, align 4
  %78 = call { i64, i32 } @TPE_vec3Minus(i64 %71, i32 %73, i64 %75, i32 %77)
  store { i64, i32 } %78, ptr %12, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 8 %12, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #3
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.TPE_Joint, ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.TPE_Joint, ptr %81, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %80, i64 12, i1 false)
  %83 = getelementptr inbounds { i64, i32 }, ptr %14, i32 0, i32 0
  %84 = load i64, ptr %83, align 4
  %85 = getelementptr inbounds { i64, i32 }, ptr %14, i32 0, i32 1
  %86 = load i32, ptr %85, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %82, i64 12, i1 false)
  %87 = getelementptr inbounds { i64, i32 }, ptr %15, i32 0, i32 0
  %88 = load i64, ptr %87, align 4
  %89 = getelementptr inbounds { i64, i32 }, ptr %15, i32 0, i32 1
  %90 = load i32, ptr %89, align 4
  %91 = call { i64, i32 } @TPE_vec3Plus(i64 %84, i32 %86, i64 %88, i32 %90)
  store { i64, i32 } %91, ptr %16, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 8 %16, i64 12, i1 false)
  %92 = getelementptr inbounds %struct.TPE_Vec3, ptr %13, i32 0, i32 0
  %93 = load i32, ptr %92, align 4, !tbaa !18
  %94 = sdiv i32 %93, 2
  store i32 %94, ptr %92, align 4, !tbaa !18
  %95 = getelementptr inbounds %struct.TPE_Vec3, ptr %13, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !21
  %97 = sdiv i32 %96, 2
  store i32 %97, ptr %95, align 4, !tbaa !21
  %98 = getelementptr inbounds %struct.TPE_Vec3, ptr %13, i32 0, i32 2
  %99 = load i32, ptr %98, align 4, !tbaa !22
  %100 = sdiv i32 %99, 2
  store i32 %100, ptr %98, align 4, !tbaa !22
  call void @TPE_vec3Normalize(ptr noundef %9)
  %101 = getelementptr inbounds %struct.TPE_Vec3, ptr %9, i32 0, i32 0
  %102 = load i32, ptr %101, align 4, !tbaa !18
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.TPE_Connection, ptr %103, i32 0, i32 2
  %105 = load i16, ptr %104, align 2, !tbaa !23
  %106 = zext i16 %105 to i32
  %107 = mul nsw i32 %102, %106
  %108 = sdiv i32 %107, 512
  %109 = getelementptr inbounds %struct.TPE_Vec3, ptr %9, i32 0, i32 0
  store i32 %108, ptr %109, align 4, !tbaa !18
  %110 = getelementptr inbounds %struct.TPE_Vec3, ptr %9, i32 0, i32 1
  %111 = load i32, ptr %110, align 4, !tbaa !21
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.TPE_Connection, ptr %112, i32 0, i32 2
  %114 = load i16, ptr %113, align 2, !tbaa !23
  %115 = zext i16 %114 to i32
  %116 = mul nsw i32 %111, %115
  %117 = sdiv i32 %116, 512
  %118 = getelementptr inbounds %struct.TPE_Vec3, ptr %9, i32 0, i32 1
  store i32 %117, ptr %118, align 4, !tbaa !21
  %119 = getelementptr inbounds %struct.TPE_Vec3, ptr %9, i32 0, i32 2
  %120 = load i32, ptr %119, align 4, !tbaa !22
  %121 = load ptr, ptr %6, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.TPE_Connection, ptr %121, i32 0, i32 2
  %123 = load i16, ptr %122, align 2, !tbaa !23
  %124 = zext i16 %123 to i32
  %125 = mul nsw i32 %120, %124
  %126 = sdiv i32 %125, 512
  %127 = getelementptr inbounds %struct.TPE_Vec3, ptr %9, i32 0, i32 2
  store i32 %126, ptr %127, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #3
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.TPE_Joint, ptr %128, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %129, i64 12, i1 false), !tbaa.struct !24
  %130 = getelementptr inbounds %struct.TPE_Vec3, ptr %13, i32 0, i32 0
  %131 = load i32, ptr %130, align 4, !tbaa !18
  %132 = getelementptr inbounds %struct.TPE_Vec3, ptr %9, i32 0, i32 0
  %133 = load i32, ptr %132, align 4, !tbaa !18
  %134 = sdiv i32 %133, 2
  %135 = sub nsw i32 %131, %134
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.TPE_Joint, ptr %136, i32 0, i32 0
  %138 = getelementptr inbounds %struct.TPE_Vec3, ptr %137, i32 0, i32 0
  store i32 %135, ptr %138, align 4, !tbaa !26
  %139 = getelementptr inbounds %struct.TPE_Vec3, ptr %13, i32 0, i32 1
  %140 = load i32, ptr %139, align 4, !tbaa !21
  %141 = getelementptr inbounds %struct.TPE_Vec3, ptr %9, i32 0, i32 1
  %142 = load i32, ptr %141, align 4, !tbaa !21
  %143 = sdiv i32 %142, 2
  %144 = sub nsw i32 %140, %143
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.TPE_Joint, ptr %145, i32 0, i32 0
  %147 = getelementptr inbounds %struct.TPE_Vec3, ptr %146, i32 0, i32 1
  store i32 %144, ptr %147, align 4, !tbaa !28
  %148 = getelementptr inbounds %struct.TPE_Vec3, ptr %13, i32 0, i32 2
  %149 = load i32, ptr %148, align 4, !tbaa !22
  %150 = getelementptr inbounds %struct.TPE_Vec3, ptr %9, i32 0, i32 2
  %151 = load i32, ptr %150, align 4, !tbaa !22
  %152 = sdiv i32 %151, 2
  %153 = sub nsw i32 %149, %152
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.TPE_Joint, ptr %154, i32 0, i32 0
  %156 = getelementptr inbounds %struct.TPE_Vec3, ptr %155, i32 0, i32 2
  store i32 %153, ptr %156, align 4, !tbaa !29
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = icmp ne ptr %157, null
  br i1 %158, label %159, label %198

159:                                              ; preds = %43
  %160 = load ptr, ptr %7, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.TPE_Joint, ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.TPE_Joint, ptr %163, i32 0, i32 0
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.TPE_Joint, ptr %165, i32 0, i32 2
  %167 = load i8, ptr %166, align 2, !tbaa !30
  %168 = zext i8 %167 to i32
  %169 = mul nsw i32 %168, 32
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %164, i64 12, i1 false)
  %170 = getelementptr inbounds { i64, i32 }, ptr %20, i32 0, i32 0
  %171 = load i64, ptr %170, align 4
  %172 = getelementptr inbounds { i64, i32 }, ptr %20, i32 0, i32 1
  %173 = load i32, ptr %172, align 4
  %174 = call { i64, i32 } %162(i64 %171, i32 %173, i32 noundef %169)
  store { i64, i32 } %174, 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.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %161, i64 12, i1 false)
  %175 = getelementptr inbounds { i64, i32 }, ptr %22, i32 0, i32 0
  %176 = load i64, ptr %175, align 4
  %177 = getelementptr inbounds { i64, i32 }, ptr %22, i32 0, i32 1
  %178 = load i32, ptr %177, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %19, i64 12, i1 false)
  %179 = getelementptr inbounds { i64, i32 }, ptr %23, i32 0, i32 0
  %180 = load i64, ptr %179, align 4
  %181 = getelementptr inbounds { i64, i32 }, ptr %23, i32 0, i32 1
  %182 = load i32, ptr %181, align 4
  %183 = call { i64, i32 } @TPE_vec3Minus(i64 %176, i32 %178, i64 %180, i32 %182)
  store { i64, i32 } %183, ptr %24, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 8 %24, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %18, i64 12, i1 false)
  %184 = getelementptr inbounds { i64, i32 }, ptr %25, i32 0, i32 0
  %185 = load i64, ptr %184, align 4
  %186 = getelementptr inbounds { i64, i32 }, ptr %25, i32 0, i32 1
  %187 = load i32, ptr %186, align 4
  %188 = call i32 @TPE_vec3Len(i64 %185, i32 %187)
  %189 = load ptr, ptr %7, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.TPE_Joint, ptr %189, i32 0, i32 2
  %191 = load i8, ptr %190, align 2, !tbaa !30
  %192 = zext i8 %191 to i32
  %193 = mul nsw i32 %192, 32
  %194 = icmp slt i32 %188, %193
  br i1 %194, label %195, label %198

195:                                              ; preds = %159
  %196 = load ptr, ptr %7, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.TPE_Joint, ptr %196, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %197, ptr align 4 %17, i64 12, i1 false), !tbaa.struct !24
  br label %198

198:                                              ; preds = %195, %159, %43
  %199 = load ptr, ptr %8, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.TPE_Joint, ptr %199, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %200, i64 12, i1 false), !tbaa.struct !24
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.TPE_Joint, ptr %201, i32 0, i32 0
  %203 = getelementptr inbounds %struct.TPE_Vec3, ptr %202, i32 0, i32 0
  %204 = load i32, ptr %203, align 4, !tbaa !26
  %205 = getelementptr inbounds %struct.TPE_Vec3, ptr %9, i32 0, i32 0
  %206 = load i32, ptr %205, align 4, !tbaa !18
  %207 = add nsw i32 %204, %206
  %208 = load ptr, ptr %8, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.TPE_Joint, ptr %208, i32 0, i32 0
  %210 = getelementptr inbounds %struct.TPE_Vec3, ptr %209, i32 0, i32 0
  store i32 %207, ptr %210, align 4, !tbaa !26
  %211 = load ptr, ptr %7, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.TPE_Joint, ptr %211, i32 0, i32 0
  %213 = getelementptr inbounds %struct.TPE_Vec3, ptr %212, i32 0, i32 1
  %214 = load i32, ptr %213, align 4, !tbaa !28
  %215 = getelementptr inbounds %struct.TPE_Vec3, ptr %9, i32 0, i32 1
  %216 = load i32, ptr %215, align 4, !tbaa !21
  %217 = add nsw i32 %214, %216
  %218 = load ptr, ptr %8, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.TPE_Joint, ptr %218, i32 0, i32 0
  %220 = getelementptr inbounds %struct.TPE_Vec3, ptr %219, i32 0, i32 1
  store i32 %217, ptr %220, align 4, !tbaa !28
  %221 = load ptr, ptr %7, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.TPE_Joint, ptr %221, i32 0, i32 0
  %223 = getelementptr inbounds %struct.TPE_Vec3, ptr %222, i32 0, i32 2
  %224 = load i32, ptr %223, align 4, !tbaa !29
  %225 = getelementptr inbounds %struct.TPE_Vec3, ptr %9, i32 0, i32 2
  %226 = load i32, ptr %225, align 4, !tbaa !22
  %227 = add nsw i32 %224, %226
  %228 = load ptr, ptr %8, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.TPE_Joint, ptr %228, i32 0, i32 0
  %230 = getelementptr inbounds %struct.TPE_Vec3, ptr %229, i32 0, i32 2
  store i32 %227, ptr %230, align 4, !tbaa !29
  %231 = load ptr, ptr %4, align 8, !tbaa !5
  %232 = icmp ne ptr %231, null
  br i1 %232, label %233, label %272

233:                                              ; preds = %198
  %234 = load ptr, ptr %8, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.TPE_Joint, ptr %234, i32 0, i32 0
  %236 = load ptr, ptr %4, align 8, !tbaa !5
  %237 = load ptr, ptr %8, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.TPE_Joint, ptr %237, i32 0, i32 0
  %239 = load ptr, ptr %8, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.TPE_Joint, ptr %239, i32 0, i32 2
  %241 = load i8, ptr %240, align 2, !tbaa !30
  %242 = zext i8 %241 to i32
  %243 = mul nsw i32 %242, 32
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %238, i64 12, i1 false)
  %244 = getelementptr inbounds { i64, i32 }, ptr %28, i32 0, i32 0
  %245 = load i64, ptr %244, align 4
  %246 = getelementptr inbounds { i64, i32 }, ptr %28, i32 0, i32 1
  %247 = load i32, ptr %246, align 4
  %248 = call { i64, i32 } %236(i64 %245, i32 %247, i32 noundef %243)
  store { i64, i32 } %248, ptr %29, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 8 %29, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %235, i64 12, i1 false)
  %249 = getelementptr inbounds { i64, i32 }, ptr %30, i32 0, i32 0
  %250 = load i64, ptr %249, align 4
  %251 = getelementptr inbounds { i64, i32 }, ptr %30, i32 0, i32 1
  %252 = load i32, ptr %251, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %27, i64 12, i1 false)
  %253 = getelementptr inbounds { i64, i32 }, ptr %31, i32 0, i32 0
  %254 = load i64, ptr %253, align 4
  %255 = getelementptr inbounds { i64, i32 }, ptr %31, i32 0, i32 1
  %256 = load i32, ptr %255, align 4
  %257 = call { i64, i32 } @TPE_vec3Minus(i64 %250, i32 %252, i64 %254, i32 %256)
  store { i64, i32 } %257, ptr %32, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 8 %32, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %26, i64 12, i1 false)
  %258 = getelementptr inbounds { i64, i32 }, ptr %33, i32 0, i32 0
  %259 = load i64, ptr %258, align 4
  %260 = getelementptr inbounds { i64, i32 }, ptr %33, i32 0, i32 1
  %261 = load i32, ptr %260, align 4
  %262 = call i32 @TPE_vec3Len(i64 %259, i32 %261)
  %263 = load ptr, ptr %8, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.TPE_Joint, ptr %263, i32 0, i32 2
  %265 = load i8, ptr %264, align 2, !tbaa !30
  %266 = zext i8 %265 to i32
  %267 = mul nsw i32 %266, 32
  %268 = icmp slt i32 %262, %267
  br i1 %268, label %269, label %272

269:                                              ; preds = %233
  %270 = load ptr, ptr %8, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.TPE_Joint, ptr %270, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %271, ptr align 4 %17, i64 12, i1 false), !tbaa.struct !24
  br label %272

272:                                              ; preds = %269, %233, %198
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %273

273:                                              ; preds = %272
  %274 = load i16, ptr %5, align 2, !tbaa !9
  %275 = add i16 %274, 1
  store i16 %275, ptr %5, align 2, !tbaa !9
  br label %34, !llvm.loop !31

276:                                              ; preds = %42
  ret void
}

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!"short", !7, i64 0}
!11 = !{!12, !7, i64 24}
!12 = !{!"", !6, i64 0, !7, i64 8, !6, i64 16, !7, i64 24, !10, i64 26, !10, i64 28, !10, i64 30, !7, i64 32, !7, i64 33}
!13 = !{!12, !6, i64 16}
!14 = !{!12, !6, i64 0}
!15 = !{!16, !7, i64 0}
!16 = !{!"", !7, i64 0, !7, i64 1, !10, i64 2}
!17 = !{!16, !7, i64 1}
!18 = !{!19, !20, i64 0}
!19 = !{!"", !20, i64 0, !20, i64 4, !20, i64 8}
!20 = !{!"int", !7, i64 0}
!21 = !{!19, !20, i64 4}
!22 = !{!19, !20, i64 8}
!23 = !{!16, !10, i64 2}
!24 = !{i64 0, i64 4, !25, i64 4, i64 4, !25, i64 8, i64 4, !25}
!25 = !{!20, !20, i64 0}
!26 = !{!27, !20, i64 0}
!27 = !{!"", !19, i64 0, !7, i64 12, !7, i64 18}
!28 = !{!27, !20, i64 4}
!29 = !{!27, !20, i64 8}
!30 = !{!27, !7, i64 18}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


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

%struct.TPE_Vec3 = type { i32, i32, i32 }
%struct.TPE_Connection = type { i8, i8, i16 }
%struct.TPE_Joint = type { %struct.TPE_Vec3, [3 x i16], i8 }

; Function Attrs: mustprogress 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @TPE_vec3Len(i64, i32) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @TPE_bodyReshape(ptr nocapture noundef readonly %0, ptr noundef readonly %1) local_unnamed_addr #2 {
  %3 = alloca %struct.TPE_Vec3, align 8
  %4 = alloca %struct.TPE_Vec3, align 4
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  %6 = load i8, ptr %5, align 8, !tbaa !5
  %.not103 = icmp eq i8 %6, 0
  br i1 %.not103, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %.sroa.255.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  %8 = getelementptr inbounds i8, ptr %3, i64 4
  %.not = icmp eq ptr %1, null
  br label %9

._crit_edge:                                      ; preds = %74, %2
  ret void

9:                                                ; preds = %.lr.ph, %74
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %74 ]
  %10 = load ptr, ptr %7, align 8, !tbaa !11
  %11 = getelementptr inbounds %struct.TPE_Connection, ptr %10, i64 %indvars.iv
  %12 = load ptr, ptr %0, align 8, !tbaa !12
  %13 = load i8, ptr %11, align 2, !tbaa !13
  %14 = zext i8 %13 to i64
  %15 = getelementptr inbounds %struct.TPE_Joint, ptr %12, i64 %14
  %16 = getelementptr inbounds i8, ptr %11, i64 1
  %17 = load i8, ptr %16, align 1, !tbaa !15
  %18 = zext i8 %17 to i64
  %19 = getelementptr inbounds %struct.TPE_Joint, ptr %12, i64 %18
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #3
  %.sroa.058.0.copyload = load i64, ptr %19, align 4
  %.sroa.259.0..sroa_idx = getelementptr inbounds i8, ptr %19, i64 8
  %.sroa.259.0.copyload = load i32, ptr %.sroa.259.0..sroa_idx, align 4
  %.sroa.056.0.copyload = load i64, ptr %15, align 4
  %.sroa.257.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 8
  %.sroa.257.0.copyload = load i32, ptr %.sroa.257.0..sroa_idx, align 4
  %20 = call { i64, i32 } @TPE_vec3Minus(i64 %.sroa.058.0.copyload, i32 %.sroa.259.0.copyload, i64 %.sroa.056.0.copyload, i32 %.sroa.257.0.copyload)
  %.fca.0.extract52 = extractvalue { i64, i32 } %20, 0
  %.fca.1.extract53 = extractvalue { i64, i32 } %20, 1
  store i64 %.fca.0.extract52, ptr %3, align 8
  store i32 %.fca.1.extract53, ptr %.sroa.255.0..sroa_idx, align 8
  %.sroa.043.0.copyload = load i64, ptr %15, align 4
  %.sroa.244.0.copyload = load i32, ptr %.sroa.257.0..sroa_idx, align 4
  %.sroa.041.0.copyload = load i64, ptr %19, align 4
  %.sroa.242.0.copyload = load i32, ptr %.sroa.259.0..sroa_idx, align 4
  %21 = call { i64, i32 } @TPE_vec3Plus(i64 %.sroa.043.0.copyload, i32 %.sroa.244.0.copyload, i64 %.sroa.041.0.copyload, i32 %.sroa.242.0.copyload)
  %.fca.0.extract37 = extractvalue { i64, i32 } %21, 0
  %.fca.1.extract38 = extractvalue { i64, i32 } %21, 1
  %.sroa.045.0.extract.trunc = trunc i64 %.fca.0.extract37 to i32
  %22 = sdiv i32 %.sroa.045.0.extract.trunc, 2
  %.sroa.045.4.extract.shift = lshr i64 %.fca.0.extract37, 32
  %.sroa.045.4.extract.trunc = trunc nuw i64 %.sroa.045.4.extract.shift to i32
  %23 = sdiv i32 %.sroa.045.4.extract.trunc, 2
  %24 = sdiv i32 %.fca.1.extract38, 2
  call void @TPE_vec3Normalize(ptr noundef nonnull %3)
  %25 = load i32, ptr %3, align 8, !tbaa !16
  %26 = getelementptr inbounds i8, ptr %11, i64 2
  %27 = load i16, ptr %26, align 2, !tbaa !19
  %28 = zext i16 %27 to i32
  %29 = mul nsw i32 %25, %28
  %30 = sdiv i32 %29, 512
  store i32 %30, ptr %3, align 8, !tbaa !16
  %31 = load i32, ptr %8, align 4, !tbaa !20
  %32 = mul nsw i32 %31, %28
  %33 = sdiv i32 %32, 512
  store i32 %33, ptr %8, align 4, !tbaa !20
  %34 = load i32, ptr %.sroa.255.0..sroa_idx, align 8, !tbaa !21
  %35 = mul nsw i32 %34, %28
  %36 = sdiv i32 %35, 512
  store i32 %36, ptr %.sroa.255.0..sroa_idx, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %15, i64 12, i1 false), !tbaa.struct !22
  %.neg = sdiv i32 %29, -1024
  %37 = add nsw i32 %.neg, %22
  store i32 %37, ptr %15, align 4, !tbaa !24
  %.neg100 = sdiv i32 %32, -1024
  %38 = add nsw i32 %.neg100, %23
  %39 = getelementptr inbounds i8, ptr %15, i64 4
  store i32 %38, ptr %39, align 4, !tbaa !26
  %.neg101 = sdiv i32 %35, -1024
  %40 = add nsw i32 %.neg101, %24
  store i32 %40, ptr %.sroa.257.0..sroa_idx, align 4, !tbaa !27
  br i1 %.not, label %54, label %41

41:                                               ; preds = %9
  %42 = getelementptr inbounds i8, ptr %15, i64 18
  %43 = load i8, ptr %42, align 2, !tbaa !28
  %44 = zext i8 %43 to i32
  %45 = shl nuw nsw i32 %44, 5
  %.sroa.031.0.copyload = load i64, ptr %15, align 4
  %46 = call { i64, i32 } %1(i64 %.sroa.031.0.copyload, i32 %40, i32 noundef %45) #3
  %.fca.0.extract27 = extractvalue { i64, i32 } %46, 0
  %.fca.1.extract28 = extractvalue { i64, i32 } %46, 1
  %.sroa.025.0.copyload = load i64, ptr %15, align 4
  %.sroa.226.0.copyload = load i32, ptr %.sroa.257.0..sroa_idx, align 4
  %47 = call { i64, i32 } @TPE_vec3Minus(i64 %.sroa.025.0.copyload, i32 %.sroa.226.0.copyload, i64 %.fca.0.extract27, i32 %.fca.1.extract28)
  %.fca.0.extract19 = extractvalue { i64, i32 } %47, 0
  %.fca.1.extract20 = extractvalue { i64, i32 } %47, 1
  %48 = call i32 @TPE_vec3Len(i64 %.fca.0.extract19, i32 %.fca.1.extract20)
  %49 = load i8, ptr %42, align 2, !tbaa !28
  %50 = zext i8 %49 to i32
  %51 = shl nuw nsw i32 %50, 5
  %52 = icmp slt i32 %48, %51
  br i1 %52, label %53, label %54

53:                                               ; preds = %41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %15, ptr noundef nonnull align 4 dereferenceable(12) %4, i64 12, i1 false), !tbaa.struct !22
  br label %54

54:                                               ; preds = %53, %41, %9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %19, i64 12, i1 false), !tbaa.struct !22
  %55 = load <2 x i32>, ptr %15, align 4, !tbaa !23
  %56 = load <2 x i32>, ptr %3, align 8, !tbaa !23
  %57 = add nsw <2 x i32> %56, %55
  store <2 x i32> %57, ptr %19, align 4, !tbaa !23
  %58 = load i32, ptr %.sroa.257.0..sroa_idx, align 4, !tbaa !27
  %59 = load i32, ptr %.sroa.255.0..sroa_idx, align 8, !tbaa !21
  %60 = add nsw i32 %59, %58
  store i32 %60, ptr %.sroa.259.0..sroa_idx, align 4, !tbaa !27
  br i1 %.not, label %74, label %61

61:                                               ; preds = %54
  %62 = getelementptr inbounds i8, ptr %19, i64 18
  %63 = load i8, ptr %62, align 2, !tbaa !28
  %64 = zext i8 %63 to i32
  %65 = shl nuw nsw i32 %64, 5
  %.sroa.011.0.copyload = load i64, ptr %19, align 4
  %66 = call { i64, i32 } %1(i64 %.sroa.011.0.copyload, i32 %60, i32 noundef %65) #3
  %.fca.0.extract7 = extractvalue { i64, i32 } %66, 0
  %.fca.1.extract8 = extractvalue { i64, i32 } %66, 1
  %.sroa.05.0.copyload = load i64, ptr %19, align 4
  %.sroa.26.0.copyload = load i32, ptr %.sroa.259.0..sroa_idx, align 4
  %67 = call { i64, i32 } @TPE_vec3Minus(i64 %.sroa.05.0.copyload, i32 %.sroa.26.0.copyload, i64 %.fca.0.extract7, i32 %.fca.1.extract8)
  %.fca.0.extract = extractvalue { i64, i32 } %67, 0
  %.fca.1.extract = extractvalue { i64, i32 } %67, 1
  %68 = call i32 @TPE_vec3Len(i64 %.fca.0.extract, i32 %.fca.1.extract)
  %69 = load i8, ptr %62, align 2, !tbaa !28
  %70 = zext i8 %69 to i32
  %71 = shl nuw nsw i32 %70, 5
  %72 = icmp slt i32 %68, %71
  br i1 %72, label %73, label %74

73:                                               ; preds = %61
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %19, ptr noundef nonnull align 4 dereferenceable(12) %4, i64 12, i1 false), !tbaa.struct !22
  br label %74

74:                                               ; preds = %73, %61, %54
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %75 = load i8, ptr %5, align 8, !tbaa !5
  %76 = zext i8 %75 to i64
  %77 = icmp ult i64 %indvars.iv.next, %76
  br i1 %77, label %9, label %._crit_edge, !llvm.loop !29
}

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

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !8, i64 24}
!6 = !{!"", !7, i64 0, !8, i64 8, !7, i64 16, !8, i64 24, !10, i64 26, !10, i64 28, !10, i64 30, !8, i64 32, !8, i64 33}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!6, !7, i64 16}
!12 = !{!6, !7, i64 0}
!13 = !{!14, !8, i64 0}
!14 = !{!"", !8, i64 0, !8, i64 1, !10, i64 2}
!15 = !{!14, !8, i64 1}
!16 = !{!17, !18, i64 0}
!17 = !{!"", !18, i64 0, !18, i64 4, !18, i64 8}
!18 = !{!"int", !8, i64 0}
!19 = !{!14, !10, i64 2}
!20 = !{!17, !18, i64 4}
!21 = !{!17, !18, i64 8}
!22 = !{i64 0, i64 4, !23, i64 4, i64 4, !23, i64 8, i64 4, !23}
!23 = !{!18, !18, i64 0}
!24 = !{!25, !18, i64 0}
!25 = !{!"", !17, i64 0, !8, i64 12, !8, i64 18}
!26 = !{!25, !18, i64 4}
!27 = !{!25, !18, i64 8}
!28 = !{!25, !8, i64 18}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass