; LLVM IR from guanzhi/GmSSL :: src (sm2_enc)

; 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.SM2_Z256_POINT = type { [4 x i64], [4 x i64], [4 x i64] }
%struct.SM2_ENC_PRE_COMP = type { [4 x i64], %struct.SM2_POINT }
%struct.SM2_POINT = type { [32 x i8], [32 x i8] }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@__FUNCTION__.sm2_encrypt_pre_compute = external hidden unnamed_addr constant [24 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

; Function Attrs: nounwind uwtable
define dso_local i32 @sm2_encrypt_pre_compute(ptr noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca [8 x %struct.SM2_Z256_POINT], align 16
  %5 = alloca [8 x [4 x i64]], align 16
  %6 = alloca [8 x [4 x i64]], align 16
  %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 768, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 256, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 256, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %9

9:                                                ; preds = %49, %1
  %10 = load i32, ptr %7, align 4, !tbaa !9
  %11 = icmp slt i32 %10, 8
  br i1 %11, label %12, label %52

12:                                               ; preds = %9
  br label %13

13:                                               ; preds = %30, %12
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = load i32, ptr %7, align 4, !tbaa !9
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds %struct.SM2_ENC_PRE_COMP, ptr %14, i64 %16
  %18 = getelementptr inbounds %struct.SM2_ENC_PRE_COMP, ptr %17, i32 0, i32 0
  %19 = getelementptr inbounds [4 x i64], ptr %18, i64 0, i64 0
  %20 = call ptr @sm2_z256_order()
  %21 = call i32 @sm2_z256_rand_range(ptr noundef %19, ptr noundef %20)
  %22 = icmp ne i32 %21, 1
  br i1 %22, label %23, label %29

23:                                               ; preds = %13
  br label %24

24:                                               ; preds = %23
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 74, ptr noundef @__FUNCTION__.sm2_encrypt_pre_compute) #4
  br label %27

27:                                               ; preds = %24
  br label %28

28:                                               ; preds = %27
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %267

29:                                               ; preds = %13
  br label %30

30:                                               ; preds = %29
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds %struct.SM2_ENC_PRE_COMP, ptr %31, i64 %33
  %35 = getelementptr inbounds %struct.SM2_ENC_PRE_COMP, ptr %34, i32 0, i32 0
  %36 = getelementptr inbounds [4 x i64], ptr %35, i64 0, i64 0
  %37 = call i64 @sm2_z256_is_zero(ptr noundef %36)
  %38 = icmp ne i64 %37, 0
  br i1 %38, label %13, label %39, !llvm.loop !11

39:                                               ; preds = %30
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %41
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = load i32, ptr %7, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds %struct.SM2_ENC_PRE_COMP, ptr %43, i64 %45
  %47 = getelementptr inbounds %struct.SM2_ENC_PRE_COMP, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds [4 x i64], ptr %47, i64 0, i64 0
  call void @sm2_z256_point_mul_generator(ptr noundef %42, ptr noundef %48)
  br label %49

49:                                               ; preds = %39
  %50 = load i32, ptr %7, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %7, align 4, !tbaa !9
  br label %9, !llvm.loop !13

52:                                               ; preds = %9
  %53 = getelementptr inbounds [8 x [4 x i64]], ptr %5, i64 0, i64 0
  %54 = getelementptr inbounds [4 x i64], ptr %53, i64 0, i64 0
  %55 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 0
  %56 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %55, i32 0, i32 2
  %57 = getelementptr inbounds [4 x i64], ptr %56, i64 0, i64 0
  call void @sm2_z256_copy(ptr noundef %54, ptr noundef %57)
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %76, %52
  %59 = load i32, ptr %7, align 4, !tbaa !9
  %60 = icmp slt i32 %59, 8
  br i1 %60, label %61, label %79

61:                                               ; preds = %58
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [8 x [4 x i64]], ptr %5, i64 0, i64 %63
  %65 = getelementptr inbounds [4 x i64], ptr %64, i64 0, i64 0
  %66 = load i32, ptr %7, align 4, !tbaa !9
  %67 = sub nsw i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [8 x [4 x i64]], ptr %5, i64 0, i64 %68
  %70 = getelementptr inbounds [4 x i64], ptr %69, i64 0, i64 0
  %71 = load i32, ptr %7, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %72
  %74 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %73, i32 0, i32 2
  %75 = getelementptr inbounds [4 x i64], ptr %74, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %65, ptr noundef %70, ptr noundef %75)
  br label %76

76:                                               ; preds = %61
  %77 = load i32, ptr %7, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %7, align 4, !tbaa !9
  br label %58, !llvm.loop !14

