; LLVM IR from cryspen/libcrux :: sys/hacl/c/src (Hacl_RSAPSS)

; 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"

@.str = external hidden unnamed_addr constant [70 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @Hacl_RSAPSS_rsapss_sign(i8 noundef zeroext %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, i32 noundef %5, ptr noundef %6, i32 noundef %7, ptr noundef %8, ptr noundef %9) #0 {
  %11 = alloca i1, align 1
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i8, align 1
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca i64, align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i64, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i64, align 8
  %33 = alloca i64, align 8
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca ptr, align 8
  %37 = alloca ptr, align 8
  %38 = alloca ptr, align 8
  %39 = alloca ptr, align 8
  %40 = alloca i64, align 8
  %41 = alloca i64, align 8
  %42 = alloca i64, align 8
  %43 = alloca i32, align 4
  %44 = alloca i64, align 8
  %45 = alloca i64, align 8
  %46 = alloca i64, align 8
  %47 = alloca i32, align 4
  %48 = alloca ptr, align 8
  %49 = alloca i64, align 8
  %50 = alloca i64, align 8
  %51 = alloca i8, align 1
  %52 = alloca i8, align 1
  %53 = alloca i32, align 4
  store i8 %0, ptr %12, align 1, !tbaa !5
  store i32 %1, ptr %13, align 4, !tbaa !8
  store i32 %2, ptr %14, align 4, !tbaa !8
  store i32 %3, ptr %15, align 4, !tbaa !8
  store ptr %4, ptr %16, align 8, !tbaa !10
  store i32 %5, ptr %17, align 4, !tbaa !8
  store ptr %6, ptr %18, align 8, !tbaa !10
  store i32 %7, ptr %19, align 4, !tbaa !8
  store ptr %8, ptr %20, align 8, !tbaa !10
  store ptr %9, ptr %21, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %54 = load i8, ptr %12, align 1, !tbaa !5
  %55 = call i32 @hash_len(i8 noundef zeroext %54)
  store i32 %55, ptr %22, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #8
  %56 = load i32, ptr %17, align 4, !tbaa !8
  %57 = load i32, ptr %22, align 4, !tbaa !8
  %58 = sub i32 -1, %57
  %59 = sub i32 %58, 8
  %60 = icmp ule i32 %56, %59
  br i1 %60, label %61, label %72

61:                                               ; preds = %10
  %62 = load i32, ptr %17, align 4, !tbaa !8
  %63 = load i32, ptr %22, align 4, !tbaa !8
  %64 = add i32 %62, %63
  %65 = add i32 %64, 2
  %66 = load i32, ptr %13, align 4, !tbaa !8
  %67 = sub i32 %66, 1
  %68 = sub i32 %67, 1
  %69 = udiv i32 %68, 8
  %70 = add i32 %69, 1
  %71 = icmp ule i32 %65, %70
  br label %72

72:                                               ; preds = %61, %10
  %73 = phi i1 [ false, %10 ], [ %71, %61 ]
  %74 = zext i1 %73 to i8
  store i8 %74, ptr %23, align 1, !tbaa !12
  %75 = load i8, ptr %23, align 1, !tbaa !12, !range !14, !noundef !15
  %76 = trunc i8 %75 to i1
  br i1 %76, label %77, label %277

77:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %78 = load i32, ptr %13, align 4, !tbaa !8
  %79 = sub i32 %78, 1
  %80 = udiv i32 %79, 64
  %81 = add i32 %80, 1
  store i32 %81, ptr %24, align 4, !tbaa !8
  br label %82

82:                                               ; preds = %77
  %83 = load i32, ptr %24, align 4, !tbaa !8
  %84 = zext i32 %83 to i64
  %85 = icmp ugt i64 %84, 2305843009213693951
  br i1 %85, label %86, label %88

86:                                               ; preds = %82
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 437)
  call void @exit(i32 noundef 253) #9
  unreachable

88:                                               ; preds = %82
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %24, align 4, !tbaa !8
  %92 = zext i32 %91 to i64
  %93 = call ptr @llvm.stacksave.p0()
  store ptr %93, ptr %25, align 8
  %94 = alloca i64, i64 %92, align 16
  store i64 %92, ptr %26, align 8
  %95 = load i32, ptr %24, align 4, !tbaa !8
  %96 = zext i32 %95 to i64
  %97 = mul i64 %96, 8
  call void @llvm.memset.p0.i64(ptr align 16 %94, i8 0, i64 %97, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %98 = load i32, ptr %13, align 4, !tbaa !8
  %99 = sub i32 %98, 1
  store i32 %99, ptr %27, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  %100 = load i32, ptr %27, align 4, !tbaa !8
  %101 = sub i32 %100, 1
  %102 = udiv i32 %101, 8
  %103 = add i32 %102, 1
  store i32 %103, ptr %28, align 4, !tbaa !8
  br label %104

104:                                              ; preds = %90
  %105 = load i32, ptr %28, align 4, !tbaa !8
  %106 = zext i32 %105 to i64
  %107 = icmp ugt i64 %106, -1
  br i1 %107, label %108, label %110

108:                                              ; preds = %104
  %109 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 442)
  call void @exit(i32 noundef 253) #9
  unreachable

110:                                              ; preds = %104
  br label %111

111:                                              ; preds = %110
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %28, align 4, !tbaa !8
  %114 = zext i32 %113 to i64
  %115 = alloca i8, i64 %114, align 16
  store i64 %114, ptr %29, align 8
  %116 = load i32, ptr %28, align 4, !tbaa !8
  %117 = zext i32 %116 to i64
  %118 = mul i64 %117, 1
  call void @llvm.memset.p0.i64(ptr align 16 %115, i8 0, i64 %118, i1 false)
  %119 = load i8, ptr %12, align 1, !tbaa !5
  %120 = load i32, ptr %17, align 4, !tbaa !8
  %121 = load ptr, ptr %18, align 8, !tbaa !10
  %122 = load i32, ptr %19, align 4, !tbaa !8
  %123 = load ptr, ptr %20, align 8, !tbaa !10
  %124 = load i32, ptr %27, align 4, !tbaa !8
  call void @pss_encode(i8 noundef zeroext %119, i32 noundef %120, ptr noundef %121, i32 noundef %122, ptr noundef %123, i32 noundef %124, ptr noundef %115)
  %125 = load i32, ptr %28, align 4, !tbaa !8
  call void @Hacl_Bignum_Convert_bn_from_bytes_be_uint64(i32 noundef %125, ptr noundef %115, ptr noundef %94)
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  %126 = load i32, ptr %13, align 4, !tbaa !8
  %127 = sub i32 %126, 1
  %128 = udiv i32 %127, 64
  %129 = add i32 %128, 1
  store i32 %129, ptr %30, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  %130 = load i32, ptr %13, align 4, !tbaa !8
  %131 = sub i32 %130, 1
  %132 = udiv i32 %131, 8
  %133 = add i32 %132, 1
  store i32 %133, ptr %31, align 4, !tbaa !8
  br label %134

134:                                              ; preds = %112
  %135 = load i32, ptr %30, align 4, !tbaa !8
  %136 = zext i32 %135 to i64
  %137 = icmp ugt i64 %136, 2305843009213693951
  br i1 %137, label %138, label %140

138:                                              ; preds = %134
  %139 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 449)
  call void @exit(i32 noundef 253) #9
  unreachable

140:                                              ; preds = %134
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %30, align 4, !tbaa !8
  %144 = zext i32 %143 to i64
  %145 = alloca i64, i64 %144, align 16
  store i64 %144, ptr %32, align 8
  %146 = load i32, ptr %30, align 4, !tbaa !8
  %147 = zext i32 %146 to i64
  %148 = mul i64 %147, 8
  call void @llvm.memset.p0.i64(ptr align 16 %145, i8 0, i64 %148, i1 false)
  br label %149

149:                                              ; preds = %142
  %150 = load i32, ptr %30, align 4, !tbaa !8
  %151 = zext i32 %150 to i64
  %152 = icmp ugt i64 %151, 2305843009213693951
  br i1 %152, label %153, label %155

153:                                              ; preds = %149
  %154 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 452)
  call void @exit(i32 noundef 253) #9
  unreachable

155:                                              ; preds = %149
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %30, align 4, !tbaa !8
  %159 = zext i32 %158 to i64
  %160 = alloca i64, i64 %159, align 16
  store i64 %159, ptr %33, align 8
  %161 = load i32, ptr %30, align 4, !tbaa !8
  %162 = zext i32 %161 to i64
  %163 = mul i64 %162, 8
  call void @llvm.memset.p0.i64(ptr align 16 %160, i8 0, i64 %163, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  %164 = load i32, ptr %13, align 4, !tbaa !8
  %165 = sub i32 %164, 1
  %166 = udiv i32 %165, 64
  %167 = add i32 %166, 1
  store i32 %167, ptr %34, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  %168 = load i32, ptr %14, align 4, !tbaa !8
  %169 = sub i32 %168, 1
  %170 = udiv i32 %169, 64
  %171 = add i32 %170, 1
  store i32 %171, ptr %35, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #8
  %172 = load ptr, ptr %16, align 8, !tbaa !10
  store ptr %172, ptr %36, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  %173 = load ptr, ptr %16, align 8, !tbaa !10
  %174 = load i32, ptr %34, align 4, !tbaa !8
  %175 = zext i32 %174 to i64
  %176 = getelementptr inbounds i64, ptr %173, i64 %175
  store ptr %176, ptr %37, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #8
  %177 = load ptr, ptr %16, align 8, !tbaa !10
  %178 = load i32, ptr %34, align 4, !tbaa !8
  %179 = zext i32 %178 to i64
  %180 = getelementptr inbounds i64, ptr %177, i64 %179
  %181 = load i32, ptr %34, align 4, !tbaa !8
  %182 = zext i32 %181 to i64
  %183 = getelementptr inbounds i64, ptr %180, i64 %182
  store ptr %183, ptr %38, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  %184 = load ptr, ptr %16, align 8, !tbaa !10
  %185 = load i32, ptr %34, align 4, !tbaa !8
  %186 = zext i32 %185 to i64
  %187 = getelementptr inbounds i64, ptr %184, i64 %186
  %188 = load i32, ptr %34, align 4, !tbaa !8
  %189 = zext i32 %188 to i64
  %190 = getelementptr inbounds i64, ptr %187, i64 %189
  %191 = load i32, ptr %35, align 4, !tbaa !8
  %192 = zext i32 %191 to i64
  %193 = getelementptr inbounds i64, ptr %190, i64 %192
  store ptr %193, ptr %39, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  %194 = load ptr, ptr %36, align 8, !tbaa !10
  %195 = getelementptr inbounds i64, ptr %194, i64 0
  %196 = load i64, ptr %195, align 8, !tbaa !16
  %197 = call i64 @Hacl_Bignum_ModInvLimb_mod_inv_uint64(i64 noundef %196)
  store i64 %197, ptr %40, align 8, !tbaa !16
  %198 = load i32, ptr %13, align 4, !tbaa !8
  %199 = sub i32 %198, 1
  %200 = udiv i32 %199, 64
  %201 = add i32 %200, 1
  %202 = load ptr, ptr %36, align 8, !tbaa !10
  %203 = load i64, ptr %40, align 8, !tbaa !16
  %204 = load ptr, ptr %37, align 8, !tbaa !10
  %205 = load i32, ptr %15, align 4, !tbaa !8
  %206 = load ptr, ptr %39, align 8, !tbaa !10
  call void @Hacl_Bignum_Exponentiation_bn_mod_exp_consttime_precomp_u64(i32 noundef %201, ptr noundef %202, i64 noundef %203, ptr noundef %204, ptr noundef %94, i32 noundef %205, ptr noundef %206, ptr noundef %145)
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  %207 = load ptr, ptr %36, align 8, !tbaa !10
  %208 = getelementptr inbounds i64, ptr %207, i64 0
  %209 = load i64, ptr %208, align 8, !tbaa !16
  %210 = call i64 @Hacl_Bignum_ModInvLimb_mod_inv_uint64(i64 noundef %209)
  store i64 %210, ptr %41, align 8, !tbaa !16
  %211 = load i32, ptr %13, align 4, !tbaa !8
  %212 = sub i32 %211, 1
  %213 = udiv i32 %212, 64
  %214 = add i32 %213, 1
  %215 = load ptr, ptr %36, align 8, !tbaa !10
  %216 = load i64, ptr %41, align 8, !tbaa !16
  %217 = load ptr, ptr %37, align 8, !tbaa !10
  %218 = load i32, ptr %14, align 4, !tbaa !8
  %219 = load ptr, ptr %38, align 8, !tbaa !10
  call void @Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_precomp_u64(i32 noundef %214, ptr noundef %215, i64 noundef %216, ptr noundef %217, ptr noundef %145, i32 noundef %218, ptr noundef %219, ptr noundef %160)
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #8
  store i64 -1, ptr %42, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #8
  store i32 0, ptr %43, align 4, !tbaa !8
  br label %220

220:                                              ; preds = %238, %157
  %221 = load i32, ptr %43, align 4, !tbaa !8
  %222 = load i32, ptr %34, align 4, !tbaa !8
  %223 = icmp ult i32 %221, %222
  br i1 %223, label %225, label %224

224:                                              ; preds = %220
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #8
  br label %241

225:                                              ; preds = %220
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #8
  %226 = load i32, ptr %43, align 4, !tbaa !8
  %227 = zext i32 %226 to i64
  %228 = getelementptr inbounds i64, ptr %94, i64 %227
  %229 = load i64, ptr %228, align 8, !tbaa !16
  %230 = load i32, ptr %43, align 4, !tbaa !8
  %231 = zext i32 %230 to i64
  %232 = getelementptr inbounds i64, ptr %160, i64 %231
  %233 = load i64, ptr %232, align 8, !tbaa !16
  %234 = call i64 @FStar_UInt64_eq_mask(i64 noundef %229, i64 noundef %233)
  store i64 %234, ptr %44, align 8, !tbaa !16
  %235 = load i64, ptr %44, align 8, !tbaa !16
  %236 = load i64, ptr %42, align 8, !tbaa !16
  %237 = and i64 %235, %236
  store i64 %237, ptr %42, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #8
  br label %238

238:                                              ; preds = %225
  %239 = load i32, ptr %43, align 4, !tbaa !8
  %240 = add i32 %239, 1
  store i32 %240, ptr %43, align 4, !tbaa !8
  br label %220, !llvm.loop !18

241:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #8
  %242 = load i64, ptr %42, align 8, !tbaa !16
  store i64 %242, ptr %45, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #8
  %243 = load i64, ptr %45, align 8, !tbaa !16
  store i64 %243, ptr %46, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #8
  store i32 0, ptr %47, align 4, !tbaa !8
  br label %244

244:                                              ; preds = %262, %241
  %245 = load i32, ptr %47, align 4, !tbaa !8
  %246 = load i32, ptr %34, align 4, !tbaa !8
  %247 = icmp ult i32 %245, %246
  br i1 %247, label %249, label %248

248:                                              ; preds = %244
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #8
  br label %265

249:                                              ; preds = %244
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #8
  store ptr %145, ptr %48, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #8
  %250 = load i32, ptr %47, align 4, !tbaa !8
  %251 = zext i32 %250 to i64
  %252 = getelementptr inbounds i64, ptr %145, i64 %251
  %253 = load i64, ptr %252, align 8, !tbaa !16
  store i64 %253, ptr %49, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #8
  %254 = load i64, ptr %46, align 8, !tbaa !16
  %255 = load i64, ptr %49, align 8, !tbaa !16
  %256 = and i64 %254, %255
  store i64 %256, ptr %50, align 8, !tbaa !16
  %257 = load i64, ptr %50, align 8, !tbaa !16
  %258 = load ptr, ptr %48, align 8, !tbaa !10
  %259 = load i32, ptr %47, align 4, !tbaa !8
  %260 = zext i32 %259 to i64
  %261 = getelementptr inbounds i64, ptr %258, i64 %260
  store i64 %257, ptr %261, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #8
  br label %262

262:                                              ; preds = %249
  %263 = load i32, ptr %47, align 4, !tbaa !8
  %264 = add i32 %263, 1
  store i32 %264, ptr %47, align 4, !tbaa !8
  br label %244, !llvm.loop !20

265:                                              ; preds = %248
  call void @llvm.lifetime.start.p0(i64 1, ptr %51) #8
  %266 = load i64, ptr %46, align 8, !tbaa !16
  %267 = icmp eq i64 %266, -1
  %268 = zext i1 %267 to i8
  store i8 %268, ptr %51, align 1, !tbaa !12
  %269 = load i32, ptr %31, align 4, !tbaa !8
  %270 = load ptr, ptr %21, align 8, !tbaa !10
  call void @Hacl_Bignum_Convert_bn_to_bytes_be_uint64(i32 noundef %269, ptr noundef %145, ptr noundef %270)
  call void @llvm.lifetime.start.p0(i64 1, ptr %52) #8
  %271 = load i8, ptr %51, align 1, !tbaa !12, !range !14, !noundef !15
  %272 = trunc i8 %271 to i1
  %273 = zext i1 %272 to i8
  store i8 %273, ptr %52, align 1, !tbaa !12
  %274 = load i8, ptr %52, align 1, !tbaa !12, !range !14, !noundef !15
  %275 = trunc i8 %274 to i1
  store i1 %275, ptr %11, align 1
  store i32 1, ptr %53, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %52) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %51) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  %276 = load ptr, ptr %25, align 8
  call void @llvm.stackrestore.p0(ptr %276)
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %278

