; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

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

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #4

declare void @Hacl_Bignum_Montgomery_bn_precomp_r2_mod_n_u64(i32 noundef, i32 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @check_modulus_u64(i32 noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @check_exponent_u64(i32 noundef, ptr noundef) #3

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

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

49:                                               ; preds = %6
  %50 = load i32, ptr %9, align 4, !tbaa !5
  %51 = icmp ult i32 0, %50
  br i1 %51, label %52, label %76

52:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = sub i32 %53, 1
  %55 = udiv i32 %54, 64
  %56 = add i32 %55, 1
  store i32 %56, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = sub i32 %57, 1
  %59 = udiv i32 %58, 64
  %60 = add i32 %59, 1
  store i32 %60, ptr %16, align 4, !tbaa !5
  %61 = load i32, ptr %15, align 4, !tbaa !5
  %62 = icmp ule i32 %61, 33554431
  br i1 %62, label %63, label %73

63:                                               ; preds = %52
  %64 = load i32, ptr %16, align 4, !tbaa !5
  %65 = icmp ule i32 %64, 67108863
  br i1 %65, label %66, label %73

66:                                               ; preds = %63
  %67 = load i32, ptr %15, align 4, !tbaa !5
  %68 = load i32, ptr %15, align 4, !tbaa !5
  %69 = add i32 %67, %68
  %70 = load i32, ptr %16, align 4, !tbaa !5
  %71 = sub i32 -1, %70
  %72 = icmp ule i32 %69, %71
  br label %73

73:                                               ; preds = %66, %63, %52
  %74 = phi i1 [ false, %63 ], [ false, %52 ], [ %72, %66 ]
  %75 = zext i1 %74 to i8
  store i8 %75, ptr %14, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %77

76:                                               ; preds = %49, %6
  store i8 0, ptr %14, align 1, !tbaa !11
  br label %77

77:                                               ; preds = %76, %73
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #7
  %78 = load i8, ptr %14, align 1, !tbaa !11, !range !13, !noundef !14
  %79 = trunc i8 %78 to i1
  br i1 %79, label %80, label %109

80:                                               ; preds = %77
  %81 = load i32, ptr %10, align 4, !tbaa !5
  %82 = icmp ult i32 0, %81
  br i1 %82, label %83, label %109

83:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %84 = load i32, ptr %8, align 4, !tbaa !5
  %85 = sub i32 %84, 1
  %86 = udiv i32 %85, 64
  %87 = add i32 %86, 1
  store i32 %87, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %88 = load i32, ptr %9, align 4, !tbaa !5
  %89 = sub i32 %88, 1
  %90 = udiv i32 %89, 64
  %91 = add i32 %90, 1
  store i32 %91, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %92 = load i32, ptr %10, align 4, !tbaa !5
  %93 = sub i32 %92, 1
  %94 = udiv i32 %93, 64
  %95 = add i32 %94, 1
  store i32 %95, ptr %20, align 4, !tbaa !5
  %96 = load i32, ptr %20, align 4, !tbaa !5
  %97 = icmp ule i32 %96, 67108863
  br i1 %97, label %98, label %106

98:                                               ; preds = %83
  %99 = load i32, ptr %18, align 4, !tbaa !5
  %100 = mul i32 2, %99
  %101 = load i32, ptr %19, align 4, !tbaa !5
  %102 = sub i32 -1, %101
  %103 = load i32, ptr %20, align 4, !tbaa !5
  %104 = sub i32 %102, %103
  %105 = icmp ule i32 %100, %104
  br label %106

106:                                              ; preds = %98, %83
  %107 = phi i1 [ false, %83 ], [ %105, %98 ]
  %108 = zext i1 %107 to i8
  store i8 %108, ptr %17, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %110

109:                                              ; preds = %80, %77
  store i8 0, ptr %17, align 1, !tbaa !11
  br label %110

110:                                              ; preds = %109, %106
  %111 = load i8, ptr %17, align 1, !tbaa !11, !range !13, !noundef !14
  %112 = trunc i8 %111 to i1
  br i1 %112, label %114, label %113

113:                                              ; preds = %110
  store ptr null, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %247

114:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %115 = load i32, ptr %8, align 4, !tbaa !5
  %116 = sub i32 %115, 1
  %117 = udiv i32 %116, 64
  %118 = add i32 %117, 1
  store i32 %118, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %119 = load i32, ptr %9, align 4, !tbaa !5
  %120 = sub i32 %119, 1
  %121 = udiv i32 %120, 64
  %122 = add i32 %121, 1
  store i32 %122, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %123 = load i32, ptr %10, align 4, !tbaa !5
  %124 = sub i32 %123, 1
  %125 = udiv i32 %124, 64
  %126 = add i32 %125, 1
  store i32 %126, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %127 = load i32, ptr %22, align 4, !tbaa !5
  %128 = load i32, ptr %22, align 4, !tbaa !5
  %129 = add i32 %127, %128
  %130 = load i32, ptr %23, align 4, !tbaa !5
  %131 = add i32 %129, %130
  %132 = load i32, ptr %24, align 4, !tbaa !5
  %133 = add i32 %131, %132
  store i32 %133, ptr %25, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %114
  %135 = load i32, ptr %25, align 4, !tbaa !5
  %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 729)
  call void @exit(i32 noundef 253) #8
  unreachable

140:                                              ; preds = %134
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %143 = load i32, ptr %25, align 4, !tbaa !5
  %144 = zext i32 %143 to i64
  %145 = call noalias ptr @calloc(i64 noundef %144, i64 noundef 8) #9
  store ptr %145, ptr %26, align 8, !tbaa !9
  %146 = load ptr, ptr %26, align 8, !tbaa !9
  %147 = icmp eq ptr %146, null
  br i1 %147, label %148, label %150

148:                                              ; preds = %142
  %149 = load ptr, ptr %26, align 8, !tbaa !9
  store ptr %149, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %246

150:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %151 = load ptr, ptr %26, align 8, !tbaa !9
  store ptr %151, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %152 = load ptr, ptr %27, align 8, !tbaa !9
  store ptr %152, ptr %28, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %153 = load i32, ptr %10, align 4, !tbaa !5
  %154 = sub i32 %153, 1
  %155 = udiv i32 %154, 8
  %156 = add i32 %155, 1
  store i32 %156, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  %157 = load i32, ptr %8, align 4, !tbaa !5
  %158 = sub i32 %157, 1
  %159 = udiv i32 %158, 64
  %160 = add i32 %159, 1
  store i32 %160, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  %161 = load i32, ptr %9, align 4, !tbaa !5
  %162 = sub i32 %161, 1
  %163 = udiv i32 %162, 64
  %164 = add i32 %163, 1
  store i32 %164, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  %165 = load i32, ptr %30, align 4, !tbaa !5
  %166 = load i32, ptr %30, align 4, !tbaa !5
  %167 = add i32 %165, %166
  %168 = load i32, ptr %31, align 4, !tbaa !5
  %169 = add i32 %167, %168
  store i32 %169, ptr %32, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  %170 = load ptr, ptr %28, align 8, !tbaa !9
  store ptr %170, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #7
  %171 = load ptr, ptr %28, align 8, !tbaa !9
  %172 = load i32, ptr %32, align 4, !tbaa !5
  %173 = zext i32 %172 to i64
  %174 = getelementptr inbounds i64, ptr %171, i64 %173
  store ptr %174, ptr %34, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #7
  %175 = load i32, ptr %8, align 4, !tbaa !5
  %176 = sub i32 %175, 1
  %177 = udiv i32 %176, 8
  %178 = add i32 %177, 1
  store i32 %178, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  %179 = load i32, ptr %9, align 4, !tbaa !5
  %180 = sub i32 %179, 1
  %181 = udiv i32 %180, 8
  %182 = add i32 %181, 1
  store i32 %182, ptr %36, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  %183 = load i32, ptr %8, align 4, !tbaa !5
  %184 = sub i32 %183, 1
  %185 = udiv i32 %184, 64
  %186 = add i32 %185, 1
  store i32 %186, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #7
  %187 = load ptr, ptr %33, align 8, !tbaa !9
  store ptr %187, ptr %38, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #7
  %188 = load ptr, ptr %33, align 8, !tbaa !9
  %189 = load i32, ptr %37, align 4, !tbaa !5
  %190 = zext i32 %189 to i64
  %191 = getelementptr inbounds i64, ptr %188, i64 %190
  store ptr %191, ptr %39, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #7
  %192 = load ptr, ptr %33, align 8, !tbaa !9
  %193 = load i32, ptr %37, align 4, !tbaa !5
  %194 = zext i32 %193 to i64
  %195 = getelementptr inbounds i64, ptr %192, i64 %194
  %196 = load i32, ptr %37, align 4, !tbaa !5
  %197 = zext i32 %196 to i64
  %198 = getelementptr inbounds i64, ptr %195, i64 %197
  store ptr %198, ptr %40, align 8, !tbaa !9
  %199 = load i32, ptr %35, align 4, !tbaa !5
  %200 = load ptr, ptr %11, align 8, !tbaa !9
  %201 = load ptr, ptr %38, align 8, !tbaa !9
  call void @Hacl_Bignum_Convert_bn_from_bytes_be_uint64(i32 noundef %199, ptr noundef %200, ptr noundef %201)
  %202 = load i32, ptr %8, align 4, !tbaa !5
  %203 = sub i32 %202, 1
  %204 = udiv i32 %203, 64
  %205 = add i32 %204, 1
  %206 = load i32, ptr %8, align 4, !tbaa !5
  %207 = sub i32 %206, 1
  %208 = load ptr, ptr %38, align 8, !tbaa !9
  %209 = load ptr, ptr %39, align 8, !tbaa !9
  call void @Hacl_Bignum_Montgomery_bn_precomp_r2_mod_n_u64(i32 noundef %205, i32 noundef %207, ptr noundef %208, ptr noundef %209)
  %210 = load i32, ptr %36, align 4, !tbaa !5
  %211 = load ptr, ptr %12, align 8, !tbaa !9
  %212 = load ptr, ptr %40, align 8, !tbaa !9
  call void @Hacl_Bignum_Convert_bn_from_bytes_be_uint64(i32 noundef %210, ptr noundef %211, ptr noundef %212)
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #7
  %213 = load i32, ptr %8, align 4, !tbaa !5
  %214 = load ptr, ptr %38, align 8, !tbaa !9
  %215 = call i64 @check_modulus_u64(i32 noundef %213, ptr noundef %214)
  store i64 %215, ptr %41, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #7
  %216 = load i32, ptr %9, align 4, !tbaa !5
  %217 = load ptr, ptr %40, align 8, !tbaa !9
  %218 = call i64 @check_exponent_u64(i32 noundef %216, ptr noundef %217)
  store i64 %218, ptr %42, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #7
  %219 = load i64, ptr %41, align 8, !tbaa !15
  %220 = load i64, ptr %42, align 8, !tbaa !15
  %221 = and i64 %219, %220
  store i64 %221, ptr %43, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %44) #7
  %222 = load i64, ptr %43, align 8, !tbaa !15
  %223 = icmp eq i64 %222, -1
  %224 = zext i1 %223 to i8
  store i8 %224, ptr %44, align 1, !tbaa !11
  %225 = load i32, ptr %29, align 4, !tbaa !5
  %226 = load ptr, ptr %13, align 8, !tbaa !9
  %227 = load ptr, ptr %34, align 8, !tbaa !9
  call void @Hacl_Bignum_Convert_bn_from_bytes_be_uint64(i32 noundef %225, ptr noundef %226, ptr noundef %227)
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #7
  %228 = load i32, ptr %10, align 4, !tbaa !5
  %229 = load ptr, ptr %34, align 8, !tbaa !9
  %230 = call i64 @check_exponent_u64(i32 noundef %228, ptr noundef %229)
  store i64 %230, ptr %45, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %46) #7
  %231 = load i8, ptr %44, align 1, !tbaa !11, !range !13, !noundef !14
  %232 = trunc i8 %231 to i1
  br i1 %232, label %233, label %236

