; LLVM IR from guanzhi/GmSSL :: src (sm9_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.SM9_Z256_TWIST_POINT = type { [2 x [4 x i64]], [2 x [4 x i64]], [2 x [4 x i64]] }
%struct.SM9_Z256_AFFINE_POINT = type { [4 x i64], [4 x i64] }

@.str.8 = external hidden unnamed_addr constant [66 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 willreturn memory(read)
declare i64 @strlen(ptr noundef) #1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @sm9_z256_pairing(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 ptr, align 8
  %8 = alloca %struct.SM9_Z256_TWIST_POINT, align 8
  %9 = alloca %struct.SM9_Z256_TWIST_POINT, align 8
  %10 = alloca %struct.SM9_Z256_TWIST_POINT, align 8
  %11 = alloca %struct.SM9_Z256_AFFINE_POINT, align 8
  %12 = alloca [3 x [2 x [4 x i64]]], align 16
  %13 = alloca [5 x [2 x [4 x i64]]], align 16
  %14 = alloca i64, align 8
  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 8, ptr %7) #3
  store ptr @.str.8, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 192, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 192, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 192, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 64, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 192, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 320, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %15 = getelementptr inbounds %struct.SM9_Z256_TWIST_POINT, ptr %8, i32 0, i32 0
  %16 = getelementptr inbounds [2 x [4 x i64]], ptr %15, i64 0, i64 0
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.SM9_Z256_TWIST_POINT, ptr %17, i32 0, i32 0
  %19 = getelementptr inbounds [2 x [4 x i64]], ptr %18, i64 0, i64 0
  call void @sm9_z256_fp2_copy(ptr noundef %16, ptr noundef %19)
  %20 = getelementptr inbounds %struct.SM9_Z256_TWIST_POINT, ptr %8, i32 0, i32 1
  %21 = getelementptr inbounds [2 x [4 x i64]], ptr %20, i64 0, i64 0
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.SM9_Z256_TWIST_POINT, ptr %22, i32 0, i32 1
  %24 = getelementptr inbounds [2 x [4 x i64]], ptr %23, i64 0, i64 0
  call void @sm9_z256_fp2_copy(ptr noundef %21, ptr noundef %24)
  %25 = getelementptr inbounds %struct.SM9_Z256_TWIST_POINT, ptr %8, i32 0, i32 2
  %26 = getelementptr inbounds [2 x [4 x i64]], ptr %25, i64 0, i64 0
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.SM9_Z256_TWIST_POINT, ptr %27, i32 0, i32 2
  %29 = getelementptr inbounds [2 x [4 x i64]], ptr %28, i64 0, i64 0
  call void @sm9_z256_fp2_copy(ptr noundef %26, ptr noundef %29)
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  call void @sm9_z256_point_to_affine(ptr noundef %11, ptr noundef %30)
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sm9_z256_twist_point_neg(ptr noundef %9, ptr noundef %31)
  %32 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 0
  %33 = getelementptr inbounds [2 x [4 x i64]], ptr %32, i64 0, i64 0
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.SM9_Z256_TWIST_POINT, ptr %34, i32 0, i32 1
  %36 = getelementptr inbounds [2 x [4 x i64]], ptr %35, i64 0, i64 0
  call void @sm9_z256_fp2_sqr(ptr noundef %33, ptr noundef %36)
  %37 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 4
  %38 = getelementptr inbounds [2 x [4 x i64]], ptr %37, i64 0, i64 0
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.SM9_Z256_TWIST_POINT, ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds [2 x [4 x i64]], ptr %40, i64 0, i64 0
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.SM9_Z256_TWIST_POINT, ptr %42, i32 0, i32 2
  %44 = getelementptr inbounds [2 x [4 x i64]], ptr %43, i64 0, i64 0
  call void @sm9_z256_fp2_mul(ptr noundef %38, ptr noundef %41, ptr noundef %44)
  %45 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 4
  %46 = getelementptr inbounds [2 x [4 x i64]], ptr %45, i64 0, i64 0
  %47 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 4
  %48 = getelementptr inbounds [2 x [4 x i64]], ptr %47, i64 0, i64 0
  call void @sm9_z256_fp2_dbl(ptr noundef %46, ptr noundef %48)
  %49 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 1
  %50 = getelementptr inbounds [2 x [4 x i64]], ptr %49, i64 0, i64 0
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.SM9_Z256_TWIST_POINT, ptr %51, i32 0, i32 2
  %53 = getelementptr inbounds [2 x [4 x i64]], ptr %52, i64 0, i64 0
  call void @sm9_z256_fp2_sqr(ptr noundef %50, ptr noundef %53)
  %54 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 1
  %55 = getelementptr inbounds [2 x [4 x i64]], ptr %54, i64 0, i64 0
  %56 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 1
  %57 = getelementptr inbounds [2 x [4 x i64]], ptr %56, i64 0, i64 0
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.SM9_Z256_TWIST_POINT, ptr %58, i32 0, i32 2
  %60 = getelementptr inbounds [2 x [4 x i64]], ptr %59, i64 0, i64 0
  call void @sm9_z256_fp2_mul(ptr noundef %55, ptr noundef %57, ptr noundef %60)
  %61 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 2
  %62 = getelementptr inbounds [2 x [4 x i64]], ptr %61, i64 0, i64 0
  %63 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 1
  %64 = getelementptr inbounds [2 x [4 x i64]], ptr %63, i64 0, i64 0
  %65 = getelementptr inbounds %struct.SM9_Z256_AFFINE_POINT, ptr %11, i32 0, i32 1
  %66 = getelementptr inbounds [4 x i64], ptr %65, i64 0, i64 0
  call void @sm9_z256_fp2_mul_fp(ptr noundef %62, ptr noundef %64, ptr noundef %66)
  %67 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 2
  %68 = getelementptr inbounds [2 x [4 x i64]], ptr %67, i64 0, i64 0
  %69 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 2
  %70 = getelementptr inbounds [2 x [4 x i64]], ptr %69, i64 0, i64 0
  call void @sm9_z256_fp2_dbl(ptr noundef %68, ptr noundef %70)
  %71 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 3
  %72 = getelementptr inbounds [2 x [4 x i64]], ptr %71, i64 0, i64 0
  %73 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 1
  %74 = getelementptr inbounds [2 x [4 x i64]], ptr %73, i64 0, i64 0
  %75 = getelementptr inbounds %struct.SM9_Z256_AFFINE_POINT, ptr %11, i32 0, i32 0
  %76 = getelementptr inbounds [4 x i64], ptr %75, i64 0, i64 0
  call void @sm9_z256_fp2_mul_fp(ptr noundef %72, ptr noundef %74, ptr noundef %76)
  %77 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 3
  %78 = getelementptr inbounds [2 x [4 x i64]], ptr %77, i64 0, i64 0
  %79 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 3
  %80 = getelementptr inbounds [2 x [4 x i64]], ptr %79, i64 0, i64 0
  call void @sm9_z256_fp2_dbl(ptr noundef %78, ptr noundef %80)
  %81 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 3
  %82 = getelementptr inbounds [2 x [4 x i64]], ptr %81, i64 0, i64 0
  %83 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 3
  %84 = getelementptr inbounds [2 x [4 x i64]], ptr %83, i64 0, i64 0
  call void @sm9_z256_fp2_neg(ptr noundef %82, ptr noundef %84)
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  call void @sm9_z256_fp12_set_one(ptr noundef %85)
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %86

86:                                               ; preds = %126, %3
  %87 = load i64, ptr %14, align 8, !tbaa !9
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = call i64 @strlen(ptr noundef %88) #4
  %90 = icmp ult i64 %87, %89
  br i1 %90, label %91, label %129

91:                                               ; preds = %86
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  call void @sm9_z256_fp12_sqr(ptr noundef %92, ptr noundef %93)
  %94 = getelementptr inbounds [3 x [2 x [4 x i64]]], ptr %12, i64 0, i64 0
  call void @sm9_z256_eval_g_tangent(ptr noundef %8, ptr noundef %94, ptr noundef %8, ptr noundef %11)
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds [3 x [2 x [4 x i64]]], ptr %12, i64 0, i64 0
  call void @sm9_z256_fp12_line_mul(ptr noundef %95, ptr noundef %96, ptr noundef %97)
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = load i64, ptr %14, align 8, !tbaa !9
  %100 = getelementptr inbounds i8, ptr %98, i64 %99
  %101 = load i8, ptr %100, align 1, !tbaa !11
  %102 = sext i8 %101 to i32
  %103 = icmp eq i32 %102, 49
  br i1 %103, label %104, label %111

104:                                              ; preds = %91
  %105 = getelementptr inbounds [3 x [2 x [4 x i64]]], ptr %12, i64 0, i64 0
  %106 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 0
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sm9_z256_eval_g_line(ptr noundef %8, ptr noundef %105, ptr noundef %106, ptr noundef %8, ptr noundef %107, ptr noundef %11)
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds [3 x [2 x [4 x i64]]], ptr %12, i64 0, i64 0
  call void @sm9_z256_fp12_line_mul(ptr noundef %108, ptr noundef %109, ptr noundef %110)
  br label %125

111:                                              ; preds = %91
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = load i64, ptr %14, align 8, !tbaa !9
  %114 = getelementptr inbounds i8, ptr %112, i64 %113
  %115 = load i8, ptr %114, align 1, !tbaa !11
  %116 = sext i8 %115 to i32
  %117 = icmp eq i32 %116, 50
  br i1 %117, label %118, label %124

118:                                              ; preds = %111
  %119 = getelementptr inbounds [3 x [2 x [4 x i64]]], ptr %12, i64 0, i64 0
  %120 = getelementptr inbounds [5 x [2 x [4 x i64]]], ptr %13, i64 0, i64 0
  call void @sm9_z256_eval_g_line(ptr noundef %8, ptr noundef %119, ptr noundef %120, ptr noundef %8, ptr noundef %9, ptr noundef %11)
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds [3 x [2 x [4 x i64]]], ptr %12, i64 0, i64 0
  call void @sm9_z256_fp12_line_mul(ptr noundef %121, ptr noundef %122, ptr noundef %123)
  br label %124

124:                                              ; preds = %118, %111
  br label %125

125:                                              ; preds = %124, %104
  br label %126

126:                                              ; preds = %125
  %127 = load i64, ptr %14, align 8, !tbaa !9
  %128 = add i64 %127, 1
  store i64 %128, ptr %14, align 8, !tbaa !9
  br label %86, !llvm.loop !12

129:                                              ; preds = %86
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sm9_z256_twist_point_pi1(ptr noundef %9, ptr noundef %130)
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sm9_z256_twist_point_neg_pi2(ptr noundef %10, ptr noundef %131)
  %132 = getelementptr inbounds [3 x [2 x [4 x i64]]], ptr %12, i64 0, i64 0
  call void @sm9_z256_eval_g_line_no_pre(ptr noundef %8, ptr noundef %132, ptr noundef %8, ptr noundef %9, ptr noundef %11)
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds [3 x [2 x [4 x i64]]], ptr %12, i64 0, i64 0
  call void @sm9_z256_fp12_line_mul(ptr noundef %133, ptr noundef %134, ptr noundef %135)
  %136 = getelementptr inbounds [3 x [2 x [4 x i64]]], ptr %12, i64 0, i64 0
  call void @sm9_z256_eval_g_line_no_pre(ptr noundef %8, ptr noundef %136, ptr noundef %8, ptr noundef %10, ptr noundef %11)
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds [3 x [2 x [4 x i64]]], ptr %12, i64 0, i64 0
  call void @sm9_z256_fp12_line_mul(ptr noundef %137, ptr noundef %138, ptr noundef %139)
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  call void @sm9_z256_final_exponent(ptr noundef %140, ptr noundef %141)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 320, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 192, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 192, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 192, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 192, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind willreturn memory(read) "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 }
attributes #4 = { nounwind willreturn memory(read) }

!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}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; 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.SM9_Z256_TWIST_POINT = type { [2 x [4 x i64]], [2 x [4 x i64]], [2 x [4 x i64]] }
%struct.SM9_Z256_AFFINE_POINT = type { [4 x i64], [4 x i64] }

@.str.8 = external hidden unnamed_addr constant [66 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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @sm9_z256_pairing(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca %struct.SM9_Z256_TWIST_POINT, align 8
  %5 = alloca %struct.SM9_Z256_TWIST_POINT, align 8
  %6 = alloca %struct.SM9_Z256_TWIST_POINT, align 8
  %7 = alloca %struct.SM9_Z256_AFFINE_POINT, align 8
  %8 = alloca [3 x [2 x [4 x i64]]], align 16
  %9 = alloca [5 x [2 x [4 x i64]]], align 16
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 320, ptr nonnull %9) #3
  call void @sm9_z256_fp2_copy(ptr noundef nonnull %4, ptr noundef %1)
  %10 = getelementptr inbounds i8, ptr %4, i64 64
  %11 = getelementptr inbounds i8, ptr %1, i64 64
  call void @sm9_z256_fp2_copy(ptr noundef nonnull %10, ptr noundef nonnull %11)
  %12 = getelementptr inbounds i8, ptr %4, i64 128
  %13 = getelementptr inbounds i8, ptr %1, i64 128
  call void @sm9_z256_fp2_copy(ptr noundef nonnull %12, ptr noundef nonnull %13)
  call void @sm9_z256_point_to_affine(ptr noundef nonnull %7, ptr noundef %2)
  call void @sm9_z256_twist_point_neg(ptr noundef nonnull %5, ptr noundef %1)
  call void @sm9_z256_fp2_sqr(ptr noundef nonnull %9, ptr noundef nonnull %11)
  %14 = getelementptr inbounds i8, ptr %9, i64 256
  call void @sm9_z256_fp2_mul(ptr noundef nonnull %14, ptr noundef %1, ptr noundef nonnull %13)
  call void @sm9_z256_fp2_dbl(ptr noundef nonnull %14, ptr noundef nonnull %14)
  %15 = getelementptr inbounds i8, ptr %9, i64 64
  call void @sm9_z256_fp2_sqr(ptr noundef nonnull %15, ptr noundef nonnull %13)
  call void @sm9_z256_fp2_mul(ptr noundef nonnull %15, ptr noundef nonnull %15, ptr noundef nonnull %13)
  %16 = getelementptr inbounds i8, ptr %9, i64 128
  %17 = getelementptr inbounds i8, ptr %7, i64 32
  call void @sm9_z256_fp2_mul_fp(ptr noundef nonnull %16, ptr noundef nonnull %15, ptr noundef nonnull %17)
  call void @sm9_z256_fp2_dbl(ptr noundef nonnull %16, ptr noundef nonnull %16)
  %18 = getelementptr inbounds i8, ptr %9, i64 192
  call void @sm9_z256_fp2_mul_fp(ptr noundef nonnull %18, ptr noundef nonnull %15, ptr noundef nonnull %7)
  call void @sm9_z256_fp2_dbl(ptr noundef nonnull %18, ptr noundef nonnull %18)
  call void @sm9_z256_fp2_neg(ptr noundef nonnull %18, ptr noundef nonnull %18)
  call void @sm9_z256_fp12_set_one(ptr noundef %0)
  %19 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @.str.8) #4
  %.not = icmp eq i64 %19, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3, %24
  %.035 = phi i64 [ %25, %24 ], [ 0, %3 ]
  call void @sm9_z256_fp12_sqr(ptr noundef %0, ptr noundef %0)
  call void @sm9_z256_eval_g_tangent(ptr noundef nonnull %4, ptr noundef nonnull %8, ptr noundef nonnull %4, ptr noundef nonnull %7)
  call void @sm9_z256_fp12_line_mul(ptr noundef %0, ptr noundef %0, ptr noundef nonnull %8)
  %20 = getelementptr inbounds i8, ptr @.str.8, i64 %.035
  %21 = load i8, ptr %20, align 1, !tbaa !5
  switch i8 %21, label %24 [
    i8 49, label %22
    i8 50, label %23
  ]

22:                                               ; preds = %.lr.ph
  call void @sm9_z256_eval_g_line(ptr noundef nonnull %4, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %4, ptr noundef %1, ptr noundef nonnull %7)
  br label %.sink.split

23:                                               ; preds = %.lr.ph
  call void @sm9_z256_eval_g_line(ptr noundef nonnull %4, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %7)
  br label %.sink.split

.sink.split:                                      ; preds = %23, %22
  call void @sm9_z256_fp12_line_mul(ptr noundef %0, ptr noundef %0, ptr noundef nonnull %8)
  br label %24

24:                                               ; preds = %.sink.split, %.lr.ph
  %25 = add nuw i64 %.035, 1
  %exitcond.not = icmp eq i64 %25, %19
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !8

._crit_edge:                                      ; preds = %24, %3
  call void @sm9_z256_twist_point_pi1(ptr noundef nonnull %5, ptr noundef %1)
  call void @sm9_z256_twist_point_neg_pi2(ptr noundef nonnull %6, ptr noundef %1)
  call void @sm9_z256_eval_g_line_no_pre(ptr noundef nonnull %4, ptr noundef nonnull %8, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %7)
  call void @sm9_z256_fp12_line_mul(ptr noundef %0, ptr noundef %0, ptr noundef nonnull %8)
  call void @sm9_z256_eval_g_line_no_pre(ptr noundef nonnull %4, ptr noundef nonnull %8, ptr noundef nonnull %4, ptr noundef nonnull %6, ptr noundef nonnull %7)
  call void @sm9_z256_fp12_line_mul(ptr noundef %0, ptr noundef %0, ptr noundef nonnull %8)
  call void @sm9_z256_final_exponent(ptr noundef %0, ptr noundef %0)
  call void @llvm.lifetime.end.p0(i64 320, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %4) #3
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 }
attributes #4 = { nounwind willreturn memory(read) }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass