; LLVM IR from pmla/polyhedral-template-matching :: ptm_index (ptm_index)

; 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.ptm::refdata_t" = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, i32, ptr, ptr, ptr, ptr }
%"struct.ptm::result_t" = type { double, double, [4 x double], [17 x i8], ptr }
%"struct.ptm::atomicenv_t" = type { [19 x i32], [19 x i64], [19 x i32], [19 x [3 x double]] }
%"struct.ptm::convexhull_t" = type { [28 x [3 x i8]], [28 x [3 x double]], [17 x i8], [4 x i32], [3 x double], i32, i32, i8 }

@.str.89 = external hidden unnamed_addr constant [81 x i8], align 1
@ptm_initialized = external global i8, align 1
@.str.90 = external hidden unnamed_addr constant [16 x i8], align 1
@__PRETTY_FUNCTION__.ptm_index = external hidden unnamed_addr constant [297 x i8], align 1
@_ZN3ptmL12structure_scE = external hidden constant %"struct.ptm::refdata_t", align 8
@_ZN3ptmL13structure_bccE = external hidden constant %"struct.ptm::refdata_t", align 8

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @ptm_index(ptr noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i1 noundef zeroext %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18, ptr noundef %19) #3 {
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i64, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i8, align 1
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca ptr, align 8
  %36 = alloca ptr, align 8
  %37 = alloca ptr, align 8
  %38 = alloca ptr, align 8
  %39 = alloca ptr, align 8
  %40 = alloca ptr, align 8
  %41 = alloca ptr, align 8
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca %"struct.ptm::result_t", align 8
  %45 = alloca %"struct.ptm::atomicenv_t", align 8
  %46 = alloca %"struct.ptm::atomicenv_t", align 8
  %47 = alloca %"struct.ptm::atomicenv_t", align 8
  %48 = alloca %"struct.ptm::convexhull_t", align 8
  %49 = alloca [19 x [3 x double]], align 16
  %50 = alloca i32, align 4
  %51 = alloca i32, align 4
  %52 = alloca i32, align 4
  %53 = alloca i32, align 4
  %54 = alloca i32, align 4
  %55 = alloca i32, align 4
  %56 = alloca ptr, align 8
  store ptr %0, ptr %22, align 8, !tbaa !5
  store i64 %1, ptr %23, align 8, !tbaa !9
  store ptr %2, ptr %24, align 8, !tbaa !5
  store ptr %3, ptr %25, align 8, !tbaa !5
  store i32 %4, ptr %26, align 4, !tbaa !11
  %57 = zext i1 %5 to i8
  store i8 %57, ptr %27, align 1, !tbaa !13
  store ptr %6, ptr %28, align 8, !tbaa !5
  store ptr %7, ptr %29, align 8, !tbaa !5
  store ptr %8, ptr %30, align 8, !tbaa !5
  store ptr %9, ptr %31, align 8, !tbaa !5
  store ptr %10, ptr %32, align 8, !tbaa !5
  store ptr %11, ptr %33, align 8, !tbaa !5
  store ptr %12, ptr %34, align 8, !tbaa !5
  store ptr %13, ptr %35, align 8, !tbaa !5
  store ptr %14, ptr %36, align 8, !tbaa !5
  store ptr %15, ptr %37, align 8, !tbaa !5
  store ptr %16, ptr %38, align 8, !tbaa !5
  store ptr %17, ptr %39, align 8, !tbaa !5
  store ptr %18, ptr %40, align 8, !tbaa !5
  store ptr %19, ptr %41, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #5
  store i32 0, ptr %42, align 4, !tbaa !11
  %58 = load i8, ptr @ptm_initialized, align 1, !tbaa !13, !range !15, !noundef !16
  %59 = trunc i8 %58 to i1
  br i1 %59, label %60, label %61

60:                                               ; preds = %20
  br label %63

61:                                               ; preds = %20
  call void @__assert_fail(ptr noundef @.str.90, ptr noundef @.str.89, i32 noundef 334, ptr noundef @__PRETTY_FUNCTION__.ptm_index) #6
  unreachable

62:                                               ; No predecessors!
  br label %63

63:                                               ; preds = %62, %60
  %64 = load i8, ptr @ptm_initialized, align 1, !tbaa !13, !range !15, !noundef !16
  %65 = trunc i8 %64 to i1
  br i1 %65, label %67, label %66

66:                                               ; preds = %63
  store i32 -1, ptr %21, align 4
  store i32 1, ptr %43, align 4
  br label %233

67:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 80, ptr %44) #5
  %68 = getelementptr inbounds %"struct.ptm::result_t", ptr %44, i32 0, i32 4
  store ptr null, ptr %68, align 8, !tbaa !17
  %69 = getelementptr inbounds %"struct.ptm::result_t", ptr %44, i32 0, i32 0
  store double 0x7FF0000000000000, ptr %69, align 8, !tbaa !20
  %70 = load ptr, ptr %41, align 8, !tbaa !5
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %74

72:                                               ; preds = %67
  %73 = load ptr, ptr %41, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 1 %73, i8 -1, i64 19, i1 false)
  br label %74

74:                                               ; preds = %72, %67
  %75 = load ptr, ptr %28, align 8, !tbaa !5
  store i32 0, ptr %75, align 4, !tbaa !11
  %76 = load ptr, ptr %29, align 8, !tbaa !5
  %77 = icmp ne ptr %76, null
  br i1 %77, label %78, label %80

78:                                               ; preds = %74
  %79 = load ptr, ptr %29, align 8, !tbaa !5
  store i32 0, ptr %79, align 4, !tbaa !11
  br label %80

80:                                               ; preds = %78, %74
  call void @llvm.lifetime.start.p0(i64 768, ptr %45) #5
  call void @llvm.lifetime.start.p0(i64 768, ptr %46) #5
  call void @llvm.lifetime.start.p0(i64 768, ptr %47) #5
  call void @llvm.lifetime.start.p0(i64 840, ptr %48) #5
  call void @llvm.lifetime.start.p0(i64 456, ptr %49) #5
  %81 = load i32, ptr %26, align 4, !tbaa !11
  %82 = and i32 %81, 31
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %149

84:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #5
  store i32 7, ptr %50, align 4, !tbaa !11
  %85 = load i32, ptr %26, align 4, !tbaa !11
  %86 = and i32 %85, 11
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %89

88:                                               ; preds = %84
  store i32 13, ptr %50, align 4, !tbaa !11
  br label %89

89:                                               ; preds = %88, %84
  %90 = load i32, ptr %26, align 4, !tbaa !11
  %91 = and i32 %90, 4
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %94

93:                                               ; preds = %89
  store i32 15, ptr %50, align 4, !tbaa !11
  br label %94

94:                                               ; preds = %93, %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %51) #5
  %95 = load ptr, ptr %24, align 8, !tbaa !5
  %96 = load ptr, ptr %25, align 8, !tbaa !5
  %97 = load i64, ptr %23, align 8, !tbaa !9
  %98 = getelementptr inbounds %"struct.ptm::atomicenv_t", ptr %45, i32 0, i32 0
  %99 = getelementptr inbounds [19 x i32], ptr %98, i64 0, i64 0
  %100 = getelementptr inbounds %"struct.ptm::atomicenv_t", ptr %45, i32 0, i32 1
  %101 = getelementptr inbounds [19 x i64], ptr %100, i64 0, i64 0
  %102 = getelementptr inbounds %"struct.ptm::atomicenv_t", ptr %45, i32 0, i32 2
  %103 = getelementptr inbounds [19 x i32], ptr %102, i64 0, i64 0
  %104 = getelementptr inbounds %"struct.ptm::atomicenv_t", ptr %45, i32 0, i32 3
  %105 = getelementptr inbounds [19 x [3 x double]], ptr %104, i64 0, i64 0
  %106 = call noundef i32 %95(ptr noundef %96, i64 noundef -1, i64 noundef %97, i32 noundef 19, ptr noundef %99, ptr noundef %101, ptr noundef %103, ptr noundef %105)
  store i32 %106, ptr %51, align 4, !tbaa !11
  %107 = load i32, ptr %51, align 4, !tbaa !11
  %108 = load i32, ptr %50, align 4, !tbaa !11
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %110, label %111

110:                                              ; preds = %94
  store i32 -1, ptr %21, align 4
  store i32 1, ptr %43, align 4
  br label %146

