; LLVM IR from bohanwang/libpgo :: src/core/mesh (intersection_tunicate)

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

@.str.1 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@__PRETTY_FUNCTION__._ZN3pgo4Mesh22simplex_intersection2dEiPKdS2_S2_S2_PdS3_S3_S3_ = external hidden unnamed_addr constant [147 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3pgo4Mesh22simplex_intersection2dEiPKdS2_S2_S2_PdS3_S3_S3_(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8) #1 {
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  store i32 %0, ptr %11, align 4, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !9
  store ptr %2, ptr %13, align 8, !tbaa !9
  store ptr %3, ptr %14, align 8, !tbaa !9
  store ptr %4, ptr %15, align 8, !tbaa !9
  store ptr %5, ptr %16, align 8, !tbaa !9
  store ptr %6, ptr %17, align 8, !tbaa !9
  store ptr %7, ptr %18, align 8, !tbaa !9
  store ptr %8, ptr %19, align 8, !tbaa !9
  %23 = load i32, ptr %11, align 4, !tbaa !5
  %24 = icmp sle i32 1, %23
  br i1 %24, label %25, label %28

25:                                               ; preds = %9
  %26 = load i32, ptr %11, align 4, !tbaa !5
  %27 = icmp sle i32 %26, 3
  br label %28

28:                                               ; preds = %25, %9
  %29 = phi i1 [ false, %9 ], [ %27, %25 ]
  br i1 %29, label %30, label %31

30:                                               ; preds = %28
  br label %33

31:                                               ; preds = %28
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 144, ptr noundef @__PRETTY_FUNCTION__._ZN3pgo4Mesh22simplex_intersection2dEiPKdS2_S2_S2_PdS3_S3_S3_) #5
  unreachable

32:                                               ; No predecessors!
  br label %33

33:                                               ; preds = %32, %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %34 = load i32, ptr %11, align 4, !tbaa !5
  switch i32 %34, label %256 [
    i32 1, label %35
    i32 2, label %132
    i32 3, label %246
  ]

35:                                               ; preds = %33
  %36 = load ptr, ptr %12, align 8, !tbaa !9
  %37 = load ptr, ptr %14, align 8, !tbaa !9
  %38 = load ptr, ptr %15, align 8, !tbaa !9
  %39 = call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %36, ptr noundef %37, ptr noundef %38)
  %40 = fneg double %39
  %41 = load ptr, ptr %17, align 8, !tbaa !9
  store double %40, ptr %41, align 8, !tbaa !11
  %42 = load ptr, ptr %12, align 8, !tbaa !9
  %43 = load ptr, ptr %13, align 8, !tbaa !9
  %44 = load ptr, ptr %15, align 8, !tbaa !9
  %45 = call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %42, ptr noundef %43, ptr noundef %44)
  %46 = load ptr, ptr %18, align 8, !tbaa !9
  store double %45, ptr %46, align 8, !tbaa !11
  %47 = load ptr, ptr %17, align 8, !tbaa !9
  %48 = load double, ptr %47, align 8, !tbaa !11
  %49 = load ptr, ptr %18, align 8, !tbaa !9
  %50 = load double, ptr %49, align 8, !tbaa !11
  %51 = call noundef zeroext i1 @_ZN3pgo4Mesh9same_signEdd(double noundef %48, double noundef %50)
  br i1 %51, label %53, label %52

52:                                               ; preds = %35
  store i32 0, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

53:                                               ; preds = %35
  %54 = load ptr, ptr %12, align 8, !tbaa !9
  %55 = load ptr, ptr %13, align 8, !tbaa !9
  %56 = load ptr, ptr %14, align 8, !tbaa !9
  %57 = call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %54, ptr noundef %55, ptr noundef %56)
  %58 = fneg double %57
  %59 = load ptr, ptr %19, align 8, !tbaa !9
  store double %58, ptr %59, align 8, !tbaa !11
  %60 = load ptr, ptr %17, align 8, !tbaa !9
  %61 = load double, ptr %60, align 8, !tbaa !11
  %62 = load ptr, ptr %19, align 8, !tbaa !9
  %63 = load double, ptr %62, align 8, !tbaa !11
  %64 = call noundef zeroext i1 @_ZN3pgo4Mesh9same_signEdd(double noundef %61, double noundef %63)
  br i1 %64, label %66, label %65