79:                                               ; preds = %58
  %80 = getelementptr inbounds [8 x [4 x i64]], ptr %5, i64 0, i64 7
  %81 = getelementptr inbounds [4 x i64], ptr %80, i64 0, i64 0
  %82 = getelementptr inbounds [8 x [4 x i64]], ptr %5, i64 0, i64 7
  %83 = getelementptr inbounds [4 x i64], ptr %82, i64 0, i64 0
  call void @sm2_z256_modp_mont_inv(ptr noundef %81, ptr noundef %83)
  %84 = getelementptr inbounds [8 x [4 x i64]], ptr %6, i64 0, i64 7
  %85 = getelementptr inbounds [4 x i64], ptr %84, i64 0, i64 0
  %86 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 7
  %87 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %86, i32 0, i32 2
  %88 = getelementptr inbounds [4 x i64], ptr %87, i64 0, i64 0
  call void @sm2_z256_copy(ptr noundef %85, ptr noundef %88)
  store i32 6, ptr %7, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %107, %79
  %90 = load i32, ptr %7, align 4, !tbaa !9
  %91 = icmp sge i32 %90, 1
  br i1 %91, label %92, label %110

92:                                               ; preds = %89
  %93 = load i32, ptr %7, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [8 x [4 x i64]], ptr %6, i64 0, i64 %94
  %96 = getelementptr inbounds [4 x i64], ptr %95, i64 0, i64 0
  %97 = load i32, ptr %7, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [8 x [4 x i64]], ptr %6, i64 0, i64 %99
  %101 = getelementptr inbounds [4 x i64], ptr %100, i64 0, i64 0
  %102 = load i32, ptr %7, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %103
  %105 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %104, i32 0, i32 2
  %106 = getelementptr inbounds [4 x i64], ptr %105, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %96, ptr noundef %101, ptr noundef %106)
  br label %107

107:                                              ; preds = %92
  %108 = load i32, ptr %7, align 4, !tbaa !9
  %109 = add nsw i32 %108, -1
  store i32 %109, ptr %7, align 4, !tbaa !9
  br label %89, !llvm.loop !15

110:                                              ; preds = %89
  %111 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 0
  %112 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %111, i32 0, i32 2
  %113 = getelementptr inbounds [4 x i64], ptr %112, i64 0, i64 0
  %114 = getelementptr inbounds [8 x [4 x i64]], ptr %6, i64 0, i64 1
  %115 = getelementptr inbounds [4 x i64], ptr %114, i64 0, i64 0
  %116 = getelementptr inbounds [8 x [4 x i64]], ptr %5, i64 0, i64 7
  %117 = getelementptr inbounds [4 x i64], ptr %116, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %113, ptr noundef %115, ptr noundef %117)
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %149, %110
  %119 = load i32, ptr %7, align 4, !tbaa !9
  %120 = icmp slt i32 %119, 7
  br i1 %120, label %121, label %152

121:                                              ; preds = %118
  %122 = load i32, ptr %7, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %123
  %125 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %124, i32 0, i32 2
  %126 = getelementptr inbounds [4 x i64], ptr %125, i64 0, i64 0
  %127 = load i32, ptr %7, align 4, !tbaa !9
  %128 = add nsw i32 %127, 1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [8 x [4 x i64]], ptr %6, i64 0, i64 %129
  %131 = getelementptr inbounds [4 x i64], ptr %130, i64 0, i64 0
  %132 = load i32, ptr %7, align 4, !tbaa !9
  %133 = sub nsw i32 %132, 1
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [8 x [4 x i64]], ptr %5, i64 0, i64 %134
  %136 = getelementptr inbounds [4 x i64], ptr %135, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %126, ptr noundef %131, ptr noundef %136)
  %137 = load i32, ptr %7, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %138
  %140 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %139, i32 0, i32 2
  %141 = getelementptr inbounds [4 x i64], ptr %140, i64 0, i64 0
  %142 = load i32, ptr %7, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %143
  %145 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %144, i32 0, i32 2
  %146 = getelementptr inbounds [4 x i64], ptr %145, i64 0, i64 0
  %147 = getelementptr inbounds [8 x [4 x i64]], ptr %5, i64 0, i64 7
  %148 = getelementptr inbounds [4 x i64], ptr %147, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %141, ptr noundef %146, ptr noundef %148)
  br label %149

149:                                              ; preds = %121
  %150 = load i32, ptr %7, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %7, align 4, !tbaa !9
  br label %118, !llvm.loop !16

152:                                              ; preds = %118
  %153 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 7
  %154 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %153, i32 0, i32 2
  %155 = getelementptr inbounds [4 x i64], ptr %154, i64 0, i64 0
  %156 = getelementptr inbounds [8 x [4 x i64]], ptr %5, i64 0, i64 6
  %157 = getelementptr inbounds [4 x i64], ptr %156, i64 0, i64 0
  %158 = getelementptr inbounds [8 x [4 x i64]], ptr %5, i64 0, i64 7
  %159 = getelementptr inbounds [4 x i64], ptr %158, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %155, ptr noundef %157, ptr noundef %159)
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %263, %152
  %161 = load i32, ptr %7, align 4, !tbaa !9
  %162 = icmp slt i32 %161, 8
  br i1 %162, label %163, label %266

163:                                              ; preds = %160
  %164 = load i32, ptr %7, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %165
  %167 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %166, i32 0, i32 1
  %168 = getelementptr inbounds [4 x i64], ptr %167, i64 0, i64 0
  %169 = load i32, ptr %7, align 4, !tbaa !9
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %170
  %172 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %171, i32 0, i32 1
  %173 = getelementptr inbounds [4 x i64], ptr %172, i64 0, i64 0
  %174 = load i32, ptr %7, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %175
  %177 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %176, i32 0, i32 2
  %178 = getelementptr inbounds [4 x i64], ptr %177, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %168, ptr noundef %173, ptr noundef %178)
  %179 = load i32, ptr %7, align 4, !tbaa !9
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %180
  %182 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %181, i32 0, i32 2
  %183 = getelementptr inbounds [4 x i64], ptr %182, i64 0, i64 0
  %184 = load i32, ptr %7, align 4, !tbaa !9
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %185
  %187 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %186, i32 0, i32 2
  %188 = getelementptr inbounds [4 x i64], ptr %187, i64 0, i64 0
  call void @sm2_z256_modp_mont_sqr(ptr noundef %183, ptr noundef %188)
  %189 = load i32, ptr %7, align 4, !tbaa !9
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %190
  %192 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %191, i32 0, i32 1
  %193 = getelementptr inbounds [4 x i64], ptr %192, i64 0, i64 0
  %194 = load i32, ptr %7, align 4, !tbaa !9
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %195
  %197 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %196, i32 0, i32 1
  %198 = getelementptr inbounds [4 x i64], ptr %197, i64 0, i64 0
  %199 = load i32, ptr %7, align 4, !tbaa !9
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %200
  %202 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %201, i32 0, i32 2
  %203 = getelementptr inbounds [4 x i64], ptr %202, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %193, ptr noundef %198, ptr noundef %203)
  %204 = load i32, ptr %7, align 4, !tbaa !9
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %205
  %207 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %206, i32 0, i32 0
  %208 = getelementptr inbounds [4 x i64], ptr %207, i64 0, i64 0
  %209 = load i32, ptr %7, align 4, !tbaa !9
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %210
  %212 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %211, i32 0, i32 0
  %213 = getelementptr inbounds [4 x i64], ptr %212, i64 0, i64 0
  %214 = load i32, ptr %7, align 4, !tbaa !9
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %215
  %217 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %216, i32 0, i32 2
  %218 = getelementptr inbounds [4 x i64], ptr %217, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %208, ptr noundef %213, ptr noundef %218)
  %219 = load i32, ptr %7, align 4, !tbaa !9
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %220
  %222 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %221, i32 0, i32 0
  %223 = getelementptr inbounds [4 x i64], ptr %222, i64 0, i64 0
  %224 = load i32, ptr %7, align 4, !tbaa !9
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %225
  %227 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %226, i32 0, i32 0
  %228 = getelementptr inbounds [4 x i64], ptr %227, i64 0, i64 0
  call void @sm2_z256_modp_from_mont(ptr noundef %223, ptr noundef %228)
  %229 = load i32, ptr %7, align 4, !tbaa !9
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %230
  %232 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %231, i32 0, i32 1
  %233 = getelementptr inbounds [4 x i64], ptr %232, i64 0, i64 0
  %234 = load i32, ptr %7, align 4, !tbaa !9
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %235
  %237 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %236, i32 0, i32 1
  %238 = getelementptr inbounds [4 x i64], ptr %237, i64 0, i64 0
  call void @sm2_z256_modp_from_mont(ptr noundef %233, ptr noundef %238)
  %239 = load i32, ptr %7, align 4, !tbaa !9
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %240
  %242 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %241, i32 0, i32 0
  %243 = getelementptr inbounds [4 x i64], ptr %242, i64 0, i64 0
  %244 = load ptr, ptr %3, align 8, !tbaa !5
  %245 = load i32, ptr %7, align 4, !tbaa !9
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds %struct.SM2_ENC_PRE_COMP, ptr %244, i64 %246
  %248 = getelementptr inbounds %struct.SM2_ENC_PRE_COMP, ptr %247, i32 0, i32 1
  %249 = getelementptr inbounds %struct.SM2_POINT, ptr %248, i32 0, i32 0
  %250 = getelementptr inbounds [32 x i8], ptr %249, i64 0, i64 0
  call void @sm2_z256_to_bytes(ptr noundef %243, ptr noundef %250)
  %251 = load i32, ptr %7, align 4, !tbaa !9
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [8 x %struct.SM2_Z256_POINT], ptr %4, i64 0, i64 %252
  %254 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %253, i32 0, i32 1
  %255 = getelementptr inbounds [4 x i64], ptr %254, i64 0, i64 0
  %256 = load ptr, ptr %3, align 8, !tbaa !5
  %257 = load i32, ptr %7, align 4, !tbaa !9
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds %struct.SM2_ENC_PRE_COMP, ptr %256, i64 %258
  %260 = getelementptr inbounds %struct.SM2_ENC_PRE_COMP, ptr %259, i32 0, i32 1
  %261 = getelementptr inbounds %struct.SM2_POINT, ptr %260, i32 0, i32 1
  %262 = getelementptr inbounds [32 x i8], ptr %261, i64 0, i64 0
  call void @sm2_z256_to_bytes(ptr noundef %255, ptr noundef %262)
  br label %263

263:                                              ; preds = %163
  %264 = load i32, ptr %7, align 4, !tbaa !9
  %265 = add nsw i32 %264, 1
  store i32 %265, ptr %7, align 4, !tbaa !9
  br label %160, !llvm.loop !17

266:                                              ; preds = %160
  store i32 1, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %267

267:                                              ; preds = %266, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 256, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 256, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 768, ptr %4) #4
  %268 = load i32, ptr %2, align 4
  ret i32 %268
}

declare i32 @sm2_z256_rand_range(ptr noundef, ptr noundef) #2

declare ptr @sm2_z256_order() #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare i64 @sm2_z256_is_zero(ptr noundef) #2

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

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

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

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

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

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

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

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

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


; 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"

%struct.SM2_Z256_POINT = type { [4 x i64], [4 x i64], [4 x i64] }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@__FUNCTION__.sm2_encrypt_pre_compute = external hidden unnamed_addr constant [24 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @sm2_encrypt_pre_compute(ptr noundef %0) local_unnamed_addr #1 {
.preheader:
  %1 = alloca [8 x %struct.SM2_Z256_POINT], align 16
  %2 = alloca [8 x [4 x i64]], align 16
  %3 = alloca [8 x [4 x i64]], align 16
  call void @llvm.lifetime.start.p0(i64 768, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %3) #4
  br label %4

4:                                                ; preds = %.preheader, %9
  %5 = tail call ptr @sm2_z256_order() #4
  %6 = tail call i32 @sm2_z256_rand_range(ptr noundef %0, ptr noundef %5) #4
  %.not = icmp eq i32 %6, 1
  br i1 %.not, label %9, label %.loopexit60

.loopexit60:                                      ; preds = %4, %12, %19, %26, %33, %40, %47, %54
  %7 = load ptr, ptr @stderr, align 8, !tbaa !5
  %8 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 74, ptr noundef nonnull @__FUNCTION__.sm2_encrypt_pre_compute) #5
  br label %.loopexit

9:                                                ; preds = %4
  %10 = tail call i64 @sm2_z256_is_zero(ptr noundef %0) #4
  %.not50 = icmp eq i64 %10, 0
  br i1 %.not50, label %.preheader.1, label %4, !llvm.loop !9

.preheader.1:                                     ; preds = %9
  call void @sm2_z256_point_mul_generator(ptr noundef nonnull %1, ptr noundef %0) #4
  %11 = getelementptr inbounds i8, ptr %0, i64 96
  br label %12

12:                                               ; preds = %15, %.preheader.1
  %13 = call ptr @sm2_z256_order() #4
  %14 = call i32 @sm2_z256_rand_range(ptr noundef nonnull %11, ptr noundef %13) #4
  %.not.1 = icmp eq i32 %14, 1
  br i1 %.not.1, label %15, label %.loopexit60

15:                                               ; preds = %12
  %16 = call i64 @sm2_z256_is_zero(ptr noundef nonnull %11) #4
  %.not50.1 = icmp eq i64 %16, 0
  br i1 %.not50.1, label %.preheader.2, label %12, !llvm.loop !9