233:                                              ; preds = %150
  %234 = load i64, ptr %45, align 8, !tbaa !15
  %235 = icmp eq i64 %234, -1
  br label %236

236:                                              ; preds = %233, %150
  %237 = phi i1 [ false, %150 ], [ %235, %233 ]
  %238 = zext i1 %237 to i8
  store i8 %238, ptr %46, align 1, !tbaa !11
  %239 = load i8, ptr %46, align 1, !tbaa !11, !range !13, !noundef !14
  %240 = trunc i8 %239 to i1
  br i1 %240, label %241, label %243

241:                                              ; preds = %236
  %242 = load ptr, ptr %28, align 8, !tbaa !9
  store ptr %242, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %245

243:                                              ; preds = %236
  %244 = load ptr, ptr %28, align 8, !tbaa !9
  call void @free(ptr noundef %244) #7
  store ptr null, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %245

245:                                              ; preds = %243, %241
  call void @llvm.lifetime.end.p0(i64 1, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %44) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %246

246:                                              ; preds = %245, %148
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %247

247:                                              ; preds = %246, %113
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  %248 = load ptr, ptr %7, align 8
  ret ptr %248
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}


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

; 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 #0

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @Hacl_RSAPSS_new_rsapss_load_skey(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #4 {
  %7 = icmp ugt i32 %0, 1
  %8 = icmp ne i32 %1, 0
  %or.cond = and i1 %7, %8
  br i1 %or.cond, label %9, label %.critedge

9:                                                ; preds = %6
  %10 = icmp ult i32 %0, 2147483585
  %11 = icmp ult i32 %1, -63
  %or.cond3 = and i1 %10, %11
  %12 = add i32 %2, -1
  %13 = icmp ult i32 %12, -64
  %or.cond92 = and i1 %or.cond3, %13
  br i1 %or.cond92, label %14, label %.critedge

14:                                               ; preds = %9
  %15 = add nsw i32 %0, -1
  %16 = lshr i32 %15, 6
  %17 = add nuw nsw i32 %16, 1
  %18 = add i32 %1, -1
  %19 = lshr i32 %18, 6
  %20 = add nuw nsw i32 %19, 1
  %21 = shl nuw nsw i32 %17, 1
  %22 = add nuw nsw i32 %20, %21
  %23 = lshr i32 %12, 6
  %24 = add nuw nsw i32 %23, 1
  %25 = add nuw nsw i32 %24, %22
  %26 = zext nneg i32 %25 to i64
  %27 = tail call noalias ptr @calloc(i64 noundef %26, i64 noundef 8) #5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %.critedge, label %29

29:                                               ; preds = %14
  %30 = lshr i32 %12, 3
  %31 = add nuw nsw i32 %30, 1
  %32 = zext nneg i32 %22 to i64
  %33 = getelementptr inbounds i64, ptr %27, i64 %32
  %34 = lshr i32 %15, 3
  %35 = add nuw nsw i32 %34, 1
  %36 = lshr i32 %18, 3
  %37 = add nuw nsw i32 %36, 1
  %38 = zext nneg i32 %17 to i64
  %39 = getelementptr inbounds i64, ptr %27, i64 %38
  %40 = getelementptr inbounds i64, ptr %39, i64 %38
  tail call void @Hacl_Bignum_Convert_bn_from_bytes_be_uint64(i32 noundef %35, ptr noundef %3, ptr noundef nonnull %27)
  tail call void @Hacl_Bignum_Montgomery_bn_precomp_r2_mod_n_u64(i32 noundef %17, i32 noundef %15, ptr noundef nonnull %27, ptr noundef nonnull %39) #6
  tail call void @Hacl_Bignum_Convert_bn_from_bytes_be_uint64(i32 noundef %37, ptr noundef %4, ptr noundef nonnull %40)
  %41 = tail call i64 @check_modulus_u64(i32 noundef %0, ptr noundef nonnull %27)
  %42 = tail call i64 @check_exponent_u64(i32 noundef %1, ptr noundef nonnull %40)
  %43 = and i64 %42, %41
  %44 = icmp eq i64 %43, -1
  tail call void @Hacl_Bignum_Convert_bn_from_bytes_be_uint64(i32 noundef %31, ptr noundef %5, ptr noundef nonnull %33)
  %45 = tail call i64 @check_exponent_u64(i32 noundef %2, ptr noundef nonnull %33)
  %46 = icmp eq i64 %45, -1
  %47 = select i1 %44, i1 %46, i1 false
  br i1 %47, label %.critedge, label %48

48:                                               ; preds = %29
  tail call void @free(ptr noundef nonnull %27) #6
  br label %.critedge

.critedge:                                        ; preds = %6, %9, %14, %29, %48
  %.2 = phi ptr [ null, %14 ], [ null, %48 ], [ %27, %29 ], [ null, %9 ], [ null, %6 ]
  ret ptr %.2
}

attributes #0 = { 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 #1 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) 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 #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 = { 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 #4 = { 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 #5 = { nounwind allocsize(0,1) }
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)"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass