; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_mesh)

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

@Rcs_calloc = external global ptr, align 8

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local ptr @RcsMesh_createCylinderHull(double noundef %0, double noundef %1, double noundef %2, i32 noundef %3, i32 noundef %4, double noundef %5) #2 {
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca i32, align 4
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca ptr, align 8
  %37 = alloca i32, align 4
  store double %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !5
  store double %2, ptr %9, align 8, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store double %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store double 0.000000e+00, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %38 = load double, ptr %12, align 8, !tbaa !5
  store double %38, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %39 = load double, ptr %9, align 8, !tbaa !5
  %40 = fmul double 5.000000e-01, %39
  store double %40, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %41 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !11
  %42 = call ptr %41(i64 noundef 1, i64 noundef 32)
  store ptr %42, ptr %17, align 8, !tbaa !11
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = add i32 %43, 1
  %45 = load i32, ptr %11, align 4, !tbaa !9
  %46 = add i32 %45, 1
  %47 = mul i32 %44, %46
  %48 = load ptr, ptr %17, align 8, !tbaa !11
  %49 = getelementptr inbounds %struct.RcsMeshData, ptr %48, i32 0, i32 0
  store i32 %47, ptr %49, align 8, !tbaa !13
  %50 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !11
  %51 = load ptr, ptr %17, align 8, !tbaa !11
  %52 = getelementptr inbounds %struct.RcsMeshData, ptr %51, i32 0, i32 0
  %53 = load i32, ptr %52, align 8, !tbaa !13
  %54 = mul i32 3, %53
  %55 = zext i32 %54 to i64
  %56 = call ptr %50(i64 noundef %55, i64 noundef 8)
  %57 = load ptr, ptr %17, align 8, !tbaa !11
  %58 = getelementptr inbounds %struct.RcsMeshData, ptr %57, i32 0, i32 1
  store ptr %56, ptr %58, align 8, !tbaa !15
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = mul i32 2, %59
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = mul i32 %60, %61
  %63 = load ptr, ptr %17, align 8, !tbaa !11
  %64 = getelementptr inbounds %struct.RcsMeshData, ptr %63, i32 0, i32 2
  store i32 %62, ptr %64, align 8, !tbaa !16
  %65 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !11
  %66 = load ptr, ptr %17, align 8, !tbaa !11
  %67 = getelementptr inbounds %struct.RcsMeshData, ptr %66, i32 0, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !16
  %69 = mul i32 3, %68
  %70 = zext i32 %69 to i64
  %71 = call ptr %65(i64 noundef %70, i64 noundef 4)
  %72 = load ptr, ptr %17, align 8, !tbaa !11
  %73 = getelementptr inbounds %struct.RcsMeshData, ptr %72, i32 0, i32 3
  store ptr %71, ptr %73, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %74 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !11
  %75 = load i32, ptr %11, align 4, !tbaa !9
  %76 = add i32 %75, 1
  %77 = zext i32 %76 to i64
  %78 = call ptr %74(i64 noundef %77, i64 noundef 8)
  store ptr %78, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %94, %6
  %80 = load i32, ptr %19, align 4, !tbaa !9
  %81 = load i32, ptr %11, align 4, !tbaa !9
  %82 = icmp ule i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %97

84:                                               ; preds = %79
  %85 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !11
  %86 = load i32, ptr %10, align 4, !tbaa !9
  %87 = add i32 %86, 1
  %88 = zext i32 %87 to i64
  %89 = call ptr %85(i64 noundef %88, i64 noundef 4)
  %90 = load ptr, ptr %18, align 8, !tbaa !11
  %91 = load i32, ptr %19, align 4, !tbaa !9
  %92 = zext i32 %91 to i64
  %93 = getelementptr inbounds ptr, ptr %90, i64 %92
  store ptr %89, ptr %93, align 8, !tbaa !11
  br label %94

94:                                               ; preds = %84
  %95 = load i32, ptr %19, align 4, !tbaa !9
  %96 = add i32 %95, 1
  store i32 %96, ptr %19, align 4, !tbaa !9
  br label %79, !llvm.loop !18

97:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %175, %97
  %99 = load i32, ptr %20, align 4, !tbaa !9
  %100 = load i32, ptr %11, align 4, !tbaa !9
  %101 = icmp ule i32 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  store i32 5, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %178

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %104 = load i32, ptr %20, align 4, !tbaa !9
  %105 = uitofp i32 %104 to double
  %106 = load i32, ptr %11, align 4, !tbaa !9
  %107 = uitofp i32 %106 to double
  %108 = fdiv double %105, %107
  store double %108, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %109 = load double, ptr %22, align 8, !tbaa !5
  %110 = load double, ptr %7, align 8, !tbaa !5
  %111 = load double, ptr %8, align 8, !tbaa !5
  %112 = fsub double %110, %111
  %113 = load double, ptr %8, align 8, !tbaa !5
  %114 = call double @llvm.fmuladd.f64(double %109, double %112, double %113)
  store double %114, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %115

115:                                              ; preds = %171, %103
  %116 = load i32, ptr %24, align 4, !tbaa !9
  %117 = load i32, ptr %10, align 4, !tbaa !9
  %118 = icmp ule i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 8, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  br label %174

120:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %121 = load i32, ptr %24, align 4, !tbaa !9
  %122 = uitofp i32 %121 to double
  %123 = load i32, ptr %10, align 4, !tbaa !9
  %124 = uitofp i32 %123 to double
  %125 = fdiv double %122, %124
  store double %125, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %126 = load double, ptr %25, align 8, !tbaa !5
  %127 = load double, ptr %14, align 8, !tbaa !5
  %128 = call double @llvm.fmuladd.f64(double %126, double %127, double 0.000000e+00)
  store double %128, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  %129 = load i32, ptr %20, align 4, !tbaa !9
  %130 = load i32, ptr %10, align 4, !tbaa !9
  %131 = add i32 %130, 1
  %132 = mul i32 %129, %131
  %133 = load i32, ptr %24, align 4, !tbaa !9
  %134 = add i32 %132, %133
  store i32 %134, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  %135 = load ptr, ptr %17, align 8, !tbaa !11
  %136 = getelementptr inbounds %struct.RcsMeshData, ptr %135, i32 0, i32 1
  %137 = load ptr, ptr %136, align 8, !tbaa !15
  %138 = load i32, ptr %27, align 4, !tbaa !9
  %139 = mul i32 3, %138
  %140 = zext i32 %139 to i64
  %141 = getelementptr inbounds double, ptr %137, i64 %140
  store ptr %141, ptr %28, align 8, !tbaa !11
  %142 = load double, ptr %23, align 8, !tbaa !5
  %143 = load double, ptr %26, align 8, !tbaa !5
  %144 = call double @sin(double noundef %143) #4
  %145 = fmul double %142, %144
  %146 = load ptr, ptr %28, align 8, !tbaa !11
  %147 = getelementptr inbounds double, ptr %146, i64 0
  store double %145, ptr %147, align 8, !tbaa !5
  %148 = load double, ptr %22, align 8, !tbaa !5
  %149 = fneg double %148
  %150 = load double, ptr %9, align 8, !tbaa !5
  %151 = load double, ptr %15, align 8, !tbaa !5
  %152 = call double @llvm.fmuladd.f64(double %149, double %150, double %151)
  %153 = load ptr, ptr %28, align 8, !tbaa !11
  %154 = getelementptr inbounds double, ptr %153, i64 2
  store double %152, ptr %154, align 8, !tbaa !5
  %155 = load double, ptr %23, align 8, !tbaa !5
  %156 = load double, ptr %26, align 8, !tbaa !5
  %157 = call double @cos(double noundef %156) #4
  %158 = fmul double %155, %157
  %159 = load ptr, ptr %28, align 8, !tbaa !11
  %160 = getelementptr inbounds double, ptr %159, i64 1
  store double %158, ptr %160, align 8, !tbaa !5
  %161 = load i32, ptr %16, align 4, !tbaa !9
  %162 = add i32 %161, 1
  store i32 %162, ptr %16, align 4, !tbaa !9
  %163 = load ptr, ptr %18, align 8, !tbaa !11
  %164 = load i32, ptr %20, align 4, !tbaa !9
  %165 = zext i32 %164 to i64
  %166 = getelementptr inbounds ptr, ptr %163, i64 %165
  %167 = load ptr, ptr %166, align 8, !tbaa !11
  %168 = load i32, ptr %24, align 4, !tbaa !9
  %169 = zext i32 %168 to i64
  %170 = getelementptr inbounds i32, ptr %167, i64 %169
  store i32 %161, ptr %170, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  br label %171

