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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.ByteArray_st = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@ecgdsa_self_test.test_Qx = external hidden constant [32 x i8], align 16
@ecgdsa_self_test.test_Qy = external hidden constant [32 x i8], align 16
@ecgdsa_self_test.test_k = external hidden constant [32 x i8], align 16
@ecgdsa_self_test.test_R = external hidden constant [32 x i8], align 16
@ecgdsa_self_test.test_S = external hidden constant [32 x i8], align 16
@ecgdsa_self_test.ba_d = external hidden constant %struct.ByteArray_st, align 8
@ecgdsa_self_test.ba_Msg = external hidden constant %struct.ByteArray_st, align 8

; Function Attrs: nounwind uwtable
declare dso_local i32 @ecgdsa_get_pubkey(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @ecgdsa_sign_internal(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @ecgdsa_verify(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare void @wa_free(ptr noundef) #2

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

10:                                               ; preds = %0
  %11 = call ptr @ec_alloc_default(i32 noundef 33)
  store ptr %11, ptr %2, align 8, !tbaa !9
  %12 = icmp eq ptr null, %11
  br i1 %12, label %13, label %15

13:                                               ; preds = %10
  store i32 2, ptr %1, align 4, !tbaa !5
  %14 = load i32, ptr %1, align 4, !tbaa !5
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 340, i32 noundef %14)
  br label %165

15:                                               ; preds = %10
  br label %16

16:                                               ; preds = %15
  br label %17

17:                                               ; preds = %16
  br label %18

18:                                               ; preds = %17
  %19 = load ptr, ptr %2, align 8, !tbaa !9
  %20 = call i32 @ecgdsa_get_pubkey(ptr noundef %19, ptr noundef @ecgdsa_self_test.ba_d, ptr noundef %6, ptr noundef %7)
  store i32 %20, ptr %1, align 4, !tbaa !5
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %25

23:                                               ; preds = %18
  %24 = load i32, ptr %1, align 4, !tbaa !5
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 341, i32 noundef %24)
  br label %165

25:                                               ; preds = %18
  br label %26

26:                                               ; preds = %25
  br label %27

27:                                               ; preds = %26
  %28 = load ptr, ptr %6, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.ByteArray_st, ptr %28, i32 0, i32 1
  %30 = load i64, ptr %29, align 8, !tbaa !11
  %31 = icmp ne i64 %30, 32
  br i1 %31, label %49, label %32

32:                                               ; preds = %27
  %33 = load ptr, ptr %7, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct.ByteArray_st, ptr %33, i32 0, i32 1
  %35 = load i64, ptr %34, align 8, !tbaa !11
  %36 = icmp ne i64 %35, 32
  br i1 %36, label %49, label %37

37:                                               ; preds = %32
  %38 = load ptr, ptr %6, align 8, !tbaa !9
  %39 = getelementptr inbounds %struct.ByteArray_st, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  %41 = call i32 @memcmp(ptr noundef %40, ptr noundef @ecgdsa_self_test.test_Qx, i64 noundef 32) #5
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %49, label %43

43:                                               ; preds = %37
  %44 = load ptr, ptr %7, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.ByteArray_st, ptr %44, i32 0, i32 0
  %46 = load ptr, ptr %45, align 8, !tbaa !14
  %47 = call i32 @memcmp(ptr noundef %46, ptr noundef @ecgdsa_self_test.test_Qy, i64 noundef 32) #5
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %54

49:                                               ; preds = %43, %37, %32, %27
  br label %50

50:                                               ; preds = %49
  store i32 33, ptr %1, align 4, !tbaa !5
  %51 = load i32, ptr %1, align 4, !tbaa !5
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 346, i32 noundef %51, ptr noundef null)
  br label %165

52:                                               ; No predecessors!
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53, %43
  br label %55

55:                                               ; preds = %54
  %56 = call ptr @hash_alloc(i32 noundef 7)
  store ptr %56, ptr %3, align 8, !tbaa !9
  %57 = icmp eq ptr null, %56
  br i1 %57, label %58, label %60

58:                                               ; preds = %55
  store i32 2, ptr %1, align 4, !tbaa !5
  %59 = load i32, ptr %1, align 4, !tbaa !5
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 349, i32 noundef %59)
  br label %165

60:                                               ; preds = %55
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62
  %64 = load ptr, ptr %3, align 8, !tbaa !9
  %65 = call i32 @hash_update(ptr noundef %64, ptr noundef @ecgdsa_self_test.ba_Msg)
  store i32 %65, ptr %1, align 4, !tbaa !5
  %66 = load i32, ptr %1, align 4, !tbaa !5
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %70

68:                                               ; preds = %63
  %69 = load i32, ptr %1, align 4, !tbaa !5
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 350, i32 noundef %69)
  br label %165

70:                                               ; preds = %63
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr %3, align 8, !tbaa !9
  %75 = call i32 @hash_final(ptr noundef %74, ptr noundef %4)
  store i32 %75, ptr %1, align 4, !tbaa !5
  %76 = load i32, ptr %1, align 4, !tbaa !5
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %80

78:                                               ; preds = %73
  %79 = load i32, ptr %1, align 4, !tbaa !5
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 351, i32 noundef %79)
  br label %165

80:                                               ; preds = %73
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  br label %83

83:                                               ; preds = %82
  %84 = call ptr @wa_alloc_from_be(ptr noundef @ecgdsa_self_test.test_k, i64 noundef 32)
  store ptr %84, ptr %5, align 8, !tbaa !9
  %85 = icmp eq ptr null, %84
  br i1 %85, label %86, label %88

86:                                               ; preds = %83
  store i32 2, ptr %1, align 4, !tbaa !5
  %87 = load i32, ptr %1, align 4, !tbaa !5
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 353, i32 noundef %87)
  br label %165

88:                                               ; preds = %83
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90
  %92 = load ptr, ptr %2, align 8, !tbaa !9
  %93 = call i32 @ec_init_sign(ptr noundef %92, ptr noundef @ecgdsa_self_test.ba_d)
  store i32 %93, ptr %1, align 4, !tbaa !5
  %94 = load i32, ptr %1, align 4, !tbaa !5
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %98

96:                                               ; preds = %91
  %97 = load i32, ptr %1, align 4, !tbaa !5
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 355, i32 noundef %97)
  br label %165

98:                                               ; preds = %91
  br label %99

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99
  br label %101

101:                                              ; preds = %100
  %102 = load ptr, ptr %2, align 8, !tbaa !9
  %103 = load ptr, ptr %4, align 8, !tbaa !9
  %104 = load ptr, ptr %5, align 8, !tbaa !9
  %105 = call i32 @ecgdsa_sign_internal(ptr noundef %102, ptr noundef %103, ptr noundef %104, ptr noundef %8, ptr noundef %9)
  store i32 %105, ptr %1, align 4, !tbaa !5
  %106 = load i32, ptr %1, align 4, !tbaa !5
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %110

108:                                              ; preds = %101
  %109 = load i32, ptr %1, align 4, !tbaa !5
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 356, i32 noundef %109)
  br label %165

110:                                              ; preds = %101
  br label %111

111:                                              ; preds = %110
  br label %112

112:                                              ; preds = %111
  %113 = load ptr, ptr %8, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.ByteArray_st, ptr %113, i32 0, i32 1
  %115 = load i64, ptr %114, align 8, !tbaa !11
  %116 = icmp ne i64 %115, 32
  br i1 %116, label %134, label %117

117:                                              ; preds = %112
  %118 = load ptr, ptr %9, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.ByteArray_st, ptr %118, i32 0, i32 1
  %120 = load i64, ptr %119, align 8, !tbaa !11
  %121 = icmp ne i64 %120, 32
  br i1 %121, label %134, label %122

122:                                              ; preds = %117
  %123 = load ptr, ptr %8, align 8, !tbaa !9
  %124 = getelementptr inbounds %struct.ByteArray_st, ptr %123, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8, !tbaa !14
  %126 = call i32 @memcmp(ptr noundef %125, ptr noundef @ecgdsa_self_test.test_R, i64 noundef 32) #5
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %134, label %128

128:                                              ; preds = %122
  %129 = load ptr, ptr %9, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.ByteArray_st, ptr %129, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !14
  %132 = call i32 @memcmp(ptr noundef %131, ptr noundef @ecgdsa_self_test.test_S, i64 noundef 32) #5
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %139

134:                                              ; preds = %128, %122, %117, %112
  br label %135

135:                                              ; preds = %134
  store i32 33, ptr %1, align 4, !tbaa !5
  %136 = load i32, ptr %1, align 4, !tbaa !5
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 362, i32 noundef %136, ptr noundef null)
  br label %165

137:                                              ; No predecessors!
  br label %138

138:                                              ; preds = %137
  br label %139

139:                                              ; preds = %138, %128
  br label %140

140:                                              ; preds = %139
  %141 = load ptr, ptr %2, align 8, !tbaa !9
  %142 = load ptr, ptr %6, align 8, !tbaa !9
  %143 = load ptr, ptr %7, align 8, !tbaa !9
  %144 = call i32 @ec_init_verify(ptr noundef %141, ptr noundef %142, ptr noundef %143)
  store i32 %144, ptr %1, align 4, !tbaa !5
  %145 = load i32, ptr %1, align 4, !tbaa !5
  %146 = icmp ne i32 %145, 0
  br i1 %146, label %147, label %149

147:                                              ; preds = %140
  %148 = load i32, ptr %1, align 4, !tbaa !5
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 365, i32 noundef %148)
  br label %165

149:                                              ; preds = %140
  br label %150

150:                                              ; preds = %149
  br label %151

151:                                              ; preds = %150
  br label %152

152:                                              ; preds = %151
  %153 = load ptr, ptr %2, align 8, !tbaa !9
  %154 = load ptr, ptr %4, align 8, !tbaa !9
  %155 = load ptr, ptr %8, align 8, !tbaa !9
  %156 = load ptr, ptr %9, align 8, !tbaa !9
  %157 = call i32 @ecgdsa_verify(ptr noundef %153, ptr noundef %154, ptr noundef %155, ptr noundef %156)
  store i32 %157, ptr %1, align 4, !tbaa !5
  %158 = load i32, ptr %1, align 4, !tbaa !5
  %159 = icmp ne i32 %158, 0
  br i1 %159, label %160, label %162

160:                                              ; preds = %152
  %161 = load i32, ptr %1, align 4, !tbaa !5
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 366, i32 noundef %161)
  br label %165

162:                                              ; preds = %152
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164, %160, %147, %135, %108, %96, %86, %78, %68, %58, %50, %23, %13
  %166 = load ptr, ptr %4, align 8, !tbaa !9
  call void @ba_free(ptr noundef %166)
  %167 = load ptr, ptr %5, align 8, !tbaa !9
  call void @wa_free(ptr noundef %167)
  %168 = load ptr, ptr %6, align 8, !tbaa !9
  call void @ba_free(ptr noundef %168)
  %169 = load ptr, ptr %7, align 8, !tbaa !9
  call void @ba_free(ptr noundef %169)
  %170 = load ptr, ptr %8, align 8, !tbaa !9
  call void @ba_free(ptr noundef %170)
  %171 = load ptr, ptr %9, align 8, !tbaa !9
  call void @ba_free(ptr noundef %171)
  %172 = load ptr, ptr %3, align 8, !tbaa !9
  call void @hash_free(ptr noundef %172)
  %173 = load ptr, ptr %2, align 8, !tbaa !9
  call void @ec_free(ptr noundef %173)
  %174 = load i32, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret i32 %174
}

declare ptr @ec_alloc_default(i32 noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #3

declare ptr @hash_alloc(i32 noundef) #2

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

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

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

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

declare void @ba_free(ptr noundef) #2

declare void @hash_free(ptr noundef) #2

declare void @ec_free(ptr noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #4 = { nounwind }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"ByteArray_st", !10, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !10, 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"

%struct.ByteArray_st = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@ecgdsa_self_test.test_Qx = external hidden constant [32 x i8], align 16
@ecgdsa_self_test.test_Qy = external hidden constant [32 x i8], align 16
@ecgdsa_self_test.test_k = external hidden constant [32 x i8], align 16
@ecgdsa_self_test.test_R = external hidden constant [32 x i8], align 16
@ecgdsa_self_test.test_S = external hidden constant [32 x i8], align 16
@ecgdsa_self_test.ba_d = external hidden constant %struct.ByteArray_st, align 8
@ecgdsa_self_test.ba_Msg = external hidden constant %struct.ByteArray_st, align 8

; Function Attrs: nounwind uwtable
declare dso_local i32 @ecgdsa_get_pubkey(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @ecgdsa_sign_internal(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @ecgdsa_verify(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @wa_free(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i32 @ecgdsa_self_test() local_unnamed_addr #0 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  store ptr null, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  store ptr null, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  store ptr null, ptr %5, align 8, !tbaa !5
  %6 = tail call ptr @ec_alloc_default(i32 noundef 33) #4
  %7 = icmp eq ptr %6, null
  br i1 %7, label %8, label %9

8:                                                ; preds = %0
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 340, i32 noundef 2) #4
  br label %70

9:                                                ; preds = %0
  %10 = call i32 @ecgdsa_get_pubkey(ptr noundef nonnull %6, ptr noundef nonnull @ecgdsa_self_test.ba_d, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %12, label %11

11:                                               ; preds = %9
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 341, i32 noundef %10) #4
  br label %70

12:                                               ; preds = %9
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = load i64, ptr %14, align 8, !tbaa !9
  %.not44 = icmp eq i64 %15, 32
  br i1 %.not44, label %16, label %24

16:                                               ; preds = %12
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 8
  %19 = load i64, ptr %18, align 8, !tbaa !9
  %.not45 = icmp eq i64 %19, 32
  br i1 %.not45, label %20, label %24

20:                                               ; preds = %16
  %21 = load ptr, ptr %13, align 8, !tbaa !12
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(32) %21, ptr noundef nonnull dereferenceable(32) @ecgdsa_self_test.test_Qx, i64 32)
  %.not46 = icmp eq i32 %bcmp, 0
  br i1 %.not46, label %22, label %24

22:                                               ; preds = %20
  %23 = load ptr, ptr %17, align 8, !tbaa !12
  %bcmp47 = call i32 @bcmp(ptr noundef nonnull dereferenceable(32) %23, ptr noundef nonnull dereferenceable(32) @ecgdsa_self_test.test_Qy, i64 32)
  %.not48 = icmp eq i32 %bcmp47, 0
  br i1 %.not48, label %25, label %24

24:                                               ; preds = %12, %16, %20, %22
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 346, i32 noundef 33, ptr noundef null) #4
  br label %70

25:                                               ; preds = %22
  %26 = call ptr @hash_alloc(i32 noundef 7) #4
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 349, i32 noundef 2) #4
  br label %70

29:                                               ; preds = %25
  %30 = call i32 @hash_update(ptr noundef nonnull %26, ptr noundef nonnull @ecgdsa_self_test.ba_Msg) #4
  %.not49 = icmp eq i32 %30, 0
  br i1 %.not49, label %32, label %31

31:                                               ; preds = %29
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 350, i32 noundef %30) #4
  br label %70

32:                                               ; preds = %29
  %33 = call i32 @hash_final(ptr noundef nonnull %26, ptr noundef nonnull %1) #4
  %.not50 = icmp eq i32 %33, 0
  br i1 %.not50, label %35, label %34

34:                                               ; preds = %32
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 351, i32 noundef %33) #4
  br label %70

35:                                               ; preds = %32
  %36 = call ptr @wa_alloc_from_be(ptr noundef nonnull @ecgdsa_self_test.test_k, i64 noundef 32) #4
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %39

38:                                               ; preds = %35
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 353, i32 noundef 2) #4
  br label %70

39:                                               ; preds = %35
  %40 = call i32 @ec_init_sign(ptr noundef nonnull %6, ptr noundef nonnull @ecgdsa_self_test.ba_d) #4
  %.not51 = icmp eq i32 %40, 0
  br i1 %.not51, label %42, label %41

41:                                               ; preds = %39
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 355, i32 noundef %40) #4
  br label %70

42:                                               ; preds = %39
  %43 = load ptr, ptr %1, align 8, !tbaa !5
  %44 = call i32 @ecgdsa_sign_internal(ptr noundef nonnull %6, ptr noundef %43, ptr noundef nonnull %36, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %.not52 = icmp eq i32 %44, 0
  br i1 %.not52, label %46, label %45

45:                                               ; preds = %42
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 356, i32 noundef %44) #4
  br label %70

46:                                               ; preds = %42
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  %49 = load i64, ptr %48, align 8, !tbaa !9
  %.not53 = icmp eq i64 %49, 32
  br i1 %.not53, label %50, label %58

50:                                               ; preds = %46
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load i64, ptr %52, align 8, !tbaa !9
  %.not54 = icmp eq i64 %53, 32
  br i1 %.not54, label %54, label %58

54:                                               ; preds = %50
  %55 = load ptr, ptr %47, align 8, !tbaa !12
  %bcmp55 = call i32 @bcmp(ptr noundef nonnull dereferenceable(32) %55, ptr noundef nonnull dereferenceable(32) @ecgdsa_self_test.test_R, i64 32)
  %.not56 = icmp eq i32 %bcmp55, 0
  br i1 %.not56, label %56, label %58

56:                                               ; preds = %54
  %57 = load ptr, ptr %51, align 8, !tbaa !12
  %bcmp57 = call i32 @bcmp(ptr noundef nonnull dereferenceable(32) %57, ptr noundef nonnull dereferenceable(32) @ecgdsa_self_test.test_S, i64 32)
  %.not58 = icmp eq i32 %bcmp57, 0
  br i1 %.not58, label %59, label %58

58:                                               ; preds = %46, %50, %54, %56
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 362, i32 noundef 33, ptr noundef null) #4
  br label %70

59:                                               ; preds = %56
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = call i32 @ec_init_verify(ptr noundef nonnull %6, ptr noundef %60, ptr noundef %61) #4
  %.not59 = icmp eq i32 %62, 0
  br i1 %.not59, label %64, label %63

63:                                               ; preds = %59
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 365, i32 noundef %62) #4
  br label %70

64:                                               ; preds = %59
  %65 = load ptr, ptr %1, align 8, !tbaa !5
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = call i32 @ecgdsa_verify(ptr noundef nonnull %6, ptr noundef %65, ptr noundef %66, ptr noundef %67)
  %.not60 = icmp eq i32 %68, 0
  br i1 %.not60, label %70, label %69

69:                                               ; preds = %64
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 366, i32 noundef %68) #4
  br label %70

70:                                               ; preds = %64, %69, %63, %58, %45, %41, %38, %34, %31, %28, %24, %11, %8
  %.031 = phi i32 [ 2, %8 ], [ %10, %11 ], [ 33, %24 ], [ 2, %28 ], [ %30, %31 ], [ %33, %34 ], [ 2, %38 ], [ %40, %41 ], [ %44, %45 ], [ 33, %58 ], [ %62, %63 ], [ %68, %69 ], [ 0, %64 ]
  %.030 = phi ptr [ null, %8 ], [ null, %11 ], [ null, %24 ], [ null, %28 ], [ %26, %31 ], [ %26, %34 ], [ %26, %38 ], [ %26, %41 ], [ %26, %45 ], [ %26, %58 ], [ %26, %63 ], [ %26, %69 ], [ %26, %64 ]
  %.0 = phi ptr [ null, %8 ], [ null, %11 ], [ null, %24 ], [ null, %28 ], [ null, %31 ], [ null, %34 ], [ null, %38 ], [ %36, %41 ], [ %36, %45 ], [ %36, %58 ], [ %36, %63 ], [ %36, %69 ], [ %36, %64 ]
  %71 = load ptr, ptr %1, align 8, !tbaa !5
  call void @ba_free(ptr noundef %71) #4
  call void @wa_free(ptr noundef %.0) #4
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  call void @ba_free(ptr noundef %72) #4
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  call void @ba_free(ptr noundef %73) #4
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  call void @ba_free(ptr noundef %74) #4
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  call void @ba_free(ptr noundef %75) #4
  call void @hash_free(ptr noundef %.030) #4
  call void @ec_free(ptr noundef %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  ret i32 %.031
}

declare ptr @ec_alloc_default(i32 noundef) local_unnamed_addr #2

declare ptr @hash_alloc(i32 noundef) local_unnamed_addr #2

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

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

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

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

declare void @ba_free(ptr noundef) local_unnamed_addr #2

declare void @hash_free(ptr noundef) local_unnamed_addr #2

declare void @ec_free(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 willreturn memory(argmem: read) }
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, !11, i64 8}
!10 = !{!"ByteArray_st", !6, i64 0, !11, i64 8}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !6, i64 0}


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