; LLVM IR from specinfo-ua/UAPKI :: library/uapkic/src (ec-internal)

; 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.EcParamsCtx_st = type { i32, ptr, ptr, ptr, ptr, i8, i64, ptr, ptr, i32, ptr }
%struct.EC2m_st = type { ptr, i64, ptr, i64 }
%struct.WordArray_st = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@all_compress_mulp = external hidden global [14 x ptr], align 16
@ROOT1_ALL_ONB = external hidden global [14 x ptr], align 16
@ROOT2_ALL_ONB = external hidden global [14 x ptr], align 16

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

; Function Attrs: nounwind uwtable
declare hidden i32 @get_defaut_ind_onb(i64 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @init_onb_params(ptr noundef %0, i64 noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store ptr null, ptr %14, align 8, !tbaa !5
  %15 = load i64, ptr %4, align 8, !tbaa !9
  %16 = call i32 @get_defaut_ind_onb(i64 noundef %15)
  store i32 %16, ptr %6, align 4, !tbaa !11
  br label %17

17:                                               ; preds = %2
  %18 = load i32, ptr %6, align 4, !tbaa !11
  %19 = icmp sge i32 %18, 0
  br i1 %19, label %22, label %20

20:                                               ; preds = %17
  store i32 2, ptr %5, align 4, !tbaa !11
  %21 = load i32, ptr %5, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 1036, i32 noundef %21, ptr noundef null)
  br label %217

22:                                               ; preds = %17
  br label %23

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  %26 = load i64, ptr %4, align 8, !tbaa !9
  %27 = mul i64 2, %26
  %28 = sub i64 %27, 1
  %29 = mul i64 %28, 2
  %30 = call noalias ptr @malloc(i64 noundef %29) #8
  store ptr %30, ptr %10, align 8, !tbaa !5
  %31 = icmp eq ptr null, %30
  br i1 %31, label %32, label %34

32:                                               ; preds = %25
  store i32 1, ptr %5, align 4, !tbaa !11
  %33 = load i32, ptr %5, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 1038, i32 noundef %33, ptr noundef null)
  br label %217

34:                                               ; preds = %25
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  %38 = load i32, ptr %6, align 4, !tbaa !11
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [14 x ptr], ptr @all_compress_mulp, i64 0, i64 %39
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %42 = load i64, ptr %4, align 8, !tbaa !9
  %43 = mul i64 2, %42
  %44 = sub i64 %43, 1
  %45 = mul i64 %44, 9
  %46 = add i64 %45, 63
  %47 = udiv i64 %46, 64
  %48 = mul i64 8, %47
  %49 = call ptr @wa_alloc_from_le(ptr noundef %41, i64 noundef %48)
  store ptr %49, ptr %9, align 8, !tbaa !5
  %50 = icmp eq ptr null, %49
  br i1 %50, label %51, label %53

51:                                               ; preds = %37
  store i32 2, ptr %5, align 4, !tbaa !11
  %52 = load i32, ptr %5, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1039, i32 noundef %52)
  br label %217

53:                                               ; preds = %37
  br label %54

54:                                               ; preds = %53
  br label %55

55:                                               ; preds = %54
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  call void @decompress_matrix(ptr noundef %56, ptr noundef %57)
  %58 = load i64, ptr %4, align 8, !tbaa !9
  %59 = add i64 %58, 64
  %60 = sub i64 %59, 1
  %61 = lshr i64 %60, 6
  store i64 %61, ptr %7, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %55
  %63 = load i32, ptr %6, align 4, !tbaa !11
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [14 x ptr], ptr @ROOT1_ALL_ONB, i64 0, i64 %64
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = load i64, ptr %7, align 8, !tbaa !9
  %68 = mul i64 %67, 8
  %69 = call ptr @wa_alloc_from_le(ptr noundef %66, i64 noundef %68)
  store ptr %69, ptr %13, align 8, !tbaa !5
  %70 = icmp eq ptr null, %69
  br i1 %70, label %71, label %73

71:                                               ; preds = %62
  store i32 2, ptr %5, align 4, !tbaa !11
  %72 = load i32, ptr %5, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1044, i32 noundef %72)
  br label %217

73:                                               ; preds = %62
  br label %74

74:                                               ; preds = %73
  br label %75

75:                                               ; preds = %74
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %6, align 4, !tbaa !11
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [14 x ptr], ptr @ROOT2_ALL_ONB, i64 0, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = load i64, ptr %7, align 8, !tbaa !9
  %82 = mul i64 %81, 8
  %83 = call ptr @wa_alloc_from_le(ptr noundef %80, i64 noundef %82)
  store ptr %83, ptr %14, align 8, !tbaa !5
  %84 = icmp eq ptr null, %83
  br i1 %84, label %85, label %87

85:                                               ; preds = %76
  store i32 2, ptr %5, align 4, !tbaa !11
  %86 = load i32, ptr %5, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1045, i32 noundef %86)
  br label %217

87:                                               ; preds = %76
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  %91 = load i64, ptr %4, align 8, !tbaa !9
  %92 = mul i64 %91, 8
  %93 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %92) #9
  store ptr %93, ptr %11, align 8, !tbaa !5
  %94 = icmp eq ptr null, %93
  br i1 %94, label %95, label %97

95:                                               ; preds = %90
  store i32 1, ptr %5, align 4, !tbaa !11
  %96 = load i32, ptr %5, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 1047, i32 noundef %96, ptr noundef null)
  br label %217

97:                                               ; preds = %90
  br label %98

98:                                               ; preds = %97
  br label %99

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99
  %101 = load i64, ptr %4, align 8, !tbaa !9
  %102 = mul i64 %101, 8
  %103 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %102) #9
  store ptr %103, ptr %12, align 8, !tbaa !5
  %104 = icmp eq ptr null, %103
  br i1 %104, label %105, label %107

105:                                              ; preds = %100
  store i32 1, ptr %5, align 4, !tbaa !11
  %106 = load i32, ptr %5, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 1048, i32 noundef %106, ptr noundef null)
  br label %217

107:                                              ; preds = %100
  br label %108

108:                                              ; preds = %107
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  %111 = load ptr, ptr %13, align 8, !tbaa !5
  %112 = call ptr @wa_copy_with_alloc(ptr noundef %111)
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  %114 = getelementptr inbounds ptr, ptr %113, i64 0
  store ptr %112, ptr %114, align 8, !tbaa !5
  %115 = icmp eq ptr null, %112
  br i1 %115, label %116, label %118

116:                                              ; preds = %110
  store i32 2, ptr %5, align 4, !tbaa !11
  %117 = load i32, ptr %5, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1051, i32 noundef %117)
  br label %217

118:                                              ; preds = %110
  br label %119

119:                                              ; preds = %118
  br label %120

120:                                              ; preds = %119
  store i64 1, ptr %8, align 8, !tbaa !9
  br label %121

121:                                              ; preds = %152, %120
  %122 = load i64, ptr %8, align 8, !tbaa !9
  %123 = load i64, ptr %4, align 8, !tbaa !9
  %124 = icmp ult i64 %122, %123
  br i1 %124, label %125, label %155

125:                                              ; preds = %121
  br label %126

126:                                              ; preds = %125
  %127 = load i64, ptr %7, align 8, !tbaa !9
  %128 = call ptr @wa_alloc(i64 noundef %127)
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  %130 = load i64, ptr %8, align 8, !tbaa !9
  %131 = getelementptr inbounds ptr, ptr %129, i64 %130
  store ptr %128, ptr %131, align 8, !tbaa !5
  %132 = icmp eq ptr null, %128
  br i1 %132, label %133, label %135

133:                                              ; preds = %126
  store i32 2, ptr %5, align 4, !tbaa !11
  %134 = load i32, ptr %5, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1053, i32 noundef %134)
  br label %217

135:                                              ; preds = %126
  br label %136

136:                                              ; preds = %135
  br label %137

137:                                              ; preds = %136
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.EcParamsCtx_st, ptr %138, i32 0, i32 4
  %140 = load ptr, ptr %139, align 8, !tbaa !13
  %141 = getelementptr inbounds %struct.EC2m_st, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !16
  %143 = load ptr, ptr %11, align 8, !tbaa !5
  %144 = load i64, ptr %8, align 8, !tbaa !9
  %145 = sub i64 %144, 1
  %146 = getelementptr inbounds ptr, ptr %143, i64 %145
  %147 = load ptr, ptr %146, align 8, !tbaa !5
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  %149 = load i64, ptr %8, align 8, !tbaa !9
  %150 = getelementptr inbounds ptr, ptr %148, i64 %149
  %151 = load ptr, ptr %150, align 8, !tbaa !5
  call void @gf2m_mod_sqr(ptr noundef %142, ptr noundef %147, ptr noundef %151)
  br label %152

152:                                              ; preds = %137
  %153 = load i64, ptr %8, align 8, !tbaa !9
  %154 = add i64 %153, 1
  store i64 %154, ptr %8, align 8, !tbaa !9
  br label %121, !llvm.loop !18

155:                                              ; preds = %121
  br label %156

156:                                              ; preds = %155
  %157 = load i64, ptr %7, align 8, !tbaa !9
  %158 = call ptr @wa_alloc(i64 noundef %157)
  %159 = load ptr, ptr %12, align 8, !tbaa !5
  %160 = getelementptr inbounds ptr, ptr %159, i64 0
  store ptr %158, ptr %160, align 8, !tbaa !5
  %161 = icmp eq ptr null, %158
  br i1 %161, label %162, label %164

162:                                              ; preds = %156
  store i32 2, ptr %5, align 4, !tbaa !11
  %163 = load i32, ptr %5, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1058, i32 noundef %163)
  br label %217

164:                                              ; preds = %156
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %12, align 8, !tbaa !5
  %168 = getelementptr inbounds ptr, ptr %167, i64 0
  %169 = load ptr, ptr %168, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.WordArray_st, ptr %169, i32 0, i32 0
  %171 = load ptr, ptr %170, align 8, !tbaa !20
  %172 = load i64, ptr %7, align 8, !tbaa !9
  %173 = mul i64 %172, 8
  call void @llvm.memset.p0.i64(ptr align 8 %171, i8 -1, i64 %173, i1 false)
  %174 = load ptr, ptr %12, align 8, !tbaa !5
  %175 = getelementptr inbounds ptr, ptr %174, i64 0
  %176 = load ptr, ptr %175, align 8, !tbaa !5
  %177 = load i64, ptr %4, align 8, !tbaa !9
  call void @int_truncate(ptr noundef %176, i64 noundef %177)
  store i64 1, ptr %8, align 8, !tbaa !9
  br label %178

178:                                              ; preds = %207, %166
  %179 = load i64, ptr %8, align 8, !tbaa !9
  %180 = load i64, ptr %4, align 8, !tbaa !9
  %181 = icmp ult i64 %179, %180
  br i1 %181, label %182, label %210

182:                                              ; preds = %178
  br label %183

183:                                              ; preds = %182
  %184 = load i64, ptr %7, align 8, !tbaa !9
  %185 = call ptr @wa_alloc(i64 noundef %184)
  %186 = load ptr, ptr %12, align 8, !tbaa !5
  %187 = load i64, ptr %8, align 8, !tbaa !9
  %188 = getelementptr inbounds ptr, ptr %186, i64 %187
  store ptr %185, ptr %188, align 8, !tbaa !5
  %189 = icmp eq ptr null, %185
  br i1 %189, label %190, label %192

190:                                              ; preds = %183
  store i32 2, ptr %5, align 4, !tbaa !11
  %191 = load i32, ptr %5, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1063, i32 noundef %191)
  br label %217

192:                                              ; preds = %183
  br label %193

193:                                              ; preds = %192
  br label %194

194:                                              ; preds = %193
  %195 = load ptr, ptr %12, align 8, !tbaa !5
  %196 = load i64, ptr %8, align 8, !tbaa !9
  %197 = sub i64 %196, 1
  %198 = getelementptr inbounds ptr, ptr %195, i64 %197
  %199 = load ptr, ptr %198, align 8, !tbaa !5
  %200 = load ptr, ptr %14, align 8, !tbaa !5
  %201 = load ptr, ptr %10, align 8, !tbaa !5
  %202 = load i64, ptr %4, align 8, !tbaa !9
  %203 = load ptr, ptr %12, align 8, !tbaa !5
  %204 = load i64, ptr %8, align 8, !tbaa !9
  %205 = getelementptr inbounds ptr, ptr %203, i64 %204
  %206 = load ptr, ptr %205, align 8, !tbaa !5
  call void @multiply_onb(ptr noundef %199, ptr noundef %200, ptr noundef %201, i64 noundef %202, ptr noundef %206)
  br label %207

