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

; 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] }

; 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
declare dso_local void @sm2_z256_copy_conditional(ptr noundef, ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @sm2_z256_equ(ptr noundef, ptr noundef) #1

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @sm2_z256_point_add(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [4 x i64], align 16
  %8 = alloca [4 x i64], align 16
  %9 = alloca [4 x i64], align 16
  %10 = alloca [4 x i64], align 16
  %11 = alloca [4 x i64], align 16
  %12 = alloca [4 x i64], align 16
  %13 = alloca [4 x i64], align 16
  %14 = alloca [4 x i64], align 16
  %15 = alloca [4 x i64], align 16
  %16 = alloca [4 x i64], align 16
  %17 = alloca [4 x i64], align 16
  %18 = alloca [4 x i64], align 16
  %19 = alloca [4 x i64], align 16
  %20 = alloca [4 x i64], align 16
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  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 32, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %30, i32 0, i32 0
  %32 = getelementptr inbounds [4 x i64], ptr %31, i64 0, i64 0
  store ptr %32, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %33, i32 0, i32 1
  %35 = getelementptr inbounds [4 x i64], ptr %34, i64 0, i64 0
  store ptr %35, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %36, i32 0, i32 2
  %38 = getelementptr inbounds [4 x i64], ptr %37, i64 0, i64 0
  store ptr %38, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds [4 x i64], ptr %40, i64 0, i64 0
  store ptr %41, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %42, i32 0, i32 1
  %44 = getelementptr inbounds [4 x i64], ptr %43, i64 0, i64 0
  store ptr %44, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %45, i32 0, i32 2
  %47 = getelementptr inbounds [4 x i64], ptr %46, i64 0, i64 0
  store ptr %47, ptr %28, align 8, !tbaa !5
  %48 = load ptr, ptr %25, align 8, !tbaa !5
  %49 = getelementptr inbounds i64, ptr %48, i64 0
  %50 = load i64, ptr %49, align 8, !tbaa !9
  %51 = load ptr, ptr %25, align 8, !tbaa !5
  %52 = getelementptr inbounds i64, ptr %51, i64 1
  %53 = load i64, ptr %52, align 8, !tbaa !9
  %54 = or i64 %50, %53
  %55 = load ptr, ptr %25, align 8, !tbaa !5
  %56 = getelementptr inbounds i64, ptr %55, i64 2
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = or i64 %54, %57
  %59 = load ptr, ptr %25, align 8, !tbaa !5
  %60 = getelementptr inbounds i64, ptr %59, i64 3
  %61 = load i64, ptr %60, align 8, !tbaa !9
  %62 = or i64 %58, %61
  store i64 %62, ptr %21, align 8, !tbaa !9
  %63 = load ptr, ptr %28, align 8, !tbaa !5
  %64 = getelementptr inbounds i64, ptr %63, i64 0
  %65 = load i64, ptr %64, align 8, !tbaa !9
  %66 = load ptr, ptr %28, align 8, !tbaa !5
  %67 = getelementptr inbounds i64, ptr %66, i64 1
  %68 = load i64, ptr %67, align 8, !tbaa !9
  %69 = or i64 %65, %68
  %70 = load ptr, ptr %28, align 8, !tbaa !5
  %71 = getelementptr inbounds i64, ptr %70, i64 2
  %72 = load i64, ptr %71, align 8, !tbaa !9
  %73 = or i64 %69, %72
  %74 = load ptr, ptr %28, align 8, !tbaa !5
  %75 = getelementptr inbounds i64, ptr %74, i64 3
  %76 = load i64, ptr %75, align 8, !tbaa !9
  %77 = or i64 %73, %76
  store i64 %77, ptr %22, align 8, !tbaa !9
  %78 = load i64, ptr %21, align 8, !tbaa !9
  %79 = call i64 @is_zero(i64 noundef %78)
  store i64 %79, ptr %21, align 8, !tbaa !9
  %80 = load i64, ptr %22, align 8, !tbaa !9
  %81 = call i64 @is_zero(i64 noundef %80)
  store i64 %81, ptr %22, align 8, !tbaa !9
  %82 = getelementptr inbounds [4 x i64], ptr %12, i64 0, i64 0
  %83 = load ptr, ptr %28, align 8, !tbaa !5
  call void @sm2_z256_modp_mont_sqr(ptr noundef %82, ptr noundef %83)
  %84 = getelementptr inbounds [4 x i64], ptr %11, i64 0, i64 0
  %85 = load ptr, ptr %25, align 8, !tbaa !5
  call void @sm2_z256_modp_mont_sqr(ptr noundef %84, ptr noundef %85)
  %86 = getelementptr inbounds [4 x i64], ptr %10, i64 0, i64 0
  %87 = getelementptr inbounds [4 x i64], ptr %12, i64 0, i64 0
  %88 = load ptr, ptr %28, align 8, !tbaa !5
  call void @sm2_z256_modp_mont_mul(ptr noundef %86, ptr noundef %87, ptr noundef %88)
  %89 = getelementptr inbounds [4 x i64], ptr %8, i64 0, i64 0
  %90 = getelementptr inbounds [4 x i64], ptr %11, i64 0, i64 0
  %91 = load ptr, ptr %25, align 8, !tbaa !5
  call void @sm2_z256_modp_mont_mul(ptr noundef %89, ptr noundef %90, ptr noundef %91)
  %92 = getelementptr inbounds [4 x i64], ptr %10, i64 0, i64 0
  %93 = getelementptr inbounds [4 x i64], ptr %10, i64 0, i64 0
  %94 = load ptr, ptr %24, align 8, !tbaa !5
  call void @sm2_z256_modp_mont_mul(ptr noundef %92, ptr noundef %93, ptr noundef %94)
  %95 = getelementptr inbounds [4 x i64], ptr %8, i64 0, i64 0
  %96 = getelementptr inbounds [4 x i64], ptr %8, i64 0, i64 0
  %97 = load ptr, ptr %27, align 8, !tbaa !5
  call void @sm2_z256_modp_mont_mul(ptr noundef %95, ptr noundef %96, ptr noundef %97)
  %98 = getelementptr inbounds [4 x i64], ptr %14, i64 0, i64 0
  %99 = getelementptr inbounds [4 x i64], ptr %8, i64 0, i64 0
  %100 = getelementptr inbounds [4 x i64], ptr %10, i64 0, i64 0
  call void @sm2_z256_modp_sub(ptr noundef %98, ptr noundef %99, ptr noundef %100)
  %101 = getelementptr inbounds [4 x i64], ptr %9, i64 0, i64 0
  %102 = load ptr, ptr %23, align 8, !tbaa !5
  %103 = getelementptr inbounds [4 x i64], ptr %12, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %101, ptr noundef %102, ptr noundef %103)
  %104 = getelementptr inbounds [4 x i64], ptr %7, i64 0, i64 0
  %105 = load ptr, ptr %26, align 8, !tbaa !5
  %106 = getelementptr inbounds [4 x i64], ptr %11, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %104, ptr noundef %105, ptr noundef %106)
  %107 = getelementptr inbounds [4 x i64], ptr %13, i64 0, i64 0
  %108 = getelementptr inbounds [4 x i64], ptr %7, i64 0, i64 0
  %109 = getelementptr inbounds [4 x i64], ptr %9, i64 0, i64 0
  call void @sm2_z256_modp_sub(ptr noundef %107, ptr noundef %108, ptr noundef %109)
  %110 = getelementptr inbounds [4 x i64], ptr %9, i64 0, i64 0
  %111 = getelementptr inbounds [4 x i64], ptr %7, i64 0, i64 0
  %112 = call i64 @sm2_z256_equ(ptr noundef %110, ptr noundef %111)
  %113 = icmp ne i64 %112, 0
  br i1 %113, label %114, label %130

114:                                              ; preds = %3
  %115 = load i64, ptr %21, align 8, !tbaa !9
  %116 = icmp ne i64 %115, 0
  br i1 %116, label %130, label %117

117:                                              ; preds = %114
  %118 = load i64, ptr %22, align 8, !tbaa !9
  %119 = icmp ne i64 %118, 0
  br i1 %119, label %130, label %120

120:                                              ; preds = %117
  %121 = getelementptr inbounds [4 x i64], ptr %10, i64 0, i64 0
  %122 = getelementptr inbounds [4 x i64], ptr %8, i64 0, i64 0
  %123 = call i64 @sm2_z256_equ(ptr noundef %121, ptr noundef %122)
  %124 = icmp ne i64 %123, 0
  br i1 %124, label %125, label %128

125:                                              ; preds = %120
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sm2_z256_point_dbl(ptr noundef %126, ptr noundef %127)
  store i32 1, ptr %29, align 4
  br label %197

128:                                              ; preds = %120
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %129, i8 0, i64 96, i1 false)
  store i32 1, ptr %29, align 4
  br label %197

130:                                              ; preds = %117, %114, %3
  %131 = getelementptr inbounds [4 x i64], ptr %16, i64 0, i64 0
  %132 = getelementptr inbounds [4 x i64], ptr %14, i64 0, i64 0
  call void @sm2_z256_modp_mont_sqr(ptr noundef %131, ptr noundef %132)
  %133 = getelementptr inbounds [4 x i64], ptr %20, i64 0, i64 0
  %134 = getelementptr inbounds [4 x i64], ptr %13, i64 0, i64 0
  %135 = load ptr, ptr %25, align 8, !tbaa !5
  call void @sm2_z256_modp_mont_mul(ptr noundef %133, ptr noundef %134, ptr noundef %135)
  %136 = getelementptr inbounds [4 x i64], ptr %15, i64 0, i64 0
  %137 = getelementptr inbounds [4 x i64], ptr %13, i64 0, i64 0
  call void @sm2_z256_modp_mont_sqr(ptr noundef %136, ptr noundef %137)
  %138 = getelementptr inbounds [4 x i64], ptr %20, i64 0, i64 0
  %139 = getelementptr inbounds [4 x i64], ptr %20, i64 0, i64 0
  %140 = load ptr, ptr %28, align 8, !tbaa !5
  call void @sm2_z256_modp_mont_mul(ptr noundef %138, ptr noundef %139, ptr noundef %140)
  %141 = getelementptr inbounds [4 x i64], ptr %17, i64 0, i64 0
  %142 = getelementptr inbounds [4 x i64], ptr %15, i64 0, i64 0
  %143 = getelementptr inbounds [4 x i64], ptr %13, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %141, ptr noundef %142, ptr noundef %143)
  %144 = getelementptr inbounds [4 x i64], ptr %7, i64 0, i64 0
  %145 = getelementptr inbounds [4 x i64], ptr %9, i64 0, i64 0
  %146 = getelementptr inbounds [4 x i64], ptr %15, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %144, ptr noundef %145, ptr noundef %146)
  %147 = getelementptr inbounds [4 x i64], ptr %15, i64 0, i64 0
  %148 = getelementptr inbounds [4 x i64], ptr %7, i64 0, i64 0
  call void @sm2_z256_modp_dbl(ptr noundef %147, ptr noundef %148)
  %149 = getelementptr inbounds [4 x i64], ptr %18, i64 0, i64 0
  %150 = getelementptr inbounds [4 x i64], ptr %16, i64 0, i64 0
  %151 = getelementptr inbounds [4 x i64], ptr %15, i64 0, i64 0
  call void @sm2_z256_modp_sub(ptr noundef %149, ptr noundef %150, ptr noundef %151)
  %152 = getelementptr inbounds [4 x i64], ptr %18, i64 0, i64 0
  %153 = getelementptr inbounds [4 x i64], ptr %18, i64 0, i64 0
  %154 = getelementptr inbounds [4 x i64], ptr %17, i64 0, i64 0
  call void @sm2_z256_modp_sub(ptr noundef %152, ptr noundef %153, ptr noundef %154)
  %155 = getelementptr inbounds [4 x i64], ptr %19, i64 0, i64 0
  %156 = getelementptr inbounds [4 x i64], ptr %7, i64 0, i64 0
  %157 = getelementptr inbounds [4 x i64], ptr %18, i64 0, i64 0
  call void @sm2_z256_modp_sub(ptr noundef %155, ptr noundef %156, ptr noundef %157)
  %158 = getelementptr inbounds [4 x i64], ptr %8, i64 0, i64 0
  %159 = getelementptr inbounds [4 x i64], ptr %10, i64 0, i64 0
  %160 = getelementptr inbounds [4 x i64], ptr %17, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %158, ptr noundef %159, ptr noundef %160)
  %161 = getelementptr inbounds [4 x i64], ptr %19, i64 0, i64 0
  %162 = getelementptr inbounds [4 x i64], ptr %14, i64 0, i64 0
  %163 = getelementptr inbounds [4 x i64], ptr %19, i64 0, i64 0
  call void @sm2_z256_modp_mont_mul(ptr noundef %161, ptr noundef %162, ptr noundef %163)
  %164 = getelementptr inbounds [4 x i64], ptr %19, i64 0, i64 0
  %165 = getelementptr inbounds [4 x i64], ptr %19, i64 0, i64 0
  %166 = getelementptr inbounds [4 x i64], ptr %8, i64 0, i64 0
  call void @sm2_z256_modp_sub(ptr noundef %164, ptr noundef %165, ptr noundef %166)
  %167 = getelementptr inbounds [4 x i64], ptr %18, i64 0, i64 0
  %168 = load ptr, ptr %26, align 8, !tbaa !5
  %169 = load i64, ptr %21, align 8, !tbaa !9
  call void @sm2_z256_copy_conditional(ptr noundef %167, ptr noundef %168, i64 noundef %169)
  %170 = getelementptr inbounds [4 x i64], ptr %19, i64 0, i64 0
  %171 = load ptr, ptr %27, align 8, !tbaa !5
  %172 = load i64, ptr %21, align 8, !tbaa !9
  call void @sm2_z256_copy_conditional(ptr noundef %170, ptr noundef %171, i64 noundef %172)
  %173 = getelementptr inbounds [4 x i64], ptr %20, i64 0, i64 0
  %174 = load ptr, ptr %28, align 8, !tbaa !5
  %175 = load i64, ptr %21, align 8, !tbaa !9
  call void @sm2_z256_copy_conditional(ptr noundef %173, ptr noundef %174, i64 noundef %175)
  %176 = getelementptr inbounds [4 x i64], ptr %18, i64 0, i64 0
  %177 = load ptr, ptr %23, align 8, !tbaa !5
  %178 = load i64, ptr %22, align 8, !tbaa !9
  call void @sm2_z256_copy_conditional(ptr noundef %176, ptr noundef %177, i64 noundef %178)
  %179 = getelementptr inbounds [4 x i64], ptr %19, i64 0, i64 0
  %180 = load ptr, ptr %24, align 8, !tbaa !5
  %181 = load i64, ptr %22, align 8, !tbaa !9
  call void @sm2_z256_copy_conditional(ptr noundef %179, ptr noundef %180, i64 noundef %181)
  %182 = getelementptr inbounds [4 x i64], ptr %20, i64 0, i64 0
  %183 = load ptr, ptr %25, align 8, !tbaa !5
  %184 = load i64, ptr %22, align 8, !tbaa !9
  call void @sm2_z256_copy_conditional(ptr noundef %182, ptr noundef %183, i64 noundef %184)
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %185, i32 0, i32 0
  %187 = getelementptr inbounds [4 x i64], ptr %186, i64 0, i64 0
  %188 = getelementptr inbounds [4 x i64], ptr %18, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %187, ptr align 16 %188, i64 32, i1 false)
  %189 = load ptr, ptr %4, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %189, i32 0, i32 1
  %191 = getelementptr inbounds [4 x i64], ptr %190, i64 0, i64 0
  %192 = getelementptr inbounds [4 x i64], ptr %19, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %191, ptr align 16 %192, i64 32, i1 false)
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.SM2_Z256_POINT, ptr %193, i32 0, i32 2
  %195 = getelementptr inbounds [4 x i64], ptr %194, i64 0, i64 0
  %196 = getelementptr inbounds [4 x i64], ptr %20, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %195, ptr align 16 %196, i64 32, i1 false)
  store i32 0, ptr %29, align 4
  br label %197

197:                                              ; preds = %130, %128, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #4
  %198 = load i32, ptr %29, align 4
  switch i32 %198, label %200 [
    i32 0, label %199
    i32 1, label %199
  ]

199:                                              ; preds = %197, %197
  ret void

200:                                              ; preds = %197
  unreachable
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long", !7, 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"

; 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
declare dso_local void @sm2_z256_copy_conditional(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden i64 @is_zero(i64 noundef) local_unnamed_addr #1

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @sm2_z256_point_add(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = alloca [4 x i64], align 16
  %5 = alloca [4 x i64], align 16
  %6 = alloca [4 x i64], align 16
  %7 = alloca [4 x i64], align 16
  %8 = alloca [4 x i64], align 16
  %9 = alloca [4 x i64], align 16
  %10 = alloca [4 x i64], align 16
  %11 = alloca [4 x i64], align 16
  %12 = alloca [4 x i64], align 16
  %13 = alloca [4 x i64], align 16
  %14 = alloca [4 x i64], align 16
  %15 = alloca [4 x i64], align 16
  %16 = alloca [4 x i64], align 16
  %17 = alloca [4 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %15) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %17) #5
  %18 = getelementptr inbounds i8, ptr %1, i64 32
  %19 = getelementptr inbounds i8, ptr %1, i64 64
  %20 = getelementptr inbounds i8, ptr %2, i64 32
  %21 = getelementptr inbounds i8, ptr %2, i64 64
  %22 = load <4 x i64>, ptr %19, align 8, !tbaa !5
  %23 = tail call i64 @llvm.vector.reduce.or.v4i64(<4 x i64> %22)
  %24 = load <4 x i64>, ptr %21, align 8, !tbaa !5
  %25 = tail call i64 @llvm.vector.reduce.or.v4i64(<4 x i64> %24)
  %26 = tail call i64 @is_zero(i64 noundef %23)
  %27 = tail call i64 @is_zero(i64 noundef %25)
  call void @sm2_z256_modp_mont_sqr(ptr noundef nonnull %9, ptr noundef nonnull %21)
  call void @sm2_z256_modp_mont_sqr(ptr noundef nonnull %8, ptr noundef nonnull %19)
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %7, ptr noundef nonnull %9, ptr noundef nonnull %21)
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %5, ptr noundef nonnull %8, ptr noundef nonnull %19)
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %7, ptr noundef nonnull %7, ptr noundef nonnull %18)
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %5, ptr noundef nonnull %5, ptr noundef nonnull %20)
  call void @sm2_z256_modp_sub(ptr noundef nonnull %11, ptr noundef nonnull %5, ptr noundef nonnull %7)
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %6, ptr noundef %1, ptr noundef nonnull %9)
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %4, ptr noundef %2, ptr noundef nonnull %8)
  call void @sm2_z256_modp_sub(ptr noundef nonnull %10, ptr noundef nonnull %4, ptr noundef nonnull %6)
  %28 = call i64 @sm2_z256_equ(ptr noundef nonnull %6, ptr noundef nonnull %4)
  %29 = icmp eq i64 %28, 0
  %30 = icmp ne i64 %26, 0
  %or.cond = select i1 %29, i1 true, i1 %30
  %31 = icmp ne i64 %27, 0
  %or.cond3 = select i1 %or.cond, i1 true, i1 %31
  br i1 %or.cond3, label %36, label %32

32:                                               ; preds = %3
  %33 = call i64 @sm2_z256_equ(ptr noundef nonnull %7, ptr noundef nonnull %5)
  %.not = icmp eq i64 %33, 0
  br i1 %.not, label %35, label %34

34:                                               ; preds = %32
  call void @sm2_z256_point_dbl(ptr noundef %0, ptr noundef nonnull %1)
  br label %39

35:                                               ; preds = %32
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(96) %0, i8 0, i64 96, i1 false)
  br label %39

36:                                               ; preds = %3
  call void @sm2_z256_modp_mont_sqr(ptr noundef nonnull %13, ptr noundef nonnull %11)
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %17, ptr noundef nonnull %10, ptr noundef nonnull %19)
  call void @sm2_z256_modp_mont_sqr(ptr noundef nonnull %12, ptr noundef nonnull %10)
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %17, ptr noundef nonnull %17, ptr noundef nonnull %21)
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %14, ptr noundef nonnull %12, ptr noundef nonnull %10)
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %4, ptr noundef nonnull %6, ptr noundef nonnull %12)
  call void @sm2_z256_modp_dbl(ptr noundef nonnull %12, ptr noundef nonnull %4)
  call void @sm2_z256_modp_sub(ptr noundef nonnull %15, ptr noundef nonnull %13, ptr noundef nonnull %12)
  call void @sm2_z256_modp_sub(ptr noundef nonnull %15, ptr noundef nonnull %15, ptr noundef nonnull %14)
  call void @sm2_z256_modp_sub(ptr noundef nonnull %16, ptr noundef nonnull %4, ptr noundef nonnull %15)
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %5, ptr noundef nonnull %7, ptr noundef nonnull %14)
  call void @sm2_z256_modp_mont_mul(ptr noundef nonnull %16, ptr noundef nonnull %11, ptr noundef nonnull %16)
  call void @sm2_z256_modp_sub(ptr noundef nonnull %16, ptr noundef nonnull %16, ptr noundef nonnull %5)
  call void @sm2_z256_copy_conditional(ptr noundef nonnull %15, ptr noundef nonnull %2, i64 noundef %26)
  call void @sm2_z256_copy_conditional(ptr noundef nonnull %16, ptr noundef nonnull %20, i64 noundef %26)
  call void @sm2_z256_copy_conditional(ptr noundef nonnull %17, ptr noundef nonnull %21, i64 noundef %26)
  call void @sm2_z256_copy_conditional(ptr noundef nonnull %15, ptr noundef nonnull %1, i64 noundef %27)
  call void @sm2_z256_copy_conditional(ptr noundef nonnull %16, ptr noundef nonnull %18, i64 noundef %27)
  call void @sm2_z256_copy_conditional(ptr noundef nonnull %17, ptr noundef nonnull %19, i64 noundef %27)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 16 dereferenceable(32) %15, i64 32, i1 false)
  %37 = getelementptr inbounds i8, ptr %0, i64 32
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %37, ptr noundef nonnull align 16 dereferenceable(32) %16, i64 32, i1 false)
  %38 = getelementptr inbounds i8, ptr %0, i64 64
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef nonnull align 16 dereferenceable(32) %17, i64 32, i1 false)
  br label %39

39:                                               ; preds = %36, %35, %34
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.or.v4i64(<4 x i64>) #4

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass