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

; 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.ByteArray_st = type { ptr, i64 }
%struct.EcCtx_st = type { ptr, ptr, ptr, ptr, i8, i8 }
%struct.EcParamsCtx_st = type { i32, ptr, ptr, ptr, ptr, i8, i64, ptr, ptr, i32, ptr }
%struct.EcGfpCtx_st = type { ptr, ptr, ptr, i8, i64 }
%struct.GfpCtx_st = type { ptr, ptr, ptr, ptr }

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

; 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

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

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

declare i64 @int_bit_len(ptr noundef) #1

declare ptr @wa_to_ba(ptr noundef) #1

declare i32 @ba_change_len(ptr noundef, i64 noundef) #1

declare void @wa_free(ptr noundef) #1

declare ptr @wa_alloc_from_be(ptr noundef, i64 noundef) #1

declare i32 @int_cmp(ptr noundef, ptr noundef) #1

declare void @wa_change_len(ptr noundef, i64 noundef) #1

declare i32 @int_get_bit(ptr noundef, i64 noundef) #1

declare zeroext i1 @int_is_zero(ptr noundef) #1

declare ptr @wa_alloc(i64 noundef) #1

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

16:                                               ; preds = %4
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %21, label %19

19:                                               ; preds = %16
  store i32 2, ptr %13, align 4, !tbaa !9
  %20 = load i32, ptr %13, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 912, i32 noundef %20, ptr noundef null)
  br label %218

21:                                               ; preds = %16
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %23
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %29, label %27

27:                                               ; preds = %24
  store i32 2, ptr %13, align 4, !tbaa !9
  %28 = load i32, ptr %13, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 913, i32 noundef %28, ptr noundef null)
  br label %218

29:                                               ; preds = %24
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  br label %32

32:                                               ; preds = %31
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %37, label %35

35:                                               ; preds = %32
  store i32 2, ptr %13, align 4, !tbaa !9
  %36 = load i32, ptr %13, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 914, i32 noundef %36, ptr noundef null)
  br label %218

37:                                               ; preds = %32
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %50

42:                                               ; preds = %39
  %43 = load i32, ptr %8, align 4, !tbaa !9
  %44 = icmp ne i32 %43, 1
  br i1 %44, label %45, label %50

45:                                               ; preds = %42
  br label %46

46:                                               ; preds = %45
  store i32 2, ptr %13, align 4, !tbaa !9
  %47 = load i32, ptr %13, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 917, i32 noundef %47, ptr noundef null)
  br label %218

48:                                               ; No predecessors!
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49, %42, %39
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.ByteArray_st, ptr %52, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !11
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.ByteArray_st, ptr %55, i32 0, i32 1
  %57 = load i64, ptr %56, align 8, !tbaa !14
  %58 = call ptr @wa_alloc_from_be(ptr noundef %54, i64 noundef %57)
  store ptr %58, ptr %10, align 8, !tbaa !5
  %59 = icmp eq ptr null, %58
  br i1 %59, label %60, label %62

60:                                               ; preds = %51
  store i32 2, ptr %13, align 4, !tbaa !9
  %61 = load i32, ptr %13, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 920, i32 noundef %61)
  br label %218

62:                                               ; preds = %51
  br label %63

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.EcCtx_st, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !15
  %68 = getelementptr inbounds %struct.EcParamsCtx_st, ptr %67, i32 0, i32 0
  %69 = load i32, ptr %68, align 8, !tbaa !18
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %201

71:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.EcCtx_st, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !15
  %75 = getelementptr inbounds %struct.EcParamsCtx_st, ptr %74, i32 0, i32 3
  %76 = load ptr, ptr %75, align 8, !tbaa !20
  %77 = getelementptr inbounds %struct.EcGfpCtx_st, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !21
  store ptr %78, ptr %14, align 8, !tbaa !5
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.EcCtx_st, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !15
  %83 = getelementptr inbounds %struct.EcParamsCtx_st, ptr %82, i32 0, i32 3
  %84 = load ptr, ptr %83, align 8, !tbaa !20
  %85 = getelementptr inbounds %struct.EcGfpCtx_st, ptr %84, i32 0, i32 4
  %86 = load i64, ptr %85, align 8, !tbaa !23
  call void @wa_change_len(ptr noundef %79, i64 noundef %86)
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = load ptr, ptr %14, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.GfpCtx_st, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !24
  %91 = call i32 @int_cmp(ptr noundef %87, ptr noundef %90)
  %92 = icmp sge i32 %91, 0
  br i1 %92, label %96, label %93

93:                                               ; preds = %71
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = call zeroext i1 @int_is_zero(ptr noundef %94)
  br i1 %95, label %96, label %101

96:                                               ; preds = %93, %71
  br label %97

97:                                               ; preds = %96
  store i32 2, ptr %13, align 4, !tbaa !9
  %98 = load i32, ptr %13, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 927, i32 noundef %98, ptr noundef null)
  store i32 4, ptr %15, align 4
  br label %198

99:                                               ; No predecessors!
  br label %100

100:                                              ; preds = %99
  br label %101

101:                                              ; preds = %100, %93
  br label %102

102:                                              ; preds = %101
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.EcCtx_st, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !15
  %106 = getelementptr inbounds %struct.EcParamsCtx_st, ptr %105, i32 0, i32 3
  %107 = load ptr, ptr %106, align 8, !tbaa !20
  %108 = getelementptr inbounds %struct.EcGfpCtx_st, ptr %107, i32 0, i32 4
  %109 = load i64, ptr %108, align 8, !tbaa !23
  %110 = call ptr @wa_alloc(i64 noundef %109)
  store ptr %110, ptr %11, align 8, !tbaa !5
  %111 = icmp eq ptr null, %110
  br i1 %111, label %112, label %114

112:                                              ; preds = %102
  store i32 2, ptr %13, align 4, !tbaa !9
  %113 = load i32, ptr %13, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 930, i32 noundef %113)
  store i32 4, ptr %15, align 4
  br label %198

114:                                              ; preds = %102
  br label %115

115:                                              ; preds = %114
  br label %116

116:                                              ; preds = %115
  %117 = load ptr, ptr %14, align 8, !tbaa !5
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfp_mod_sqr(ptr noundef %117, ptr noundef %118, ptr noundef %119)
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  %121 = load ptr, ptr %11, align 8, !tbaa !5
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.EcCtx_st, ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !15
  %125 = getelementptr inbounds %struct.EcParamsCtx_st, ptr %124, i32 0, i32 3
  %126 = load ptr, ptr %125, align 8, !tbaa !20
  %127 = getelementptr inbounds %struct.EcGfpCtx_st, ptr %126, i32 0, i32 1
  %128 = load ptr, ptr %127, align 8, !tbaa !26
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfp_mod_add(ptr noundef %120, ptr noundef %121, ptr noundef %128, ptr noundef %129)
  %130 = load ptr, ptr %14, align 8, !tbaa !5
  %131 = load ptr, ptr %10, align 8, !tbaa !5
  %132 = load ptr, ptr %11, align 8, !tbaa !5
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfp_mod_mul(ptr noundef %130, ptr noundef %131, ptr noundef %132, ptr noundef %133)
  %134 = load ptr, ptr %14, align 8, !tbaa !5
  %135 = load ptr, ptr %11, align 8, !tbaa !5
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.EcCtx_st, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !15
  %139 = getelementptr inbounds %struct.EcParamsCtx_st, ptr %138, i32 0, i32 3
  %140 = load ptr, ptr %139, align 8, !tbaa !20
  %141 = getelementptr inbounds %struct.EcGfpCtx_st, ptr %140, i32 0, i32 2
  %142 = load ptr, ptr %141, align 8, !tbaa !27
  %143 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfp_mod_add(ptr noundef %134, ptr noundef %135, ptr noundef %142, ptr noundef %143)
  %144 = load ptr, ptr %14, align 8, !tbaa !5
  %145 = load ptr, ptr %11, align 8, !tbaa !5
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  %147 = call zeroext i1 @gfp_mod_sqrt(ptr noundef %144, ptr noundef %145, ptr noundef %146)
  br i1 %147, label %153, label %148

148:                                              ; preds = %116
  br label %149

149:                                              ; preds = %148
  store i32 25, ptr %13, align 4, !tbaa !9
  %150 = load i32, ptr %13, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 936, i32 noundef %150, ptr noundef null)
  store i32 4, ptr %15, align 4
  br label %198

151:                                              ; No predecessors!
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152, %116
  %154 = load ptr, ptr %11, align 8, !tbaa !5
  %155 = call i32 @int_get_bit(ptr noundef %154, i64 noundef 0)
  %156 = load i32, ptr %8, align 4, !tbaa !9
  %157 = icmp ne i32 %155, %156
  br i1 %157, label %158, label %165

158:                                              ; preds = %153
  %159 = load ptr, ptr %14, align 8, !tbaa !5
  %160 = load ptr, ptr %14, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.GfpCtx_st, ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8, !tbaa !24
  %163 = load ptr, ptr %11, align 8, !tbaa !5
  %164 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfp_mod_sub(ptr noundef %159, ptr noundef %162, ptr noundef %163, ptr noundef %164)
  br label %165

165:                                              ; preds = %158, %153
  %166 = load ptr, ptr %14, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.GfpCtx_st, ptr %166, i32 0, i32 0
  %168 = load ptr, ptr %167, align 8, !tbaa !24
  %169 = call i64 @int_bit_len(ptr noundef %168)
  %170 = add i64 %169, 7
  %171 = udiv i64 %170, 8
  store i64 %171, ptr %12, align 8, !tbaa !28
  %172 = load ptr, ptr %11, align 8, !tbaa !5
  %173 = call ptr @wa_to_ba(ptr noundef %172)
  %174 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %173, ptr %174, align 8, !tbaa !5
  br label %175

175:                                              ; preds = %165
  %176 = load ptr, ptr %9, align 8, !tbaa !5
  %177 = load ptr, ptr %176, align 8, !tbaa !5
  %178 = load i64, ptr %12, align 8, !tbaa !28
  %179 = call i32 @ba_change_len(ptr noundef %177, i64 noundef %178)
  store i32 %179, ptr %13, align 4, !tbaa !9
  %180 = load i32, ptr %13, align 4, !tbaa !9
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %184

182:                                              ; preds = %175
  %183 = load i32, ptr %13, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 946, i32 noundef %183)
  store i32 4, ptr %15, align 4
  br label %198

184:                                              ; preds = %175
  br label %185

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185
  br label %187

187:                                              ; preds = %186
  %188 = load ptr, ptr %9, align 8, !tbaa !5
  %189 = load ptr, ptr %188, align 8, !tbaa !5
  %190 = call i32 @ba_swap(ptr noundef %189)
  store i32 %190, ptr %13, align 4, !tbaa !9
  %191 = load i32, ptr %13, align 4, !tbaa !9
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %195

193:                                              ; preds = %187
  %194 = load i32, ptr %13, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 947, i32 noundef %194)
  store i32 4, ptr %15, align 4
  br label %198

195:                                              ; preds = %187
  br label %196

196:                                              ; preds = %195
  br label %197

197:                                              ; preds = %196
  store i32 0, ptr %15, align 4
  br label %198

198:                                              ; preds = %197, %193, %182, %149, %112, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %199 = load i32, ptr %15, align 4
  switch i32 %199, label %222 [
    i32 0, label %200
    i32 4, label %218
  ]

200:                                              ; preds = %198
  br label %217

201:                                              ; preds = %64
  br label %202

202:                                              ; preds = %201
  %203 = load ptr, ptr %6, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.EcCtx_st, ptr %203, i32 0, i32 0
  %205 = load ptr, ptr %204, align 8, !tbaa !15
  %206 = load ptr, ptr %7, align 8, !tbaa !5
  %207 = load i32, ptr %8, align 4, !tbaa !9
  %208 = load ptr, ptr %9, align 8, !tbaa !5
  %209 = call i32 @ec2m_decompress_point_core(ptr noundef %205, ptr noundef %206, i32 noundef %207, ptr noundef null, ptr noundef %208)
  store i32 %209, ptr %13, align 4, !tbaa !9
  %210 = load i32, ptr %13, align 4, !tbaa !9
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %212, label %214

212:                                              ; preds = %202
  %213 = load i32, ptr %13, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 951, i32 noundef %213)
  br label %218

214:                                              ; preds = %202
  br label %215

215:                                              ; preds = %214
  br label %216

216:                                              ; preds = %215
  br label %217

217:                                              ; preds = %216, %200
  br label %218

218:                                              ; preds = %217, %212, %198, %60, %46, %35, %27, %19
  %219 = load ptr, ptr %10, align 8, !tbaa !5
  call void @wa_free(ptr noundef %219)
  %220 = load ptr, ptr %11, align 8, !tbaa !5
  call void @wa_free(ptr noundef %220)
  %221 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %221, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %222

222:                                              ; preds = %218, %198
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %223 = load i32, ptr %5, align 4
  ret i32 %223
}

declare void @gfp_mod_sqr(ptr noundef, ptr noundef, ptr noundef) #1

declare void @gfp_mod_add(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare void @gfp_mod_mul(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare zeroext i1 @gfp_mod_sqrt(ptr noundef, ptr noundef, ptr noundef) #1

declare void @gfp_mod_sub(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @ba_swap(ptr noundef) #1

declare i32 @ec2m_decompress_point_core(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"ByteArray_st", !6, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!16, !6, i64 0}
!16 = !{!"EcCtx_st", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !17, i64 32, !17, i64 33}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{!19, !10, i64 0}
!19 = !{!"EcParamsCtx_st", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !17, i64 40, !13, i64 48, !6, i64 56, !6, i64 64, !10, i64 72, !6, i64 80}
!20 = !{!19, !6, i64 24}
!21 = !{!22, !6, i64 0}
!22 = !{!"EcGfpCtx_st", !6, i64 0, !6, i64 8, !6, i64 16, !17, i64 24, !13, i64 32}
!23 = !{!22, !13, i64 32}
!24 = !{!25, !6, i64 0}
!25 = !{!"GfpCtx_st", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!26 = !{!22, !6, i64 8}
!27 = !{!22, !6, i64 16}
!28 = !{!13, !13, i64 0}


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

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

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

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

declare i64 @int_bit_len(ptr noundef) local_unnamed_addr #0

declare ptr @wa_to_ba(ptr noundef) local_unnamed_addr #0

declare i32 @ba_change_len(ptr noundef, i64 noundef) local_unnamed_addr #0

declare void @wa_free(ptr noundef) local_unnamed_addr #0

declare ptr @wa_alloc_from_be(ptr noundef, i64 noundef) local_unnamed_addr #0

declare i32 @int_cmp(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @wa_change_len(ptr noundef, i64 noundef) local_unnamed_addr #0

declare i32 @int_get_bit(ptr noundef, i64 noundef) local_unnamed_addr #0

declare zeroext i1 @int_is_zero(ptr noundef) local_unnamed_addr #0

declare ptr @wa_alloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @ec_point_decompress(ptr noundef readonly %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %5, label %6

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

6:                                                ; preds = %4
  %.not85 = icmp eq ptr %3, null
  br i1 %.not85, label %7, label %8

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

8:                                                ; preds = %6
  %.not86 = icmp eq ptr %1, null
  br i1 %.not86, label %9, label %10

9:                                                ; preds = %8
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 914, i32 noundef 2, ptr noundef null) #2
  br label %76

10:                                               ; preds = %8
  %or.cond = icmp ugt i32 %2, 1
  br i1 %or.cond, label %11, label %12

11:                                               ; preds = %10
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 917, i32 noundef 2, ptr noundef null) #2
  br label %76

12:                                               ; preds = %10
  %13 = load ptr, ptr %1, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  %15 = load i64, ptr %14, align 8, !tbaa !11
  %16 = tail call ptr @wa_alloc_from_be(ptr noundef %13, i64 noundef %15) #2
  %17 = icmp eq ptr %16, null
  br i1 %17, label %18, label %19

18:                                               ; preds = %12
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 920, i32 noundef 2) #2
  br label %76

19:                                               ; preds = %12
  %20 = load ptr, ptr %0, align 8, !tbaa !12
  %21 = load i32, ptr %20, align 8, !tbaa !15
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %73

23:                                               ; preds = %19
  %24 = getelementptr inbounds i8, ptr %20, i64 24
  %25 = load ptr, ptr %24, align 8, !tbaa !18
  %26 = load ptr, ptr %25, align 8, !tbaa !19
  %27 = getelementptr inbounds i8, ptr %25, i64 32
  %28 = load i64, ptr %27, align 8, !tbaa !21
  tail call void @wa_change_len(ptr noundef nonnull %16, i64 noundef %28) #2
  %29 = load ptr, ptr %26, align 8, !tbaa !22
  %30 = tail call i32 @int_cmp(ptr noundef nonnull %16, ptr noundef %29) #2
  %31 = icmp sgt i32 %30, -1
  br i1 %31, label %34, label %32

32:                                               ; preds = %23
  %33 = tail call zeroext i1 @int_is_zero(ptr noundef nonnull %16) #2
  br i1 %33, label %34, label %35

34:                                               ; preds = %23, %32
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 927, i32 noundef 2, ptr noundef null) #2
  br label %76

35:                                               ; preds = %32
  %36 = load ptr, ptr %0, align 8, !tbaa !12
  %37 = getelementptr inbounds i8, ptr %36, i64 24
  %38 = load ptr, ptr %37, align 8, !tbaa !18
  %39 = getelementptr inbounds i8, ptr %38, i64 32
  %40 = load i64, ptr %39, align 8, !tbaa !21
  %41 = tail call ptr @wa_alloc(i64 noundef %40) #2
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %35
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 930, i32 noundef 2) #2
  br label %76

44:                                               ; preds = %35
  tail call void @gfp_mod_sqr(ptr noundef nonnull %26, ptr noundef nonnull %16, ptr noundef nonnull %41) #2
  %45 = load ptr, ptr %0, align 8, !tbaa !12
  %46 = getelementptr inbounds i8, ptr %45, i64 24
  %47 = load ptr, ptr %46, align 8, !tbaa !18
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !24
  tail call void @gfp_mod_add(ptr noundef nonnull %26, ptr noundef nonnull %41, ptr noundef %49, ptr noundef nonnull %41) #2
  tail call void @gfp_mod_mul(ptr noundef nonnull %26, ptr noundef nonnull %16, ptr noundef nonnull %41, ptr noundef nonnull %41) #2
  %50 = load ptr, ptr %0, align 8, !tbaa !12
  %51 = getelementptr inbounds i8, ptr %50, i64 24
  %52 = load ptr, ptr %51, align 8, !tbaa !18
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  %54 = load ptr, ptr %53, align 8, !tbaa !25
  tail call void @gfp_mod_add(ptr noundef nonnull %26, ptr noundef nonnull %41, ptr noundef %54, ptr noundef nonnull %41) #2
  %55 = tail call zeroext i1 @gfp_mod_sqrt(ptr noundef nonnull %26, ptr noundef nonnull %41, ptr noundef nonnull %41) #2
  br i1 %55, label %57, label %56

56:                                               ; preds = %44
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 936, i32 noundef 25, ptr noundef null) #2
  br label %76

57:                                               ; preds = %44
  %58 = tail call i32 @int_get_bit(ptr noundef nonnull %41, i64 noundef 0) #2
  %.not88 = icmp eq i32 %58, %2
  br i1 %.not88, label %61, label %59

59:                                               ; preds = %57
  %60 = load ptr, ptr %26, align 8, !tbaa !22
  tail call void @gfp_mod_sub(ptr noundef nonnull %26, ptr noundef %60, ptr noundef nonnull %41, ptr noundef nonnull %41) #2
  br label %61

61:                                               ; preds = %59, %57
  %62 = load ptr, ptr %26, align 8, !tbaa !22
  %63 = tail call i64 @int_bit_len(ptr noundef %62) #2
  %64 = add i64 %63, 7
  %65 = lshr i64 %64, 3
  %66 = tail call ptr @wa_to_ba(ptr noundef nonnull %41) #2
  store ptr %66, ptr %3, align 8, !tbaa !26
  %67 = tail call i32 @ba_change_len(ptr noundef %66, i64 noundef %65) #2
  %.not89 = icmp eq i32 %67, 0
  br i1 %.not89, label %69, label %68

68:                                               ; preds = %61
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 946, i32 noundef %67) #2
  br label %76

69:                                               ; preds = %61
  %70 = load ptr, ptr %3, align 8, !tbaa !26
  %71 = tail call i32 @ba_swap(ptr noundef %70) #2
  %.not90 = icmp eq i32 %71, 0
  br i1 %.not90, label %76, label %72

72:                                               ; preds = %69
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 947, i32 noundef %71) #2
  br label %76

73:                                               ; preds = %19
  %74 = tail call i32 @ec2m_decompress_point_core(ptr noundef nonnull %20, ptr noundef nonnull %1, i32 noundef %2, ptr noundef null, ptr noundef nonnull %3) #2
  %.not87 = icmp eq i32 %74, 0
  br i1 %.not87, label %76, label %75

75:                                               ; preds = %73
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 951, i32 noundef %74) #2
  br label %76

76:                                               ; preds = %34, %43, %56, %68, %72, %69, %73, %75, %18, %11, %9, %7, %5
  %.172 = phi ptr [ null, %11 ], [ null, %18 ], [ null, %75 ], [ null, %73 ], [ null, %9 ], [ null, %7 ], [ null, %5 ], [ null, %34 ], [ null, %43 ], [ %41, %68 ], [ %41, %72 ], [ %41, %56 ], [ %41, %69 ]
  %.070 = phi ptr [ null, %11 ], [ null, %18 ], [ %16, %75 ], [ %16, %73 ], [ null, %9 ], [ null, %7 ], [ null, %5 ], [ %16, %34 ], [ %16, %43 ], [ %16, %68 ], [ %16, %72 ], [ %16, %56 ], [ %16, %69 ]
  %.1 = phi i32 [ 2, %11 ], [ 2, %18 ], [ %74, %75 ], [ 0, %73 ], [ 2, %9 ], [ 2, %7 ], [ 2, %5 ], [ 2, %34 ], [ 2, %43 ], [ %67, %68 ], [ %71, %72 ], [ 25, %56 ], [ 0, %69 ]
  tail call void @wa_free(ptr noundef %.070) #2
  tail call void @wa_free(ptr noundef %.172) #2
  ret i32 %.1
}

declare void @gfp_mod_sqr(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @gfp_mod_add(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @gfp_mod_mul(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare zeroext i1 @gfp_mod_sqrt(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @gfp_mod_sub(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @ba_swap(ptr noundef) local_unnamed_addr #0

declare i32 @ec2m_decompress_point_core(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

attributes #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 = { 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, !7, i64 0}
!6 = !{!"ByteArray_st", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!13, !7, i64 0}
!13 = !{!"EcCtx_st", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !14, i64 32, !14, i64 33}
!14 = !{!"_Bool", !8, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"EcParamsCtx_st", !17, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !14, i64 40, !10, i64 48, !7, i64 56, !7, i64 64, !17, i64 72, !7, i64 80}
!17 = !{!"int", !8, i64 0}
!18 = !{!16, !7, i64 24}
!19 = !{!20, !7, i64 0}
!20 = !{!"EcGfpCtx_st", !7, i64 0, !7, i64 8, !7, i64 16, !14, i64 24, !10, i64 32}
!21 = !{!20, !10, i64 32}
!22 = !{!23, !7, i64 0}
!23 = !{!"GfpCtx_st", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!24 = !{!20, !7, i64 8}
!25 = !{!20, !7, i64 16}
!26 = !{!7, !7, i64 0}


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