207:                                              ; preds = %194
  %208 = load i64, ptr %8, align 8, !tbaa !9
  %209 = add i64 %208, 1
  store i64 %209, ptr %8, align 8, !tbaa !9
  br label %178, !llvm.loop !22

210:                                              ; preds = %178
  %211 = load ptr, ptr %11, align 8, !tbaa !5
  %212 = load ptr, ptr %3, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.EcParamsCtx_st, ptr %212, i32 0, i32 7
  store ptr %211, ptr %213, align 8, !tbaa !23
  %214 = load ptr, ptr %12, align 8, !tbaa !5
  %215 = load ptr, ptr %3, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.EcParamsCtx_st, ptr %215, i32 0, i32 8
  store ptr %214, ptr %216, align 8, !tbaa !24
  store ptr null, ptr %11, align 8, !tbaa !5
  store ptr null, ptr %12, align 8, !tbaa !5
  br label %217

217:                                              ; preds = %210, %190, %162, %133, %116, %105, %95, %85, %71, %51, %32, %20
  %218 = load ptr, ptr %9, align 8, !tbaa !5
  call void @wa_free(ptr noundef %218)
  %219 = load ptr, ptr %13, align 8, !tbaa !5
  call void @wa_free(ptr noundef %219)
  %220 = load ptr, ptr %14, align 8, !tbaa !5
  call void @wa_free(ptr noundef %220)
  %221 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %221) #7
  %222 = load ptr, ptr %11, align 8, !tbaa !5
  %223 = icmp ne ptr %222, null
  br i1 %223, label %224, label %239

224:                                              ; preds = %217
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %225

225:                                              ; preds = %234, %224
  %226 = load i64, ptr %8, align 8, !tbaa !9
  %227 = load i64, ptr %4, align 8, !tbaa !9
  %228 = icmp ult i64 %226, %227
  br i1 %228, label %229, label %237

229:                                              ; preds = %225
  %230 = load ptr, ptr %11, align 8, !tbaa !5
  %231 = load i64, ptr %8, align 8, !tbaa !9
  %232 = getelementptr inbounds ptr, ptr %230, i64 %231
  %233 = load ptr, ptr %232, align 8, !tbaa !5
  call void @wa_free(ptr noundef %233)
  br label %234

234:                                              ; preds = %229
  %235 = load i64, ptr %8, align 8, !tbaa !9
  %236 = add i64 %235, 1
  store i64 %236, ptr %8, align 8, !tbaa !9
  br label %225, !llvm.loop !25

237:                                              ; preds = %225
  %238 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %238) #7
  br label %239

239:                                              ; preds = %237, %217
  %240 = load ptr, ptr %12, align 8, !tbaa !5
  %241 = icmp ne ptr %240, null
  br i1 %241, label %242, label %257

242:                                              ; preds = %239
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %243

243:                                              ; preds = %252, %242
  %244 = load i64, ptr %8, align 8, !tbaa !9
  %245 = load i64, ptr %4, align 8, !tbaa !9
  %246 = icmp ult i64 %244, %245
  br i1 %246, label %247, label %255

247:                                              ; preds = %243
  %248 = load ptr, ptr %12, align 8, !tbaa !5
  %249 = load i64, ptr %8, align 8, !tbaa !9
  %250 = getelementptr inbounds ptr, ptr %248, i64 %249
  %251 = load ptr, ptr %250, align 8, !tbaa !5
  call void @wa_free(ptr noundef %251)
  br label %252

252:                                              ; preds = %247
  %253 = load i64, ptr %8, align 8, !tbaa !9
  %254 = add i64 %253, 1
  store i64 %254, ptr %8, align 8, !tbaa !9
  br label %243, !llvm.loop !26

255:                                              ; preds = %243
  %256 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %256) #7
  br label %257

257:                                              ; preds = %255, %239
  %258 = load i32, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  ret i32 %258
}

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

declare ptr @wa_alloc_from_le(ptr noundef, i64 noundef) #2

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @decompress_matrix(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #4

declare ptr @wa_copy_with_alloc(ptr noundef) #2

declare ptr @wa_alloc(i64 noundef) #2

declare void @gf2m_mod_sqr(ptr noundef, ptr noundef, ptr noundef) #2

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

declare void @int_truncate(ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @multiply_onb(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

declare void @wa_free(ptr noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind allocsize(0,1) "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind allocsize(0,1) }

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

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


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

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@all_compress_mulp = external hidden local_unnamed_addr global [14 x ptr], align 16
@ROOT1_ALL_ONB = external hidden local_unnamed_addr global [14 x ptr], align 16
@ROOT2_ALL_ONB = external hidden local_unnamed_addr global [14 x ptr], align 16

; Function Attrs: nounwind uwtable
declare hidden i32 @get_defaut_ind_onb(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 3) i32 @init_onb_params(ptr nocapture noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = tail call i32 @get_defaut_ind_onb(i64 noundef %1)
  %4 = icmp sgt i32 %3, -1
  br i1 %4, label %6, label %5

5:                                                ; preds = %2
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 1036, i32 noundef 2, ptr noundef null) #6
  br label %81

6:                                                ; preds = %2
  %7 = shl i64 %1, 1
  %8 = add i64 %7, -1
  %9 = shl i64 %8, 1
  %10 = tail call noalias ptr @malloc(i64 noundef %9) #7
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %13

12:                                               ; preds = %6
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 1038, i32 noundef 1, ptr noundef null) #6
  br label %81

13:                                               ; preds = %6
  %14 = zext nneg i32 %3 to i64
  %15 = getelementptr inbounds [14 x ptr], ptr @all_compress_mulp, i64 0, i64 %14
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %17 = mul i64 %8, 9
  %18 = add i64 %17, 63
  %19 = lshr i64 %18, 3
  %20 = and i64 %19, 2305843009213693944
  %21 = tail call ptr @wa_alloc_from_le(ptr noundef %16, i64 noundef %20) #6
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %24

23:                                               ; preds = %13
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 1039, i32 noundef 2) #6
  br label %81

24:                                               ; preds = %13
  tail call void @decompress_matrix(ptr noundef nonnull %21, ptr noundef nonnull %10)
  %25 = add i64 %1, 63
  %26 = lshr i64 %25, 6
  %27 = getelementptr inbounds [14 x ptr], ptr @ROOT1_ALL_ONB, i64 0, i64 %14
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = shl nuw nsw i64 %26, 3
  %30 = tail call ptr @wa_alloc_from_le(ptr noundef %28, i64 noundef %29) #6
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %33

32:                                               ; preds = %24
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 1044, i32 noundef 2) #6
  br label %81

33:                                               ; preds = %24
  %34 = getelementptr inbounds [14 x ptr], ptr @ROOT2_ALL_ONB, i64 0, i64 %14
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  %36 = tail call ptr @wa_alloc_from_le(ptr noundef %35, i64 noundef %29) #6
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %39

38:                                               ; preds = %33
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 1045, i32 noundef 2) #6
  br label %81

39:                                               ; preds = %33
  %40 = shl i64 %1, 3
  %41 = tail call noalias ptr @calloc(i64 noundef 1, i64 noundef %40) #8
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 1047, i32 noundef 1, ptr noundef null) #6
  br label %81

44:                                               ; preds = %39
  %45 = tail call noalias ptr @calloc(i64 noundef 1, i64 noundef %40) #8
  %46 = icmp eq ptr %45, null
  br i1 %46, label %47, label %48

47:                                               ; preds = %44
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 1048, i32 noundef 1, ptr noundef null) #6
  br label %81

48:                                               ; preds = %44
  %49 = tail call ptr @wa_copy_with_alloc(ptr noundef nonnull %30) #6
  store ptr %49, ptr %41, align 8, !tbaa !5
  %50 = icmp eq ptr %49, null
  br i1 %50, label %53, label %.preheader105

.preheader105:                                    ; preds = %48
  %51 = icmp ugt i64 %1, 1
  br i1 %51, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader105
  %52 = getelementptr inbounds i8, ptr %0, i64 32
  br label %54

53:                                               ; preds = %48
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 1051, i32 noundef 2) #6
  br label %81

54:                                               ; preds = %.lr.ph, %59
  %.084106 = phi i64 [ 1, %.lr.ph ], [ %64, %59 ]
  %55 = tail call ptr @wa_alloc(i64 noundef %26) #6
  %56 = getelementptr inbounds ptr, ptr %41, i64 %.084106
  store ptr %55, ptr %56, align 8, !tbaa !5
  %57 = icmp eq ptr %55, null
  br i1 %57, label %58, label %59

58:                                               ; preds = %54
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 1053, i32 noundef 2) #6
  br label %81

59:                                               ; preds = %54
  %60 = load ptr, ptr %52, align 8, !tbaa !9
  %61 = load ptr, ptr %60, align 8, !tbaa !14
  %62 = getelementptr i8, ptr %56, i64 -8
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  tail call void @gf2m_mod_sqr(ptr noundef %61, ptr noundef %63, ptr noundef nonnull %55) #6
  %64 = add nuw i64 %.084106, 1
  %exitcond.not = icmp eq i64 %64, %1
  br i1 %exitcond.not, label %._crit_edge, label %54, !llvm.loop !16

._crit_edge:                                      ; preds = %59, %.preheader105
  %65 = tail call ptr @wa_alloc(i64 noundef %26) #6
  store ptr %65, ptr %45, align 8, !tbaa !5
  %66 = icmp eq ptr %65, null
  br i1 %66, label %67, label %68

67:                                               ; preds = %._crit_edge
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 1058, i32 noundef 2) #6
  br label %81

68:                                               ; preds = %._crit_edge
  %69 = load ptr, ptr %65, align 8, !tbaa !18
  tail call void @llvm.memset.p0.i64(ptr align 8 %69, i8 -1, i64 %29, i1 false)
  %70 = load ptr, ptr %45, align 8, !tbaa !5
  tail call void @int_truncate(ptr noundef %70, i64 noundef %1) #6
  br i1 %51, label %.lr.ph109, label %._crit_edge110

.lr.ph109:                                        ; preds = %68, %75
  %.1107 = phi i64 [ %78, %75 ], [ 1, %68 ]
  %71 = tail call ptr @wa_alloc(i64 noundef %26) #6
  %72 = getelementptr inbounds ptr, ptr %45, i64 %.1107
  store ptr %71, ptr %72, align 8, !tbaa !5
  %73 = icmp eq ptr %71, null
  br i1 %73, label %74, label %75

74:                                               ; preds = %.lr.ph109
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 1063, i32 noundef 2) #6
  br label %81

75:                                               ; preds = %.lr.ph109
  %76 = getelementptr i8, ptr %72, i64 -8
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  tail call void @multiply_onb(ptr noundef %77, ptr noundef nonnull %36, ptr noundef nonnull %10, i64 noundef %1, ptr noundef nonnull %71)
  %78 = add nuw i64 %.1107, 1
  %exitcond119.not = icmp eq i64 %78, %1
  br i1 %exitcond119.not, label %._crit_edge110, label %.lr.ph109, !llvm.loop !20

._crit_edge110:                                   ; preds = %75, %68
  %79 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %41, ptr %79, align 8, !tbaa !21
  %80 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr %45, ptr %80, align 8, !tbaa !22
  br label %81

81:                                               ; preds = %._crit_edge110, %74, %67, %58, %53, %47, %43, %38, %32, %23, %12, %5
  %.085 = phi i32 [ 1, %12 ], [ 2, %23 ], [ 2, %32 ], [ 2, %38 ], [ 1, %43 ], [ 1, %47 ], [ 2, %53 ], [ 2, %58 ], [ 2, %67 ], [ 2, %74 ], [ 0, %._crit_edge110 ], [ 2, %5 ]
  %.083 = phi ptr [ null, %12 ], [ null, %23 ], [ %21, %32 ], [ %21, %38 ], [ %21, %43 ], [ %21, %47 ], [ %21, %53 ], [ %21, %58 ], [ %21, %67 ], [ %21, %74 ], [ %21, %._crit_edge110 ], [ null, %5 ]
  %.082 = phi ptr [ null, %12 ], [ %10, %23 ], [ %10, %32 ], [ %10, %38 ], [ %10, %43 ], [ %10, %47 ], [ %10, %53 ], [ %10, %58 ], [ %10, %67 ], [ %10, %74 ], [ %10, %._crit_edge110 ], [ null, %5 ]
  %.081 = phi ptr [ null, %12 ], [ null, %23 ], [ null, %32 ], [ null, %38 ], [ null, %43 ], [ %41, %47 ], [ %41, %53 ], [ %41, %58 ], [ %41, %67 ], [ %41, %74 ], [ null, %._crit_edge110 ], [ null, %5 ]
  %.080 = phi ptr [ null, %12 ], [ null, %23 ], [ null, %32 ], [ null, %38 ], [ null, %43 ], [ null, %47 ], [ %45, %53 ], [ %45, %58 ], [ %45, %67 ], [ %45, %74 ], [ null, %._crit_edge110 ], [ null, %5 ]
  %.079 = phi ptr [ null, %12 ], [ null, %23 ], [ null, %32 ], [ %30, %38 ], [ %30, %43 ], [ %30, %47 ], [ %30, %53 ], [ %30, %58 ], [ %30, %67 ], [ %30, %74 ], [ %30, %._crit_edge110 ], [ null, %5 ]
  %.0 = phi ptr [ null, %12 ], [ null, %23 ], [ null, %32 ], [ null, %38 ], [ %36, %43 ], [ %36, %47 ], [ %36, %53 ], [ %36, %58 ], [ %36, %67 ], [ %36, %74 ], [ %36, %._crit_edge110 ], [ null, %5 ]
  tail call void @wa_free(ptr noundef %.083) #6
  tail call void @wa_free(ptr noundef %.079) #6
  tail call void @wa_free(ptr noundef %.0) #6
  tail call void @free(ptr noundef %.082) #6
  %.not = icmp eq ptr %.081, null
  br i1 %.not, label %85, label %.preheader104

.preheader104:                                    ; preds = %81
  %.not117 = icmp eq i64 %1, 0
  br i1 %.not117, label %._crit_edge113, label %.lr.ph112

.lr.ph112:                                        ; preds = %.preheader104, %.lr.ph112
  %.2111 = phi i64 [ %84, %.lr.ph112 ], [ 0, %.preheader104 ]
  %82 = getelementptr inbounds ptr, ptr %.081, i64 %.2111
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  tail call void @wa_free(ptr noundef %83) #6
  %84 = add nuw i64 %.2111, 1
  %exitcond120.not = icmp eq i64 %84, %1
  br i1 %exitcond120.not, label %._crit_edge113, label %.lr.ph112, !llvm.loop !23

._crit_edge113:                                   ; preds = %.lr.ph112, %.preheader104
  tail call void @free(ptr noundef nonnull %.081) #6
  br label %85

85:                                               ; preds = %._crit_edge113, %81
  %.not103 = icmp eq ptr %.080, null
  br i1 %.not103, label %89, label %.preheader

.preheader:                                       ; preds = %85
  %.not118 = icmp eq i64 %1, 0
  br i1 %.not118, label %._crit_edge116, label %.lr.ph115

.lr.ph115:                                        ; preds = %.preheader, %.lr.ph115
  %.3114 = phi i64 [ %88, %.lr.ph115 ], [ 0, %.preheader ]
  %86 = getelementptr inbounds ptr, ptr %.080, i64 %.3114
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  tail call void @wa_free(ptr noundef %87) #6
  %88 = add nuw i64 %.3114, 1
  %exitcond121.not = icmp eq i64 %88, %1
  br i1 %exitcond121.not, label %._crit_edge116, label %.lr.ph115, !llvm.loop !24

._crit_edge116:                                   ; preds = %.lr.ph115, %.preheader
  tail call void @free(ptr noundef nonnull %.080) #6
  br label %89

89:                                               ; preds = %._crit_edge116, %85
  ret i32 %.085
}

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

declare ptr @wa_alloc_from_le(ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @decompress_matrix(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #3

declare ptr @wa_copy_with_alloc(ptr noundef) local_unnamed_addr #1

declare ptr @wa_alloc(i64 noundef) local_unnamed_addr #1

declare void @gf2m_mod_sqr(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare void @int_truncate(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @multiply_onb(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

declare void @wa_free(ptr noundef) local_unnamed_addr #1

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

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

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

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


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