; LLVM IR from glaretechnologies/substrata :: secp256k1-master/src (bench_schnorrsig)

; 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.bench_schnorrsig_data = type { ptr, i32, ptr, ptr, ptr, ptr }
%struct.secp256k1_xonly_pubkey = type { [64 x i8] }

@stderr = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [101 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 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
declare dso_local void @run_benchmark(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @get_iters(i32 noundef) #1

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #3

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

; Function Attrs: noreturn nounwind
declare void @abort() #5

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.bench_schnorrsig_data, align 8
  %4 = alloca i32, align 4
  %5 = alloca [32 x i8], align 16
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.secp256k1_xonly_pubkey, align 1
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 48, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  %11 = call i32 @get_iters(i32 noundef 10000)
  store i32 %11, ptr %4, align 4, !tbaa !5
  %12 = call ptr @secp256k1_context_create(i32 noundef 769)
  %13 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 0
  store ptr %12, ptr %13, align 8, !tbaa !9
  %14 = load i32, ptr %4, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = mul i64 %15, 8
  %17 = call noalias ptr @malloc(i64 noundef %16) #9
  %18 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 2
  store ptr %17, ptr %18, align 8, !tbaa !12
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = mul i64 %20, 8
  %22 = call noalias ptr @malloc(i64 noundef %21) #9
  %23 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 3
  store ptr %22, ptr %23, align 8, !tbaa !13
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = mul i64 %25, 8
  %27 = call noalias ptr @malloc(i64 noundef %26) #9
  %28 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 5
  store ptr %27, ptr %28, align 8, !tbaa !14
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = mul i64 %30, 8
  %32 = call noalias ptr @malloc(i64 noundef %31) #9
  %33 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 4
  store ptr %32, ptr %33, align 8, !tbaa !15
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %176, %0
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %38, label %179

38:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %39 = call noalias ptr @malloc(i64 noundef 32) #9
  store ptr %39, ptr %6, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %40 = call noalias ptr @malloc(i64 noundef 64) #9
  store ptr %40, ptr %7, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %41 = call noalias ptr @malloc(i64 noundef 96) #9
  store ptr %41, ptr %8, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %42 = call noalias ptr @malloc(i64 noundef 32) #9
  store ptr %42, ptr %9, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 64, ptr %10) #8
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = trunc i32 %43 to i8
  %45 = getelementptr inbounds [32 x i8], ptr %5, i64 0, i64 0
  store i8 %44, ptr %45, align 16, !tbaa !17
  %46 = load ptr, ptr %6, align 8, !tbaa !16
  %47 = getelementptr inbounds i8, ptr %46, i64 0
  store i8 %44, ptr %47, align 1, !tbaa !17
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = ashr i32 %48, 8
  %50 = trunc i32 %49 to i8
  %51 = getelementptr inbounds [32 x i8], ptr %5, i64 0, i64 1
  store i8 %50, ptr %51, align 1, !tbaa !17
  %52 = load ptr, ptr %6, align 8, !tbaa !16
  %53 = getelementptr inbounds i8, ptr %52, i64 1
  store i8 %50, ptr %53, align 1, !tbaa !17
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = ashr i32 %54, 16
  %56 = trunc i32 %55 to i8
  %57 = getelementptr inbounds [32 x i8], ptr %5, i64 0, i64 2
  store i8 %56, ptr %57, align 2, !tbaa !17
  %58 = load ptr, ptr %6, align 8, !tbaa !16
  %59 = getelementptr inbounds i8, ptr %58, i64 2
  store i8 %56, ptr %59, align 1, !tbaa !17
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = ashr i32 %60, 24
  %62 = trunc i32 %61 to i8
  %63 = getelementptr inbounds [32 x i8], ptr %5, i64 0, i64 3
  store i8 %62, ptr %63, align 1, !tbaa !17
  %64 = load ptr, ptr %6, align 8, !tbaa !16
  %65 = getelementptr inbounds i8, ptr %64, i64 3
  store i8 %62, ptr %65, align 1, !tbaa !17
  %66 = load ptr, ptr %6, align 8, !tbaa !16
  %67 = getelementptr inbounds i8, ptr %66, i64 4
  call void @llvm.memset.p0.i64(ptr align 1 %67, i8 109, i64 28, i1 false)
  %68 = getelementptr inbounds [32 x i8], ptr %5, i64 0, i64 4
  call void @llvm.memset.p0.i64(ptr align 4 %68, i8 115, i64 28, i1 false)
  %69 = load ptr, ptr %8, align 8, !tbaa !16
  %70 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 2
  %71 = load ptr, ptr %70, align 8, !tbaa !12
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds ptr, ptr %71, i64 %73
  store ptr %69, ptr %74, align 8, !tbaa !16
  %75 = load ptr, ptr %9, align 8, !tbaa !16
  %76 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 3
  %77 = load ptr, ptr %76, align 8, !tbaa !13
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds ptr, ptr %77, i64 %79
  store ptr %75, ptr %80, align 8, !tbaa !16
  %81 = load ptr, ptr %6, align 8, !tbaa !16
  %82 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 5
  %83 = load ptr, ptr %82, align 8, !tbaa !14
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds ptr, ptr %83, i64 %85
  store ptr %81, ptr %86, align 8, !tbaa !16
  %87 = load ptr, ptr %7, align 8, !tbaa !16
  %88 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 4
  %89 = load ptr, ptr %88, align 8, !tbaa !15
  %90 = load i32, ptr %2, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds ptr, ptr %89, i64 %91
  store ptr %87, ptr %92, align 8, !tbaa !16
  br label %93

93:                                               ; preds = %38
  %94 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !9
  %96 = load ptr, ptr %8, align 8, !tbaa !16
  %97 = getelementptr inbounds [32 x i8], ptr %5, i64 0, i64 0
  %98 = call i32 @secp256k1_keypair_create(ptr noundef %95, ptr noundef %96, ptr noundef %97)
  %99 = icmp ne i32 %98, 0
  %100 = xor i1 %99, true
  %101 = zext i1 %100 to i32
  %102 = sext i32 %101 to i64
  %103 = call i64 @llvm.expect.i64(i64 %102, i64 0)
  %104 = icmp ne i64 %103, 0
  br i1 %104, label %105, label %111

105:                                              ; preds = %93
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr @stderr, align 8, !tbaa !16
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 80, ptr noundef @.str.12) #8
  call void @abort() #10
  unreachable

109:                                              ; No predecessors!
  br label %110

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110, %93
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  %115 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  %117 = load ptr, ptr %7, align 8, !tbaa !16
  %118 = load ptr, ptr %6, align 8, !tbaa !16
  %119 = load ptr, ptr %8, align 8, !tbaa !16
  %120 = call i32 @secp256k1_schnorrsig_sign(ptr noundef %116, ptr noundef %117, ptr noundef %118, ptr noundef %119, ptr noundef null, ptr noundef null)
  %121 = icmp ne i32 %120, 0
  %122 = xor i1 %121, true
  %123 = zext i1 %122 to i32
  %124 = sext i32 %123 to i64
  %125 = call i64 @llvm.expect.i64(i64 %124, i64 0)
  %126 = icmp ne i64 %125, 0
  br i1 %126, label %127, label %133

127:                                              ; preds = %114
  br label %128

128:                                              ; preds = %127
  %129 = load ptr, ptr @stderr, align 8, !tbaa !16
  %130 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %129, ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 81, ptr noundef @.str.13) #8
  call void @abort() #10
  unreachable

131:                                              ; No predecessors!
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132, %114
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135
  %137 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !9
  %139 = load ptr, ptr %8, align 8, !tbaa !16
  %140 = call i32 @secp256k1_keypair_xonly_pub(ptr noundef %138, ptr noundef %10, ptr noundef null, ptr noundef %139)
  %141 = icmp ne i32 %140, 0
  %142 = xor i1 %141, true
  %143 = zext i1 %142 to i32
  %144 = sext i32 %143 to i64
  %145 = call i64 @llvm.expect.i64(i64 %144, i64 0)
  %146 = icmp ne i64 %145, 0
  br i1 %146, label %147, label %153

147:                                              ; preds = %136
  br label %148

148:                                              ; preds = %147
  %149 = load ptr, ptr @stderr, align 8, !tbaa !16
  %150 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %149, ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 82, ptr noundef @.str.14) #8
  call void @abort() #10
  unreachable

151:                                              ; No predecessors!
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152, %136
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154
  br label %156

156:                                              ; preds = %155
  %157 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 0
  %158 = load ptr, ptr %157, align 8, !tbaa !9
  %159 = load ptr, ptr %9, align 8, !tbaa !16
  %160 = call i32 @secp256k1_xonly_pubkey_serialize(ptr noundef %158, ptr noundef %159, ptr noundef %10)
  %161 = icmp eq i32 %160, 1
  %162 = xor i1 %161, true
  %163 = zext i1 %162 to i32
  %164 = sext i32 %163 to i64
  %165 = call i64 @llvm.expect.i64(i64 %164, i64 0)
  %166 = icmp ne i64 %165, 0
  br i1 %166, label %167, label %173

167:                                              ; preds = %156
  br label %168

168:                                              ; preds = %167
  %169 = load ptr, ptr @stderr, align 8, !tbaa !16
  %170 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %169, ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 83, ptr noundef @.str.15) #8
  call void @abort() #10
  unreachable

171:                                              ; No predecessors!
  br label %172

172:                                              ; preds = %171
  br label %173

173:                                              ; preds = %172, %156
  br label %174

174:                                              ; preds = %173
  br label %175

175:                                              ; preds = %174
  call void @llvm.lifetime.end.p0(i64 64, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #8
  br label %176

176:                                              ; preds = %175
  %177 = load i32, ptr %2, align 4, !tbaa !5
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %2, align 4, !tbaa !5
  br label %34, !llvm.loop !18

179:                                              ; preds = %34
  %180 = load i32, ptr %4, align 4, !tbaa !5
  call void @run_benchmark(ptr noundef @.str.16, ptr noundef @bench_schnorrsig_sign, ptr noundef null, ptr noundef null, ptr noundef %3, i32 noundef 10, i32 noundef %180)
  %181 = load i32, ptr %4, align 4, !tbaa !5
  call void @run_benchmark(ptr noundef @.str.17, ptr noundef @bench_schnorrsig_verify, ptr noundef null, ptr noundef null, ptr noundef %3, i32 noundef 10, i32 noundef %181)
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %182

182:                                              ; preds = %211, %179
  %183 = load i32, ptr %2, align 4, !tbaa !5
  %184 = load i32, ptr %4, align 4, !tbaa !5
  %185 = icmp slt i32 %183, %184
  br i1 %185, label %186, label %214

186:                                              ; preds = %182
  %187 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 2
  %188 = load ptr, ptr %187, align 8, !tbaa !12
  %189 = load i32, ptr %2, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds ptr, ptr %188, i64 %190
  %192 = load ptr, ptr %191, align 8, !tbaa !16
  call void @free(ptr noundef %192) #8
  %193 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 3
  %194 = load ptr, ptr %193, align 8, !tbaa !13
  %195 = load i32, ptr %2, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds ptr, ptr %194, i64 %196
  %198 = load ptr, ptr %197, align 8, !tbaa !16
  call void @free(ptr noundef %198) #8
  %199 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 5
  %200 = load ptr, ptr %199, align 8, !tbaa !14
  %201 = load i32, ptr %2, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds ptr, ptr %200, i64 %202
  %204 = load ptr, ptr %203, align 8, !tbaa !16
  call void @free(ptr noundef %204) #8
  %205 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 4
  %206 = load ptr, ptr %205, align 8, !tbaa !15
  %207 = load i32, ptr %2, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds ptr, ptr %206, i64 %208
  %210 = load ptr, ptr %209, align 8, !tbaa !16
  call void @free(ptr noundef %210) #8
  br label %211

211:                                              ; preds = %186
  %212 = load i32, ptr %2, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %2, align 4, !tbaa !5
  br label %182, !llvm.loop !20

214:                                              ; preds = %182
  %215 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 2
  %216 = load ptr, ptr %215, align 8, !tbaa !12
  call void @free(ptr noundef %216) #8
  %217 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 3
  %218 = load ptr, ptr %217, align 8, !tbaa !13
  call void @free(ptr noundef %218) #8
  %219 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 5
  %220 = load ptr, ptr %219, align 8, !tbaa !14
  call void @free(ptr noundef %220) #8
  %221 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 4
  %222 = load ptr, ptr %221, align 8, !tbaa !15
  call void @free(ptr noundef %222) #8
  %223 = getelementptr inbounds %struct.bench_schnorrsig_data, ptr %3, i32 0, i32 0
  %224 = load ptr, ptr %223, align 8, !tbaa !9
  call void @secp256k1_context_destroy(ptr noundef %224)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  ret i32 0
}

declare ptr @secp256k1_context_create(i32 noundef) #2

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #6

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

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

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

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

declare void @secp256k1_context_destroy(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 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #4 = { 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 #5 = { noreturn 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 #6 = { nounwind allocsize(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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !11, i64 16}
!13 = !{!10, !11, i64 24}
!14 = !{!10, !11, i64 40}
!15 = !{!10, !11, i64 32}
!16 = !{!11, !11, i64 0}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; 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.bench_schnorrsig_data = type { ptr, i32, ptr, ptr, ptr, ptr }
%struct.secp256k1_xonly_pubkey = type { [64 x i8] }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [101 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 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
declare dso_local void @run_benchmark(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @get_iters(i32 noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca %struct.bench_schnorrsig_data, align 8
  %2 = alloca [32 x i8], align 16
  %3 = alloca %struct.secp256k1_xonly_pubkey, align 1
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #8
  %4 = tail call i32 @get_iters(i32 noundef 10000)
  %5 = tail call ptr @secp256k1_context_create(i32 noundef 769) #8
  store ptr %5, ptr %1, align 8, !tbaa !5
  %6 = sext i32 %4 to i64
  %7 = shl nsw i64 %6, 3
  %8 = tail call noalias ptr @malloc(i64 noundef %7) #9
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  store ptr %8, ptr %9, align 8, !tbaa !11
  %10 = tail call noalias ptr @malloc(i64 noundef %7) #9
  %11 = getelementptr inbounds i8, ptr %1, i64 24
  store ptr %10, ptr %11, align 8, !tbaa !12
  %12 = tail call noalias ptr @malloc(i64 noundef %7) #9
  %13 = getelementptr inbounds i8, ptr %1, i64 40
  store ptr %12, ptr %13, align 8, !tbaa !13
  %14 = tail call noalias ptr @malloc(i64 noundef %7) #9
  %15 = getelementptr inbounds i8, ptr %1, i64 32
  store ptr %14, ptr %15, align 8, !tbaa !14
  %16 = icmp sgt i32 %4, 0
  br i1 %16, label %.lr.ph, label %._crit_edge46.critedge

.lr.ph:                                           ; preds = %0
  %17 = getelementptr inbounds i8, ptr %2, i64 1
  %18 = getelementptr inbounds i8, ptr %2, i64 2
  %19 = getelementptr inbounds i8, ptr %2, i64 3
  %20 = getelementptr inbounds i8, ptr %2, i64 4
  %wide.trip.count = zext nneg i32 %4 to i64
  br label %21

21:                                               ; preds = %.lr.ph, %60
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %60 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #8
  %22 = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
  %23 = call noalias dereferenceable_or_null(64) ptr @malloc(i64 noundef 64) #9
  %24 = call noalias dereferenceable_or_null(96) ptr @malloc(i64 noundef 96) #9
  %25 = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #8
  %26 = trunc i64 %indvars.iv to i8
  store i8 %26, ptr %2, align 16, !tbaa !15
  store i8 %26, ptr %22, align 1, !tbaa !15
  %27 = lshr i64 %indvars.iv, 8
  %28 = trunc i64 %27 to i8
  store i8 %28, ptr %17, align 1, !tbaa !15
  %29 = getelementptr inbounds i8, ptr %22, i64 1
  store i8 %28, ptr %29, align 1, !tbaa !15
  %30 = lshr i64 %indvars.iv, 16
  %31 = trunc i64 %30 to i8
  store i8 %31, ptr %18, align 2, !tbaa !15
  %32 = getelementptr inbounds i8, ptr %22, i64 2
  store i8 %31, ptr %32, align 1, !tbaa !15
  %33 = lshr i64 %indvars.iv, 24
  %34 = trunc i64 %33 to i8
  store i8 %34, ptr %19, align 1, !tbaa !15
  %35 = getelementptr inbounds i8, ptr %22, i64 3
  store i8 %34, ptr %35, align 1, !tbaa !15
  %36 = getelementptr inbounds i8, ptr %22, i64 4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(28) %36, i8 109, i64 28, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %20, i8 115, i64 28, i1 false)
  %37 = getelementptr inbounds ptr, ptr %8, i64 %indvars.iv
  store ptr %24, ptr %37, align 8, !tbaa !16
  %38 = getelementptr inbounds ptr, ptr %10, i64 %indvars.iv
  store ptr %25, ptr %38, align 8, !tbaa !16
  %39 = getelementptr inbounds ptr, ptr %12, i64 %indvars.iv
  store ptr %22, ptr %39, align 8, !tbaa !16
  %40 = getelementptr inbounds ptr, ptr %14, i64 %indvars.iv
  store ptr %23, ptr %40, align 8, !tbaa !16
  %41 = call i32 @secp256k1_keypair_create(ptr noundef %5, ptr noundef %24, ptr noundef nonnull %2) #8
  %.not = icmp eq i32 %41, 0
  br i1 %.not, label %42, label %45, !prof !17

42:                                               ; preds = %21
  %43 = load ptr, ptr @stderr, align 8, !tbaa !16
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, i32 noundef 80, ptr noundef nonnull @.str.12) #10
  call void @abort() #11
  unreachable

45:                                               ; preds = %21
  %46 = call i32 @secp256k1_schnorrsig_sign(ptr noundef %5, ptr noundef %23, ptr noundef nonnull %22, ptr noundef %24, ptr noundef null, ptr noundef null) #8
  %.not39 = icmp eq i32 %46, 0
  br i1 %.not39, label %47, label %50, !prof !17

47:                                               ; preds = %45
  %48 = load ptr, ptr @stderr, align 8, !tbaa !16
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, i32 noundef 81, ptr noundef nonnull @.str.13) #10
  call void @abort() #11
  unreachable

50:                                               ; preds = %45
  %51 = call i32 @secp256k1_keypair_xonly_pub(ptr noundef %5, ptr noundef nonnull %3, ptr noundef null, ptr noundef %24) #8
  %.not40 = icmp eq i32 %51, 0
  br i1 %.not40, label %52, label %55, !prof !17

52:                                               ; preds = %50
  %53 = load ptr, ptr @stderr, align 8, !tbaa !16
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, i32 noundef 82, ptr noundef nonnull @.str.14) #10
  call void @abort() #11
  unreachable

55:                                               ; preds = %50
  %56 = call i32 @secp256k1_xonly_pubkey_serialize(ptr noundef %5, ptr noundef %25, ptr noundef nonnull %3) #8
  %.not41 = icmp eq i32 %56, 1
  br i1 %.not41, label %60, label %57, !prof !18

57:                                               ; preds = %55
  %58 = load ptr, ptr @stderr, align 8, !tbaa !16
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, i32 noundef 83, ptr noundef nonnull @.str.15) #10
  call void @abort() #11
  unreachable

60:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %21, !llvm.loop !19

._crit_edge:                                      ; preds = %60
  call void @run_benchmark(ptr noundef nonnull @.str.16, ptr noundef nonnull @bench_schnorrsig_sign, ptr noundef null, ptr noundef null, ptr noundef nonnull %1, i32 noundef 10, i32 noundef %4)
  call void @run_benchmark(ptr noundef nonnull @.str.17, ptr noundef nonnull @bench_schnorrsig_verify, ptr noundef null, ptr noundef null, ptr noundef nonnull %1, i32 noundef 10, i32 noundef %4)
  br i1 %16, label %.lr.ph45.preheader, label %._crit_edge46

.lr.ph45.preheader:                               ; preds = %._crit_edge
  %wide.trip.count51 = zext nneg i32 %4 to i64
  br label %.lr.ph45

.lr.ph45:                                         ; preds = %.lr.ph45.preheader, %.lr.ph45
  %indvars.iv48 = phi i64 [ 0, %.lr.ph45.preheader ], [ %indvars.iv.next49, %.lr.ph45 ]
  %61 = load ptr, ptr %9, align 8, !tbaa !11
  %62 = getelementptr inbounds ptr, ptr %61, i64 %indvars.iv48
  %63 = load ptr, ptr %62, align 8, !tbaa !16
  call void @free(ptr noundef %63) #8
  %64 = load ptr, ptr %11, align 8, !tbaa !12
  %65 = getelementptr inbounds ptr, ptr %64, i64 %indvars.iv48
  %66 = load ptr, ptr %65, align 8, !tbaa !16
  call void @free(ptr noundef %66) #8
  %67 = load ptr, ptr %13, align 8, !tbaa !13
  %68 = getelementptr inbounds ptr, ptr %67, i64 %indvars.iv48
  %69 = load ptr, ptr %68, align 8, !tbaa !16
  call void @free(ptr noundef %69) #8
  %70 = load ptr, ptr %15, align 8, !tbaa !14
  %71 = getelementptr inbounds ptr, ptr %70, i64 %indvars.iv48
  %72 = load ptr, ptr %71, align 8, !tbaa !16
  call void @free(ptr noundef %72) #8
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond52.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count51
  br i1 %exitcond52.not, label %._crit_edge46, label %.lr.ph45, !llvm.loop !21

._crit_edge46.critedge:                           ; preds = %0
  call void @run_benchmark(ptr noundef nonnull @.str.16, ptr noundef nonnull @bench_schnorrsig_sign, ptr noundef null, ptr noundef null, ptr noundef nonnull %1, i32 noundef 10, i32 noundef %4)
  call void @run_benchmark(ptr noundef nonnull @.str.17, ptr noundef nonnull @bench_schnorrsig_verify, ptr noundef null, ptr noundef null, ptr noundef nonnull %1, i32 noundef 10, i32 noundef %4)
  br label %._crit_edge46

._crit_edge46:                                    ; preds = %.lr.ph45, %._crit_edge46.critedge, %._crit_edge
  %73 = load ptr, ptr %9, align 8, !tbaa !11
  call void @free(ptr noundef %73) #8
  %74 = load ptr, ptr %11, align 8, !tbaa !12
  call void @free(ptr noundef %74) #8
  %75 = load ptr, ptr %13, align 8, !tbaa !13
  call void @free(ptr noundef %75) #8
  %76 = load ptr, ptr %15, align 8, !tbaa !14
  call void @free(ptr noundef %76) #8
  %77 = load ptr, ptr %1, align 8, !tbaa !5
  call void @secp256k1_context_destroy(ptr noundef %77) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #8
  ret i32 0
}

declare ptr @secp256k1_context_create(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5

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

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

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #7

declare void @secp256k1_context_destroy(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 = { noreturn 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 #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { cold nounwind }
attributes #11 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 16}
!12 = !{!6, !7, i64 24}
!13 = !{!6, !7, i64 40}
!14 = !{!6, !7, i64 32}
!15 = !{!8, !8, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!18 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


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