277:                                              ; preds = %72
  store i1 false, ptr %11, align 1
  store i32 1, ptr %53, align 4
  br label %278

278:                                              ; preds = %277, %265
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  %279 = load i1, ptr %11, align 1
  ret i1 %279
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @hash_len(i8 noundef zeroext) #2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @pss_encode(i8 noundef zeroext, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Bignum_Convert_bn_from_bytes_be_uint64(i32 noundef, ptr noundef, ptr noundef) #2

declare i64 @Hacl_Bignum_ModInvLimb_mod_inv_uint64(i64 noundef) #3

declare void @Hacl_Bignum_Exponentiation_bn_mod_exp_consttime_precomp_u64(i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

declare void @Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_precomp_u64(i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: noinline nounwind uwtable
declare hidden i64 @FStar_UInt64_eq_mask(i64 noundef, i64 noundef) #7

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Bignum_Convert_bn_to_bytes_be_uint64(i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { nocallback nofree nosync nounwind willreturn }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { noinline 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 #8 = { nounwind }
attributes #9 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"_Bool", !6, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !6, 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"

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @Hacl_RSAPSS_rsapss_sign(i8 noundef zeroext %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, i32 noundef %5, ptr noundef %6, i32 noundef %7, ptr noundef %8, ptr noundef %9) local_unnamed_addr #0 {
  %11 = tail call i32 @hash_len(i8 noundef zeroext %0)
  %12 = sub i32 -9, %11
  %.not = icmp ult i32 %12, %5
  br i1 %.not, label %.critedge, label %13

13:                                               ; preds = %10
  %14 = add i32 %5, 2
  %15 = add i32 %14, %11
  %16 = add i32 %1, -2
  %17 = lshr i32 %16, 3
  %18 = add nuw nsw i32 %17, 1
  %.not88 = icmp ugt i32 %15, %18
  br i1 %.not88, label %.critedge, label %19

19:                                               ; preds = %13
  %20 = add i32 %1, -1
  %21 = lshr i32 %20, 6
  %22 = add nuw nsw i32 %21, 1
  %23 = zext nneg i32 %22 to i64
  %24 = tail call ptr @llvm.stacksave.p0()
  %25 = alloca i64, i64 %23, align 16
  %26 = shl nuw nsw i64 %23, 3
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %25, i8 0, i64 %26, i1 false)
  %27 = zext nneg i32 %18 to i64
  %28 = alloca i8, i64 %27, align 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %28, i8 0, i64 %27, i1 false)
  call void @pss_encode(i8 noundef zeroext %0, i32 noundef %5, ptr noundef %6, i32 noundef %7, ptr noundef %8, i32 noundef %20, ptr noundef nonnull %28)
  call void @Hacl_Bignum_Convert_bn_from_bytes_be_uint64(i32 noundef %18, ptr noundef nonnull %28, ptr noundef nonnull %25)
  %29 = lshr i32 %20, 3
  %30 = alloca i64, i64 %23, align 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %30, i8 0, i64 %26, i1 false)
  %31 = alloca i64, i64 %23, align 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %31, i8 0, i64 %26, i1 false)
  %32 = add i32 %2, -1
  %33 = lshr i32 %32, 6
  %34 = getelementptr inbounds i64, ptr %4, i64 %23
  %35 = getelementptr inbounds i64, ptr %34, i64 %23
  %36 = zext nneg i32 %33 to i64
  %37 = getelementptr inbounds i64, ptr %35, i64 %36
  %38 = getelementptr inbounds i8, ptr %37, i64 8
  %39 = load i64, ptr %4, align 8, !tbaa !5
  %40 = call i64 @Hacl_Bignum_ModInvLimb_mod_inv_uint64(i64 noundef %39) #6
  call void @Hacl_Bignum_Exponentiation_bn_mod_exp_consttime_precomp_u64(i32 noundef %22, ptr noundef nonnull %4, i64 noundef %40, ptr noundef nonnull %34, ptr noundef nonnull %25, i32 noundef %3, ptr noundef nonnull %38, ptr noundef nonnull %30) #6
  %41 = load i64, ptr %4, align 8, !tbaa !5
  %42 = call i64 @Hacl_Bignum_ModInvLimb_mod_inv_uint64(i64 noundef %41) #6
  call void @Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_precomp_u64(i32 noundef %22, ptr noundef nonnull %4, i64 noundef %42, ptr noundef nonnull %34, ptr noundef nonnull %30, i32 noundef %2, ptr noundef nonnull %35, ptr noundef nonnull %31) #6
  br label %48

.preheader:                                       ; preds = %48
  %min.iters.check = icmp ult i32 %20, 192
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader
  %indvars.iv93.ph = phi i64 [ 0, %.preheader ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.preheader
  %n.vec = and i64 %23, 134217724
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %54, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %43 = getelementptr inbounds i64, ptr %30, i64 %index
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  %wide.load = load <2 x i64>, ptr %43, align 16, !tbaa !5
  %wide.load98 = load <2 x i64>, ptr %44, align 16, !tbaa !5
  %45 = and <2 x i64> %wide.load, %broadcast.splat
  %46 = and <2 x i64> %wide.load98, %broadcast.splat
  store <2 x i64> %45, ptr %43, align 16, !tbaa !5
  store <2 x i64> %46, ptr %44, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %47 = icmp eq i64 %index.next, %n.vec
  br i1 %47, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %23
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

48:                                               ; preds = %19, %48
  %indvars.iv = phi i64 [ 0, %19 ], [ %indvars.iv.next, %48 ]
  %.08190 = phi i64 [ -1, %19 ], [ %54, %48 ]
  %49 = getelementptr inbounds i64, ptr %25, i64 %indvars.iv
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = getelementptr inbounds i64, ptr %31, i64 %indvars.iv
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = call i64 @FStar_UInt64_eq_mask(i64 noundef %50, i64 noundef %52)
  %54 = and i64 %53, %.08190
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %23
  br i1 %exitcond.not, label %.preheader, label %48, !llvm.loop !13

.loopexit:                                        ; preds = %scalar.ph, %middle.block
  %55 = add nuw nsw i32 %29, 1
  %56 = icmp eq i64 %54, -1
  call void @Hacl_Bignum_Convert_bn_to_bytes_be_uint64(i32 noundef %55, ptr noundef nonnull %30, ptr noundef %9)
  call void @llvm.stackrestore.p0(ptr %24)
  br label %.critedge

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %scalar.ph ], [ %indvars.iv93.ph, %scalar.ph.preheader ]
  %57 = getelementptr inbounds i64, ptr %30, i64 %indvars.iv93
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = and i64 %58, %54
  store i64 %59, ptr %57, align 8, !tbaa !5
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next94, %23
  br i1 %exitcond97.not, label %.loopexit, label %scalar.ph, !llvm.loop !14

.critedge:                                        ; preds = %13, %10, %.loopexit
  %.0 = phi i1 [ %56, %.loopexit ], [ false, %10 ], [ false, %13 ]
  ret i1 %.0
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @hash_len(i8 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @pss_encode(i8 noundef zeroext, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Bignum_Convert_bn_from_bytes_be_uint64(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i64 @Hacl_Bignum_ModInvLimb_mod_inv_uint64(i64 noundef) local_unnamed_addr #4

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

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

; Function Attrs: noinline nounwind uwtable
declare hidden i64 @FStar_UInt64_eq_mask(i64 noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Bignum_Convert_bn_to_bytes_be_uint64(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { noinline 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass