; LLVM IR from gbanegas/CryptoSith :: gf/GField.ll (ZN11galoisfield6GField14generate_fieldEPKj)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.galoisfield::GField" = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11galoisfield6GField14generate_fieldEPKj(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 1, ptr %5, align 4, !tbaa !9
  %19 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 3
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !13
  %23 = zext i32 %22 to i64
  %24 = getelementptr inbounds i32, ptr %20, i64 %23
  store i32 0, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %68, %2
  %26 = load i32, ptr %6, align 4, !tbaa !9
  %27 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 0
  %28 = load i32, ptr %27, align 8, !tbaa !13
  %29 = icmp ult i32 %26, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %71

31:                                               ; preds = %25
  %32 = load i32, ptr %5, align 4, !tbaa !9
  %33 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 3
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = load i32, ptr %6, align 4, !tbaa !9
  %36 = zext i32 %35 to i64
  %37 = getelementptr inbounds i32, ptr %34, i64 %36
  store i32 %32, ptr %37, align 4, !tbaa !9
  %38 = load i32, ptr %6, align 4, !tbaa !9
  %39 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 4
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  %41 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 3
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = zext i32 %43 to i64
  %45 = getelementptr inbounds i32, ptr %42, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i32, ptr %40, i64 %47
  store i32 %38, ptr %48, align 4, !tbaa !9
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %49, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %65

55:                                               ; preds = %31
  %56 = load i32, ptr %5, align 4, !tbaa !9
  %57 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 3
  %58 = load ptr, ptr %57, align 8, !tbaa !11
  %59 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 0
  %60 = load i32, ptr %59, align 8, !tbaa !13
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds i32, ptr %58, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = xor i32 %63, %56
  store i32 %64, ptr %62, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %55, %31
  %66 = load i32, ptr %5, align 4, !tbaa !9
  %67 = shl i32 %66, 1
  store i32 %67, ptr %5, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %65
  %69 = load i32, ptr %6, align 4, !tbaa !9
  %70 = add i32 %69, 1
  store i32 %70, ptr %6, align 4, !tbaa !9
  br label %25, !llvm.loop !15

71:                                               ; preds = %30
  %72 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 0
  %73 = load i32, ptr %72, align 8, !tbaa !13
  %74 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 4
  %75 = load ptr, ptr %74, align 8, !tbaa !14
  %76 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 3
  %77 = load ptr, ptr %76, align 8, !tbaa !11
  %78 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 0
  %79 = load i32, ptr %78, align 8, !tbaa !13
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds i32, ptr %77, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr %75, i64 %83
  store i32 %73, ptr %84, align 4, !tbaa !9
  %85 = load i32, ptr %5, align 4, !tbaa !9
  %86 = ashr i32 %85, 1
  store i32 %86, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %87 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 0
  %88 = load i32, ptr %87, align 8, !tbaa !13
  %89 = add i32 %88, 1
  store i32 %89, ptr %7, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %156, %71
  %91 = load i32, ptr %7, align 4, !tbaa !9
  %92 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 1
  %93 = load i32, ptr %92, align 4, !tbaa !17
  %94 = icmp ult i32 %91, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %159

96:                                               ; preds = %90
  %97 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 3
  %98 = load ptr, ptr %97, align 8, !tbaa !11
  %99 = load i32, ptr %7, align 4, !tbaa !9
  %100 = sub i32 %99, 1
  %101 = zext i32 %100 to i64
  %102 = getelementptr inbounds i32, ptr %98, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = load i32, ptr %5, align 4, !tbaa !9
  %105 = icmp sge i32 %103, %104
  br i1 %105, label %106, label %130

106:                                              ; preds = %96
  %107 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 3
  %108 = load ptr, ptr %107, align 8, !tbaa !11
  %109 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 0
  %110 = load i32, ptr %109, align 8, !tbaa !13
  %111 = zext i32 %110 to i64
  %112 = getelementptr inbounds i32, ptr %108, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 3
  %115 = load ptr, ptr %114, align 8, !tbaa !11
  %116 = load i32, ptr %7, align 4, !tbaa !9
  %117 = sub i32 %116, 1
  %118 = zext i32 %117 to i64
  %119 = getelementptr inbounds i32, ptr %115, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !9
  %121 = load i32, ptr %5, align 4, !tbaa !9
  %122 = xor i32 %120, %121
  %123 = shl i32 %122, 1
  %124 = xor i32 %113, %123
  %125 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 3
  %126 = load ptr, ptr %125, align 8, !tbaa !11
  %127 = load i32, ptr %7, align 4, !tbaa !9
  %128 = zext i32 %127 to i64
  %129 = getelementptr inbounds i32, ptr %126, i64 %128
  store i32 %124, ptr %129, align 4, !tbaa !9
  br label %144

130:                                              ; preds = %96
  %131 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 3
  %132 = load ptr, ptr %131, align 8, !tbaa !11
  %133 = load i32, ptr %7, align 4, !tbaa !9
  %134 = sub i32 %133, 1
  %135 = zext i32 %134 to i64
  %136 = getelementptr inbounds i32, ptr %132, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !9
  %138 = shl i32 %137, 1
  %139 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 3
  %140 = load ptr, ptr %139, align 8, !tbaa !11
  %141 = load i32, ptr %7, align 4, !tbaa !9
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds i32, ptr %140, i64 %142
  store i32 %138, ptr %143, align 4, !tbaa !9
  br label %144

144:                                              ; preds = %130, %106
  %145 = load i32, ptr %7, align 4, !tbaa !9
  %146 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 4
  %147 = load ptr, ptr %146, align 8, !tbaa !14
  %148 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 3
  %149 = load ptr, ptr %148, align 8, !tbaa !11
  %150 = load i32, ptr %7, align 4, !tbaa !9
  %151 = zext i32 %150 to i64
  %152 = getelementptr inbounds i32, ptr %149, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !9
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds i32, ptr %147, i64 %154
  store i32 %145, ptr %155, align 4, !tbaa !9
  br label %156

156:                                              ; preds = %144
  %157 = load i32, ptr %7, align 4, !tbaa !9
  %158 = add i32 %157, 1
  store i32 %158, ptr %7, align 4, !tbaa !9
  br label %90, !llvm.loop !18

159:                                              ; preds = %95
  %160 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 4
  %161 = load ptr, ptr %160, align 8, !tbaa !14
  %162 = getelementptr inbounds i32, ptr %161, i64 0
  store i32 -1, ptr %162, align 4, !tbaa !9
  %163 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 3
  %164 = load ptr, ptr %163, align 8, !tbaa !11
  %165 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 1
  %166 = load i32, ptr %165, align 4, !tbaa !17
  %167 = zext i32 %166 to i64
  %168 = getelementptr inbounds i32, ptr %164, i64 %167
  store i32 1, ptr %168, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %169

169:                                              ; preds = %224, %159
  %170 = load i32, ptr %8, align 4, !tbaa !9
  %171 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 1
  %172 = load i32, ptr %171, align 4, !tbaa !17
  %173 = add i32 %172, 1
  %174 = icmp ult i32 %170, %173
  br i1 %174, label %176, label %175

175:                                              ; preds = %169
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %227

176:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %177

177:                                              ; preds = %220, %176
  %178 = load i32, ptr %10, align 4, !tbaa !9
  %179 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 1
  %180 = load i32, ptr %179, align 4, !tbaa !17
  %181 = add i32 %180, 1
  %182 = icmp ult i32 %178, %181
  br i1 %182, label %184, label %183

183:                                              ; preds = %177
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %223

184:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %185 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %185, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %186 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %186, ptr %12, align 4, !tbaa !9
  %187 = call noundef i32 @_ZN11galoisfield6GField7gen_mulERKiS2_(ptr noundef nonnull align 8 dereferenceable(64) %18, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %188 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 6
  %189 = load ptr, ptr %188, align 8, !tbaa !19
  %190 = load i32, ptr %8, align 4, !tbaa !9
  %191 = zext i32 %190 to i64
  %192 = getelementptr inbounds ptr, ptr %189, i64 %191
  %193 = load ptr, ptr %192, align 8, !tbaa !5
  %194 = load i32, ptr %10, align 4, !tbaa !9
  %195 = zext i32 %194 to i64
  %196 = getelementptr inbounds i32, ptr %193, i64 %195
  store i32 %187, ptr %196, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %197 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %197, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %198 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %198, ptr %14, align 4, !tbaa !9
  %199 = call noundef i32 @_ZN11galoisfield6GField7gen_divERKiS2_(ptr noundef nonnull align 8 dereferenceable(64) %18, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %200 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 7
  %201 = load ptr, ptr %200, align 8, !tbaa !20
  %202 = load i32, ptr %8, align 4, !tbaa !9
  %203 = zext i32 %202 to i64
  %204 = getelementptr inbounds ptr, ptr %201, i64 %203
  %205 = load ptr, ptr %204, align 8, !tbaa !5
  %206 = load i32, ptr %10, align 4, !tbaa !9
  %207 = zext i32 %206 to i64
  %208 = getelementptr inbounds i32, ptr %205, i64 %207
  store i32 %199, ptr %208, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %209 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %209, ptr %15, align 4, !tbaa !9
  %210 = call noundef i32 @_ZN11galoisfield6GField7gen_expERKiRKj(ptr noundef nonnull align 8 dereferenceable(64) %18, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %211 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 8
  %212 = load ptr, ptr %211, align 8, !tbaa !21
  %213 = load i32, ptr %8, align 4, !tbaa !9
  %214 = zext i32 %213 to i64
  %215 = getelementptr inbounds ptr, ptr %212, i64 %214
  %216 = load ptr, ptr %215, align 8, !tbaa !5
  %217 = load i32, ptr %10, align 4, !tbaa !9
  %218 = zext i32 %217 to i64
  %219 = getelementptr inbounds i32, ptr %216, i64 %218
  store i32 %210, ptr %219, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  br label %220

220:                                              ; preds = %184
  %221 = load i32, ptr %10, align 4, !tbaa !9
  %222 = add i32 %221, 1
  store i32 %222, ptr %10, align 4, !tbaa !9
  br label %177, !llvm.loop !22

223:                                              ; preds = %183
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %8, align 4, !tbaa !9
  %226 = add i32 %225, 1
  store i32 %226, ptr %8, align 4, !tbaa !9
  br label %169, !llvm.loop !23

227:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %228

228:                                              ; preds = %258, %227
  %229 = load i32, ptr %16, align 4, !tbaa !9
  %230 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 1
  %231 = load i32, ptr %230, align 4, !tbaa !17
  %232 = add i32 %231, 1
  %233 = icmp ult i32 %229, %232
  br i1 %233, label %235, label %234

234:                                              ; preds = %228
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %261

235:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %236 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %236, ptr %17, align 4, !tbaa !9
  %237 = call noundef i32 @_ZN11galoisfield6GField11gen_inverseERKi(ptr noundef nonnull align 8 dereferenceable(64) %18, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %238 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 5
  %239 = load ptr, ptr %238, align 8, !tbaa !24
  %240 = load i32, ptr %16, align 4, !tbaa !9
  %241 = zext i32 %240 to i64
  %242 = getelementptr inbounds i32, ptr %239, i64 %241
  store i32 %237, ptr %242, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  %243 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 5
  %244 = load ptr, ptr %243, align 8, !tbaa !24
  %245 = load i32, ptr %16, align 4, !tbaa !9
  %246 = zext i32 %245 to i64
  %247 = getelementptr inbounds i32, ptr %244, i64 %246
  %248 = load i32, ptr %247, align 4, !tbaa !9
  %249 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 5
  %250 = load ptr, ptr %249, align 8, !tbaa !24
  %251 = load i32, ptr %16, align 4, !tbaa !9
  %252 = getelementptr inbounds %"class.galoisfield::GField", ptr %18, i32 0, i32 1
  %253 = load i32, ptr %252, align 4, !tbaa !17
  %254 = add i32 %253, 1
  %255 = add i32 %251, %254
  %256 = zext i32 %255 to i64
  %257 = getelementptr inbounds i32, ptr %250, i64 %256
  store i32 %248, ptr %257, align 4, !tbaa !9
  br label %258

258:                                              ; preds = %235
  %259 = load i32, ptr %16, align 4, !tbaa !9
  %260 = add i32 %259, 1
  store i32 %260, ptr %16, align 4, !tbaa !9
  br label %228, !llvm.loop !25

261:                                              ; preds = %234
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11galoisfield6GField7gen_mulERKiS2_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11galoisfield6GField7gen_divERKiS2_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11galoisfield6GField7gen_expERKiRKj(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11galoisfield6GField11gen_inverseERKi(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

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

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

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


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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN11galoisfield6GField14generate_fieldEPKj(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = load i32, ptr %0, align 8, !tbaa !11
  %13 = zext i32 %12 to i64
  %14 = getelementptr inbounds i32, ptr %11, i64 %13
  store i32 0, ptr %14, align 4, !tbaa !12
  %15 = load i32, ptr %0, align 8, !tbaa !11
  %.not64 = icmp eq i32 %15, 0
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 24
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !13
  br i1 %.not64, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %39
  %16 = ashr exact i32 %40, 1
  br label %._crit_edge

._crit_edge:                                      ; preds = %2, %._crit_edge.loopexit
  %.039.lcssa = phi i32 [ %16, %._crit_edge.loopexit ], [ 0, %2 ]
  %.lcssa44 = phi i32 [ %41, %._crit_edge.loopexit ], [ 0, %2 ]
  %17 = zext i32 %.lcssa44 to i64
  %18 = getelementptr inbounds i32, ptr %11, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !12
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds i32, ptr %.pre, i64 %20
  store i32 %.lcssa44, ptr %21, align 4, !tbaa !12
  %22 = load i32, ptr %0, align 8, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %0, i64 4
  %.03748 = add i32 %22, 1
  %24 = load i32, ptr %23, align 4, !tbaa !14
  %25 = icmp ult i32 %.03748, %24
  br i1 %25, label %.lr.ph52.preheader, label %._crit_edge53

.lr.ph52.preheader:                               ; preds = %._crit_edge
  %26 = zext i32 %.03748 to i64
  br label %.lr.ph52

.lr.ph:                                           ; preds = %2, %39
  %indvars.iv = phi i64 [ %indvars.iv.next, %39 ], [ 0, %2 ]
  %.03945 = phi i32 [ %40, %39 ], [ 1, %2 ]
  %27 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv
  store i32 %.03945, ptr %27, align 4, !tbaa !12
  %28 = sext i32 %.03945 to i64
  %29 = getelementptr inbounds i32, ptr %.pre, i64 %28
  %30 = trunc nuw i64 %indvars.iv to i32
  store i32 %30, ptr %29, align 4, !tbaa !12
  %31 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
  %32 = load i32, ptr %31, align 4, !tbaa !12
  %.not43 = icmp eq i32 %32, 0
  br i1 %.not43, label %39, label %33

33:                                               ; preds = %.lr.ph
  %34 = load i32, ptr %0, align 8, !tbaa !11
  %35 = zext i32 %34 to i64
  %36 = getelementptr inbounds i32, ptr %11, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !12
  %38 = xor i32 %37, %.03945
  store i32 %38, ptr %36, align 4, !tbaa !12
  br label %39

39:                                               ; preds = %33, %.lr.ph
  %40 = shl i32 %.03945, 1
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %41 = load i32, ptr %0, align 8, !tbaa !11
  %42 = zext i32 %41 to i64
  %43 = icmp ult i64 %indvars.iv.next, %42
  br i1 %43, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !15

._crit_edge53:                                    ; preds = %64, %._crit_edge
  store i32 -1, ptr %.pre, align 4, !tbaa !12
  %44 = load i32, ptr %23, align 4, !tbaa !14
  %45 = zext i32 %44 to i64
  %46 = getelementptr inbounds i32, ptr %11, i64 %45
  store i32 1, ptr %46, align 4, !tbaa !12
  %47 = load i32, ptr %23, align 4, !tbaa !14
  %.not65 = icmp eq i32 %47, -1
  br i1 %.not65, label %._crit_edge63, label %.lr.ph60

.lr.ph60:                                         ; preds = %._crit_edge53
  %48 = getelementptr inbounds i8, ptr %0, i64 40
  %49 = getelementptr inbounds i8, ptr %0, i64 48
  %50 = getelementptr inbounds i8, ptr %0, i64 56
  br label %74

.lr.ph52:                                         ; preds = %.lr.ph52.preheader, %64
  %indvars.iv70 = phi i64 [ %26, %.lr.ph52.preheader ], [ %indvars.iv.next71, %64 ]
  %.037.in49 = phi i32 [ %22, %.lr.ph52.preheader ], [ %68, %64 ]
  %51 = zext i32 %.037.in49 to i64
  %52 = getelementptr inbounds i32, ptr %11, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !12
  %.not = icmp slt i32 %53, %.039.lcssa
  br i1 %.not, label %62, label %54

54:                                               ; preds = %.lr.ph52
  %55 = load i32, ptr %0, align 8, !tbaa !11
  %56 = zext i32 %55 to i64
  %57 = getelementptr inbounds i32, ptr %11, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !12
  %59 = xor i32 %53, %.039.lcssa
  %60 = shl i32 %59, 1
  %61 = xor i32 %58, %60
  br label %64

62:                                               ; preds = %.lr.ph52
  %63 = shl i32 %53, 1
  br label %64

64:                                               ; preds = %62, %54
  %.sink = phi i32 [ %63, %62 ], [ %61, %54 ]
  %65 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv70
  store i32 %.sink, ptr %65, align 4
  %66 = sext i32 %.sink to i64
  %67 = getelementptr inbounds i32, ptr %.pre, i64 %66
  %68 = trunc nuw i64 %indvars.iv70 to i32
  store i32 %68, ptr %67, align 4, !tbaa !12
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %69 = load i32, ptr %23, align 4, !tbaa !14
  %70 = zext i32 %69 to i64
  %71 = icmp ult i64 %indvars.iv.next71, %70
  br i1 %71, label %.lr.ph52, label %._crit_edge53, !llvm.loop !17

.preheader:                                       ; preds = %._crit_edge57
  %72 = icmp eq i32 %105, -1
  br i1 %72, label %._crit_edge63, label %.lr.ph62

.lr.ph62:                                         ; preds = %.preheader
  %73 = getelementptr inbounds i8, ptr %0, i64 32
  br label %108

74:                                               ; preds = %.lr.ph60, %._crit_edge57
  %75 = phi i32 [ %47, %.lr.ph60 ], [ %105, %._crit_edge57 ]
  %indvars.iv73 = phi i64 [ 0, %.lr.ph60 ], [ %indvars.iv.next74, %._crit_edge57 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #2
  store i32 0, ptr %3, align 4, !tbaa !12
  %.not66 = icmp eq i32 %75, -1
  br i1 %.not66, label %.preheader.thread81, label %.lr.ph56

.lr.ph56:                                         ; preds = %74
  %76 = trunc nuw i64 %indvars.iv73 to i32
  br label %80

._crit_edge57:                                    ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #2
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %77 = add i32 %105, 1
  %78 = zext i32 %77 to i64
  %79 = icmp ult i64 %indvars.iv.next74, %78
  br i1 %79, label %74, label %.preheader, !llvm.loop !18

.preheader.thread81:                              ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #2
  br label %._crit_edge63

80:                                               ; preds = %.lr.ph56, %80
  %storemerge54 = phi i32 [ 0, %.lr.ph56 ], [ %104, %80 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #2
  store i32 %76, ptr %4, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #2
  store i32 %storemerge54, ptr %5, align 4, !tbaa !12
  %81 = call noundef i32 @_ZN11galoisfield6GField7gen_mulERKiS2_(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %82 = load ptr, ptr %48, align 8, !tbaa !19
  %83 = getelementptr inbounds ptr, ptr %82, i64 %indvars.iv73
  %84 = load ptr, ptr %83, align 8, !tbaa !20
  %85 = load i32, ptr %3, align 4, !tbaa !12
  %86 = zext i32 %85 to i64
  %87 = getelementptr inbounds i32, ptr %84, i64 %86
  store i32 %81, ptr %87, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #2
  store i32 %76, ptr %6, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #2
  %88 = load i32, ptr %3, align 4, !tbaa !12
  store i32 %88, ptr %7, align 4, !tbaa !12
  %89 = call noundef i32 @_ZN11galoisfield6GField7gen_divERKiS2_(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %90 = load ptr, ptr %49, align 8, !tbaa !21
  %91 = getelementptr inbounds ptr, ptr %90, i64 %indvars.iv73
  %92 = load ptr, ptr %91, align 8, !tbaa !20
  %93 = load i32, ptr %3, align 4, !tbaa !12
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds i32, ptr %92, i64 %94
  store i32 %89, ptr %95, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #2
  store i32 %76, ptr %8, align 4, !tbaa !12
  %96 = call noundef i32 @_ZN11galoisfield6GField7gen_expERKiRKj(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %97 = load ptr, ptr %50, align 8, !tbaa !22
  %98 = getelementptr inbounds ptr, ptr %97, i64 %indvars.iv73
  %99 = load ptr, ptr %98, align 8, !tbaa !20
  %100 = load i32, ptr %3, align 4, !tbaa !12
  %101 = zext i32 %100 to i64
  %102 = getelementptr inbounds i32, ptr %99, i64 %101
  store i32 %96, ptr %102, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #2
  %103 = load i32, ptr %3, align 4, !tbaa !12
  %104 = add i32 %103, 1
  store i32 %104, ptr %3, align 4, !tbaa !12
  %105 = load i32, ptr %23, align 4, !tbaa !14
  %106 = add i32 %105, 1
  %107 = icmp ult i32 %104, %106
  br i1 %107, label %80, label %._crit_edge57, !llvm.loop !23

._crit_edge63:                                    ; preds = %108, %._crit_edge53, %.preheader.thread81, %.preheader
  ret void

108:                                              ; preds = %.lr.ph62, %108
  %indvars.iv76 = phi i64 [ 0, %.lr.ph62 ], [ %indvars.iv.next77, %108 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #2
  %109 = trunc nuw i64 %indvars.iv76 to i32
  store i32 %109, ptr %9, align 4, !tbaa !12
  %110 = call noundef i32 @_ZN11galoisfield6GField11gen_inverseERKi(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %111 = load ptr, ptr %73, align 8, !tbaa !24
  %112 = getelementptr inbounds i32, ptr %111, i64 %indvars.iv76
  store i32 %110, ptr %112, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #2
  %113 = load i32, ptr %112, align 4, !tbaa !12
  %114 = load i32, ptr %23, align 4, !tbaa !14
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %115 = trunc nuw i64 %indvars.iv.next77 to i32
  %116 = add i32 %114, %115
  %117 = zext i32 %116 to i64
  %118 = getelementptr inbounds i32, ptr %111, i64 %117
  store i32 %113, ptr %118, align 4, !tbaa !12
  %119 = load i32, ptr %23, align 4, !tbaa !14
  %120 = add i32 %119, 1
  %121 = zext i32 %120 to i64
  %122 = icmp ult i64 %indvars.iv.next77, %121
  br i1 %122, label %108, label %._crit_edge63, !llvm.loop !25
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11galoisfield6GField7gen_mulERKiS2_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11galoisfield6GField7gen_divERKiS2_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11galoisfield6GField7gen_expERKiRKj(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11galoisfield6GField11gen_inverseERKi(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

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


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