111:                                              ; preds = %94
  %112 = load i32, ptr %51, align 4, !tbaa !11
  %113 = getelementptr inbounds %"struct.ptm::atomicenv_t", ptr %45, i32 0, i32 3
  %114 = getelementptr inbounds [19 x [3 x double]], ptr %113, i64 0, i64 0
  %115 = getelementptr inbounds [19 x [3 x double]], ptr %49, i64 0, i64 0
  %116 = call noundef double @_ZN3ptm18normalize_verticesEiPA3_dS1_(i32 noundef %112, ptr noundef %114, ptr noundef %115)
  %117 = getelementptr inbounds %"struct.ptm::convexhull_t", ptr %48, i32 0, i32 7
  store i8 0, ptr %117, align 8, !tbaa !21
  %118 = load i32, ptr %26, align 4, !tbaa !11
  %119 = and i32 %118, 16
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %126

121:                                              ; preds = %111
  %122 = getelementptr inbounds [19 x [3 x double]], ptr %49, i64 0, i64 0
  %123 = getelementptr inbounds %"struct.ptm::atomicenv_t", ptr %45, i32 0, i32 3
  %124 = getelementptr inbounds [19 x [3 x double]], ptr %123, i64 0, i64 0
  %125 = call noundef i32 @_ZN3ptm13match_generalEPKNS_9refdata_tEPA3_dS4_PNS_12convexhull_tEPNS_8result_tE(ptr noundef @_ZN3ptmL12structure_scE, ptr noundef %122, ptr noundef %124, ptr noundef %48, ptr noundef %44)
  store i32 %125, ptr %42, align 4, !tbaa !11
  br label %126

126:                                              ; preds = %121, %111
  %127 = load i32, ptr %26, align 4, !tbaa !11
  %128 = and i32 %127, 11
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %136

130:                                              ; preds = %126
  %131 = getelementptr inbounds [19 x [3 x double]], ptr %49, i64 0, i64 0
  %132 = getelementptr inbounds %"struct.ptm::atomicenv_t", ptr %45, i32 0, i32 3
  %133 = getelementptr inbounds [19 x [3 x double]], ptr %132, i64 0, i64 0
  %134 = load i32, ptr %26, align 4, !tbaa !11
  %135 = call noundef i32 @_ZN3ptm17match_fcc_hcp_icoEPA3_dS1_iPNS_12convexhull_tEPNS_8result_tE(ptr noundef %131, ptr noundef %133, i32 noundef %134, ptr noundef %48, ptr noundef %44)
  store i32 %135, ptr %42, align 4, !tbaa !11
  br label %136

136:                                              ; preds = %130, %126
  %137 = load i32, ptr %26, align 4, !tbaa !11
  %138 = and i32 %137, 4
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %145

140:                                              ; preds = %136
  %141 = getelementptr inbounds [19 x [3 x double]], ptr %49, i64 0, i64 0
  %142 = getelementptr inbounds %"struct.ptm::atomicenv_t", ptr %45, i32 0, i32 3
  %143 = getelementptr inbounds [19 x [3 x double]], ptr %142, i64 0, i64 0
  %144 = call noundef i32 @_ZN3ptm13match_generalEPKNS_9refdata_tEPA3_dS4_PNS_12convexhull_tEPNS_8result_tE(ptr noundef @_ZN3ptmL13structure_bccE, ptr noundef %141, ptr noundef %143, ptr noundef %48, ptr noundef %44)
  store i32 %144, ptr %42, align 4, !tbaa !11
  br label %145

145:                                              ; preds = %140, %136
  store i32 0, ptr %43, align 4
  br label %146

146:                                              ; preds = %145, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #5
  %147 = load i32, ptr %43, align 4
  switch i32 %147, label %232 [
    i32 0, label %148
  ]

148:                                              ; preds = %146
  br label %149

149:                                              ; preds = %148, %80
  %150 = load i32, ptr %26, align 4, !tbaa !11
  %151 = and i32 %150, 96
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %153, label %172

153:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #5
  store i32 4, ptr %52, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %53) #5
  store i32 3, ptr %53, align 4, !tbaa !11
  %154 = load i64, ptr %23, align 8, !tbaa !9
  %155 = load ptr, ptr %24, align 8, !tbaa !5
  %156 = load ptr, ptr %25, align 8, !tbaa !5
  %157 = call noundef i32 @_ZN3ptm38calculate_two_shell_neighbour_orderingEiimPFiPvmmiPiPmS1_PA3_dES0_PNS_11atomicenv_tE(i32 noundef 4, i32 noundef 3, i64 noundef %154, ptr noundef %155, ptr noundef %156, ptr noundef %46)
  store i32 %157, ptr %42, align 4, !tbaa !11
  %158 = load i32, ptr %42, align 4, !tbaa !11
  %159 = icmp eq i32 %158, 0
  br i1 %159, label %160, label %171

160:                                              ; preds = %153
  %161 = getelementptr inbounds %"struct.ptm::atomicenv_t", ptr %46, i32 0, i32 3
  %162 = getelementptr inbounds [19 x [3 x double]], ptr %161, i64 0, i64 0
  %163 = getelementptr inbounds [19 x [3 x double]], ptr %49, i64 0, i64 0
  %164 = call noundef double @_ZN3ptm18normalize_verticesEiPA3_dS1_(i32 noundef 17, ptr noundef %162, ptr noundef %163)
  %165 = getelementptr inbounds %"struct.ptm::convexhull_t", ptr %48, i32 0, i32 7
  store i8 0, ptr %165, align 8, !tbaa !21
  %166 = getelementptr inbounds [19 x [3 x double]], ptr %49, i64 0, i64 0
  %167 = getelementptr inbounds %"struct.ptm::atomicenv_t", ptr %46, i32 0, i32 3
  %168 = getelementptr inbounds [19 x [3 x double]], ptr %167, i64 0, i64 0
  %169 = load i32, ptr %26, align 4, !tbaa !11
  %170 = call noundef i32 @_ZN3ptm15match_dcub_dhexEPA3_dS1_iPNS_12convexhull_tEPNS_8result_tE(ptr noundef %166, ptr noundef %168, i32 noundef %169, ptr noundef %48, ptr noundef %44)
  store i32 %170, ptr %42, align 4, !tbaa !11
  br label %171

171:                                              ; preds = %160, %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #5
  br label %172

172:                                              ; preds = %171, %149
  %173 = load i32, ptr %26, align 4, !tbaa !11
  %174 = and i32 %173, 128
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %176, label %188

176:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #5
  store i32 3, ptr %54, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %55) #5
  store i32 2, ptr %55, align 4, !tbaa !11
  %177 = load i64, ptr %23, align 8, !tbaa !9
  %178 = load ptr, ptr %24, align 8, !tbaa !5
  %179 = load ptr, ptr %25, align 8, !tbaa !5
  %180 = call noundef i32 @_ZN3ptm38calculate_two_shell_neighbour_orderingEiimPFiPvmmiPiPmS1_PA3_dES0_PNS_11atomicenv_tE(i32 noundef 3, i32 noundef 2, i64 noundef %177, ptr noundef %178, ptr noundef %179, ptr noundef %47)
  store i32 %180, ptr %42, align 4, !tbaa !11
  %181 = load i32, ptr %42, align 4, !tbaa !11
  %182 = icmp eq i32 %181, 0
  br i1 %182, label %183, label %187

183:                                              ; preds = %176
  %184 = getelementptr inbounds %"struct.ptm::atomicenv_t", ptr %47, i32 0, i32 3
  %185 = getelementptr inbounds [19 x [3 x double]], ptr %184, i64 0, i64 0
  %186 = call noundef i32 @_ZN3ptm14match_grapheneEPA3_dPNS_8result_tE(ptr noundef %185, ptr noundef %44)
  store i32 %186, ptr %42, align 4, !tbaa !11
  br label %187

187:                                              ; preds = %183, %176
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #5
  br label %188

188:                                              ; preds = %187, %172
  %189 = getelementptr inbounds %"struct.ptm::result_t", ptr %44, i32 0, i32 4
  %190 = load ptr, ptr %189, align 8, !tbaa !17
  %191 = icmp eq ptr %190, null
  br i1 %191, label %192, label %193

192:                                              ; preds = %188
  store i32 0, ptr %21, align 4
  store i32 1, ptr %43, align 4
  br label %232

193:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 8, ptr %56) #5
  store ptr %45, ptr %56, align 8, !tbaa !5
  %194 = getelementptr inbounds %"struct.ptm::result_t", ptr %44, i32 0, i32 4
  %195 = load ptr, ptr %194, align 8, !tbaa !17
  %196 = getelementptr inbounds %"struct.ptm::refdata_t", ptr %195, i32 0, i32 0
  %197 = load i32, ptr %196, align 8, !tbaa !23
  %198 = icmp eq i32 %197, 6
  br i1 %198, label %205, label %199

199:                                              ; preds = %193
  %200 = getelementptr inbounds %"struct.ptm::result_t", ptr %44, i32 0, i32 4
  %201 = load ptr, ptr %200, align 8, !tbaa !17
  %202 = getelementptr inbounds %"struct.ptm::refdata_t", ptr %201, i32 0, i32 0
  %203 = load i32, ptr %202, align 8, !tbaa !23
  %204 = icmp eq i32 %203, 7
  br i1 %204, label %205, label %206

205:                                              ; preds = %199, %193
  store ptr %46, ptr %56, align 8, !tbaa !5
  br label %214

206:                                              ; preds = %199
  %207 = getelementptr inbounds %"struct.ptm::result_t", ptr %44, i32 0, i32 4
  %208 = load ptr, ptr %207, align 8, !tbaa !17
  %209 = getelementptr inbounds %"struct.ptm::refdata_t", ptr %208, i32 0, i32 0
  %210 = load i32, ptr %209, align 8, !tbaa !23
  %211 = icmp eq i32 %210, 8
  br i1 %211, label %212, label %213

212:                                              ; preds = %206
  store ptr %47, ptr %56, align 8, !tbaa !5
  br label %213

213:                                              ; preds = %212, %206
  br label %214

214:                                              ; preds = %213, %205
  %215 = load ptr, ptr %56, align 8, !tbaa !5
  %216 = load i8, ptr %27, align 1, !tbaa !13, !range !15, !noundef !16
  %217 = trunc i8 %216 to i1
  %218 = load ptr, ptr %28, align 8, !tbaa !5
  %219 = load ptr, ptr %29, align 8, !tbaa !5
  %220 = load ptr, ptr %30, align 8, !tbaa !5
  %221 = load ptr, ptr %31, align 8, !tbaa !5
  %222 = load ptr, ptr %32, align 8, !tbaa !5
  %223 = load ptr, ptr %33, align 8, !tbaa !5
  %224 = load ptr, ptr %34, align 8, !tbaa !5
  %225 = load ptr, ptr %35, align 8, !tbaa !5
  %226 = load ptr, ptr %36, align 8, !tbaa !5
  %227 = load ptr, ptr %37, align 8, !tbaa !5
  %228 = load ptr, ptr %38, align 8, !tbaa !5
  %229 = load ptr, ptr %39, align 8, !tbaa !5
  %230 = load ptr, ptr %40, align 8, !tbaa !5
  %231 = load ptr, ptr %41, align 8, !tbaa !5
  call void @_ZL11output_dataPN3ptm8result_tEPNS_11atomicenv_tEbPiS4_PdS5_S5_S5_S5_S5_S5_S5_S5_S4_PPA3_KdPa(ptr noundef %44, ptr noundef %215, i1 noundef zeroext %217, ptr noundef %218, ptr noundef %219, ptr noundef %220, ptr noundef %221, ptr noundef %222, ptr noundef %223, ptr noundef %224, ptr noundef %225, ptr noundef %226, ptr noundef %227, ptr noundef %228, ptr noundef %229, ptr noundef %230, ptr noundef %231)
  store i32 0, ptr %21, align 4
  store i32 1, ptr %43, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #5
  br label %232

232:                                              ; preds = %214, %192, %146
  call void @llvm.lifetime.end.p0(i64 456, ptr %49) #5
  call void @llvm.lifetime.end.p0(i64 840, ptr %48) #5
  call void @llvm.lifetime.end.p0(i64 768, ptr %47) #5
  call void @llvm.lifetime.end.p0(i64 768, ptr %46) #5
  call void @llvm.lifetime.end.p0(i64 768, ptr %45) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %44) #5
  br label %233

233:                                              ; preds = %232, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #5
  %234 = load i32, ptr %21, align 4
  ret i32 %234
}

declare noundef double @_ZN3ptm18normalize_verticesEiPA3_dS1_(i32 noundef, ptr noundef, ptr noundef) #4

declare noundef i32 @_ZN3ptm13match_generalEPKNS_9refdata_tEPA3_dS4_PNS_12convexhull_tEPNS_8result_tE(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare noundef i32 @_ZN3ptm17match_fcc_hcp_icoEPA3_dS1_iPNS_12convexhull_tEPNS_8result_tE(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #4

declare noundef i32 @_ZN3ptm38calculate_two_shell_neighbour_orderingEiimPFiPvmmiPiPmS1_PA3_dES0_PNS_11atomicenv_tE(i32 noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare noundef i32 @_ZN3ptm15match_dcub_dhexEPA3_dS1_iPNS_12convexhull_tEPNS_8result_tE(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #4

declare noundef i32 @_ZN3ptm14match_grapheneEPA3_dPNS_8result_tE(ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11output_dataPN3ptm8result_tEPNS_11atomicenv_tEbPiS4_PdS5_S5_S5_S5_S5_S5_S5_S5_S4_PPA3_KdPa(ptr noundef, ptr noundef, i1 noundef zeroext, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "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 = { nounwind }
attributes #6 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !6, i64 72}
!18 = !{!"_ZTSN3ptm8result_tE", !19, i64 0, !19, i64 8, !7, i64 16, !7, i64 48, !6, i64 72}
!19 = !{!"double", !7, i64 0}
!20 = !{!18, !19, i64 0}
!21 = !{!22, !14, i64 832}
!22 = !{!"_ZTSN3ptm12convexhull_tE", !7, i64 0, !7, i64 88, !7, i64 760, !7, i64 780, !7, i64 800, !12, i64 824, !12, i64 828, !14, i64 832}
!23 = !{!24, !12, i64 0}
!24 = !{!"_ZTSN3ptm9refdata_tE", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !12, i64 96, !6, i64 104, !12, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144}


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

%"struct.ptm::refdata_t" = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, i32, ptr, ptr, ptr, ptr }
%"struct.ptm::result_t" = type { double, double, [4 x double], [17 x i8], ptr }
%"struct.ptm::atomicenv_t" = type { [19 x i32], [19 x i64], [19 x i32], [19 x [3 x double]] }
%"struct.ptm::convexhull_t" = type { [28 x [3 x i8]], [28 x [3 x double]], [17 x i8], [4 x i32], [3 x double], i32, i32, i8 }

@.str.89 = external hidden unnamed_addr constant [81 x i8], align 1
@ptm_initialized = external local_unnamed_addr global i8, align 1
@.str.90 = external hidden unnamed_addr constant [16 x i8], align 1
@__PRETTY_FUNCTION__.ptm_index = external hidden unnamed_addr constant [297 x i8], align 1
@_ZN3ptmL12structure_scE = external hidden constant %"struct.ptm::refdata_t", align 8
@_ZN3ptmL13structure_bccE = external hidden constant %"struct.ptm::refdata_t", align 8

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local range(i32 -1, 1) i32 @ptm_index(ptr nocapture noundef readnone %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i1 noundef zeroext %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18, ptr noundef %19) local_unnamed_addr #3 {
  %21 = alloca %"struct.ptm::result_t", align 8
  %22 = alloca %"struct.ptm::atomicenv_t", align 8
  %23 = alloca %"struct.ptm::atomicenv_t", align 8
  %24 = alloca %"struct.ptm::atomicenv_t", align 8
  %25 = alloca %"struct.ptm::convexhull_t", align 8
  %26 = alloca [19 x [3 x double]], align 16
  %27 = load i8, ptr @ptm_initialized, align 1, !tbaa !5, !range !9, !noundef !10
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %30, label %29

29:                                               ; preds = %20
  tail call void @__assert_fail(ptr noundef nonnull @.str.90, ptr noundef nonnull @.str.89, i32 noundef 334, ptr noundef nonnull @__PRETTY_FUNCTION__.ptm_index) #5
  unreachable

30:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %21) #6
  %31 = getelementptr inbounds i8, ptr %21, i64 72
  store ptr null, ptr %31, align 8, !tbaa !11
  store double 0x7FF0000000000000, ptr %21, align 8, !tbaa !15
  %.not = icmp eq ptr %19, null
  br i1 %.not, label %33, label %32

32:                                               ; preds = %30
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(19) %19, i8 -1, i64 19, i1 false)
  br label %33

33:                                               ; preds = %32, %30
  store i32 0, ptr %6, align 4, !tbaa !16
  %.not54 = icmp eq ptr %7, null
  br i1 %.not54, label %35, label %34

34:                                               ; preds = %33
  store i32 0, ptr %7, align 4, !tbaa !16
  br label %35

35:                                               ; preds = %34, %33
  call void @llvm.lifetime.start.p0(i64 768, ptr nonnull %22) #6
  call void @llvm.lifetime.start.p0(i64 768, ptr nonnull %23) #6
  call void @llvm.lifetime.start.p0(i64 768, ptr nonnull %24) #6
  call void @llvm.lifetime.start.p0(i64 840, ptr nonnull %25) #6
  call void @llvm.lifetime.start.p0(i64 456, ptr nonnull %26) #6
  %36 = and i32 %4, 31
  %.not55 = icmp eq i32 %36, 0
  br i1 %.not55, label %56, label %37

37:                                               ; preds = %35
  %38 = and i32 %4, 11
  %.not56 = icmp eq i32 %38, 0
  %spec.store.select = select i1 %.not56, i32 7, i32 13
  %39 = and i32 %4, 4
  %.not57 = icmp eq i32 %39, 0
  %spec.store.select1 = select i1 %.not57, i32 %spec.store.select, i32 15
  %40 = getelementptr inbounds i8, ptr %22, i64 80
  %41 = getelementptr inbounds i8, ptr %22, i64 232
  %42 = getelementptr inbounds i8, ptr %22, i64 312
  %43 = call noundef i32 %2(ptr noundef %3, i64 noundef -1, i64 noundef %1, i32 noundef 19, ptr noundef nonnull %22, ptr noundef nonnull %40, ptr noundef nonnull %41, ptr noundef nonnull %42)
  %.not59 = icmp slt i32 %43, %spec.store.select1
  br i1 %.not59, label %.critedge, label %44

44:                                               ; preds = %37
  %45 = call noundef double @_ZN3ptm18normalize_verticesEiPA3_dS1_(i32 noundef %43, ptr noundef nonnull %42, ptr noundef nonnull %26)
  %46 = getelementptr inbounds i8, ptr %25, i64 832
  store i8 0, ptr %46, align 8, !tbaa !18
  %47 = and i32 %4, 16
  %.not58 = icmp eq i32 %47, 0
  br i1 %.not58, label %50, label %48

48:                                               ; preds = %44
  %49 = call noundef i32 @_ZN3ptm13match_generalEPKNS_9refdata_tEPA3_dS4_PNS_12convexhull_tEPNS_8result_tE(ptr noundef nonnull @_ZN3ptmL12structure_scE, ptr noundef nonnull %26, ptr noundef nonnull %42, ptr noundef nonnull %25, ptr noundef nonnull %21)
  br label %50

50:                                               ; preds = %48, %44
  br i1 %.not56, label %53, label %51

51:                                               ; preds = %50
  %52 = call noundef i32 @_ZN3ptm17match_fcc_hcp_icoEPA3_dS1_iPNS_12convexhull_tEPNS_8result_tE(ptr noundef nonnull %26, ptr noundef nonnull %42, i32 noundef %4, ptr noundef nonnull %25, ptr noundef nonnull %21)
  br label %53

53:                                               ; preds = %51, %50
  br i1 %.not57, label %56, label %54

54:                                               ; preds = %53
  %55 = call noundef i32 @_ZN3ptm13match_generalEPKNS_9refdata_tEPA3_dS4_PNS_12convexhull_tEPNS_8result_tE(ptr noundef nonnull @_ZN3ptmL13structure_bccE, ptr noundef nonnull %26, ptr noundef nonnull %42, ptr noundef nonnull %25, ptr noundef nonnull %21)
  br label %56

56:                                               ; preds = %54, %53, %35
  %57 = and i32 %4, 96
  %.not60 = icmp eq i32 %57, 0
  br i1 %.not60, label %66, label %58

58:                                               ; preds = %56
  %59 = call noundef i32 @_ZN3ptm38calculate_two_shell_neighbour_orderingEiimPFiPvmmiPiPmS1_PA3_dES0_PNS_11atomicenv_tE(i32 noundef 4, i32 noundef 3, i64 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef nonnull %23)
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %66

61:                                               ; preds = %58
  %62 = getelementptr inbounds i8, ptr %23, i64 312
  %63 = call noundef double @_ZN3ptm18normalize_verticesEiPA3_dS1_(i32 noundef 17, ptr noundef nonnull %62, ptr noundef nonnull %26)
  %64 = getelementptr inbounds i8, ptr %25, i64 832
  store i8 0, ptr %64, align 8, !tbaa !18
  %65 = call noundef i32 @_ZN3ptm15match_dcub_dhexEPA3_dS1_iPNS_12convexhull_tEPNS_8result_tE(ptr noundef nonnull %26, ptr noundef nonnull %62, i32 noundef %4, ptr noundef nonnull %25, ptr noundef nonnull %21)
  br label %66

66:                                               ; preds = %58, %61, %56
  %67 = and i32 %4, 128
  %.not61 = icmp eq i32 %67, 0
  br i1 %.not61, label %74, label %68

68:                                               ; preds = %66
  %69 = call noundef i32 @_ZN3ptm38calculate_two_shell_neighbour_orderingEiimPFiPvmmiPiPmS1_PA3_dES0_PNS_11atomicenv_tE(i32 noundef 3, i32 noundef 2, i64 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef nonnull %24)
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %74

71:                                               ; preds = %68
  %72 = getelementptr inbounds i8, ptr %24, i64 312
  %73 = call noundef i32 @_ZN3ptm14match_grapheneEPA3_dPNS_8result_tE(ptr noundef nonnull %72, ptr noundef nonnull %21)
  br label %74

74:                                               ; preds = %68, %71, %66
  %75 = load ptr, ptr %31, align 8, !tbaa !11
  %76 = icmp eq ptr %75, null
  br i1 %76, label %.critedge, label %77

77:                                               ; preds = %74
  %78 = load i32, ptr %75, align 8, !tbaa !20
  switch i32 %78, label %.fold.split [
    i32 6, label %80
    i32 7, label %80
    i32 8, label %79
  ]

79:                                               ; preds = %77
  br label %80

.fold.split:                                      ; preds = %77
  br label %80

80:                                               ; preds = %77, %77, %.fold.split, %79
  %.0 = phi ptr [ %24, %79 ], [ %23, %77 ], [ %23, %77 ], [ %22, %.fold.split ]
  call void @_ZL11output_dataPN3ptm8result_tEPNS_11atomicenv_tEbPiS4_PdS5_S5_S5_S5_S5_S5_S5_S5_S4_PPA3_KdPa(ptr noundef nonnull %21, ptr noundef nonnull %.0, i1 noundef zeroext %5, ptr noundef nonnull %6, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18, ptr noundef %19)
  br label %.critedge

.critedge:                                        ; preds = %37, %74, %80
  %.1 = phi i32 [ 0, %80 ], [ 0, %74 ], [ -1, %37 ]
  call void @llvm.lifetime.end.p0(i64 456, ptr nonnull %26) #6
  call void @llvm.lifetime.end.p0(i64 840, ptr nonnull %25) #6
  call void @llvm.lifetime.end.p0(i64 768, ptr nonnull %24) #6
  call void @llvm.lifetime.end.p0(i64 768, ptr nonnull %23) #6
  call void @llvm.lifetime.end.p0(i64 768, ptr nonnull %22) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %21) #6
  ret i32 %.1
}

declare noundef double @_ZN3ptm18normalize_verticesEiPA3_dS1_(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare noundef i32 @_ZN3ptm13match_generalEPKNS_9refdata_tEPA3_dS4_PNS_12convexhull_tEPNS_8result_tE(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare noundef i32 @_ZN3ptm17match_fcc_hcp_icoEPA3_dS1_iPNS_12convexhull_tEPNS_8result_tE(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare noundef i32 @_ZN3ptm38calculate_two_shell_neighbour_orderingEiimPFiPvmmiPiPmS1_PA3_dES0_PNS_11atomicenv_tE(i32 noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare noundef i32 @_ZN3ptm15match_dcub_dhexEPA3_dS1_iPNS_12convexhull_tEPNS_8result_tE(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare noundef i32 @_ZN3ptm14match_grapheneEPA3_dPNS_8result_tE(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11output_dataPN3ptm8result_tEPNS_11atomicenv_tEbPiS4_PdS5_S5_S5_S5_S5_S5_S5_S5_S4_PPA3_KdPa(ptr noundef, ptr noundef, i1 noundef zeroext, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !14, i64 72}
!12 = !{!"_ZTSN3ptm8result_tE", !13, i64 0, !13, i64 8, !7, i64 16, !7, i64 48, !14, i64 72}
!13 = !{!"double", !7, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!12, !13, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!19, !6, i64 832}
!19 = !{!"_ZTSN3ptm12convexhull_tE", !7, i64 0, !7, i64 88, !7, i64 760, !7, i64 780, !7, i64 800, !17, i64 824, !17, i64 828, !6, i64 832}
!20 = !{!21, !17, i64 0}
!21 = !{!"_ZTSN3ptm9refdata_tE", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12, !17, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !17, i64 96, !14, i64 104, !17, i64 112, !14, i64 120, !14, i64 128, !14, i64 136, !14, i64 144}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass