; LLVM IR from specinfo-ua/UAPKI :: library/uapkic/src (math-ec-precomp-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.EcPrecomp_st = type { i32, %union.anon }
%union.anon = type { ptr }
%struct.EcPrecompComb_st = type { ptr, i32 }
%struct.EcPrecompWin_st = type { ptr, i32, i32 }

@.str = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @ec_copy_precomp_with_alloc(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store ptr null, ptr %6, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %12

11:                                               ; preds = %1
  store ptr null, ptr %2, align 8
  store i32 1, ptr %7, align 4
  br label %219

12:                                               ; preds = %1
  br label %13

13:                                               ; preds = %12
  %14 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 16) #5
  store ptr %14, ptr %6, align 8, !tbaa !5
  %15 = icmp eq ptr null, %14
  br i1 %15, label %16, label %18

16:                                               ; preds = %13
  store i32 1, ptr %5, align 4, !tbaa !9
  %17 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 44, i32 noundef %17, ptr noundef null)
  br label %217

18:                                               ; preds = %13
  br label %19

19:                                               ; preds = %18
  br label %20

20:                                               ; preds = %19
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.EcPrecomp_st, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.EcPrecomp_st, ptr %24, i32 0, i32 0
  store i32 %23, ptr %25, align 8, !tbaa !11
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.EcPrecomp_st, ptr %26, i32 0, i32 0
  %28 = load i32, ptr %27, align 8, !tbaa !11
  switch i32 %28, label %210 [
    i32 1, label %29
    i32 0, label %116
  ]

29:                                               ; preds = %20
  br label %30

30:                                               ; preds = %29
  %31 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 16) #5
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.EcPrecomp_st, ptr %32, i32 0, i32 1
  store ptr %31, ptr %33, align 8, !tbaa !13
  %34 = icmp eq ptr null, %31
  br i1 %34, label %35, label %37

35:                                               ; preds = %30
  store i32 1, ptr %5, align 4, !tbaa !9
  %36 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 48, i32 noundef %36, ptr noundef null)
  br label %217

37:                                               ; preds = %30
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.EcPrecomp_st, ptr %40, i32 0, i32 1
  %42 = load ptr, ptr %41, align 8, !tbaa !13
  %43 = getelementptr inbounds %struct.EcPrecompComb_st, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 8, !tbaa !14
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.EcPrecomp_st, ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !13
  %48 = getelementptr inbounds %struct.EcPrecompComb_st, ptr %47, i32 0, i32 1
  store i32 %44, ptr %48, align 8, !tbaa !14
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.EcPrecomp_st, ptr %49, i32 0, i32 1
  %51 = load ptr, ptr %50, align 8, !tbaa !13
  %52 = getelementptr inbounds %struct.EcPrecompComb_st, ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %115

55:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.EcPrecomp_st, ptr %56, i32 0, i32 1
  %58 = load ptr, ptr %57, align 8, !tbaa !13
  %59 = getelementptr inbounds %struct.EcPrecompComb_st, ptr %58, i32 0, i32 1
  %60 = load i32, ptr %59, align 8, !tbaa !14
  %61 = shl i32 1, %60
  %62 = sub nsw i32 %61, 1
  store i32 %62, ptr %8, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %55
  %64 = load i32, ptr %8, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = mul i64 %65, 8
  %67 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %66) #5
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.EcPrecomp_st, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !13
  %71 = getelementptr inbounds %struct.EcPrecompComb_st, ptr %70, i32 0, i32 0
  store ptr %67, ptr %71, align 8, !tbaa !16
  %72 = icmp eq ptr null, %67
  br i1 %72, label %73, label %75

73:                                               ; preds = %63
  store i32 1, ptr %5, align 4, !tbaa !9
  %74 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 54, i32 noundef %74, ptr noundef null)
  store i32 4, ptr %7, align 4
  br label %112

75:                                               ; preds = %63
  br label %76

76:                                               ; preds = %75
  br label %77

77:                                               ; preds = %76
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %108, %77
  %79 = load i32, ptr %4, align 4, !tbaa !9
  %80 = load i32, ptr %8, align 4, !tbaa !9
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %82, label %111

82:                                               ; preds = %78
  br label %83

83:                                               ; preds = %82
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.EcPrecomp_st, ptr %84, i32 0, i32 1
  %86 = load ptr, ptr %85, align 8, !tbaa !13
  %87 = getelementptr inbounds %struct.EcPrecompComb_st, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !16
  %89 = load i32, ptr %4, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds ptr, ptr %88, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  %93 = call ptr @ec_point_copy_with_alloc(ptr noundef %92)
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.EcPrecomp_st, ptr %94, i32 0, i32 1
  %96 = load ptr, ptr %95, align 8, !tbaa !13
  %97 = getelementptr inbounds %struct.EcPrecompComb_st, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !16
  %99 = load i32, ptr %4, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds ptr, ptr %98, i64 %100
  store ptr %93, ptr %101, align 8, !tbaa !5
  %102 = icmp eq ptr null, %93
  br i1 %102, label %103, label %105

103:                                              ; preds = %83
  store i32 2, ptr %5, align 4, !tbaa !9
  %104 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 57, i32 noundef %104)
  store i32 4, ptr %7, align 4
  br label %112

105:                                              ; preds = %83
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %4, align 4, !tbaa !9
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %4, align 4, !tbaa !9
  br label %78, !llvm.loop !17

111:                                              ; preds = %78
  store i32 0, ptr %7, align 4
  br label %112

112:                                              ; preds = %111, %103, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %113 = load i32, ptr %7, align 4
  switch i32 %113, label %219 [
    i32 0, label %114
    i32 4, label %217
  ]

114:                                              ; preds = %112
  br label %115

115:                                              ; preds = %114, %39
  br label %215

116:                                              ; preds = %20
  br label %117

117:                                              ; preds = %116
  %118 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 16) #5
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.EcPrecomp_st, ptr %119, i32 0, i32 1
  store ptr %118, ptr %120, align 8, !tbaa !13
  %121 = icmp eq ptr null, %118
  br i1 %121, label %122, label %124

122:                                              ; preds = %117
  store i32 1, ptr %5, align 4, !tbaa !9
  %123 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 62, i32 noundef %123, ptr noundef null)
  br label %217

124:                                              ; preds = %117
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.EcPrecomp_st, ptr %127, i32 0, i32 1
  %129 = load ptr, ptr %128, align 8, !tbaa !13
  %130 = getelementptr inbounds %struct.EcPrecompWin_st, ptr %129, i32 0, i32 2
  %131 = load i32, ptr %130, align 4, !tbaa !19
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.EcPrecomp_st, ptr %132, i32 0, i32 1
  %134 = load ptr, ptr %133, align 8, !tbaa !13
  %135 = getelementptr inbounds %struct.EcPrecompWin_st, ptr %134, i32 0, i32 2
  store i32 %131, ptr %135, align 4, !tbaa !19
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.EcPrecomp_st, ptr %136, i32 0, i32 1
  %138 = load ptr, ptr %137, align 8, !tbaa !13
  %139 = getelementptr inbounds %struct.EcPrecompWin_st, ptr %138, i32 0, i32 1
  %140 = load i32, ptr %139, align 8, !tbaa !21
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.EcPrecomp_st, ptr %141, i32 0, i32 1
  %143 = load ptr, ptr %142, align 8, !tbaa !13
  %144 = getelementptr inbounds %struct.EcPrecompWin_st, ptr %143, i32 0, i32 1
  store i32 %140, ptr %144, align 8, !tbaa !21
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.EcPrecomp_st, ptr %145, i32 0, i32 1
  %147 = load ptr, ptr %146, align 8, !tbaa !13
  %148 = getelementptr inbounds %struct.EcPrecompWin_st, ptr %147, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8, !tbaa !22
  %150 = icmp ne ptr %149, null
  br i1 %150, label %151, label %209

151:                                              ; preds = %126
  br label %152

