; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes/R3Mesh.ll (ZN6R3Mesh14CreateCylinderERK10R3Cylinderd)

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

%class.R3Point = type { [3 x double] }

@RN_TWO_PI = external constant double, align 8
@RN_PI = external constant double, align 8

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #0

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 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

declare void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Mesh14CreateCylinderERK10R3Cylinderd(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(232) %1, double noundef %2) #5 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca %class.R3Point, align 8
  %14 = alloca %class.R3Point, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %class.R3Point, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca %class.R3Point, align 8
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store double %2, ptr %6, align 8, !tbaa !9
  %30 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 32, ptr %7, align 4, !tbaa !11
  %31 = load double, ptr %6, align 8, !tbaa !9
  %32 = fcmp ogt double %31, 0.000000e+00
  br i1 %32, label %33, label %46

33:                                               ; preds = %3
  %34 = load double, ptr @RN_PI, align 8, !tbaa !9
  %35 = fmul double 2.000000e+00, %34
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call noundef double @_ZNK10R3Cylinder6RadiusEv(ptr noundef nonnull align 8 dereferenceable(232) %36)
  %38 = fmul double %35, %37
  %39 = load double, ptr %6, align 8, !tbaa !9
  %40 = fdiv double %38, %39
  %41 = fptosi double %40 to i32
  store i32 %41, ptr %7, align 4, !tbaa !11
  %42 = load i32, ptr %7, align 4, !tbaa !11
  %43 = icmp slt i32 %42, 8
  br i1 %43, label %44, label %45

44:                                               ; preds = %33
  store i32 8, ptr %7, align 4, !tbaa !11
  br label %45

45:                                               ; preds = %44, %33
  br label %46

46:                                               ; preds = %45, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %47 = call noalias noundef nonnull ptr @_Znam(i64 noundef 16) #10
  store ptr %47, ptr %8, align 8, !tbaa !5
  %48 = load i32, ptr %7, align 4, !tbaa !11
  %49 = sext i32 %48 to i64
  %50 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %49, i64 8)
  %51 = extractvalue { i64, i1 } %50, 1
  %52 = extractvalue { i64, i1 } %50, 0
  %53 = select i1 %51, i64 -1, i64 %52
  %54 = call noalias noundef nonnull ptr @_Znam(i64 noundef %53) #10
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds ptr, ptr %55, i64 0
  store ptr %54, ptr %56, align 8, !tbaa !5
  %57 = load i32, ptr %7, align 4, !tbaa !11
  %58 = sext i32 %57 to i64
  %59 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %58, i64 8)
  %60 = extractvalue { i64, i1 } %59, 1
  %61 = extractvalue { i64, i1 } %59, 0
  %62 = select i1 %60, i64 -1, i64 %61
  %63 = call noalias noundef nonnull ptr @_Znam(i64 noundef %62) #10
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds ptr, ptr %64, i64 1
  store ptr %63, ptr %65, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %66

66:                                               ; preds = %119, %46
  %67 = load i32, ptr %9, align 4, !tbaa !11
  %68 = load i32, ptr %7, align 4, !tbaa !11
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %122

71:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %72 = load i32, ptr %9, align 4, !tbaa !11
  %73 = sitofp i32 %72 to double
  %74 = load double, ptr @RN_TWO_PI, align 8, !tbaa !9
  %75 = fmul double %73, %74
  %76 = load i32, ptr %7, align 4, !tbaa !11
  %77 = sitofp i32 %76 to double
  %78 = fdiv double %75, %77
  store double %78, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = call noundef double @_ZNK10R3Cylinder6RadiusEv(ptr noundef nonnull align 8 dereferenceable(232) %79)
  %81 = load double, ptr %10, align 8, !tbaa !9
  %82 = call double @cos(double noundef %81) #9
  %83 = fmul double %80, %82
  store double %83, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = call noundef double @_ZNK10R3Cylinder6RadiusEv(ptr noundef nonnull align 8 dereferenceable(232) %84)
  %86 = load double, ptr %10, align 8, !tbaa !9
  %87 = call double @sin(double noundef %86) #9
  %88 = fmul double %85, %87
  store double %88, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #9
  %89 = load double, ptr %11, align 8, !tbaa !9
  %90 = load double, ptr %12, align 8, !tbaa !9
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %91)
  %93 = fmul double -5.000000e-01, %92
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %13, double noundef %89, double noundef %90, double noundef %93)
  %94 = load ptr, ptr %30, align 8, !tbaa !13
  %95 = getelementptr inbounds ptr, ptr %94, i64 4
  %96 = load ptr, ptr %95, align 8
  %97 = call noundef ptr %96(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef null)
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = getelementptr inbounds ptr, ptr %98, i64 0
  %100 = load ptr, ptr %99, align 8, !tbaa !5
  %101 = load i32, ptr %9, align 4, !tbaa !11
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds ptr, ptr %100, i64 %102
  store ptr %97, ptr %103, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #9
  %104 = load double, ptr %11, align 8, !tbaa !9
  %105 = load double, ptr %12, align 8, !tbaa !9
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %106)
  %108 = fmul double 5.000000e-01, %107
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %14, double noundef %104, double noundef %105, double noundef %108)
  %109 = load ptr, ptr %30, align 8, !tbaa !13
  %110 = getelementptr inbounds ptr, ptr %109, i64 4
  %111 = load ptr, ptr %110, align 8
  %112 = call noundef ptr %111(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef null)
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = getelementptr inbounds ptr, ptr %113, i64 1
  %115 = load ptr, ptr %114, align 8, !tbaa !5
  %116 = load i32, ptr %9, align 4, !tbaa !11
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds ptr, ptr %115, i64 %117
  store ptr %112, ptr %118, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  br label %119

119:                                              ; preds = %71
  %120 = load i32, ptr %9, align 4, !tbaa !11
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %9, align 4, !tbaa !11
  br label %66, !llvm.loop !15

122:                                              ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #9
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %123)
  %125 = fmul double -5.000000e-01, %124
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %16, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef %125)
  %126 = load ptr, ptr %30, align 8, !tbaa !13
  %127 = getelementptr inbounds ptr, ptr %126, i64 4
  %128 = load ptr, ptr %127, align 8
  %129 = call noundef ptr %128(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #9
  store ptr %129, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %130

130:                                              ; preds = %160, %122
  %131 = load i32, ptr %17, align 4, !tbaa !11
  %132 = load i32, ptr %7, align 4, !tbaa !11
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  br label %163

135:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  %136 = load ptr, ptr %8, align 8, !tbaa !5
  %137 = getelementptr inbounds ptr, ptr %136, i64 0
  %138 = load ptr, ptr %137, align 8, !tbaa !5
  %139 = load i32, ptr %17, align 4, !tbaa !11
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds ptr, ptr %138, i64 %140
  %142 = load ptr, ptr %141, align 8, !tbaa !5
  store ptr %142, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = getelementptr inbounds ptr, ptr %143, i64 0
  %145 = load ptr, ptr %144, align 8, !tbaa !5
  %146 = load i32, ptr %17, align 4, !tbaa !11
  %147 = add nsw i32 %146, 1
  %148 = load i32, ptr %7, align 4, !tbaa !11
  %149 = srem i32 %147, %148
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds ptr, ptr %145, i64 %150
  %152 = load ptr, ptr %151, align 8, !tbaa !5
  store ptr %152, ptr %19, align 8, !tbaa !5
  %153 = load ptr, ptr %15, align 8, !tbaa !5
  %154 = load ptr, ptr %19, align 8, !tbaa !5
  %155 = load ptr, ptr %18, align 8, !tbaa !5
  %156 = load ptr, ptr %30, align 8, !tbaa !13
  %157 = getelementptr inbounds ptr, ptr %156, i64 9
  %158 = load ptr, ptr %157, align 8
  %159 = call noundef ptr %158(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %153, ptr noundef %154, ptr noundef %155, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  br label %160

160:                                              ; preds = %135
  %161 = load i32, ptr %17, align 4, !tbaa !11
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %17, align 4, !tbaa !11
  br label %130, !llvm.loop !17

163:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #9
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  %165 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %164)
  %166 = fmul double 5.000000e-01, %165
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %21, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef %166)
  %167 = load ptr, ptr %30, align 8, !tbaa !13
  %168 = getelementptr inbounds ptr, ptr %167, i64 4
  %169 = load ptr, ptr %168, align 8
  %170 = call noundef ptr %169(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #9
  store ptr %170, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %171

171:                                              ; preds = %201, %163
  %172 = load i32, ptr %22, align 4, !tbaa !11
  %173 = load i32, ptr %7, align 4, !tbaa !11
  %174 = icmp slt i32 %172, %173
  br i1 %174, label %176, label %175

175:                                              ; preds = %171
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %204

176:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  %177 = load ptr, ptr %8, align 8, !tbaa !5
  %178 = getelementptr inbounds ptr, ptr %177, i64 1
  %179 = load ptr, ptr %178, align 8, !tbaa !5
  %180 = load i32, ptr %22, align 4, !tbaa !11
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds ptr, ptr %179, i64 %181
  %183 = load ptr, ptr %182, align 8, !tbaa !5
  store ptr %183, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #9
  %184 = load ptr, ptr %8, align 8, !tbaa !5
  %185 = getelementptr inbounds ptr, ptr %184, i64 1
  %186 = load ptr, ptr %185, align 8, !tbaa !5
  %187 = load i32, ptr %22, align 4, !tbaa !11
  %188 = add nsw i32 %187, 1
  %189 = load i32, ptr %7, align 4, !tbaa !11
  %190 = srem i32 %188, %189
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds ptr, ptr %186, i64 %191
  %193 = load ptr, ptr %192, align 8, !tbaa !5
  store ptr %193, ptr %24, align 8, !tbaa !5
  %194 = load ptr, ptr %20, align 8, !tbaa !5
  %195 = load ptr, ptr %23, align 8, !tbaa !5
  %196 = load ptr, ptr %24, align 8, !tbaa !5
  %197 = load ptr, ptr %30, align 8, !tbaa !13
  %198 = getelementptr inbounds ptr, ptr %197, i64 9
  %199 = load ptr, ptr %198, align 8
  %200 = call noundef ptr %199(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %194, ptr noundef %195, ptr noundef %196, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  br label %201

201:                                              ; preds = %176
  %202 = load i32, ptr %22, align 4, !tbaa !11
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %22, align 4, !tbaa !11
  br label %171, !llvm.loop !18

204:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #9
  store i32 0, ptr %25, align 4, !tbaa !11
  br label %205

205:                                              ; preds = %259, %204
  %206 = load i32, ptr %25, align 4, !tbaa !11
  %207 = load i32, ptr %7, align 4, !tbaa !11
  %208 = icmp slt i32 %206, %207
  br i1 %208, label %210, label %209

209:                                              ; preds = %205
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #9
  br label %262

210:                                              ; preds = %205
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  %211 = load ptr, ptr %8, align 8, !tbaa !5
  %212 = getelementptr inbounds ptr, ptr %211, i64 0
  %213 = load ptr, ptr %212, align 8, !tbaa !5
  %214 = load i32, ptr %25, align 4, !tbaa !11
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds ptr, ptr %213, i64 %215
  %217 = load ptr, ptr %216, align 8, !tbaa !5
  store ptr %217, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %218 = load ptr, ptr %8, align 8, !tbaa !5
  %219 = getelementptr inbounds ptr, ptr %218, i64 0
  %220 = load ptr, ptr %219, align 8, !tbaa !5
  %221 = load i32, ptr %25, align 4, !tbaa !11
  %222 = add nsw i32 %221, 1
  %223 = load i32, ptr %7, align 4, !tbaa !11
  %224 = srem i32 %222, %223
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds ptr, ptr %220, i64 %225
  %227 = load ptr, ptr %226, align 8, !tbaa !5
  store ptr %227, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %228 = load ptr, ptr %8, align 8, !tbaa !5
  %229 = getelementptr inbounds ptr, ptr %228, i64 1
  %230 = load ptr, ptr %229, align 8, !tbaa !5
  %231 = load i32, ptr %25, align 4, !tbaa !11
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds ptr, ptr %230, i64 %232
  %234 = load ptr, ptr %233, align 8, !tbaa !5
  store ptr %234, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #9
  %235 = load ptr, ptr %8, align 8, !tbaa !5
  %236 = getelementptr inbounds ptr, ptr %235, i64 1
  %237 = load ptr, ptr %236, align 8, !tbaa !5
  %238 = load i32, ptr %25, align 4, !tbaa !11
  %239 = add nsw i32 %238, 1
  %240 = load i32, ptr %7, align 4, !tbaa !11
  %241 = srem i32 %239, %240
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds ptr, ptr %237, i64 %242
  %244 = load ptr, ptr %243, align 8, !tbaa !5
  store ptr %244, ptr %29, align 8, !tbaa !5
  %245 = load ptr, ptr %26, align 8, !tbaa !5
  %246 = load ptr, ptr %27, align 8, !tbaa !5
  %247 = load ptr, ptr %29, align 8, !tbaa !5
  %248 = load ptr, ptr %30, align 8, !tbaa !13
  %249 = getelementptr inbounds ptr, ptr %248, i64 9
  %250 = load ptr, ptr %249, align 8
  %251 = call noundef ptr %250(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %245, ptr noundef %246, ptr noundef %247, ptr noundef null)
  %252 = load ptr, ptr %26, align 8, !tbaa !5
  %253 = load ptr, ptr %29, align 8, !tbaa !5
  %254 = load ptr, ptr %28, align 8, !tbaa !5
  %255 = load ptr, ptr %30, align 8, !tbaa !13
  %256 = getelementptr inbounds ptr, ptr %255, i64 9
  %257 = load ptr, ptr %256, align 8
  %258 = call noundef ptr %257(ptr noundef nonnull align 8 dereferenceable(272) %30, ptr noundef %252, ptr noundef %253, ptr noundef %254, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  br label %259

259:                                              ; preds = %210
  %260 = load i32, ptr %25, align 4, !tbaa !11
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %25, align 4, !tbaa !11
  br label %205, !llvm.loop !19

262:                                              ; preds = %209
  %263 = load ptr, ptr %8, align 8, !tbaa !5
  %264 = getelementptr inbounds ptr, ptr %263, i64 0
  %265 = load ptr, ptr %264, align 8, !tbaa !5
  %266 = icmp eq ptr %265, null
  br i1 %266, label %268, label %267

267:                                              ; preds = %262
  call void @_ZdaPv(ptr noundef %265) #11
  br label %268

268:                                              ; preds = %267, %262
  %269 = load ptr, ptr %8, align 8, !tbaa !5
  %270 = getelementptr inbounds ptr, ptr %269, i64 1
  %271 = load ptr, ptr %270, align 8, !tbaa !5
  %272 = icmp eq ptr %271, null
  br i1 %272, label %274, label %273

273:                                              ; preds = %268
  call void @_ZdaPv(ptr noundef %271) #11
  br label %274

274:                                              ; preds = %273, %268
  %275 = load ptr, ptr %8, align 8, !tbaa !5
  %276 = icmp eq ptr %275, null
  br i1 %276, label %278, label %277

277:                                              ; preds = %274
  call void @_ZdaPv(ptr noundef %275) #11
  br label %278

278:                                              ; preds = %277, %274
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK10R3Cylinder6RadiusEv(ptr noundef nonnull align 8 dereferenceable(232)) #6 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232)) #8 align 2

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nobuiltin allocsize(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 = { "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 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress 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 #6 = { inlinehint mustprogress 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 #7 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { inlinehint mustprogress 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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


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

%class.R3Point = type { [3 x double] }

@RN_TWO_PI = external local_unnamed_addr constant double, align 8
@RN_PI = external local_unnamed_addr constant double, align 8

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #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

declare void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Mesh14CreateCylinderERK10R3Cylinderd(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(232) %1, double noundef %2) local_unnamed_addr #4 align 2 {
  %4 = alloca %class.R3Point, align 8
  %5 = alloca %class.R3Point, align 8
  %6 = alloca %class.R3Point, align 8
  %7 = alloca %class.R3Point, align 8
  %8 = fcmp ogt double %2, 0.000000e+00
  br i1 %8, label %9, label %16

9:                                                ; preds = %3
  %10 = load double, ptr @RN_PI, align 8, !tbaa !5
  %11 = fmul double %10, 2.000000e+00
  %12 = tail call noundef double @_ZNK10R3Cylinder6RadiusEv(ptr noundef nonnull align 8 dereferenceable(232) %1)
  %13 = fmul double %11, %12
  %14 = fdiv double %13, %2
  %15 = fptosi double %14 to i32
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %15, i32 8)
  br label %16

16:                                               ; preds = %9, %3
  %.0 = phi i32 [ %spec.store.select, %9 ], [ 32, %3 ]
  %17 = zext nneg i32 %.0 to i64
  %18 = shl nuw nsw i64 %17, 3
  %19 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %18) #9
  %20 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %18) #9
  %21 = load double, ptr @RN_TWO_PI, align 8, !tbaa !5
  %22 = uitofp nneg i32 %.0 to double
  br label %30

23:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #10
  %24 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %1)
  %25 = fmul double %24, -5.000000e-01
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %6, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef %25)
  %26 = load ptr, ptr %0, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %26, i64 32
  %28 = load ptr, ptr %27, align 8
  %29 = call noundef ptr %28(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #10
  br label %62

30:                                               ; preds = %16, %30
  %indvars.iv = phi i64 [ 0, %16 ], [ %indvars.iv.next, %30 ]
  %31 = trunc nuw nsw i64 %indvars.iv to i32
  %32 = uitofp nneg i32 %31 to double
  %33 = fmul double %21, %32
  %34 = fdiv double %33, %22
  %35 = call noundef double @_ZNK10R3Cylinder6RadiusEv(ptr noundef nonnull align 8 dereferenceable(232) %1)
  %36 = call double @cos(double noundef %34) #10
  %37 = fmul double %35, %36
  %38 = call noundef double @_ZNK10R3Cylinder6RadiusEv(ptr noundef nonnull align 8 dereferenceable(232) %1)
  %39 = call double @sin(double noundef %34) #10
  %40 = fmul double %38, %39
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #10
  %41 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %1)
  %42 = fmul double %41, -5.000000e-01
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %4, double noundef %37, double noundef %40, double noundef %42)
  %43 = load ptr, ptr %0, align 8, !tbaa !9
  %44 = getelementptr inbounds i8, ptr %43, i64 32
  %45 = load ptr, ptr %44, align 8
  %46 = call noundef ptr %45(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef null)
  %47 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv
  store ptr %46, ptr %47, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #10
  %48 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %1)
  %49 = fmul double %48, 5.000000e-01
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %5, double noundef %37, double noundef %40, double noundef %49)
  %50 = load ptr, ptr %0, align 8, !tbaa !9
  %51 = getelementptr inbounds i8, ptr %50, i64 32
  %52 = load ptr, ptr %51, align 8
  %53 = call noundef ptr %52(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef null)
  %54 = getelementptr inbounds ptr, ptr %20, i64 %indvars.iv
  store ptr %53, ptr %54, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #10
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %17
  br i1 %exitcond.not, label %23, label %30, !llvm.loop !13

55:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #10
  %56 = call noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232) %1)
  %57 = fmul double %56, 5.000000e-01
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %7, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef %57)
  %58 = load ptr, ptr %0, align 8, !tbaa !9
  %59 = getelementptr inbounds i8, ptr %58, i64 32
  %60 = load ptr, ptr %59, align 8
  %61 = call noundef ptr %60(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #10
  br label %74

62:                                               ; preds = %23, %62
  %indvars.iv85 = phi i64 [ 0, %23 ], [ %indvars.iv.next86, %62 ]
  %63 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv85
  %64 = load ptr, ptr %63, align 8, !tbaa !11
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %65 = icmp eq i64 %indvars.iv.next86, %17
  %sext = shl i64 %indvars.iv.next86, 32
  %66 = ashr exact i64 %sext, 32
  %67 = select i1 %65, i64 0, i64 %66
  %68 = getelementptr inbounds ptr, ptr %19, i64 %67
  %69 = load ptr, ptr %68, align 8, !tbaa !11
  %70 = load ptr, ptr %0, align 8, !tbaa !9
  %71 = getelementptr inbounds i8, ptr %70, i64 72
  %72 = load ptr, ptr %71, align 8
  %73 = call noundef ptr %72(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %29, ptr noundef %69, ptr noundef %64, ptr noundef null)
  %exitcond89.not = icmp eq i64 %indvars.iv.next86, %17
  br i1 %exitcond89.not, label %55, label %62, !llvm.loop !15

74:                                               ; preds = %55, %74
  %indvars.iv90 = phi i64 [ 0, %55 ], [ %indvars.iv.next91, %74 ]
  %75 = getelementptr inbounds ptr, ptr %20, i64 %indvars.iv90
  %76 = load ptr, ptr %75, align 8, !tbaa !11
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %77 = icmp eq i64 %indvars.iv.next91, %17
  %sext101 = shl i64 %indvars.iv.next91, 32
  %78 = ashr exact i64 %sext101, 32
  %79 = select i1 %77, i64 0, i64 %78
  %80 = getelementptr inbounds ptr, ptr %20, i64 %79
  %81 = load ptr, ptr %80, align 8, !tbaa !11
  %82 = load ptr, ptr %0, align 8, !tbaa !9
  %83 = getelementptr inbounds i8, ptr %82, i64 72
  %84 = load ptr, ptr %83, align 8
  %85 = call noundef ptr %84(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %61, ptr noundef %76, ptr noundef %81, ptr noundef null)
  %exitcond94.not = icmp eq i64 %indvars.iv.next91, %17
  br i1 %exitcond94.not, label %.preheader, label %74, !llvm.loop !16

.preheader:                                       ; preds = %74, %.preheader
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %.preheader ], [ 0, %74 ]
  %86 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv95
  %87 = load ptr, ptr %86, align 8, !tbaa !11
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %88 = icmp eq i64 %indvars.iv.next96, %17
  %sext102 = shl i64 %indvars.iv.next96, 32
  %89 = ashr exact i64 %sext102, 32
  %90 = select i1 %88, i64 0, i64 %89
  %91 = getelementptr inbounds ptr, ptr %19, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !11
  %93 = getelementptr inbounds ptr, ptr %20, i64 %indvars.iv95
  %94 = load ptr, ptr %93, align 8, !tbaa !11
  %95 = getelementptr inbounds ptr, ptr %20, i64 %90
  %96 = load ptr, ptr %95, align 8, !tbaa !11
  %97 = load ptr, ptr %0, align 8, !tbaa !9
  %98 = getelementptr inbounds i8, ptr %97, i64 72
  %99 = load ptr, ptr %98, align 8
  %100 = call noundef ptr %99(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %87, ptr noundef %92, ptr noundef %96, ptr noundef null)
  %101 = load ptr, ptr %0, align 8, !tbaa !9
  %102 = getelementptr inbounds i8, ptr %101, i64 72
  %103 = load ptr, ptr %102, align 8
  %104 = call noundef ptr %103(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %87, ptr noundef %96, ptr noundef %94, ptr noundef null)
  %exitcond99.not = icmp eq i64 %indvars.iv.next96, %17
  br i1 %exitcond99.not, label %105, label %.preheader, !llvm.loop !17

105:                                              ; preds = %.preheader
  call void @_ZdaPv(ptr noundef nonnull %19) #11
  call void @_ZdaPv(ptr noundef nonnull %20) #11
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK10R3Cylinder6RadiusEv(ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #5 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK10R3Cylinder6HeightEv(ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #7 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8

attributes #0 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 #5 = { inlinehint mustprogress 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 #6 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { inlinehint mustprogress 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { nounwind }
attributes #11 = { builtin 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


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