.preheader.2:                                     ; preds = %15
  %17 = getelementptr inbounds i8, ptr %1, i64 96
  call void @sm2_z256_point_mul_generator(ptr noundef nonnull %17, ptr noundef nonnull %11) #4
  %18 = getelementptr inbounds i8, ptr %0, i64 192
  br label %19

19:                                               ; preds = %22, %.preheader.2
  %20 = call ptr @sm2_z256_order() #4
  %21 = call i32 @sm2_z256_rand_range(ptr noundef nonnull %18, ptr noundef %20) #4
  %.not.2 = icmp eq i32 %21, 1
  br i1 %.not.2, label %22, label %.loopexit60

22:                                               ; preds = %19
  %23 = call i64 @sm2_z256_is_zero(ptr noundef nonnull %18) #4
  %.not50.2 = icmp eq i64 %23, 0
  br i1 %.not50.2, label %.preheader.3, label %19, !llvm.loop !9

.preheader.3:                                     ; preds = %22
  %24 = getelementptr inbounds i8, ptr %1, i64 192
  call void @sm2_z256_point_mul_generator(ptr noundef nonnull %24, ptr noundef nonnull %18) #4
  %25 = getelementptr inbounds i8, ptr %0, i64 288
  br label %26

26:                                               ; preds = %29, %.preheader.3
  %27 = call ptr @sm2_z256_order() #4
  %28 = call i32 @sm2_z256_rand_range(ptr noundef nonnull %25, ptr noundef %27) #4
  %.not.3 = icmp eq i32 %28, 1
  br i1 %.not.3, label %29, label %.loopexit60

29:                                               ; preds = %26
  %30 = call i64 @sm2_z256_is_zero(ptr noundef nonnull %25) #4
  %.not50.3 = icmp eq i64 %30, 0
  br i1 %.not50.3, label %.preheader.4, label %26, !llvm.loop !9

.preheader.4:                                     ; preds = %29
  %31 = getelementptr inbounds i8, ptr %1, i64 288
  call void @sm2_z256_point_mul_generator(ptr noundef nonnull %31, ptr noundef nonnull %25) #4
  %32 = getelementptr inbounds i8, ptr %0, i64 384
  br label %33

33:                                               ; preds = %36, %.preheader.4
  %34 = call ptr @sm2_z256_order() #4
  %35 = call i32 @sm2_z256_rand_range(ptr noundef nonnull %32, ptr noundef %34) #4
  %.not.4 = icmp eq i32 %35, 1
  br i1 %.not.4, label %36, label %.loopexit60

36:                                               ; preds = %33
  %37 = call i64 @sm2_z256_is_zero(ptr noundef nonnull %32) #4
  %.not50.4 = icmp eq i64 %37, 0
  br i1 %.not50.4, label %.preheader.5, label %33, !llvm.loop !9

.preheader.5:                                     ; preds = %36
  %38 = getelementptr inbounds i8, ptr %1, i64 384
  call void @sm2_z256_point_mul_generator(ptr noundef nonnull %38, ptr noundef nonnull %32) #4
  %39 = getelementptr inbounds i8, ptr %0, i64 480
  br label %40

40:                                               ; preds = %43, %.preheader.5
  %41 = call ptr @sm2_z256_order() #4
  %42 = call i32 @sm2_z256_rand_range(ptr noundef nonnull %39, ptr noundef %41) #4
  %.not.5 = icmp eq i32 %42, 1
  br i1 %.not.5, label %43, label %.loopexit60

43:                                               ; preds = %40
  %44 = call i64 @sm2_z256_is_zero(ptr noundef nonnull %39) #4
  %.not50.5 = icmp eq i64 %44, 0
  br i1 %.not50.5, label %.preheader.6, label %40, !llvm.loop !9

.preheader.6:                                     ; preds = %43
  %45 = getelementptr inbounds i8, ptr %1, i64 480
  call void @sm2_z256_point_mul_generator(ptr noundef nonnull %45, ptr noundef nonnull %39) #4
  %46 = getelementptr inbounds i8, ptr %0, i64 576
  br label %47

47:                                               ; preds = %50, %.preheader.6
  %48 = call ptr @sm2_z256_order() #4
  %49 = call i32 @sm2_z256_rand_range(ptr noundef nonnull %46, ptr noundef %48) #4
  %.not.6 = icmp eq i32 %49, 1
  br i1 %.not.6, label %50, label %.loopexit60

50:                                               ; preds = %47
  %51 = call i64 @sm2_z256_is_zero(ptr noundef nonnull %46) #4
  %.not50.6 = icmp eq i64 %51, 0
  br i1 %.not50.6, label %.preheader.7, label %47, !llvm.loop !9

.preheader.7:                                     ; preds = %50
  %52 = getelementptr inbounds i8, ptr %1, i64 576
  call void @sm2_z256_point_mul_generator(ptr noundef nonnull %52, ptr noundef nonnull %46) #4
  %53 = getelementptr inbounds i8, ptr %0, i64 672
  br label %54

54:                                               ; preds = %57, %.preheader.7
  %55 = call ptr @sm2_z256_order() #4
  %56 = call i32 @sm2_z256_rand_range(ptr noundef nonnull %53, ptr noundef %55) #4
  %.not.7 = icmp eq i32 %56, 1
  br i1 %.not.7, label %57, label %.loopexit60

57:                                               ; preds = %54
  %58 = call i64 @sm2_z256_is_zero(ptr noundef nonnull %53) #4
  %.not50.7 = icmp eq i64 %58, 0
  br i1 %.not50.7, label %.loopexit.loopexit, label %54, !llvm.loop !9

.loopexit.loopexit:                               ; preds = %57
  %59 = getelementptr inbounds i8, ptr %1, i64 672
  call void @sm2_z256_point_mul_generator(ptr noundef nonnull %59, ptr noundef nonnull %53) #4
  %60 = getelementptr inbounds i8, ptr %1, i64 64
  call void @sm2_z256_copy(ptr noundef nonnull %2, ptr noundef nonnull %60) #4
  %61 = getelementptr inbounds i8, ptr %2, i64 32
  %62 = getelementptr inbounds i8, ptr %1, i64 160
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %61, ptr noundef nonnull %2, ptr noundef nonnull %62) #4
  %63 = getelementptr inbounds i8, ptr %2, i64 64
  %64 = getelementptr inbounds i8, ptr %1, i64 256
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %63, ptr noundef nonnull %61, ptr noundef nonnull %64) #4
  %65 = getelementptr inbounds i8, ptr %2, i64 96
  %66 = getelementptr inbounds i8, ptr %1, i64 352
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %65, ptr noundef nonnull %63, ptr noundef nonnull %66) #4
  %67 = getelementptr inbounds i8, ptr %2, i64 128
  %68 = getelementptr inbounds i8, ptr %1, i64 448
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %67, ptr noundef nonnull %65, ptr noundef nonnull %68) #4
  %69 = getelementptr inbounds i8, ptr %2, i64 160
  %70 = getelementptr inbounds i8, ptr %1, i64 544
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %69, ptr noundef nonnull %67, ptr noundef nonnull %70) #4
  %71 = getelementptr inbounds i8, ptr %2, i64 192
  %72 = getelementptr inbounds i8, ptr %1, i64 640
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %71, ptr noundef nonnull %69, ptr noundef nonnull %72) #4
  %73 = getelementptr inbounds i8, ptr %2, i64 224
  %74 = getelementptr inbounds i8, ptr %1, i64 736
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %73, ptr noundef nonnull %71, ptr noundef nonnull %74) #4
  call void @sm2_z256_modp_mont_inv(ptr noundef nonnull %73, ptr noundef nonnull %73) #4
  %75 = getelementptr inbounds i8, ptr %3, i64 224
  call void @sm2_z256_copy(ptr noundef nonnull %75, ptr noundef nonnull %74) #4
  %76 = getelementptr inbounds i8, ptr %3, i64 192
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %76, ptr noundef nonnull %75, ptr noundef nonnull %72) #4
  %77 = getelementptr inbounds i8, ptr %3, i64 160
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %77, ptr noundef nonnull %76, ptr noundef nonnull %70) #4
  %78 = getelementptr inbounds i8, ptr %3, i64 128
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %78, ptr noundef nonnull %77, ptr noundef nonnull %68) #4
  %79 = getelementptr inbounds i8, ptr %3, i64 96
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %79, ptr noundef nonnull %78, ptr noundef nonnull %66) #4
  %80 = getelementptr inbounds i8, ptr %3, i64 64
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %80, ptr noundef nonnull %79, ptr noundef nonnull %64) #4
  %81 = getelementptr inbounds i8, ptr %3, i64 32
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %81, ptr noundef nonnull %80, ptr noundef nonnull %62) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %60, ptr noundef nonnull %81, ptr noundef nonnull %73) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %62, ptr noundef nonnull %80, ptr noundef nonnull %2) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %62, ptr noundef nonnull %62, ptr noundef nonnull %73) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %64, ptr noundef nonnull %79, ptr noundef nonnull %61) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %64, ptr noundef nonnull %64, ptr noundef nonnull %73) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %66, ptr noundef nonnull %78, ptr noundef nonnull %63) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %66, ptr noundef nonnull %66, ptr noundef nonnull %73) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %68, ptr noundef nonnull %77, ptr noundef nonnull %65) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %68, ptr noundef nonnull %68, ptr noundef nonnull %73) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %70, ptr noundef nonnull %76, ptr noundef nonnull %67) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %70, ptr noundef nonnull %70, ptr noundef nonnull %73) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %72, ptr noundef nonnull %75, ptr noundef nonnull %69) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %72, ptr noundef nonnull %72, ptr noundef nonnull %73) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %74, ptr noundef nonnull %71, ptr noundef nonnull %73) #4
  %82 = getelementptr inbounds i8, ptr %1, i64 32
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %82, ptr noundef nonnull %82, ptr noundef nonnull %60) #4
  call void @sm2_z256_modp_mont_sqr(ptr noundef nonnull %60, ptr noundef nonnull %60) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %82, ptr noundef nonnull %82, ptr noundef nonnull %60) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %1, ptr noundef nonnull %1, ptr noundef nonnull %60) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %1, ptr noundef nonnull %1) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %82, ptr noundef nonnull %82) #4
  %83 = getelementptr inbounds i8, ptr %0, i64 32
  call void @sm2_z256_to_bytes(ptr noundef nonnull %1, ptr noundef nonnull %83) #4
  %84 = getelementptr inbounds i8, ptr %0, i64 64
  call void @sm2_z256_to_bytes(ptr noundef nonnull %82, ptr noundef nonnull %84) #4
  %85 = getelementptr inbounds i8, ptr %1, i64 128
  %86 = getelementptr inbounds i8, ptr %1, i64 160
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %85, ptr noundef nonnull %85, ptr noundef nonnull %86) #4
  call void @sm2_z256_modp_mont_sqr(ptr noundef nonnull %86, ptr noundef nonnull %86) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %85, ptr noundef nonnull %85, ptr noundef nonnull %86) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %17, ptr noundef nonnull %17, ptr noundef nonnull %86) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %17, ptr noundef nonnull %17) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %85, ptr noundef nonnull %85) #4
  %87 = getelementptr inbounds i8, ptr %0, i64 128
  call void @sm2_z256_to_bytes(ptr noundef nonnull %17, ptr noundef nonnull %87) #4
  %88 = getelementptr inbounds i8, ptr %0, i64 160
  call void @sm2_z256_to_bytes(ptr noundef nonnull %85, ptr noundef nonnull %88) #4
  %89 = getelementptr inbounds i8, ptr %1, i64 224
  %90 = getelementptr inbounds i8, ptr %1, i64 256
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %89, ptr noundef nonnull %89, ptr noundef nonnull %90) #4
  call void @sm2_z256_modp_mont_sqr(ptr noundef nonnull %90, ptr noundef nonnull %90) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %89, ptr noundef nonnull %89, ptr noundef nonnull %90) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %24, ptr noundef nonnull %24, ptr noundef nonnull %90) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %24, ptr noundef nonnull %24) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %89, ptr noundef nonnull %89) #4
  %91 = getelementptr inbounds i8, ptr %0, i64 224
  call void @sm2_z256_to_bytes(ptr noundef nonnull %24, ptr noundef nonnull %91) #4
  %92 = getelementptr inbounds i8, ptr %0, i64 256
  call void @sm2_z256_to_bytes(ptr noundef nonnull %89, ptr noundef nonnull %92) #4
  %93 = getelementptr inbounds i8, ptr %1, i64 320
  %94 = getelementptr inbounds i8, ptr %1, i64 352
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %93, ptr noundef nonnull %93, ptr noundef nonnull %94) #4
  call void @sm2_z256_modp_mont_sqr(ptr noundef nonnull %94, ptr noundef nonnull %94) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %93, ptr noundef nonnull %93, ptr noundef nonnull %94) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %31, ptr noundef nonnull %31, ptr noundef nonnull %94) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %31, ptr noundef nonnull %31) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %93, ptr noundef nonnull %93) #4
  %95 = getelementptr inbounds i8, ptr %0, i64 320
  call void @sm2_z256_to_bytes(ptr noundef nonnull %31, ptr noundef nonnull %95) #4
  %96 = getelementptr inbounds i8, ptr %0, i64 352
  call void @sm2_z256_to_bytes(ptr noundef nonnull %93, ptr noundef nonnull %96) #4
  %97 = getelementptr inbounds i8, ptr %1, i64 416
  %98 = getelementptr inbounds i8, ptr %1, i64 448
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %97, ptr noundef nonnull %97, ptr noundef nonnull %98) #4
  call void @sm2_z256_modp_mont_sqr(ptr noundef nonnull %98, ptr noundef nonnull %98) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %97, ptr noundef nonnull %97, ptr noundef nonnull %98) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %38, ptr noundef nonnull %38, ptr noundef nonnull %98) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %38, ptr noundef nonnull %38) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %97, ptr noundef nonnull %97) #4
  %99 = getelementptr inbounds i8, ptr %0, i64 416
  call void @sm2_z256_to_bytes(ptr noundef nonnull %38, ptr noundef nonnull %99) #4
  %100 = getelementptr inbounds i8, ptr %0, i64 448
  call void @sm2_z256_to_bytes(ptr noundef nonnull %97, ptr noundef nonnull %100) #4
  %101 = getelementptr inbounds i8, ptr %1, i64 512
  %102 = getelementptr inbounds i8, ptr %1, i64 544
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %101, ptr noundef nonnull %101, ptr noundef nonnull %102) #4
  call void @sm2_z256_modp_mont_sqr(ptr noundef nonnull %102, ptr noundef nonnull %102) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %101, ptr noundef nonnull %101, ptr noundef nonnull %102) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %45, ptr noundef nonnull %45, ptr noundef nonnull %102) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %45, ptr noundef nonnull %45) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %101, ptr noundef nonnull %101) #4
  %103 = getelementptr inbounds i8, ptr %0, i64 512
  call void @sm2_z256_to_bytes(ptr noundef nonnull %45, ptr noundef nonnull %103) #4
  %104 = getelementptr inbounds i8, ptr %0, i64 544
  call void @sm2_z256_to_bytes(ptr noundef nonnull %101, ptr noundef nonnull %104) #4
  %105 = getelementptr inbounds i8, ptr %1, i64 608
  %106 = getelementptr inbounds i8, ptr %1, i64 640
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %105, ptr noundef nonnull %105, ptr noundef nonnull %106) #4
  call void @sm2_z256_modp_mont_sqr(ptr noundef nonnull %106, ptr noundef nonnull %106) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %105, ptr noundef nonnull %105, ptr noundef nonnull %106) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %52, ptr noundef nonnull %52, ptr noundef nonnull %106) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %52, ptr noundef nonnull %52) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %105, ptr noundef nonnull %105) #4
  %107 = getelementptr inbounds i8, ptr %0, i64 608
  call void @sm2_z256_to_bytes(ptr noundef nonnull %52, ptr noundef nonnull %107) #4
  %108 = getelementptr inbounds i8, ptr %0, i64 640
  call void @sm2_z256_to_bytes(ptr noundef nonnull %105, ptr noundef nonnull %108) #4
  %109 = getelementptr inbounds i8, ptr %1, i64 704
  %110 = getelementptr inbounds i8, ptr %1, i64 736
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %109, ptr noundef nonnull %109, ptr noundef nonnull %110) #4
  call void @sm2_z256_modp_mont_sqr(ptr noundef nonnull %110, ptr noundef nonnull %110) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %109, ptr noundef nonnull %109, ptr noundef nonnull %110) #4
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %59, ptr noundef nonnull %59, ptr noundef nonnull %110) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %59, ptr noundef nonnull %59) #4
  call void @sm2_z256_modp_from_mont(ptr noundef nonnull %109, ptr noundef nonnull %109) #4
  %111 = getelementptr inbounds i8, ptr %0, i64 704
  call void @sm2_z256_to_bytes(ptr noundef nonnull %59, ptr noundef nonnull %111) #4
  %112 = getelementptr inbounds i8, ptr %0, i64 736
  call void @sm2_z256_to_bytes(ptr noundef nonnull %109, ptr noundef nonnull %112) #4
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.loopexit60
  %.049 = phi i32 [ -1, %.loopexit60 ], [ 1, %.loopexit.loopexit ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 768, ptr nonnull %1) #4
  ret i32 %.049
}

declare i32 @sm2_z256_rand_range(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @sm2_z256_order() local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare i64 @sm2_z256_is_zero(ptr noundef) local_unnamed_addr #2

declare void @sm2_z256_point_mul_generator(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @sm2_z256_copy(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @sm2_z256_modp_mont_mul(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @sm2_z256_modp_mont_inv(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @sm2_z256_modp_mont_sqr(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @sm2_z256_modp_from_mont(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @sm2_z256_to_bytes(ptr noundef, ptr noundef) local_unnamed_addr #2

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


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