171:                                              ; preds = %120
  %172 = load i32, ptr %24, align 4, !tbaa !9
  %173 = add i32 %172, 1
  store i32 %173, ptr %24, align 4, !tbaa !9
  br label %115, !llvm.loop !20

174:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %20, align 4, !tbaa !9
  %177 = add i32 %176, 1
  store i32 %177, ptr %20, align 4, !tbaa !9
  br label %98, !llvm.loop !21

178:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #4
  store i32 0, ptr %29, align 4, !tbaa !9
  br label %179

179:                                              ; preds = %265, %178
  %180 = load i32, ptr %29, align 4, !tbaa !9
  %181 = load i32, ptr %10, align 4, !tbaa !9
  %182 = icmp ult i32 %180, %181
  br i1 %182, label %184, label %183

183:                                              ; preds = %179
  store i32 11, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  br label %268

184:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #4
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %185

185:                                              ; preds = %261, %184
  %186 = load i32, ptr %30, align 4, !tbaa !9
  %187 = load i32, ptr %11, align 4, !tbaa !9
  %188 = icmp ult i32 %186, %187
  br i1 %188, label %190, label %189

189:                                              ; preds = %185
  store i32 14, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  br label %264

190:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #4
  %191 = load ptr, ptr %18, align 8, !tbaa !11
  %192 = load i32, ptr %30, align 4, !tbaa !9
  %193 = zext i32 %192 to i64
  %194 = getelementptr inbounds ptr, ptr %191, i64 %193
  %195 = load ptr, ptr %194, align 8, !tbaa !11
  %196 = load i32, ptr %29, align 4, !tbaa !9
  %197 = zext i32 %196 to i64
  %198 = getelementptr inbounds i32, ptr %195, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !9
  store i32 %199, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #4
  %200 = load ptr, ptr %18, align 8, !tbaa !11
  %201 = load i32, ptr %30, align 4, !tbaa !9
  %202 = add i32 %201, 1
  %203 = zext i32 %202 to i64
  %204 = getelementptr inbounds ptr, ptr %200, i64 %203
  %205 = load ptr, ptr %204, align 8, !tbaa !11
  %206 = load i32, ptr %29, align 4, !tbaa !9
  %207 = zext i32 %206 to i64
  %208 = getelementptr inbounds i32, ptr %205, i64 %207
  %209 = load i32, ptr %208, align 4, !tbaa !9
  store i32 %209, ptr %32, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #4
  %210 = load ptr, ptr %18, align 8, !tbaa !11
  %211 = load i32, ptr %30, align 4, !tbaa !9
  %212 = add i32 %211, 1
  %213 = zext i32 %212 to i64
  %214 = getelementptr inbounds ptr, ptr %210, i64 %213
  %215 = load ptr, ptr %214, align 8, !tbaa !11
  %216 = load i32, ptr %29, align 4, !tbaa !9
  %217 = add i32 %216, 1
  %218 = zext i32 %217 to i64
  %219 = getelementptr inbounds i32, ptr %215, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !9
  store i32 %220, ptr %33, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #4
  %221 = load ptr, ptr %18, align 8, !tbaa !11
  %222 = load i32, ptr %30, align 4, !tbaa !9
  %223 = zext i32 %222 to i64
  %224 = getelementptr inbounds ptr, ptr %221, i64 %223
  %225 = load ptr, ptr %224, align 8, !tbaa !11
  %226 = load i32, ptr %29, align 4, !tbaa !9
  %227 = add i32 %226, 1
  %228 = zext i32 %227 to i64
  %229 = getelementptr inbounds i32, ptr %225, i64 %228
  %230 = load i32, ptr %229, align 4, !tbaa !9
  store i32 %230, ptr %34, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #4
  %231 = load i32, ptr %30, align 4, !tbaa !9
  %232 = load i32, ptr %10, align 4, !tbaa !9
  %233 = mul i32 %231, %232
  %234 = load i32, ptr %29, align 4, !tbaa !9
  %235 = add i32 %233, %234
  store i32 %235, ptr %35, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #4
  %236 = load ptr, ptr %17, align 8, !tbaa !11
  %237 = getelementptr inbounds %struct.RcsMeshData, ptr %236, i32 0, i32 3
  %238 = load ptr, ptr %237, align 8, !tbaa !17
  %239 = load i32, ptr %35, align 4, !tbaa !9
  %240 = mul nsw i32 6, %239
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds i32, ptr %238, i64 %241
  store ptr %242, ptr %36, align 8, !tbaa !11
  %243 = load i32, ptr %34, align 4, !tbaa !9
  %244 = load ptr, ptr %36, align 8, !tbaa !11
  %245 = getelementptr inbounds i32, ptr %244, i64 0
  store i32 %243, ptr %245, align 4, !tbaa !9
  %246 = load i32, ptr %32, align 4, !tbaa !9
  %247 = load ptr, ptr %36, align 8, !tbaa !11
  %248 = getelementptr inbounds i32, ptr %247, i64 1
  store i32 %246, ptr %248, align 4, !tbaa !9
  %249 = load i32, ptr %31, align 4, !tbaa !9
  %250 = load ptr, ptr %36, align 8, !tbaa !11
  %251 = getelementptr inbounds i32, ptr %250, i64 2
  store i32 %249, ptr %251, align 4, !tbaa !9
  %252 = load i32, ptr %34, align 4, !tbaa !9
  %253 = load ptr, ptr %36, align 8, !tbaa !11
  %254 = getelementptr inbounds i32, ptr %253, i64 3
  store i32 %252, ptr %254, align 4, !tbaa !9
  %255 = load i32, ptr %33, align 4, !tbaa !9
  %256 = load ptr, ptr %36, align 8, !tbaa !11
  %257 = getelementptr inbounds i32, ptr %256, i64 4
  store i32 %255, ptr %257, align 4, !tbaa !9
  %258 = load i32, ptr %32, align 4, !tbaa !9
  %259 = load ptr, ptr %36, align 8, !tbaa !11
  %260 = getelementptr inbounds i32, ptr %259, i64 5
  store i32 %258, ptr %260, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  br label %261