152:                                              ; preds = %151
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.EcPrecomp_st, ptr %153, i32 0, i32 1
  %155 = load ptr, ptr %154, align 8, !tbaa !13
  %156 = getelementptr inbounds %struct.EcPrecompWin_st, ptr %155, i32 0, i32 1
  %157 = load i32, ptr %156, align 8, !tbaa !21
  %158 = sext i32 %157 to i64
  %159 = mul i64 %158, 8
  %160 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %159) #5
  %161 = load ptr, ptr %6, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.EcPrecomp_st, ptr %161, i32 0, i32 1
  %163 = load ptr, ptr %162, align 8, !tbaa !13
  %164 = getelementptr inbounds %struct.EcPrecompWin_st, ptr %163, i32 0, i32 0
  store ptr %160, ptr %164, align 8, !tbaa !22
  %165 = icmp eq ptr null, %160
  br i1 %165, label %166, label %168

166:                                              ; preds = %152
  store i32 1, ptr %5, align 4, !tbaa !9
  %167 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 68, i32 noundef %167, ptr noundef null)
  br label %217

168:                                              ; preds = %152
  br label %169

169:                                              ; preds = %168
  br label %170

170:                                              ; preds = %169
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %171

171:                                              ; preds = %205, %170
  %172 = load i32, ptr %4, align 4, !tbaa !9
  %173 = load ptr, ptr %3, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.EcPrecomp_st, ptr %173, i32 0, i32 1
  %175 = load ptr, ptr %174, align 8, !tbaa !13
  %176 = getelementptr inbounds %struct.EcPrecompWin_st, ptr %175, i32 0, i32 1
  %177 = load i32, ptr %176, align 8, !tbaa !21
  %178 = icmp slt i32 %172, %177
  br i1 %178, label %179, label %208

179:                                              ; preds = %171
  br label %180

180:                                              ; preds = %179
  %181 = load ptr, ptr %3, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.EcPrecomp_st, ptr %181, i32 0, i32 1
  %183 = load ptr, ptr %182, align 8, !tbaa !13
  %184 = getelementptr inbounds %struct.EcPrecompWin_st, ptr %183, i32 0, i32 0
  %185 = load ptr, ptr %184, align 8, !tbaa !22
  %186 = load i32, ptr %4, align 4, !tbaa !9
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds ptr, ptr %185, i64 %187
  %189 = load ptr, ptr %188, align 8, !tbaa !5
  %190 = call ptr @ec_point_copy_with_alloc(ptr noundef %189)
  %191 = load ptr, ptr %6, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.EcPrecomp_st, ptr %191, i32 0, i32 1
  %193 = load ptr, ptr %192, align 8, !tbaa !13
  %194 = getelementptr inbounds %struct.EcPrecompWin_st, ptr %193, i32 0, i32 0
  %195 = load ptr, ptr %194, align 8, !tbaa !22
  %196 = load i32, ptr %4, align 4, !tbaa !9
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds ptr, ptr %195, i64 %197
  store ptr %190, ptr %198, align 8, !tbaa !5
  %199 = icmp eq ptr null, %190
  br i1 %199, label %200, label %202

200:                                              ; preds = %180
  store i32 2, ptr %5, align 4, !tbaa !9
  %201 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 71, i32 noundef %201)
  br label %217

202:                                              ; preds = %180
  br label %203

203:                                              ; preds = %202
  br label %204

204:                                              ; preds = %203
  br label %205

205:                                              ; preds = %204
  %206 = load i32, ptr %4, align 4, !tbaa !9
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %4, align 4, !tbaa !9
  br label %171, !llvm.loop !23

208:                                              ; preds = %171
  br label %209

209:                                              ; preds = %208, %126
  br label %215

210:                                              ; preds = %20
  br label %211

211:                                              ; preds = %210
  store i32 5, ptr %5, align 4, !tbaa !9
  %212 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 76, i32 noundef %212, ptr noundef null)
  br label %217

213:                                              ; No predecessors!
  br label %214

214:                                              ; preds = %213
  br label %215

215:                                              ; preds = %214, %209, %115
  %216 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %216, ptr %2, align 8
  store i32 1, ptr %7, align 4
  br label %219

217:                                              ; preds = %211, %200, %166, %122, %112, %35, %16
  %218 = load ptr, ptr %6, align 8, !tbaa !5
  call void @ec_precomp_free(ptr noundef %218)
  store ptr null, ptr %2, align 8
  store i32 1, ptr %7, align 4
  br label %219

219:                                              ; preds = %217, %215, %112, %11
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %220 = load ptr, ptr %2, align 8
  ret ptr %220
}

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

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

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

declare ptr @ec_point_copy_with_alloc(ptr noundef) #3

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @ec_precomp_free(ptr noundef) #0

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"EcPrecomp_st", !10, i64 0, !7, i64 8}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !10, i64 8}
!15 = !{!"EcPrecompComb_st", !6, i64 0, !10, i64 8}
!16 = !{!15, !6, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !10, i64 12}
!20 = !{!"EcPrecompWin_st", !6, i64 0, !10, i64 8, !10, i64 12}
!21 = !{!20, !10, i64 8}
!22 = !{!20, !6, i64 0}
!23 = distinct !{!23, !18}


; 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 [34 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @ec_copy_precomp_with_alloc(ptr noundef readonly %0) local_unnamed_addr #0 {
  %2 = icmp eq ptr %0, null
  br i1 %2, label %.loopexit, label %3

3:                                                ; preds = %1
  %4 = tail call noalias dereferenceable_or_null(16) ptr @calloc(i64 noundef 1, i64 noundef 16) #4
  %5 = icmp eq ptr %4, null
  br i1 %5, label %6, label %7

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

7:                                                ; preds = %3
  %8 = load i32, ptr %0, align 8, !tbaa !5
  store i32 %8, ptr %4, align 8, !tbaa !5
  switch i32 %8, label %73 [
    i32 1, label %9
    i32 0, label %38
  ]

9:                                                ; preds = %7
  %10 = tail call noalias dereferenceable_or_null(16) ptr @calloc(i64 noundef 1, i64 noundef 16) #4
  %11 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr %10, ptr %11, align 8, !tbaa !10
  %12 = icmp eq ptr %10, null
  br i1 %12, label %13, label %14

13:                                               ; preds = %9
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 48, i32 noundef 1, ptr noundef null) #5
  br label %.thread

14:                                               ; preds = %9
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = load ptr, ptr %15, align 8, !tbaa !10
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = load i32, ptr %17, align 8, !tbaa !11
  %19 = getelementptr inbounds i8, ptr %10, i64 8
  store i32 %18, ptr %19, align 8, !tbaa !11
  %20 = load ptr, ptr %16, align 8, !tbaa !14
  %.not50 = icmp eq ptr %20, null
  br i1 %.not50, label %.loopexit, label %21

21:                                               ; preds = %14
  %notmask = shl nsw i32 -1, %18
  %22 = xor i32 %notmask, -1
  %23 = zext nneg i32 %22 to i64
  %24 = shl nuw nsw i64 %23, 3
  %25 = tail call noalias ptr @calloc(i64 noundef 1, i64 noundef %24) #4
  store ptr %25, ptr %10, align 8, !tbaa !14
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %.preheader

.preheader:                                       ; preds = %21
  %.not59 = icmp eq i32 %18, 0
  br i1 %.not59, label %.loopexit, label %.lr.ph58.preheader

.lr.ph58.preheader:                               ; preds = %.preheader
  %umax = tail call i32 @llvm.umax.i32(i32 %22, i32 1)
  %wide.trip.count = zext nneg i32 %umax to i64
  br label %.lr.ph58

27:                                               ; preds = %21
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 54, i32 noundef 1, ptr noundef null) #5
  br label %.thread

28:                                               ; preds = %.lr.ph58
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph58, !llvm.loop !15

.lr.ph58:                                         ; preds = %.lr.ph58.preheader, %28
  %indvars.iv62 = phi i64 [ 0, %.lr.ph58.preheader ], [ %indvars.iv.next63, %28 ]
  %29 = load ptr, ptr %15, align 8, !tbaa !10
  %30 = load ptr, ptr %29, align 8, !tbaa !14
  %31 = getelementptr inbounds ptr, ptr %30, i64 %indvars.iv62
  %32 = load ptr, ptr %31, align 8, !tbaa !17
  %33 = tail call ptr @ec_point_copy_with_alloc(ptr noundef %32) #5
  %34 = load ptr, ptr %10, align 8, !tbaa !14
  %35 = getelementptr inbounds ptr, ptr %34, i64 %indvars.iv62
  store ptr %33, ptr %35, align 8, !tbaa !17
  %36 = icmp eq ptr %33, null
  br i1 %36, label %37, label %28

37:                                               ; preds = %.lr.ph58
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 57, i32 noundef 2) #5
  br label %.thread

38:                                               ; preds = %7
  %39 = tail call noalias dereferenceable_or_null(16) ptr @calloc(i64 noundef 1, i64 noundef 16) #4
  %40 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr %39, ptr %40, align 8, !tbaa !10
  %41 = icmp eq ptr %39, null
  br i1 %41, label %42, label %43

42:                                               ; preds = %38
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 62, i32 noundef 1, ptr noundef null) #5
  br label %.thread

43:                                               ; preds = %38
  %44 = getelementptr inbounds i8, ptr %0, i64 8
  %45 = load ptr, ptr %44, align 8, !tbaa !10
  %46 = getelementptr inbounds i8, ptr %45, i64 8
  %47 = getelementptr inbounds i8, ptr %39, i64 8
  %48 = load <2 x i32>, ptr %46, align 8, !tbaa !18
  store <2 x i32> %48, ptr %47, align 8, !tbaa !18
  %49 = load ptr, ptr %45, align 8, !tbaa !19
  %.not = icmp eq ptr %49, null
  br i1 %.not, label %.loopexit, label %50

50:                                               ; preds = %43
  %51 = extractelement <2 x i32> %48, i64 0
  %52 = sext i32 %51 to i64
  %53 = shl nsw i64 %52, 3
  %54 = tail call noalias ptr @calloc(i64 noundef 1, i64 noundef %53) #4
  store ptr %54, ptr %39, align 8, !tbaa !19
  %55 = icmp eq ptr %54, null
  br i1 %55, label %57, label %.preheader54

.preheader54:                                     ; preds = %50
  %56 = icmp sgt i32 %51, 0
  br i1 %56, label %.lr.ph, label %.loopexit

57:                                               ; preds = %50
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 68, i32 noundef 1, ptr noundef null) #5
  br label %.thread

58:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %59 = load ptr, ptr %44, align 8, !tbaa !10
  %60 = getelementptr inbounds i8, ptr %59, i64 8
  %61 = load i32, ptr %60, align 8, !tbaa !21
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next, %62
  br i1 %63, label %.lr.ph, label %.loopexit, !llvm.loop !22

.lr.ph:                                           ; preds = %.preheader54, %58
  %indvars.iv = phi i64 [ %indvars.iv.next, %58 ], [ 0, %.preheader54 ]
  %64 = phi ptr [ %59, %58 ], [ %45, %.preheader54 ]
  %65 = load ptr, ptr %64, align 8, !tbaa !19
  %66 = getelementptr inbounds ptr, ptr %65, i64 %indvars.iv
  %67 = load ptr, ptr %66, align 8, !tbaa !17
  %68 = tail call ptr @ec_point_copy_with_alloc(ptr noundef %67) #5
  %69 = load ptr, ptr %39, align 8, !tbaa !19
  %70 = getelementptr inbounds ptr, ptr %69, i64 %indvars.iv
  store ptr %68, ptr %70, align 8, !tbaa !17
  %71 = icmp eq ptr %68, null
  br i1 %71, label %72, label %58

72:                                               ; preds = %.lr.ph
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 71, i32 noundef 2) #5
  br label %.thread

73:                                               ; preds = %7
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 76, i32 noundef 5, ptr noundef null) #5
  br label %.thread

.thread:                                          ; preds = %37, %27, %73, %72, %57, %42, %13, %6
  tail call void @ec_precomp_free(ptr noundef %4)
  br label %.loopexit

.loopexit:                                        ; preds = %58, %28, %.preheader54, %.preheader, %14, %43, %1, %.thread
  %.0 = phi ptr [ null, %.thread ], [ null, %1 ], [ %4, %43 ], [ %4, %14 ], [ %4, %.preheader ], [ %4, %.preheader54 ], [ %4, %28 ], [ %4, %58 ]
  ret ptr %.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 #1

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

declare ptr @ec_point_copy_with_alloc(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @ec_precomp_free(ptr noundef) local_unnamed_addr #0

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

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


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