65:                                               ; preds = %53
  store i32 0, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

66:                                               ; preds = %53
  %67 = load ptr, ptr %18, align 8, !tbaa !9
  %68 = load double, ptr %67, align 8, !tbaa !11
  %69 = load ptr, ptr %19, align 8, !tbaa !9
  %70 = load double, ptr %69, align 8, !tbaa !11
  %71 = call noundef zeroext i1 @_ZN3pgo4Mesh9same_signEdd(double noundef %68, double noundef %70)
  br i1 %71, label %73, label %72

72:                                               ; preds = %66
  store i32 0, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

73:                                               ; preds = %66
  %74 = load ptr, ptr %17, align 8, !tbaa !9
  %75 = load double, ptr %74, align 8, !tbaa !11
  %76 = load ptr, ptr %18, align 8, !tbaa !9
  %77 = load double, ptr %76, align 8, !tbaa !11
  %78 = fadd double %75, %77
  %79 = load ptr, ptr %19, align 8, !tbaa !9
  %80 = load double, ptr %79, align 8, !tbaa !11
  %81 = fadd double %78, %80
  store double %81, ptr %21, align 8, !tbaa !11
  %82 = load double, ptr %21, align 8, !tbaa !11
  %83 = fcmp une double %82, 0.000000e+00
  br i1 %83, label %84, label %98

84:                                               ; preds = %73
  %85 = load ptr, ptr %16, align 8, !tbaa !9
  store double 1.000000e+00, ptr %85, align 8, !tbaa !11
  %86 = load double, ptr %21, align 8, !tbaa !11
  %87 = load ptr, ptr %17, align 8, !tbaa !9
  %88 = load double, ptr %87, align 8, !tbaa !11
  %89 = fdiv double %88, %86
  store double %89, ptr %87, align 8, !tbaa !11
  %90 = load double, ptr %21, align 8, !tbaa !11
  %91 = load ptr, ptr %18, align 8, !tbaa !9
  %92 = load double, ptr %91, align 8, !tbaa !11
  %93 = fdiv double %92, %90
  store double %93, ptr %91, align 8, !tbaa !11
  %94 = load double, ptr %21, align 8, !tbaa !11
  %95 = load ptr, ptr %19, align 8, !tbaa !9
  %96 = load double, ptr %95, align 8, !tbaa !11
  %97 = fdiv double %96, %94
  store double %97, ptr %95, align 8, !tbaa !11
  store i32 1, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

98:                                               ; preds = %73
  %99 = load ptr, ptr %12, align 8, !tbaa !9
  %100 = load ptr, ptr %13, align 8, !tbaa !9
  %101 = load ptr, ptr %14, align 8, !tbaa !9
  %102 = load ptr, ptr %16, align 8, !tbaa !9
  %103 = load ptr, ptr %17, align 8, !tbaa !9
  %104 = load ptr, ptr %18, align 8, !tbaa !9
  %105 = call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %99, ptr noundef %100, ptr noundef %101, ptr noundef %102, ptr noundef %103, ptr noundef %104)
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %109

107:                                              ; preds = %98
  %108 = load ptr, ptr %19, align 8, !tbaa !9
  store double 0.000000e+00, ptr %108, align 8, !tbaa !11
  store i32 1, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

109:                                              ; preds = %98
  %110 = load ptr, ptr %12, align 8, !tbaa !9
  %111 = load ptr, ptr %13, align 8, !tbaa !9
  %112 = load ptr, ptr %15, align 8, !tbaa !9
  %113 = load ptr, ptr %16, align 8, !tbaa !9
  %114 = load ptr, ptr %17, align 8, !tbaa !9
  %115 = load ptr, ptr %19, align 8, !tbaa !9
  %116 = call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %110, ptr noundef %111, ptr noundef %112, ptr noundef %113, ptr noundef %114, ptr noundef %115)
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %120

118:                                              ; preds = %109
  %119 = load ptr, ptr %18, align 8, !tbaa !9
  store double 0.000000e+00, ptr %119, align 8, !tbaa !11
  store i32 1, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

120:                                              ; preds = %109
  %121 = load ptr, ptr %12, align 8, !tbaa !9
  %122 = load ptr, ptr %14, align 8, !tbaa !9
  %123 = load ptr, ptr %15, align 8, !tbaa !9
  %124 = load ptr, ptr %16, align 8, !tbaa !9
  %125 = load ptr, ptr %18, align 8, !tbaa !9
  %126 = load ptr, ptr %19, align 8, !tbaa !9
  %127 = call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %121, ptr noundef %122, ptr noundef %123, ptr noundef %124, ptr noundef %125, ptr noundef %126)
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %131

129:                                              ; preds = %120
  %130 = load ptr, ptr %17, align 8, !tbaa !9
  store double 0.000000e+00, ptr %130, align 8, !tbaa !11
  store i32 1, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

131:                                              ; preds = %120
  store i32 0, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

132:                                              ; preds = %33
  %133 = load ptr, ptr %13, align 8, !tbaa !9
  %134 = load ptr, ptr %14, align 8, !tbaa !9
  %135 = load ptr, ptr %15, align 8, !tbaa !9
  %136 = call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %133, ptr noundef %134, ptr noundef %135)
  %137 = load ptr, ptr %16, align 8, !tbaa !9
  store double %136, ptr %137, align 8, !tbaa !11
  %138 = load ptr, ptr %12, align 8, !tbaa !9
  %139 = load ptr, ptr %14, align 8, !tbaa !9
  %140 = load ptr, ptr %15, align 8, !tbaa !9
  %141 = call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %138, ptr noundef %139, ptr noundef %140)
  %142 = fneg double %141
  %143 = load ptr, ptr %17, align 8, !tbaa !9
  store double %142, ptr %143, align 8, !tbaa !11
  %144 = load ptr, ptr %16, align 8, !tbaa !9
  %145 = load double, ptr %144, align 8, !tbaa !11
  %146 = load ptr, ptr %17, align 8, !tbaa !9
  %147 = load double, ptr %146, align 8, !tbaa !11
  %148 = call noundef zeroext i1 @_ZN3pgo4Mesh9same_signEdd(double noundef %145, double noundef %147)
  br i1 %148, label %150, label %149

149:                                              ; preds = %132
  store i32 0, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

150:                                              ; preds = %132
  %151 = load ptr, ptr %12, align 8, !tbaa !9
  %152 = load ptr, ptr %13, align 8, !tbaa !9
  %153 = load ptr, ptr %15, align 8, !tbaa !9
  %154 = call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %151, ptr noundef %152, ptr noundef %153)
  %155 = load ptr, ptr %18, align 8, !tbaa !9
  store double %154, ptr %155, align 8, !tbaa !11
  %156 = load ptr, ptr %12, align 8, !tbaa !9
  %157 = load ptr, ptr %13, align 8, !tbaa !9
  %158 = load ptr, ptr %14, align 8, !tbaa !9
  %159 = call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %156, ptr noundef %157, ptr noundef %158)
  %160 = fneg double %159
  %161 = load ptr, ptr %19, align 8, !tbaa !9
  store double %160, ptr %161, align 8, !tbaa !11
  %162 = load ptr, ptr %18, align 8, !tbaa !9
  %163 = load double, ptr %162, align 8, !tbaa !11
  %164 = load ptr, ptr %19, align 8, !tbaa !9
  %165 = load double, ptr %164, align 8, !tbaa !11
  %166 = call noundef zeroext i1 @_ZN3pgo4Mesh9same_signEdd(double noundef %163, double noundef %165)
  br i1 %166, label %168, label %167

167:                                              ; preds = %150
  store i32 0, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

168:                                              ; preds = %150
  %169 = load ptr, ptr %16, align 8, !tbaa !9
  %170 = load double, ptr %169, align 8, !tbaa !11
  %171 = load ptr, ptr %17, align 8, !tbaa !9
  %172 = load double, ptr %171, align 8, !tbaa !11
  %173 = fadd double %170, %172
  store double %173, ptr %20, align 8, !tbaa !11
  %174 = load ptr, ptr %18, align 8, !tbaa !9
  %175 = load double, ptr %174, align 8, !tbaa !11
  %176 = load ptr, ptr %19, align 8, !tbaa !9
  %177 = load double, ptr %176, align 8, !tbaa !11
  %178 = fadd double %175, %177
  store double %178, ptr %21, align 8, !tbaa !11
  %179 = load double, ptr %20, align 8, !tbaa !11
  %180 = fcmp une double %179, 0.000000e+00
  br i1 %180, label %181, label %201

181:                                              ; preds = %168
  %182 = load double, ptr %21, align 8, !tbaa !11
  %183 = fcmp une double %182, 0.000000e+00
  br i1 %183, label %184, label %201

184:                                              ; preds = %181
  %185 = load double, ptr %20, align 8, !tbaa !11
  %186 = load ptr, ptr %16, align 8, !tbaa !9
  %187 = load double, ptr %186, align 8, !tbaa !11
  %188 = fdiv double %187, %185
  store double %188, ptr %186, align 8, !tbaa !11
  %189 = load double, ptr %20, align 8, !tbaa !11
  %190 = load ptr, ptr %17, align 8, !tbaa !9
  %191 = load double, ptr %190, align 8, !tbaa !11
  %192 = fdiv double %191, %189
  store double %192, ptr %190, align 8, !tbaa !11
  %193 = load double, ptr %21, align 8, !tbaa !11
  %194 = load ptr, ptr %18, align 8, !tbaa !9
  %195 = load double, ptr %194, align 8, !tbaa !11
  %196 = fdiv double %195, %193
  store double %196, ptr %194, align 8, !tbaa !11
  %197 = load double, ptr %21, align 8, !tbaa !11
  %198 = load ptr, ptr %19, align 8, !tbaa !9
  %199 = load double, ptr %198, align 8, !tbaa !11
  %200 = fdiv double %199, %197
  store double %200, ptr %198, align 8, !tbaa !11
  store i32 1, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

201:                                              ; preds = %181, %168
  %202 = load ptr, ptr %12, align 8, !tbaa !9
  %203 = load ptr, ptr %14, align 8, !tbaa !9
  %204 = load ptr, ptr %15, align 8, !tbaa !9
  %205 = load ptr, ptr %16, align 8, !tbaa !9
  %206 = load ptr, ptr %18, align 8, !tbaa !9
  %207 = load ptr, ptr %19, align 8, !tbaa !9
  %208 = call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %202, ptr noundef %203, ptr noundef %204, ptr noundef %205, ptr noundef %206, ptr noundef %207)
  %209 = icmp ne i32 %208, 0
  br i1 %209, label %210, label %212

210:                                              ; preds = %201
  %211 = load ptr, ptr %17, align 8, !tbaa !9
  store double 0.000000e+00, ptr %211, align 8, !tbaa !11
  store i32 1, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

212:                                              ; preds = %201
  %213 = load ptr, ptr %13, align 8, !tbaa !9
  %214 = load ptr, ptr %14, align 8, !tbaa !9
  %215 = load ptr, ptr %15, align 8, !tbaa !9
  %216 = load ptr, ptr %17, align 8, !tbaa !9
  %217 = load ptr, ptr %18, align 8, !tbaa !9
  %218 = load ptr, ptr %19, align 8, !tbaa !9
  %219 = call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %213, ptr noundef %214, ptr noundef %215, ptr noundef %216, ptr noundef %217, ptr noundef %218)
  %220 = icmp ne i32 %219, 0
  br i1 %220, label %221, label %223

221:                                              ; preds = %212
  %222 = load ptr, ptr %16, align 8, !tbaa !9
  store double 0.000000e+00, ptr %222, align 8, !tbaa !11
  store i32 1, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

223:                                              ; preds = %212
  %224 = load ptr, ptr %14, align 8, !tbaa !9
  %225 = load ptr, ptr %12, align 8, !tbaa !9
  %226 = load ptr, ptr %13, align 8, !tbaa !9
  %227 = load ptr, ptr %18, align 8, !tbaa !9
  %228 = load ptr, ptr %16, align 8, !tbaa !9
  %229 = load ptr, ptr %17, align 8, !tbaa !9
  %230 = call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %224, ptr noundef %225, ptr noundef %226, ptr noundef %227, ptr noundef %228, ptr noundef %229)
  %231 = icmp ne i32 %230, 0
  br i1 %231, label %232, label %234

232:                                              ; preds = %223
  %233 = load ptr, ptr %19, align 8, !tbaa !9
  store double 0.000000e+00, ptr %233, align 8, !tbaa !11
  store i32 1, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

234:                                              ; preds = %223
  %235 = load ptr, ptr %15, align 8, !tbaa !9
  %236 = load ptr, ptr %12, align 8, !tbaa !9
  %237 = load ptr, ptr %13, align 8, !tbaa !9
  %238 = load ptr, ptr %19, align 8, !tbaa !9
  %239 = load ptr, ptr %16, align 8, !tbaa !9
  %240 = load ptr, ptr %17, align 8, !tbaa !9
  %241 = call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %235, ptr noundef %236, ptr noundef %237, ptr noundef %238, ptr noundef %239, ptr noundef %240)
  %242 = icmp ne i32 %241, 0
  br i1 %242, label %243, label %245

243:                                              ; preds = %234
  %244 = load ptr, ptr %18, align 8, !tbaa !9
  store double 0.000000e+00, ptr %244, align 8, !tbaa !11
  store i32 1, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

245:                                              ; preds = %234
  store i32 0, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

246:                                              ; preds = %33
  %247 = load ptr, ptr %15, align 8, !tbaa !9
  %248 = load ptr, ptr %14, align 8, !tbaa !9
  %249 = load ptr, ptr %13, align 8, !tbaa !9
  %250 = load ptr, ptr %12, align 8, !tbaa !9
  %251 = load ptr, ptr %19, align 8, !tbaa !9
  %252 = load ptr, ptr %18, align 8, !tbaa !9
  %253 = load ptr, ptr %17, align 8, !tbaa !9
  %254 = load ptr, ptr %16, align 8, !tbaa !9
  %255 = call noundef i32 @_ZN3pgo4Mesh22simplex_intersection2dEiPKdS2_S2_S2_PdS3_S3_S3_(i32 noundef 1, ptr noundef %247, ptr noundef %248, ptr noundef %249, ptr noundef %250, ptr noundef %251, ptr noundef %252, ptr noundef %253, ptr noundef %254)
  store i32 %255, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

256:                                              ; preds = %33
  store i32 -1, ptr %10, align 4
  store i32 1, ptr %22, align 4
  br label %257

257:                                              ; preds = %256, %246, %245, %243, %232, %221, %210, %184, %167, %149, %131, %129, %118, %107, %84, %72, %65, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  %258 = load i32, ptr %10, align 4
  ret i32 %258
}

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

declare noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3pgo4Mesh9same_signEdd(double noundef, double noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

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

attributes #0 = { noreturn 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 #1 = { 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 #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 = { 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 #5 = { noreturn nounwind }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}


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

@.str.1 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@__PRETTY_FUNCTION__._ZN3pgo4Mesh22simplex_intersection2dEiPKdS2_S2_S2_PdS3_S3_S3_ = external hidden unnamed_addr constant [147 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN3pgo4Mesh22simplex_intersection2dEiPKdS2_S2_S2_PdS3_S3_S3_(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8) local_unnamed_addr #1 {
tailrecurse.peel.begin:
  %9 = add i32 %0, -1
  %10 = icmp ult i32 %9, 3
  br i1 %10, label %11, label %12

11:                                               ; preds = %tailrecurse.peel.begin
  switch i32 %0, label %default.unreachable [
    i32 1, label %13
    i32 2, label %51
    i32 3, label %.loopexit191
  ]

12:                                               ; preds = %tailrecurse.peel.begin
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 144, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3pgo4Mesh22simplex_intersection2dEiPKdS2_S2_S2_PdS3_S3_S3_) #4
  unreachable

.loopexit191:                                     ; preds = %11
  br label %13

13:                                               ; preds = %.loopexit191, %11
  %.tr134.lcssa188 = phi ptr [ %1, %11 ], [ %4, %.loopexit191 ]
  %.tr135.lcssa185 = phi ptr [ %2, %11 ], [ %3, %.loopexit191 ]
  %.tr136.lcssa182 = phi ptr [ %3, %11 ], [ %2, %.loopexit191 ]
  %.tr137.lcssa179 = phi ptr [ %4, %11 ], [ %1, %.loopexit191 ]
  %.tr138.lcssa176 = phi ptr [ %5, %11 ], [ %8, %.loopexit191 ]
  %.tr139.lcssa173 = phi ptr [ %6, %11 ], [ %7, %.loopexit191 ]
  %.tr140.lcssa170 = phi ptr [ %7, %11 ], [ %6, %.loopexit191 ]
  %.tr141.lcssa167 = phi ptr [ %8, %11 ], [ %5, %.loopexit191 ]
  %14 = tail call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %.tr134.lcssa188, ptr noundef %.tr136.lcssa182, ptr noundef %.tr137.lcssa179)
  %15 = fneg double %14
  store double %15, ptr %.tr139.lcssa173, align 8, !tbaa !5
  %16 = tail call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %.tr134.lcssa188, ptr noundef %.tr135.lcssa185, ptr noundef %.tr137.lcssa179)
  store double %16, ptr %.tr140.lcssa170, align 8, !tbaa !5
  %17 = load double, ptr %.tr139.lcssa173, align 8, !tbaa !5
  %18 = tail call noundef zeroext i1 @_ZN3pgo4Mesh9same_signEdd(double noundef %17, double noundef %16)
  br i1 %18, label %19, label %92

19:                                               ; preds = %13
  %20 = tail call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %.tr134.lcssa188, ptr noundef %.tr135.lcssa185, ptr noundef %.tr136.lcssa182)
  %21 = fneg double %20
  store double %21, ptr %.tr141.lcssa167, align 8, !tbaa !5
  %22 = load double, ptr %.tr139.lcssa173, align 8, !tbaa !5
  %23 = tail call noundef zeroext i1 @_ZN3pgo4Mesh9same_signEdd(double noundef %22, double noundef %21)
  br i1 %23, label %24, label %92

24:                                               ; preds = %19
  %25 = load double, ptr %.tr140.lcssa170, align 8, !tbaa !5
  %26 = load double, ptr %.tr141.lcssa167, align 8, !tbaa !5
  %27 = tail call noundef zeroext i1 @_ZN3pgo4Mesh9same_signEdd(double noundef %25, double noundef %26)
  br i1 %27, label %28, label %92

28:                                               ; preds = %24
  %29 = load double, ptr %.tr139.lcssa173, align 8, !tbaa !5
  %30 = load double, ptr %.tr140.lcssa170, align 8, !tbaa !5
  %31 = fadd double %29, %30
  %32 = load double, ptr %.tr141.lcssa167, align 8, !tbaa !5
  %33 = fadd double %31, %32
  %34 = fcmp une double %33, 0.000000e+00
  br i1 %34, label %35, label %42

35:                                               ; preds = %28
  store double 1.000000e+00, ptr %.tr138.lcssa176, align 8, !tbaa !5
  %36 = load double, ptr %.tr139.lcssa173, align 8, !tbaa !5
  %37 = fdiv double %36, %33
  store double %37, ptr %.tr139.lcssa173, align 8, !tbaa !5
  %38 = load double, ptr %.tr140.lcssa170, align 8, !tbaa !5
  %39 = fdiv double %38, %33
  store double %39, ptr %.tr140.lcssa170, align 8, !tbaa !5
  %40 = load double, ptr %.tr141.lcssa167, align 8, !tbaa !5
  %41 = fdiv double %40, %33
  store double %41, ptr %.tr141.lcssa167, align 8, !tbaa !5
  br label %92

42:                                               ; preds = %28
  %43 = tail call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %.tr134.lcssa188, ptr noundef %.tr135.lcssa185, ptr noundef %.tr136.lcssa182, ptr noundef %.tr138.lcssa176, ptr noundef nonnull %.tr139.lcssa173, ptr noundef nonnull %.tr140.lcssa170)
  %.not131 = icmp eq i32 %43, 0
  br i1 %.not131, label %45, label %44

44:                                               ; preds = %42
  store double 0.000000e+00, ptr %.tr141.lcssa167, align 8, !tbaa !5
  br label %92

45:                                               ; preds = %42
  %46 = tail call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %.tr134.lcssa188, ptr noundef %.tr135.lcssa185, ptr noundef %.tr137.lcssa179, ptr noundef %.tr138.lcssa176, ptr noundef nonnull %.tr139.lcssa173, ptr noundef nonnull %.tr141.lcssa167)
  %.not132 = icmp eq i32 %46, 0
  br i1 %.not132, label %48, label %47

47:                                               ; preds = %45
  store double 0.000000e+00, ptr %.tr140.lcssa170, align 8, !tbaa !5
  br label %92

48:                                               ; preds = %45
  %49 = tail call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %.tr134.lcssa188, ptr noundef %.tr136.lcssa182, ptr noundef %.tr137.lcssa179, ptr noundef %.tr138.lcssa176, ptr noundef nonnull %.tr140.lcssa170, ptr noundef nonnull %.tr141.lcssa167)
  %.not133 = icmp eq i32 %49, 0
  br i1 %.not133, label %92, label %50

50:                                               ; preds = %48
  store double 0.000000e+00, ptr %.tr139.lcssa173, align 8, !tbaa !5
  br label %92

51:                                               ; preds = %11
  %52 = tail call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %2, ptr noundef %3, ptr noundef %4)
  store double %52, ptr %5, align 8, !tbaa !5
  %53 = tail call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %1, ptr noundef %3, ptr noundef %4)
  %54 = fneg double %53
  store double %54, ptr %6, align 8, !tbaa !5
  %55 = load double, ptr %5, align 8, !tbaa !5
  %56 = tail call noundef zeroext i1 @_ZN3pgo4Mesh9same_signEdd(double noundef %55, double noundef %54)
  br i1 %56, label %57, label %92

57:                                               ; preds = %51
  %58 = tail call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %1, ptr noundef %2, ptr noundef %4)
  store double %58, ptr %7, align 8, !tbaa !5
  %59 = tail call noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef %1, ptr noundef %2, ptr noundef %3)
  %60 = fneg double %59
  store double %60, ptr %8, align 8, !tbaa !5
  %61 = load double, ptr %7, align 8, !tbaa !5
  %62 = tail call noundef zeroext i1 @_ZN3pgo4Mesh9same_signEdd(double noundef %61, double noundef %60)
  br i1 %62, label %63, label %92

63:                                               ; preds = %57
  %64 = load double, ptr %5, align 8, !tbaa !5
  %65 = load double, ptr %6, align 8, !tbaa !5
  %66 = fadd double %64, %65
  %67 = load double, ptr %7, align 8, !tbaa !5
  %68 = load double, ptr %8, align 8, !tbaa !5
  %69 = fadd double %67, %68
  %70 = fcmp une double %66, 0.000000e+00
  %71 = fcmp une double %69, 0.000000e+00
  %or.cond = select i1 %70, i1 %71, i1 false
  br i1 %or.cond, label %72, label %80

72:                                               ; preds = %63
  %73 = fdiv double %64, %66
  store double %73, ptr %5, align 8, !tbaa !5
  %74 = load double, ptr %6, align 8, !tbaa !5
  %75 = fdiv double %74, %66
  store double %75, ptr %6, align 8, !tbaa !5
  %76 = load double, ptr %7, align 8, !tbaa !5
  %77 = fdiv double %76, %69
  store double %77, ptr %7, align 8, !tbaa !5
  %78 = load double, ptr %8, align 8, !tbaa !5
  %79 = fdiv double %78, %69
  store double %79, ptr %8, align 8, !tbaa !5
  br label %92

80:                                               ; preds = %63
  %81 = tail call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %1, ptr noundef %3, ptr noundef %4, ptr noundef nonnull %5, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %.not = icmp eq i32 %81, 0
  br i1 %.not, label %83, label %82

82:                                               ; preds = %80
  store double 0.000000e+00, ptr %6, align 8, !tbaa !5
  br label %92

83:                                               ; preds = %80
  %84 = tail call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %.not128 = icmp eq i32 %84, 0
  br i1 %.not128, label %86, label %85

85:                                               ; preds = %83
  store double 0.000000e+00, ptr %5, align 8, !tbaa !5
  br label %92

86:                                               ; preds = %83
  %87 = tail call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %3, ptr noundef %1, ptr noundef %2, ptr noundef nonnull %7, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %.not129 = icmp eq i32 %87, 0
  br i1 %.not129, label %89, label %88

88:                                               ; preds = %86
  store double 0.000000e+00, ptr %8, align 8, !tbaa !5
  br label %92

89:                                               ; preds = %86
  %90 = tail call noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef 1, ptr noundef %4, ptr noundef %1, ptr noundef %2, ptr noundef nonnull %8, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %.not130 = icmp eq i32 %90, 0
  br i1 %.not130, label %92, label %91

91:                                               ; preds = %89
  store double 0.000000e+00, ptr %7, align 8, !tbaa !5
  br label %92

default.unreachable:                              ; preds = %11
  unreachable

92:                                               ; preds = %89, %57, %51, %48, %24, %19, %13, %91, %88, %85, %82, %72, %50, %47, %44, %35
  %.0 = phi i32 [ 1, %72 ], [ 1, %82 ], [ 1, %85 ], [ 1, %88 ], [ 1, %91 ], [ 1, %35 ], [ 1, %44 ], [ 1, %47 ], [ 1, %50 ], [ 0, %13 ], [ 0, %19 ], [ 0, %24 ], [ 0, %48 ], [ 0, %51 ], [ 0, %57 ], [ 0, %89 ]
  ret i32 %.0
}

declare noundef double @_ZN3pgo4Mesh8orient2dEPKdS2_S2_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3pgo4Mesh9same_signEdd(double noundef, double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN3pgo4MeshL22simplex_intersection2dEiPKdS2_S2_PdS3_S3_(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { noreturn 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 #1 = { 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 #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 = { 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 #4 = { noreturn 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"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopFullUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass