; LLVM IR from guanzhi/GmSSL :: tools (sm9sign)

; 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_SIGN_KEY = type { %struct.SM9_Z256_TWIST_POINT, %struct.SM9_Z256_POINT }
%struct.SM9_Z256_TWIST_POINT = type { [2 x [4 x i64]], [2 x [4 x i64]], [2 x [4 x i64]] }
%struct.SM9_Z256_POINT = type { [4 x i64], [4 x i64], [4 x i64] }
%struct.SM9_SIGN_CTX = type { %struct.SM3_CTX }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }

@stdin = external global ptr, align 8
@stdout = external global ptr, align 8
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@usage = external hidden global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@options = external hidden global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [63 x i8], align 1
@__FUNCTION__.sm9sign_main = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @sm9sign_main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %struct.SM9_SIGN_KEY, align 8
  %16 = alloca %struct.SM9_SIGN_CTX, align 8
  %17 = alloca [4096 x i8], align 16
  %18 = alloca i64, align 8
  %19 = alloca [104 x i8], align 16
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 0
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  store ptr %24, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store ptr null, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr null, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store ptr null, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %25 = load ptr, ptr @stdin, align 8, !tbaa !9
  store ptr %25, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store ptr null, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %26 = load ptr, ptr @stdout, align 8, !tbaa !9
  store ptr %26, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 288, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 112, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4096, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 104, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = add nsw i32 %27, -1
  store i32 %28, ptr %4, align 4, !tbaa !5
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = getelementptr inbounds ptr, ptr %29, i32 1
  store ptr %30, ptr %5, align 8, !tbaa !9
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = icmp slt i32 %31, 1
  br i1 %32, label %33, label %38

33:                                               ; preds = %2
  %34 = load ptr, ptr @stderr, align 8, !tbaa !9
  %35 = load ptr, ptr %7, align 8, !tbaa !9
  %36 = load ptr, ptr @usage, align 8, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef @.str, ptr noundef %35, ptr noundef %36) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %250

38:                                               ; preds = %2
  br label %39

39:                                               ; preds = %150, %38
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %42, label %155

42:                                               ; preds = %39
  %43 = load ptr, ptr %5, align 8, !tbaa !9
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = call i32 @strcmp(ptr noundef %44, ptr noundef @.str.1) #6
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %53, label %47

47:                                               ; preds = %42
  %48 = load ptr, ptr %7, align 8, !tbaa !9
  %49 = load ptr, ptr @usage, align 8, !tbaa !9
  %50 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %48, ptr noundef %49)
  %51 = load ptr, ptr @options, align 8, !tbaa !9
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %51)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %250

53:                                               ; preds = %42
  %54 = load ptr, ptr %5, align 8, !tbaa !9
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = call i32 @strcmp(ptr noundef %55, ptr noundef @.str.3) #6
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %77, label %58

58:                                               ; preds = %53
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = add nsw i32 %59, -1
  store i32 %60, ptr %4, align 4, !tbaa !5
  %61 = icmp slt i32 %60, 1
  br i1 %61, label %62, label %63

62:                                               ; preds = %58
  br label %140

63:                                               ; preds = %58
  %64 = load ptr, ptr %5, align 8, !tbaa !9
  %65 = getelementptr inbounds ptr, ptr %64, i32 1
  store ptr %65, ptr %5, align 8, !tbaa !9
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  store ptr %66, ptr %8, align 8, !tbaa !9
  %67 = load ptr, ptr %8, align 8, !tbaa !9
  %68 = call noalias ptr @fopen(ptr noundef %67, ptr noundef @.str.4)
  store ptr %68, ptr %12, align 8, !tbaa !9
  %69 = icmp ne ptr %68, null
  br i1 %69, label %76, label %70

70:                                               ; preds = %63
  br label %71

71:                                               ; preds = %70
  %72 = load ptr, ptr @stderr, align 8, !tbaa !9
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 73, ptr noundef @__FUNCTION__.sm9sign_main) #5
  br label %74

74:                                               ; preds = %71
  br label %75

75:                                               ; preds = %74
  br label %229

76:                                               ; preds = %63
  br label %149

77:                                               ; preds = %53
  %78 = load ptr, ptr %5, align 8, !tbaa !9
  %79 = load ptr, ptr %78, align 8, !tbaa !9
  %80 = call i32 @strcmp(ptr noundef %79, ptr noundef @.str.7) #6
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %101, label %82

82:                                               ; preds = %77
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = add nsw i32 %83, -1
  store i32 %84, ptr %4, align 4, !tbaa !5
  %85 = icmp slt i32 %84, 1
  br i1 %85, label %86, label %87

86:                                               ; preds = %82
  br label %140

87:                                               ; preds = %82
  %88 = load ptr, ptr %5, align 8, !tbaa !9
  %89 = getelementptr inbounds ptr, ptr %88, i32 1
  store ptr %89, ptr %5, align 8, !tbaa !9
  %90 = load ptr, ptr %89, align 8, !tbaa !9
  store ptr %90, ptr %9, align 8, !tbaa !9
  %91 = load ptr, ptr %9, align 8, !tbaa !9
  %92 = call noalias ptr @fopen(ptr noundef %91, ptr noundef @.str.4)
  store ptr %92, ptr %13, align 8, !tbaa !9
  %93 = icmp ne ptr %92, null
  br i1 %93, label %100, label %94

94:                                               ; preds = %87
  br label %95

95:                                               ; preds = %94
  %96 = load ptr, ptr @stderr, align 8, !tbaa !9
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 80, ptr noundef @__FUNCTION__.sm9sign_main) #5
  br label %98

98:                                               ; preds = %95
  br label %99

99:                                               ; preds = %98
  br label %229

100:                                              ; preds = %87
  br label %148

101:                                              ; preds = %77
  %102 = load ptr, ptr %5, align 8, !tbaa !9
  %103 = load ptr, ptr %102, align 8, !tbaa !9
  %104 = call i32 @strcmp(ptr noundef %103, ptr noundef @.str.8) #6
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %115, label %106

106:                                              ; preds = %101
  %107 = load i32, ptr %4, align 4, !tbaa !5
  %108 = add nsw i32 %107, -1
  store i32 %108, ptr %4, align 4, !tbaa !5
  %109 = icmp slt i32 %108, 1
  br i1 %109, label %110, label %111

110:                                              ; preds = %106
  br label %140

111:                                              ; preds = %106
  %112 = load ptr, ptr %5, align 8, !tbaa !9
  %113 = getelementptr inbounds ptr, ptr %112, i32 1
  store ptr %113, ptr %5, align 8, !tbaa !9
  %114 = load ptr, ptr %113, align 8, !tbaa !9
  store ptr %114, ptr %10, align 8, !tbaa !9
  br label %147

115:                                              ; preds = %101
  %116 = load ptr, ptr %5, align 8, !tbaa !9
  %117 = load ptr, ptr %116, align 8, !tbaa !9
  %118 = call i32 @strcmp(ptr noundef %117, ptr noundef @.str.9) #6
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %139, label %120

120:                                              ; preds = %115
  %121 = load i32, ptr %4, align 4, !tbaa !5
  %122 = add nsw i32 %121, -1
  store i32 %122, ptr %4, align 4, !tbaa !5
  %123 = icmp slt i32 %122, 1
  br i1 %123, label %124, label %125

124:                                              ; preds = %120
  br label %140

125:                                              ; preds = %120
  %126 = load ptr, ptr %5, align 8, !tbaa !9
  %127 = getelementptr inbounds ptr, ptr %126, i32 1
  store ptr %127, ptr %5, align 8, !tbaa !9
  %128 = load ptr, ptr %127, align 8, !tbaa !9
  store ptr %128, ptr %11, align 8, !tbaa !9
  %129 = load ptr, ptr %11, align 8, !tbaa !9
  %130 = call noalias ptr @fopen(ptr noundef %129, ptr noundef @.str.10)
  store ptr %130, ptr %14, align 8, !tbaa !9
  %131 = icmp ne ptr %130, null
  br i1 %131, label %138, label %132

132:                                              ; preds = %125
  br label %133

133:                                              ; preds = %132
  %134 = load ptr, ptr @stderr, align 8, !tbaa !9
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 90, ptr noundef @__FUNCTION__.sm9sign_main) #5
  br label %136

136:                                              ; preds = %133
  br label %137

137:                                              ; preds = %136
  br label %229

138:                                              ; preds = %125
  br label %146

139:                                              ; preds = %115
  br label %140

140:                                              ; preds = %139, %124, %110, %86, %62
  %141 = load ptr, ptr @stderr, align 8, !tbaa !9
  %142 = load ptr, ptr %7, align 8, !tbaa !9
  %143 = load ptr, ptr %5, align 8, !tbaa !9
  %144 = load ptr, ptr %143, align 8, !tbaa !9
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef @.str.11, ptr noundef %142, ptr noundef %144) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %250

146:                                              ; preds = %138
  br label %147

147:                                              ; preds = %146, %111
  br label %148

148:                                              ; preds = %147, %100
  br label %149

149:                                              ; preds = %148, %76
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %4, align 4, !tbaa !5
  %152 = add nsw i32 %151, -1
  store i32 %152, ptr %4, align 4, !tbaa !5
  %153 = load ptr, ptr %5, align 8, !tbaa !9
  %154 = getelementptr inbounds ptr, ptr %153, i32 1
  store ptr %154, ptr %5, align 8, !tbaa !9
  br label %39, !llvm.loop !11

155:                                              ; preds = %39
  %156 = load ptr, ptr %9, align 8, !tbaa !9
  %157 = icmp ne ptr %156, null
  br i1 %157, label %158, label %161

158:                                              ; preds = %155
  %159 = load ptr, ptr %10, align 8, !tbaa !9
  %160 = icmp ne ptr %159, null
  br i1 %160, label %167, label %161

161:                                              ; preds = %158, %155
  br label %162

162:                                              ; preds = %161
  %163 = load ptr, ptr @stderr, align 8, !tbaa !9
  %164 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %163, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 104, ptr noundef @__FUNCTION__.sm9sign_main) #5
  br label %165

165:                                              ; preds = %162
  br label %166

166:                                              ; preds = %165
  br label %229

167:                                              ; preds = %158
  %168 = load ptr, ptr %10, align 8, !tbaa !9
  %169 = load ptr, ptr %13, align 8, !tbaa !9
  %170 = call i32 @sm9_sign_key_info_decrypt_from_pem(ptr noundef %15, ptr noundef %168, ptr noundef %169)
  %171 = icmp ne i32 %170, 1
  br i1 %171, label %172, label %178

172:                                              ; preds = %167
  br label %173

173:                                              ; preds = %172
  %174 = load ptr, ptr @stderr, align 8, !tbaa !9
  %175 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %174, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 109, ptr noundef @__FUNCTION__.sm9sign_main) #5
  br label %176

176:                                              ; preds = %173
  br label %177

177:                                              ; preds = %176
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %250

178:                                              ; preds = %167
  %179 = call i32 @sm9_sign_init(ptr noundef %16)
  %180 = icmp ne i32 %179, 1
  br i1 %180, label %181, label %187

181:                                              ; preds = %178
  br label %182

182:                                              ; preds = %181
  %183 = load ptr, ptr @stderr, align 8, !tbaa !9
  %184 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %183, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 114, ptr noundef @__FUNCTION__.sm9sign_main) #5
  br label %185

185:                                              ; preds = %182
  br label %186

186:                                              ; preds = %185
  br label %229

187:                                              ; preds = %178
  br label %188

188:                                              ; preds = %204, %187
  %189 = getelementptr inbounds [4096 x i8], ptr %17, i64 0, i64 0
  %190 = load ptr, ptr %12, align 8, !tbaa !9
  %191 = call i64 @fread(ptr noundef %189, i64 noundef 1, i64 noundef 4096, ptr noundef %190)
  store i64 %191, ptr %18, align 8, !tbaa !13
  %192 = icmp ugt i64 %191, 0
  br i1 %192, label %193, label %205

193:                                              ; preds = %188
  %194 = getelementptr inbounds [4096 x i8], ptr %17, i64 0, i64 0
  %195 = load i64, ptr %18, align 8, !tbaa !13
  %196 = call i32 @sm9_sign_update(ptr noundef %16, ptr noundef %194, i64 noundef %195)
  %197 = icmp ne i32 %196, 1
  br i1 %197, label %198, label %204

198:                                              ; preds = %193
  br label %199

199:                                              ; preds = %198
  %200 = load ptr, ptr @stderr, align 8, !tbaa !9
  %201 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %200, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 119, ptr noundef @__FUNCTION__.sm9sign_main) #5
  br label %202

202:                                              ; preds = %199
  br label %203

203:                                              ; preds = %202
  br label %229

204:                                              ; preds = %193
  br label %188, !llvm.loop !15

205:                                              ; preds = %188
  %206 = getelementptr inbounds [104 x i8], ptr %19, i64 0, i64 0
  %207 = call i32 @sm9_sign_finish(ptr noundef %16, ptr noundef %15, ptr noundef %206, ptr noundef %20)
  %208 = icmp ne i32 %207, 1
  br i1 %208, label %209, label %215

209:                                              ; preds = %205
  br label %210

210:                                              ; preds = %209
  %211 = load ptr, ptr @stderr, align 8, !tbaa !9
  %212 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %211, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 124, ptr noundef @__FUNCTION__.sm9sign_main) #5
  br label %213

213:                                              ; preds = %210
  br label %214

214:                                              ; preds = %213
  br label %229

215:                                              ; preds = %205
  %216 = load i64, ptr %20, align 8, !tbaa !13
  %217 = getelementptr inbounds [104 x i8], ptr %19, i64 0, i64 0
  %218 = load i64, ptr %20, align 8, !tbaa !13
  %219 = load ptr, ptr %14, align 8, !tbaa !9
  %220 = call i64 @fwrite(ptr noundef %217, i64 noundef 1, i64 noundef %218, ptr noundef %219)
  %221 = icmp ne i64 %216, %220
  br i1 %221, label %222, label %228

222:                                              ; preds = %215
  br label %223

223:                                              ; preds = %222
  %224 = load ptr, ptr @stderr, align 8, !tbaa !9
  %225 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %224, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 129, ptr noundef @__FUNCTION__.sm9sign_main) #5
  br label %226

226:                                              ; preds = %223
  br label %227

227:                                              ; preds = %226
  br label %229

228:                                              ; preds = %215
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %229

229:                                              ; preds = %228, %227, %214, %203, %186, %166, %137, %99, %75
  call void @gmssl_secure_clear(ptr noundef %15, i64 noundef 288)
  call void @gmssl_secure_clear(ptr noundef %16, i64 noundef 112)
  %230 = getelementptr inbounds [4096 x i8], ptr %17, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %230, i64 noundef 4096)
  %231 = load ptr, ptr %8, align 8, !tbaa !9
  %232 = icmp ne ptr %231, null
  br i1 %232, label %233, label %239

233:                                              ; preds = %229
  %234 = load ptr, ptr %12, align 8, !tbaa !9
  %235 = icmp ne ptr %234, null
  br i1 %235, label %236, label %239

236:                                              ; preds = %233
  %237 = load ptr, ptr %12, align 8, !tbaa !9
  %238 = call i32 @fclose(ptr noundef %237)
  br label %239

239:                                              ; preds = %236, %233, %229
  %240 = load ptr, ptr %11, align 8, !tbaa !9
  %241 = icmp ne ptr %240, null
  br i1 %241, label %242, label %248

242:                                              ; preds = %239
  %243 = load ptr, ptr %14, align 8, !tbaa !9
  %244 = icmp ne ptr %243, null
  br i1 %244, label %245, label %248

245:                                              ; preds = %242
  %246 = load ptr, ptr %14, align 8, !tbaa !9
  %247 = call i32 @fclose(ptr noundef %246)
  br label %248

248:                                              ; preds = %245, %242, %239
  %249 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %249, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %250

250:                                              ; preds = %248, %177, %140, %47, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4096, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 288, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %251 = load i32, ptr %3, align 4
  ret i32 %251
}

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

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

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

declare i32 @printf(ptr noundef, ...) #4

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

declare i32 @sm9_sign_key_info_decrypt_from_pem(ptr noundef, ptr noundef, ptr noundef) #4

declare i32 @sm9_sign_init(ptr noundef) #4

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

declare i32 @sm9_sign_update(ptr noundef, ptr noundef, i64 noundef) #4

declare i32 @sm9_sign_finish(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

declare void @gmssl_secure_clear(ptr noundef, i64 noundef) #4

declare i32 @fclose(ptr noundef) #4

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

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 = { 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 #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 = { "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 = { nounwind }
attributes #6 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.SM9_SIGN_KEY = type { %struct.SM9_Z256_TWIST_POINT, %struct.SM9_Z256_POINT }
%struct.SM9_Z256_TWIST_POINT = type { [2 x [4 x i64]], [2 x [4 x i64]], [2 x [4 x i64]] }
%struct.SM9_Z256_POINT = type { [4 x i64], [4 x i64], [4 x i64] }
%struct.SM9_SIGN_CTX = type { %struct.SM3_CTX }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }

@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@usage = external hidden local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@options = external hidden local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [63 x i8], align 1
@__FUNCTION__.sm9sign_main = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @sm9sign_main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca %struct.SM9_SIGN_KEY, align 8
  %4 = alloca %struct.SM9_SIGN_CTX, align 8
  %5 = alloca [4096 x i8], align 16
  %6 = alloca [104 x i8], align 16
  %7 = alloca i64, align 8
  %8 = load ptr, ptr %1, align 8, !tbaa !5
  %9 = load ptr, ptr @stdin, align 8, !tbaa !5
  %10 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 288, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %11 = icmp slt i32 %0, 2
  br i1 %11, label %13, label %.preheader92.preheader

.preheader92.preheader:                           ; preds = %2
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  br label %.preheader92

13:                                               ; preds = %2
  %14 = load ptr, ptr @stderr, align 8, !tbaa !5
  %15 = load ptr, ptr @usage, align 8, !tbaa !5
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str, ptr noundef %8, ptr noundef %15) #6
  br label %112

.preheader92:                                     ; preds = %.preheader92.preheader, %66
  %.046142 = phi ptr [ %.1, %66 ], [ %10, %.preheader92.preheader ]
  %.047141 = phi ptr [ %.148, %66 ], [ null, %.preheader92.preheader ]
  %.049140 = phi ptr [ %.150, %66 ], [ %9, %.preheader92.preheader ]
  %.052139 = phi ptr [ %.153, %66 ], [ null, %.preheader92.preheader ]
  %.055138 = phi ptr [ %.156, %66 ], [ null, %.preheader92.preheader ]
  %.057137 = phi ptr [ %.158, %66 ], [ null, %.preheader92.preheader ]
  %.059136 = phi ptr [ %.160, %66 ], [ null, %.preheader92.preheader ]
  %.062.in135 = phi i32 [ %.163, %66 ], [ %0, %.preheader92.preheader ]
  %.065134 = phi ptr [ %67, %66 ], [ %12, %.preheader92.preheader ]
  %17 = load ptr, ptr %.065134, align 8, !tbaa !5
  %18 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.1) #7
  %.not83 = icmp eq i32 %18, 0
  br i1 %.not83, label %19, label %24

19:                                               ; preds = %.preheader92
  %20 = load ptr, ptr @usage, align 8, !tbaa !5
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %8, ptr noundef %20)
  %22 = load ptr, ptr @options, align 8, !tbaa !5
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %22)
  br label %112

24:                                               ; preds = %.preheader92
  %25 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.3) #7
  %.not84 = icmp eq i32 %25, 0
  br i1 %.not84, label %26, label %35

26:                                               ; preds = %24
  %27 = icmp eq i32 %.062.in135, 2
  br i1 %27, label %63, label %28

28:                                               ; preds = %26
  %29 = getelementptr inbounds i8, ptr %.065134, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = tail call noalias ptr @fopen(ptr noundef %30, ptr noundef nonnull @.str.4)
  %.not85 = icmp eq ptr %31, null
  br i1 %.not85, label %32, label %66

32:                                               ; preds = %28
  %33 = load ptr, ptr @stderr, align 8, !tbaa !5
  %34 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 73, ptr noundef nonnull @__FUNCTION__.sm9sign_main) #6
  br label %102

35:                                               ; preds = %24
  %36 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.7) #7
  %.not86 = icmp eq i32 %36, 0
  br i1 %.not86, label %37, label %46

37:                                               ; preds = %35
  %38 = icmp eq i32 %.062.in135, 2
  br i1 %38, label %63, label %39

39:                                               ; preds = %37
  %40 = getelementptr inbounds i8, ptr %.065134, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %42 = tail call noalias ptr @fopen(ptr noundef %41, ptr noundef nonnull @.str.4)
  %.not87 = icmp eq ptr %42, null
  br i1 %.not87, label %43, label %66

43:                                               ; preds = %39
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 80, ptr noundef nonnull @__FUNCTION__.sm9sign_main) #6
  br label %102

46:                                               ; preds = %35
  %47 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.8) #7
  %.not88 = icmp eq i32 %47, 0
  br i1 %.not88, label %48, label %53

48:                                               ; preds = %46
  %49 = icmp eq i32 %.062.in135, 2
  br i1 %49, label %63, label %50

50:                                               ; preds = %48
  %51 = getelementptr inbounds i8, ptr %.065134, i64 8
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  br label %66

53:                                               ; preds = %46
  %54 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.9) #7
  %.not89 = icmp ne i32 %54, 0
  %55 = icmp eq i32 %.062.in135, 2
  %or.cond91 = or i1 %55, %.not89
  br i1 %or.cond91, label %63, label %56

56:                                               ; preds = %53
  %57 = getelementptr inbounds i8, ptr %.065134, i64 8
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = tail call noalias ptr @fopen(ptr noundef %58, ptr noundef nonnull @.str.10)
  %.not90 = icmp eq ptr %59, null
  br i1 %.not90, label %60, label %66

60:                                               ; preds = %56
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 90, ptr noundef nonnull @__FUNCTION__.sm9sign_main) #6
  br label %102

63:                                               ; preds = %53, %48, %37, %26
  %64 = load ptr, ptr @stderr, align 8, !tbaa !5
  %65 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef nonnull @.str.11, ptr noundef %8, ptr noundef %17) #6
  br label %112

66:                                               ; preds = %28, %50, %56, %39
  %.160 = phi ptr [ %.059136, %56 ], [ %.059136, %50 ], [ %.059136, %39 ], [ %30, %28 ]
  %.158 = phi ptr [ %.057137, %56 ], [ %.057137, %50 ], [ %41, %39 ], [ %.057137, %28 ]
  %.156 = phi ptr [ %.055138, %56 ], [ %52, %50 ], [ %.055138, %39 ], [ %.055138, %28 ]
  %.153 = phi ptr [ %58, %56 ], [ %.052139, %50 ], [ %.052139, %39 ], [ %.052139, %28 ]
  %.150 = phi ptr [ %.049140, %56 ], [ %.049140, %50 ], [ %.049140, %39 ], [ %31, %28 ]
  %.148 = phi ptr [ %.047141, %56 ], [ %.047141, %50 ], [ %42, %39 ], [ %.047141, %28 ]
  %.1 = phi ptr [ %59, %56 ], [ %.046142, %50 ], [ %.046142, %39 ], [ %.046142, %28 ]
  %.163 = add nsw i32 %.062.in135, -2
  %67 = getelementptr inbounds i8, ptr %.065134, i64 16
  %68 = icmp sgt i32 %.062.in135, 3
  br i1 %68, label %.preheader92, label %69, !llvm.loop !9

69:                                               ; preds = %66
  %70 = icmp ne ptr %.158, null
  %71 = icmp ne ptr %.156, null
  %or.cond = select i1 %70, i1 %71, i1 false
  br i1 %or.cond, label %75, label %72

72:                                               ; preds = %69
  %73 = load ptr, ptr @stderr, align 8, !tbaa !5
  %74 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 104, ptr noundef nonnull @__FUNCTION__.sm9sign_main) #6
  br label %102

75:                                               ; preds = %69
  %76 = call i32 @sm9_sign_key_info_decrypt_from_pem(ptr noundef nonnull %3, ptr noundef nonnull %.156, ptr noundef %.148) #5
  %.not = icmp eq i32 %76, 1
  br i1 %.not, label %80, label %77

77:                                               ; preds = %75
  %78 = load ptr, ptr @stderr, align 8, !tbaa !5
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 109, ptr noundef nonnull @__FUNCTION__.sm9sign_main) #6
  br label %112

80:                                               ; preds = %75
  %81 = call i32 @sm9_sign_init(ptr noundef nonnull %4) #5
  %.not78 = icmp eq i32 %81, 1
  br i1 %.not78, label %.preheader, label %82

82:                                               ; preds = %80
  %83 = load ptr, ptr @stderr, align 8, !tbaa !5
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 114, ptr noundef nonnull @__FUNCTION__.sm9sign_main) #6
  br label %102

.preheader:                                       ; preds = %80, %86
  %85 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 1, i64 noundef 4096, ptr noundef %.150)
  %.not79 = icmp eq i64 %85, 0
  br i1 %.not79, label %91, label %86

86:                                               ; preds = %.preheader
  %87 = call i32 @sm9_sign_update(ptr noundef nonnull %4, ptr noundef nonnull %5, i64 noundef %85) #5
  %.not82 = icmp eq i32 %87, 1
  br i1 %.not82, label %.preheader, label %88, !llvm.loop !11

88:                                               ; preds = %86
  %89 = load ptr, ptr @stderr, align 8, !tbaa !5
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 119, ptr noundef nonnull @__FUNCTION__.sm9sign_main) #6
  br label %102

91:                                               ; preds = %.preheader
  %92 = call i32 @sm9_sign_finish(ptr noundef nonnull %4, ptr noundef nonnull %3, ptr noundef nonnull %6, ptr noundef nonnull %7) #5
  %.not80 = icmp eq i32 %92, 1
  br i1 %.not80, label %96, label %93

93:                                               ; preds = %91
  %94 = load ptr, ptr @stderr, align 8, !tbaa !5
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 124, ptr noundef nonnull @__FUNCTION__.sm9sign_main) #6
  br label %102

96:                                               ; preds = %91
  %97 = load i64, ptr %7, align 8, !tbaa !12
  %98 = call i64 @fwrite(ptr noundef nonnull %6, i64 noundef 1, i64 noundef %97, ptr noundef %.1)
  %.not81 = icmp eq i64 %97, %98
  br i1 %.not81, label %102, label %99

99:                                               ; preds = %96
  %100 = load ptr, ptr @stderr, align 8, !tbaa !5
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 129, ptr noundef nonnull @__FUNCTION__.sm9sign_main) #6
  br label %102

102:                                              ; preds = %96, %99, %93, %88, %82, %72, %60, %43, %32
  %.064 = phi i32 [ 1, %60 ], [ 1, %43 ], [ 1, %32 ], [ 1, %82 ], [ 1, %88 ], [ 1, %93 ], [ 1, %99 ], [ 1, %72 ], [ 0, %96 ]
  %.261 = phi ptr [ %.059136, %60 ], [ %.059136, %43 ], [ %30, %32 ], [ %.160, %82 ], [ %.160, %88 ], [ %.160, %93 ], [ %.160, %99 ], [ %.160, %72 ], [ %.160, %96 ]
  %.254 = phi ptr [ %58, %60 ], [ %.052139, %43 ], [ %.052139, %32 ], [ %.153, %82 ], [ %.153, %88 ], [ %.153, %93 ], [ %.153, %99 ], [ %.153, %72 ], [ %.153, %96 ]
  %.251 = phi ptr [ %.049140, %60 ], [ %.049140, %43 ], [ null, %32 ], [ %.150, %82 ], [ %.150, %88 ], [ %.150, %93 ], [ %.150, %99 ], [ %.150, %72 ], [ %.150, %96 ]
  %.2 = phi ptr [ null, %60 ], [ %.046142, %43 ], [ %.046142, %32 ], [ %.1, %82 ], [ %.1, %88 ], [ %.1, %93 ], [ %.1, %99 ], [ %.1, %72 ], [ %.1, %96 ]
  call void @gmssl_secure_clear(ptr noundef nonnull %3, i64 noundef 288) #5
  call void @gmssl_secure_clear(ptr noundef nonnull %4, i64 noundef 112) #5
  call void @gmssl_secure_clear(ptr noundef nonnull %5, i64 noundef 4096) #5
  %103 = icmp ne ptr %.261, null
  %104 = icmp ne ptr %.251, null
  %or.cond3 = select i1 %103, i1 %104, i1 false
  br i1 %or.cond3, label %105, label %107

105:                                              ; preds = %102
  %106 = call i32 @fclose(ptr noundef nonnull %.251)
  br label %107

107:                                              ; preds = %105, %102
  %108 = icmp ne ptr %.254, null
  %109 = icmp ne ptr %.2, null
  %or.cond5 = select i1 %108, i1 %109, i1 false
  br i1 %or.cond5, label %110, label %112

110:                                              ; preds = %107
  %111 = call i32 @fclose(ptr noundef nonnull %.2)
  br label %112

112:                                              ; preds = %107, %110, %77, %63, %19, %13
  %.0 = phi i32 [ 1, %13 ], [ 1, %63 ], [ 0, %19 ], [ -1, %77 ], [ %.064, %110 ], [ %.064, %107 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 288, ptr nonnull %3) #5
  ret i32 %.0
}

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

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

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

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

declare i32 @sm9_sign_key_info_decrypt_from_pem(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @sm9_sign_init(ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

declare i32 @sm9_sign_update(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

declare i32 @sm9_sign_finish(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

declare void @gmssl_secure_clear(ptr noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture 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

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 = { 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 #3 = { 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 #4 = { "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 = { nounwind }
attributes #6 = { cold nounwind }
attributes #7 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass