; LLVM IR from specinfo-ua/UAPKI :: library/uapkic/src (math-gfp-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.GfpCtx_st = type { ptr, ptr, ptr, ptr }
%struct.WordArray_st = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [27 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_add(ptr noundef, i64 noundef, i32 noundef) #1

declare void @wa_free(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @gfp_mod_add(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @gfp_mod_sub(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @gfp_mod_mul(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @wa_alloc(i64 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @gfp_mod_sqr(ptr noundef, ptr noundef, ptr noundef) #2

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

declare zeroext i1 @int_is_zero(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @gfp_mod_pow(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @gfp_mod_sqrt(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, 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
  %15 = alloca ptr, align 8
  %16 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.GfpCtx_st, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  %20 = getelementptr inbounds %struct.WordArray_st, ptr %19, i32 0, i32 1
  %21 = load i64, ptr %20, align 8, !tbaa !13
  store i64 %21, ptr %8, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %22 = load i64, ptr %8, align 8, !tbaa !16
  %23 = call ptr @wa_alloc(i64 noundef %22)
  store ptr %23, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %24 = load i64, ptr %8, align 8, !tbaa !16
  %25 = call ptr @wa_alloc(i64 noundef %24)
  store ptr %25, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %26 = load i64, ptr %8, align 8, !tbaa !16
  %27 = call ptr @wa_alloc(i64 noundef %26)
  store ptr %27, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %28 = load i64, ptr %8, align 8, !tbaa !16
  %29 = call ptr @wa_alloc(i64 noundef %28)
  store ptr %29, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %30 = load i64, ptr %8, align 8, !tbaa !16
  %31 = call ptr @wa_alloc(i64 noundef %30)
  store ptr %31, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %32 = load i64, ptr %8, align 8, !tbaa !16
  %33 = call ptr @wa_alloc(i64 noundef %32)
  store ptr %33, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #3
  store i8 0, ptr %16, align 1, !tbaa !17
  br label %34

34:                                               ; preds = %3
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = icmp eq ptr null, %35
  br i1 %36, label %37, label %39

37:                                               ; preds = %34
  store i32 2, ptr %7, align 4, !tbaa !9
  %38 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 606, i32 noundef %38)
  br label %262

39:                                               ; preds = %34
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  %44 = icmp eq ptr null, %43
  br i1 %44, label %45, label %47

45:                                               ; preds = %42
  store i32 2, ptr %7, align 4, !tbaa !9
  %46 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 607, i32 noundef %46)
  br label %262

47:                                               ; preds = %42
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = icmp eq ptr null, %51
  br i1 %52, label %53, label %55

53:                                               ; preds = %50
  store i32 2, ptr %7, align 4, !tbaa !9
  %54 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 608, i32 noundef %54)
  br label %262

55:                                               ; preds = %50
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  br label %58

58:                                               ; preds = %57
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = icmp eq ptr null, %59
  br i1 %60, label %61, label %63

61:                                               ; preds = %58
  store i32 2, ptr %7, align 4, !tbaa !9
  %62 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 609, i32 noundef %62)
  br label %262

63:                                               ; preds = %58
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = icmp eq ptr null, %67
  br i1 %68, label %69, label %71

69:                                               ; preds = %66
  store i32 2, ptr %7, align 4, !tbaa !9
  %70 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 610, i32 noundef %70)
  br label %262

71:                                               ; preds = %66
  br label %72

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72
  br label %74

74:                                               ; preds = %73
  %75 = load ptr, ptr %15, align 8, !tbaa !5
  %76 = icmp eq ptr null, %75
  br i1 %76, label %77, label %79

77:                                               ; preds = %74
  store i32 2, ptr %7, align 4, !tbaa !9
  %78 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 611, i32 noundef %78)
  br label %262

79:                                               ; preds = %74
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = call zeroext i1 @int_is_zero(ptr noundef %82)
  br i1 %83, label %90, label %84

84:                                               ; preds = %81
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.GfpCtx_st, ptr %86, i32 0, i32 1
  %88 = load ptr, ptr %87, align 8, !tbaa !19
  %89 = call zeroext i1 @int_equals(ptr noundef %85, ptr noundef %88)
  br i1 %89, label %90, label %94

90:                                               ; preds = %84, %81
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = call i32 @wa_copy(ptr noundef %91, ptr noundef %92)
  store i8 1, ptr %16, align 1, !tbaa !17
  br label %262

94:                                               ; preds = %84
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.GfpCtx_st, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !11
  %98 = getelementptr inbounds %struct.WordArray_st, ptr %97, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8, !tbaa !20
  %100 = getelementptr inbounds i64, ptr %99, i64 0
  %101 = load i64, ptr %100, align 8, !tbaa !16
  %102 = and i64 %101, 3
  %103 = icmp eq i64 %102, 3
  br i1 %103, label %104, label %130

104:                                              ; preds = %94
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.GfpCtx_st, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !11
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  call void @int_rshift(i64 noundef 0, ptr noundef %107, i64 noundef 2, ptr noundef %108)
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.GfpCtx_st, ptr %110, i32 0, i32 1
  %112 = load ptr, ptr %111, align 8, !tbaa !19
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = call i64 @int_add(ptr noundef %109, ptr noundef %112, ptr noundef %113)
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfp_mod_pow(ptr noundef %115, ptr noundef %116, ptr noundef %117, ptr noundef %118)
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  call void @gfp_mod_sqr(ptr noundef %119, ptr noundef %120, ptr noundef %121)
  %122 = load ptr, ptr %12, align 8, !tbaa !5
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = call zeroext i1 @int_equals(ptr noundef %122, ptr noundef %123)
  br i1 %124, label %125, label %129

125:                                              ; preds = %104
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = call i32 @wa_copy(ptr noundef %126, ptr noundef %127)
  store i8 1, ptr %16, align 1, !tbaa !17
  br label %129

129:                                              ; preds = %125, %104
  br label %261

130:                                              ; preds = %94
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.GfpCtx_st, ptr %131, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !11
  %134 = getelementptr inbounds %struct.WordArray_st, ptr %133, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !20
  %136 = getelementptr inbounds i64, ptr %135, i64 0
  %137 = load i64, ptr %136, align 8, !tbaa !16
  %138 = and i64 %137, 7
  %139 = icmp eq i64 %138, 5
  br i1 %139, label %140, label %185

140:                                              ; preds = %130
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  call void @gfp_mod_add(ptr noundef %141, ptr noundef %142, ptr noundef %143, ptr noundef %144)
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.GfpCtx_st, ptr %145, i32 0, i32 0
  %147 = load ptr, ptr %146, align 8, !tbaa !11
  %148 = load ptr, ptr %12, align 8, !tbaa !5
  call void @int_rshift(i64 noundef 0, ptr noundef %147, i64 noundef 3, ptr noundef %148)
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = load ptr, ptr %10, align 8, !tbaa !5
  %151 = load ptr, ptr %12, align 8, !tbaa !5
  %152 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfp_mod_pow(ptr noundef %149, ptr noundef %150, ptr noundef %151, ptr noundef %152)
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = load ptr, ptr %11, align 8, !tbaa !5
  %155 = load ptr, ptr %13, align 8, !tbaa !5
  call void @gfp_mod_sqr(ptr noundef %153, ptr noundef %154, ptr noundef %155)
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = load ptr, ptr %13, align 8, !tbaa !5
  %158 = load ptr, ptr %10, align 8, !tbaa !5
  %159 = load ptr, ptr %13, align 8, !tbaa !5
  call void @gfp_mod_mul(ptr noundef %156, ptr noundef %157, ptr noundef %158, ptr noundef %159)
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = load ptr, ptr %13, align 8, !tbaa !5
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.GfpCtx_st, ptr %162, i32 0, i32 1
  %164 = load ptr, ptr %163, align 8, !tbaa !19
  %165 = load ptr, ptr %13, align 8, !tbaa !5
  call void @gfp_mod_sub(ptr noundef %160, ptr noundef %161, ptr noundef %164, ptr noundef %165)
  %166 = load ptr, ptr %4, align 8, !tbaa !5
  %167 = load ptr, ptr %13, align 8, !tbaa !5
  %168 = load ptr, ptr %11, align 8, !tbaa !5
  %169 = load ptr, ptr %13, align 8, !tbaa !5
  call void @gfp_mod_mul(ptr noundef %166, ptr noundef %167, ptr noundef %168, ptr noundef %169)
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = load ptr, ptr %5, align 8, !tbaa !5
  %172 = load ptr, ptr %13, align 8, !tbaa !5
  %173 = load ptr, ptr %14, align 8, !tbaa !5
  call void @gfp_mod_mul(ptr noundef %170, ptr noundef %171, ptr noundef %172, ptr noundef %173)
  %174 = load ptr, ptr %4, align 8, !tbaa !5
  %175 = load ptr, ptr %14, align 8, !tbaa !5
  %176 = load ptr, ptr %15, align 8, !tbaa !5
  call void @gfp_mod_sqr(ptr noundef %174, ptr noundef %175, ptr noundef %176)
  %177 = load ptr, ptr %15, align 8, !tbaa !5
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = call zeroext i1 @int_equals(ptr noundef %177, ptr noundef %178)
  br i1 %179, label %180, label %184

180:                                              ; preds = %140
  %181 = load ptr, ptr %14, align 8, !tbaa !5
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = call i32 @wa_copy(ptr noundef %181, ptr noundef %182)
  store i8 1, ptr %16, align 1, !tbaa !17
  br label %184

184:                                              ; preds = %180, %140
  br label %260

185:                                              ; preds = %130
  %186 = load ptr, ptr %4, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.GfpCtx_st, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !11
  %189 = load ptr, ptr %4, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.GfpCtx_st, ptr %189, i32 0, i32 1
  %191 = load ptr, ptr %190, align 8, !tbaa !19
  %192 = load ptr, ptr %13, align 8, !tbaa !5
  %193 = call i32 @int_sub(ptr noundef %188, ptr noundef %191, ptr noundef %192)
  %194 = load ptr, ptr %4, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.GfpCtx_st, ptr %194, i32 0, i32 0
  %196 = load ptr, ptr %195, align 8, !tbaa !11
  %197 = load ptr, ptr %4, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.GfpCtx_st, ptr %197, i32 0, i32 1
  %199 = load ptr, ptr %198, align 8, !tbaa !19
  %200 = load ptr, ptr %14, align 8, !tbaa !5
  %201 = call i64 @int_add(ptr noundef %196, ptr noundef %199, ptr noundef %200)
  store i64 %201, ptr %9, align 8, !tbaa !16
  %202 = load i64, ptr %9, align 8, !tbaa !16
  %203 = load ptr, ptr %14, align 8, !tbaa !5
  %204 = load ptr, ptr %14, align 8, !tbaa !5
  call void @int_rshift(i64 noundef %202, ptr noundef %203, i64 noundef 1, ptr noundef %204)
  %205 = load ptr, ptr %5, align 8, !tbaa !5
  %206 = load ptr, ptr %11, align 8, !tbaa !5
  %207 = call i32 @wa_copy(ptr noundef %205, ptr noundef %206)
  br label %208

208:                                              ; preds = %258, %185
  %209 = load ptr, ptr %4, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.GfpCtx_st, ptr %209, i32 0, i32 0
  %211 = load ptr, ptr %210, align 8, !tbaa !11
  %212 = load ptr, ptr %10, align 8, !tbaa !5
  %213 = call i32 @int_prand(ptr noundef %211, ptr noundef %212)
  %214 = load ptr, ptr %4, align 8, !tbaa !5
  %215 = load ptr, ptr %10, align 8, !tbaa !5
  %216 = load ptr, ptr %11, align 8, !tbaa !5
  %217 = load ptr, ptr %14, align 8, !tbaa !5
  %218 = load ptr, ptr %12, align 8, !tbaa !5
  %219 = load ptr, ptr %15, align 8, !tbaa !5
  call void @gfp_mod_lucas_seq(ptr noundef %214, ptr noundef %215, ptr noundef %216, ptr noundef %217, ptr noundef %218, ptr noundef %219)
  %220 = load ptr, ptr %15, align 8, !tbaa !5
  %221 = load ptr, ptr %4, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.GfpCtx_st, ptr %221, i32 0, i32 1
  %223 = load ptr, ptr %222, align 8, !tbaa !19
  %224 = call i32 @int_cmp(ptr noundef %220, ptr noundef %223)
  %225 = icmp sgt i32 %224, 0
  br i1 %225, label %226, label %232

226:                                              ; preds = %208
  %227 = load ptr, ptr %15, align 8, !tbaa !5
  %228 = load ptr, ptr %13, align 8, !tbaa !5
  %229 = call i32 @int_cmp(ptr noundef %227, ptr noundef %228)
  %230 = icmp slt i32 %229, 0
  br i1 %230, label %231, label %232

231:                                              ; preds = %226
  store i8 0, ptr %16, align 1, !tbaa !17
  br label %262

232:                                              ; preds = %226, %208
  store i64 0, ptr %9, align 8, !tbaa !16
  %233 = load ptr, ptr %12, align 8, !tbaa !5
  %234 = call i32 @int_get_bit(ptr noundef %233, i64 noundef 0)
  %235 = icmp ne i32 %234, 0
  br i1 %235, label %236, label %243

236:                                              ; preds = %232
  %237 = load ptr, ptr %12, align 8, !tbaa !5
  %238 = load ptr, ptr %4, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.GfpCtx_st, ptr %238, i32 0, i32 0
  %240 = load ptr, ptr %239, align 8, !tbaa !11
  %241 = load ptr, ptr %12, align 8, !tbaa !5
  %242 = call i64 @int_add(ptr noundef %237, ptr noundef %240, ptr noundef %241)
  store i64 %242, ptr %9, align 8, !tbaa !16
  br label %243

243:                                              ; preds = %236, %232
  %244 = load i64, ptr %9, align 8, !tbaa !16
  %245 = load ptr, ptr %12, align 8, !tbaa !5
  %246 = load ptr, ptr %12, align 8, !tbaa !5
  call void @int_rshift(i64 noundef %244, ptr noundef %245, i64 noundef 1, ptr noundef %246)
  %247 = load ptr, ptr %4, align 8, !tbaa !5
  %248 = load ptr, ptr %12, align 8, !tbaa !5
  %249 = load ptr, ptr %10, align 8, !tbaa !5
  call void @gfp_mod_sqr(ptr noundef %247, ptr noundef %248, ptr noundef %249)
  %250 = load ptr, ptr %10, align 8, !tbaa !5
  %251 = load ptr, ptr %5, align 8, !tbaa !5
  %252 = call zeroext i1 @int_equals(ptr noundef %250, ptr noundef %251)
  br i1 %252, label %253, label %257

253:                                              ; preds = %243
  %254 = load ptr, ptr %12, align 8, !tbaa !5
  %255 = load ptr, ptr %6, align 8, !tbaa !5
  %256 = call i32 @wa_copy(ptr noundef %254, ptr noundef %255)
  store i8 1, ptr %16, align 1, !tbaa !17
  br label %262

257:                                              ; preds = %243
  br label %258

258:                                              ; preds = %257
  br i1 true, label %208, label %259

259:                                              ; preds = %258
  br label %260

260:                                              ; preds = %259, %184
  br label %261

261:                                              ; preds = %260, %129
  br label %262

262:                                              ; preds = %261, %253, %231, %90, %77, %69, %61, %53, %45, %37
  %263 = load ptr, ptr %10, align 8, !tbaa !5
  call void @wa_free(ptr noundef %263)
  %264 = load ptr, ptr %11, align 8, !tbaa !5
  call void @wa_free(ptr noundef %264)
  %265 = load ptr, ptr %12, align 8, !tbaa !5
  call void @wa_free(ptr noundef %265)
  %266 = load ptr, ptr %13, align 8, !tbaa !5
  call void @wa_free(ptr noundef %266)
  %267 = load ptr, ptr %14, align 8, !tbaa !5
  call void @wa_free(ptr noundef %267)
  %268 = load ptr, ptr %15, align 8, !tbaa !5
  call void @wa_free(ptr noundef %268)
  %269 = load i8, ptr %16, align 1, !tbaa !17, !range !21, !noundef !22
  %270 = trunc i8 %269 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  ret i1 %270
}

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

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

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 = !{!"GfpCtx_st", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!13 = !{!14, !15, i64 8}
!14 = !{!"WordArray_st", !6, i64 0, !15, i64 8}
!15 = !{!"long", !7, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"_Bool", !7, i64 0}
!19 = !{!12, !6, i64 8}
!20 = !{!14, !6, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}


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

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

declare void @wa_free(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @gfp_mod_add(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @gfp_mod_sub(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @gfp_mod_mul(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @wa_alloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @gfp_mod_sqr(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @gfp_mod_pow(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @gfp_mod_sqrt(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 8
  %6 = load i64, ptr %5, align 8, !tbaa !10
  %7 = tail call ptr @wa_alloc(i64 noundef %6) #2
  %8 = tail call ptr @wa_alloc(i64 noundef %6) #2
  %9 = tail call ptr @wa_alloc(i64 noundef %6) #2
  %10 = tail call ptr @wa_alloc(i64 noundef %6) #2
  %11 = tail call ptr @wa_alloc(i64 noundef %6) #2
  %12 = tail call ptr @wa_alloc(i64 noundef %6) #2
  %13 = icmp eq ptr %7, null
  br i1 %13, label %14, label %15

14:                                               ; preds = %3
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 606, i32 noundef 2) #2
  br label %.loopexit

15:                                               ; preds = %3
  %16 = icmp eq ptr %8, null
  br i1 %16, label %17, label %18

17:                                               ; preds = %15
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 607, i32 noundef 2) #2
  br label %.loopexit

18:                                               ; preds = %15
  %19 = icmp eq ptr %9, null
  br i1 %19, label %20, label %21

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

21:                                               ; preds = %18
  %22 = icmp eq ptr %10, null
  br i1 %22, label %23, label %24

23:                                               ; preds = %21
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 609, i32 noundef 2) #2
  br label %.loopexit

24:                                               ; preds = %21
  %25 = icmp eq ptr %11, null
  br i1 %25, label %26, label %27

26:                                               ; preds = %24
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 610, i32 noundef 2) #2
  br label %.loopexit

27:                                               ; preds = %24
  %28 = icmp eq ptr %12, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %27
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 611, i32 noundef 2) #2
  br label %.loopexit

30:                                               ; preds = %27
  %31 = tail call zeroext i1 @int_is_zero(ptr noundef %1) #2
  br i1 %31, label %36, label %32

32:                                               ; preds = %30
  %33 = getelementptr inbounds i8, ptr %0, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !13
  %35 = tail call zeroext i1 @int_equals(ptr noundef %1, ptr noundef %34) #2
  br i1 %35, label %36, label %38

36:                                               ; preds = %32, %30
  %37 = tail call i32 @wa_copy(ptr noundef %1, ptr noundef %2) #2
  br label %.loopexit

38:                                               ; preds = %32
  %39 = load ptr, ptr %0, align 8, !tbaa !5
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  %41 = load i64, ptr %40, align 8, !tbaa !15
  %42 = and i64 %41, 3
  %43 = icmp eq i64 %42, 3
  br i1 %43, label %44, label %50

44:                                               ; preds = %38
  tail call void @int_rshift(i64 noundef 0, ptr noundef nonnull %39, i64 noundef 2, ptr noundef nonnull %7) #2
  %45 = load ptr, ptr %33, align 8, !tbaa !13
  %46 = tail call i64 @int_add(ptr noundef nonnull %7, ptr noundef %45, ptr noundef nonnull %7) #2
  tail call void @gfp_mod_pow(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %7, ptr noundef nonnull %8)
  tail call void @gfp_mod_sqr(ptr noundef nonnull %0, ptr noundef nonnull %8, ptr noundef nonnull %9)
  %47 = tail call zeroext i1 @int_equals(ptr noundef nonnull %9, ptr noundef %1) #2
  br i1 %47, label %48, label %.loopexit

48:                                               ; preds = %44
  %49 = tail call i32 @wa_copy(ptr noundef nonnull %8, ptr noundef %2) #2
  br label %.loopexit

50:                                               ; preds = %38
  %51 = and i64 %41, 7
  %52 = icmp eq i64 %51, 5
  br i1 %52, label %53, label %59

53:                                               ; preds = %50
  tail call void @gfp_mod_add(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %1, ptr noundef nonnull %7)
  %54 = load ptr, ptr %0, align 8, !tbaa !5
  tail call void @int_rshift(i64 noundef 0, ptr noundef %54, i64 noundef 3, ptr noundef nonnull %9) #2
  tail call void @gfp_mod_pow(ptr noundef nonnull %0, ptr noundef nonnull %7, ptr noundef nonnull %9, ptr noundef nonnull %8)
  tail call void @gfp_mod_sqr(ptr noundef nonnull %0, ptr noundef nonnull %8, ptr noundef nonnull %10)
  tail call void @gfp_mod_mul(ptr noundef nonnull %0, ptr noundef nonnull %10, ptr noundef nonnull %7, ptr noundef nonnull %10)
  %55 = load ptr, ptr %33, align 8, !tbaa !13
  tail call void @gfp_mod_sub(ptr noundef nonnull %0, ptr noundef nonnull %10, ptr noundef %55, ptr noundef nonnull %10)
  tail call void @gfp_mod_mul(ptr noundef nonnull %0, ptr noundef nonnull %10, ptr noundef nonnull %8, ptr noundef nonnull %10)
  tail call void @gfp_mod_mul(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %10, ptr noundef nonnull %11)
  tail call void @gfp_mod_sqr(ptr noundef nonnull %0, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %56 = tail call zeroext i1 @int_equals(ptr noundef nonnull %12, ptr noundef %1) #2
  br i1 %56, label %57, label %.loopexit

57:                                               ; preds = %53
  %58 = tail call i32 @wa_copy(ptr noundef nonnull %11, ptr noundef %2) #2
  br label %.loopexit

59:                                               ; preds = %50
  %60 = load ptr, ptr %33, align 8, !tbaa !13
  %61 = tail call i32 @int_sub(ptr noundef nonnull %39, ptr noundef %60, ptr noundef nonnull %10) #2
  %62 = load ptr, ptr %0, align 8, !tbaa !5
  %63 = load ptr, ptr %33, align 8, !tbaa !13
  %64 = tail call i64 @int_add(ptr noundef %62, ptr noundef %63, ptr noundef nonnull %11) #2
  tail call void @int_rshift(i64 noundef %64, ptr noundef nonnull %11, i64 noundef 1, ptr noundef nonnull %11) #2
  %65 = tail call i32 @wa_copy(ptr noundef %1, ptr noundef nonnull %8) #2
  br label %66

66:                                               ; preds = %80, %59
  %67 = load ptr, ptr %0, align 8, !tbaa !5
  %68 = tail call i32 @int_prand(ptr noundef %67, ptr noundef nonnull %7) #2
  tail call void @gfp_mod_lucas_seq(ptr noundef nonnull %0, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %11, ptr noundef nonnull %9, ptr noundef nonnull %12)
  %69 = load ptr, ptr %33, align 8, !tbaa !13
  %70 = tail call i32 @int_cmp(ptr noundef nonnull %12, ptr noundef %69) #2
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %72, label %75

72:                                               ; preds = %66
  %73 = tail call i32 @int_cmp(ptr noundef nonnull %12, ptr noundef nonnull %10) #2
  %74 = icmp slt i32 %73, 0
  br i1 %74, label %.loopexit, label %75

75:                                               ; preds = %72, %66
  %76 = tail call i32 @int_get_bit(ptr noundef nonnull %9, i64 noundef 0) #2
  %.not = icmp eq i32 %76, 0
  br i1 %.not, label %80, label %77

77:                                               ; preds = %75
  %78 = load ptr, ptr %0, align 8, !tbaa !5
  %79 = tail call i64 @int_add(ptr noundef nonnull %9, ptr noundef %78, ptr noundef nonnull %9) #2
  br label %80

80:                                               ; preds = %77, %75
  %.0121 = phi i64 [ %79, %77 ], [ 0, %75 ]
  tail call void @int_rshift(i64 noundef %.0121, ptr noundef nonnull %9, i64 noundef 1, ptr noundef nonnull %9) #2
  tail call void @gfp_mod_sqr(ptr noundef nonnull %0, ptr noundef nonnull %9, ptr noundef nonnull %7)
  %81 = tail call zeroext i1 @int_equals(ptr noundef nonnull %7, ptr noundef %1) #2
  br i1 %81, label %82, label %66

82:                                               ; preds = %80
  %83 = tail call i32 @wa_copy(ptr noundef nonnull %9, ptr noundef %2) #2
  br label %.loopexit

.loopexit:                                        ; preds = %72, %48, %44, %53, %57, %82, %36, %29, %26, %23, %20, %17, %14
  %.0 = phi i1 [ false, %14 ], [ false, %17 ], [ false, %20 ], [ false, %23 ], [ false, %26 ], [ false, %29 ], [ true, %36 ], [ true, %48 ], [ false, %44 ], [ true, %57 ], [ false, %53 ], [ true, %82 ], [ false, %72 ]
  tail call void @wa_free(ptr noundef %7) #2
  tail call void @wa_free(ptr noundef %8) #2
  tail call void @wa_free(ptr noundef %9) #2
  tail call void @wa_free(ptr noundef %10) #2
  tail call void @wa_free(ptr noundef %11) #2
  tail call void @wa_free(ptr noundef %12) #2
  ret i1 %.0
}

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

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

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 = !{!"GfpCtx_st", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !12, i64 8}
!11 = !{!"WordArray_st", !7, i64 0, !12, i64 8}
!12 = !{!"long", !8, i64 0}
!13 = !{!6, !7, i64 8}
!14 = !{!11, !7, i64 0}
!15 = !{!12, !12, i64 0}


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