261:                                              ; preds = %190
  %262 = load i32, ptr %30, align 4, !tbaa !9
  %263 = add i32 %262, 1
  store i32 %263, ptr %30, align 4, !tbaa !9
  br label %185, !llvm.loop !22

264:                                              ; preds = %189
  br label %265

265:                                              ; preds = %264
  %266 = load i32, ptr %29, align 4, !tbaa !9
  %267 = add i32 %266, 1
  store i32 %267, ptr %29, align 4, !tbaa !9
  br label %179, !llvm.loop !23

268:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #4
  store i32 0, ptr %37, align 4, !tbaa !9
  br label %269

269:                                              ; preds = %280, %268
  %270 = load i32, ptr %37, align 4, !tbaa !9
  %271 = load i32, ptr %11, align 4, !tbaa !9
  %272 = icmp ule i32 %270, %271
  br i1 %272, label %274, label %273

273:                                              ; preds = %269
  store i32 17, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #4
  br label %283

274:                                              ; preds = %269
  %275 = load ptr, ptr %18, align 8, !tbaa !11
  %276 = load i32, ptr %37, align 4, !tbaa !9
  %277 = zext i32 %276 to i64
  %278 = getelementptr inbounds ptr, ptr %275, i64 %277
  %279 = load ptr, ptr %278, align 8, !tbaa !11
  call void @free(ptr noundef %279) #4
  br label %280

280:                                              ; preds = %274
  %281 = load i32, ptr %37, align 4, !tbaa !9
  %282 = add i32 %281, 1
  store i32 %282, ptr %37, align 4, !tbaa !9
  br label %269, !llvm.loop !24

283:                                              ; preds = %273
  %284 = load ptr, ptr %18, align 8, !tbaa !11
  call void @free(ptr noundef %284) #4
  %285 = load ptr, ptr %17, align 8, !tbaa !11
  store i32 1, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  ret ptr %285
}

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"", !10, i64 0, !12, i64 8, !10, i64 16, !12, i64 24}
!15 = !{!14, !12, i64 8}
!16 = !{!14, !10, i64 16}
!17 = !{!14, !12, i64 24}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}
!23 = distinct !{!23, !19}
!24 = distinct !{!24, !19}


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

@Rcs_calloc = external local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @RcsMesh_createCylinderHull(double noundef %0, double noundef %1, double noundef %2, i32 noundef %3, i32 noundef %4, double noundef %5) local_unnamed_addr #1 {
  %7 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %8 = tail call ptr %7(i64 noundef 1, i64 noundef 32) #4
  %9 = add i32 %3, 1
  %10 = add i32 %4, 1
  %11 = mul i32 %10, %9
  store i32 %11, ptr %8, align 8, !tbaa !9
  %12 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %13 = mul i32 %11, 3
  %14 = zext i32 %13 to i64
  %15 = tail call ptr %12(i64 noundef %14, i64 noundef 8) #4
  %16 = getelementptr inbounds i8, ptr %8, i64 8
  store ptr %15, ptr %16, align 8, !tbaa !12
  %17 = shl i32 %3, 1
  %18 = mul i32 %17, %4
  %19 = getelementptr inbounds i8, ptr %8, i64 16
  store i32 %18, ptr %19, align 8, !tbaa !13
  %20 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %21 = mul i32 %18, 3
  %22 = zext i32 %21 to i64
  %23 = tail call ptr %20(i64 noundef %22, i64 noundef 4) #4
  %24 = getelementptr inbounds i8, ptr %8, i64 24
  store ptr %23, ptr %24, align 8, !tbaa !14
  %25 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %26 = zext i32 %10 to i64
  %27 = tail call ptr %25(i64 noundef %26, i64 noundef 8) #4
  %28 = zext i32 %9 to i64
  br label %34

.preheader109:                                    ; preds = %34
  %29 = fmul double %2, 5.000000e-01
  %30 = uitofp i32 %4 to double
  %31 = fsub double %0, %1
  %32 = uitofp i32 %3 to double
  %33 = zext i32 %4 to i64
  br label %62

34:                                               ; preds = %6, %34
  %.096110 = phi i32 [ 0, %6 ], [ %39, %34 ]
  %35 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %36 = tail call ptr %35(i64 noundef %28, i64 noundef 4) #4
  %37 = zext i32 %.096110 to i64
  %38 = getelementptr inbounds ptr, ptr %27, i64 %37
  store ptr %36, ptr %38, align 8, !tbaa !5
  %39 = add i32 %.096110, 1
  %.not = icmp ugt i32 %39, %4
  br i1 %.not, label %.preheader109, label %34, !llvm.loop !15

.preheader108:                                    ; preds = %71
  %.not118 = icmp eq i32 %3, 0
  %.not119 = icmp eq i32 %4, 0
  %or.cond = or i1 %.not118, %.not119
  br i1 %or.cond, label %.preheader.preheader, label %.preheader107.lr.ph.split.us

.preheader.preheader:                             ; preds = %._crit_edge.us, %.preheader108
  br label %.preheader

.preheader107.lr.ph.split.us:                     ; preds = %.preheader108
  %40 = load ptr, ptr %24, align 8, !tbaa !14
  %wide.trip.count = zext i32 %3 to i64
  %.pre.pre = load ptr, ptr %27, align 8, !tbaa !5
  br label %.preheader107.us

.preheader107.us:                                 ; preds = %._crit_edge.us, %.preheader107.lr.ph.split.us
  %indvars.iv123 = phi i64 [ %indvars.iv.next124, %._crit_edge.us ], [ 0, %.preheader107.lr.ph.split.us ]
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %41 = trunc nuw i64 %indvars.iv123 to i32
  br label %42

42:                                               ; preds = %.preheader107.us, %42
  %43 = phi ptr [ %.pre.pre, %.preheader107.us ], [ %48, %42 ]
  %.0100115.us = phi i32 [ 0, %.preheader107.us ], [ %45, %42 ]
  %44 = getelementptr inbounds i32, ptr %43, i64 %indvars.iv123
  %45 = add nuw i32 %.0100115.us, 1
  %46 = zext i32 %45 to i64
  %47 = getelementptr inbounds ptr, ptr %27, i64 %46
  %48 = load ptr, ptr %47, align 8, !tbaa !5
  %49 = getelementptr inbounds i32, ptr %48, i64 %indvars.iv123
  %50 = load <2 x i32>, ptr %49, align 4, !tbaa !17
  %51 = load <2 x i32>, ptr %44, align 4, !tbaa !17
  %52 = mul i32 %.0100115.us, %3
  %53 = add i32 %52, %41
  %54 = mul nsw i32 %53, 6
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i32, ptr %40, i64 %55
  %57 = extractelement <2 x i32> %51, i64 1
  store i32 %57, ptr %56, align 4, !tbaa !17
  %58 = getelementptr inbounds i8, ptr %56, i64 4
  %59 = shufflevector <2 x i32> %50, <2 x i32> %51, <4 x i32> <i32 0, i32 2, i32 3, i32 1>
  store <4 x i32> %59, ptr %58, align 4, !tbaa !17
  %60 = getelementptr inbounds i8, ptr %56, i64 20
  %61 = extractelement <2 x i32> %50, i64 0
  store i32 %61, ptr %60, align 4, !tbaa !17
  %exitcond122.not = icmp eq i32 %45, %4
  br i1 %exitcond122.not, label %._crit_edge.us, label %42, !llvm.loop !18

._crit_edge.us:                                   ; preds = %42
  %exitcond126.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count
  br i1 %exitcond126.not, label %.preheader.preheader, label %.preheader107.us, !llvm.loop !19

62:                                               ; preds = %.preheader109, %71
  %indvars.iv = phi i64 [ 0, %.preheader109 ], [ %indvars.iv.next, %71 ]
  %.095114 = phi i32 [ 0, %.preheader109 ], [ %87, %71 ]
  %63 = trunc nuw i64 %indvars.iv to i32
  %64 = uitofp i32 %63 to double
  %65 = fdiv double %64, %30
  %66 = tail call double @llvm.fmuladd.f64(double %65, double %31, double %1)
  %67 = mul i32 %9, %63
  %68 = fneg double %65
  %69 = tail call double @llvm.fmuladd.f64(double %68, double %2, double %29)
  %70 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv
  br label %72

71:                                               ; preds = %72
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond = icmp eq i64 %indvars.iv, %33
  br i1 %exitcond, label %.preheader108, label %62, !llvm.loop !20

72:                                               ; preds = %62, %72
  %.1112 = phi i32 [ %.095114, %62 ], [ %87, %72 ]
  %.098111 = phi i32 [ 0, %62 ], [ %91, %72 ]
  %73 = uitofp i32 %.098111 to double
  %74 = fdiv double %73, %32
  %75 = tail call double @llvm.fmuladd.f64(double %74, double %5, double 0.000000e+00)
  %76 = add i32 %.098111, %67
  %77 = load ptr, ptr %16, align 8, !tbaa !12
  %78 = mul i32 %76, 3
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds double, ptr %77, i64 %79
  %81 = tail call double @sin(double noundef %75) #4
  %82 = fmul double %66, %81
  store double %82, ptr %80, align 8, !tbaa !21
  %83 = getelementptr inbounds i8, ptr %80, i64 16
  store double %69, ptr %83, align 8, !tbaa !21
  %84 = tail call double @cos(double noundef %75) #4
  %85 = fmul double %66, %84
  %86 = getelementptr inbounds i8, ptr %80, i64 8
  store double %85, ptr %86, align 8, !tbaa !21
  %87 = add i32 %.1112, 1
  %88 = load ptr, ptr %70, align 8, !tbaa !5
  %89 = zext i32 %.098111 to i64
  %90 = getelementptr inbounds i32, ptr %88, i64 %89
  store i32 %.1112, ptr %90, align 4, !tbaa !17
  %91 = add i32 %.098111, 1
  %.not106 = icmp ugt i32 %91, %3
  br i1 %.not106, label %71, label %72, !llvm.loop !23

92:                                               ; preds = %.preheader
  tail call void @free(ptr noundef nonnull %27) #4
  ret ptr %8

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %.0117 = phi i32 [ %96, %.preheader ], [ 0, %.preheader.preheader ]
  %93 = zext i32 %.0117 to i64
  %94 = getelementptr inbounds ptr, ptr %27, i64 %93
  %95 = load ptr, ptr %94, align 8, !tbaa !5
  tail call void @free(ptr noundef %95) #4
  %96 = add i32 %.0117, 1
  %.not105 = icmp ugt i32 %96, %4
  br i1 %.not105, label %92, label %.preheader, !llvm.loop !24
}

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

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

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

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

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


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