; LLVM IR from ARMmbed/mbed-crypto :: library (rsa)

; 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.mbedtls_md_context_t = type { ptr, ptr, ptr }
%struct.mbedtls_rsa_context = type { i32, i64, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, i32, i32 }
%struct.mbedtls_mpi = type { i32, i64, ptr }

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

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

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

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

declare ptr @mbedtls_md_info_from_type(i32 noundef) #2

declare zeroext i8 @mbedtls_md_get_size(ptr noundef) #2

declare i32 @mbedtls_md(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare void @mbedtls_md_init(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @mgf_mask(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) #1

declare void @mbedtls_md_free(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @mbedtls_rsa_rsaes_oaep_decrypt(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, i64 noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, i64 noundef %9) #1 {
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca ptr, align 8
  %27 = alloca i8, align 1
  %28 = alloca i8, align 1
  %29 = alloca [1024 x i8], align 16
  %30 = alloca [64 x i8], align 16
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca %struct.mbedtls_md_context_t, align 8
  %34 = alloca i32, align 4
  store ptr %0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %13, align 8, !tbaa !5
  store ptr %2, ptr %14, align 8, !tbaa !5
  store i32 %3, ptr %15, align 4, !tbaa !9
  store ptr %4, ptr %16, align 8, !tbaa !5
  store i64 %5, ptr %17, align 8, !tbaa !11
  store ptr %6, ptr %18, align 8, !tbaa !5
  store ptr %7, ptr %19, align 8, !tbaa !5
  store ptr %8, ptr %20, align 8, !tbaa !5
  store i64 %9, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  store i32 -110, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 1024, ptr %29) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %30) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %33) #4
  br label %35

35:                                               ; preds = %10
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %15, align 4, !tbaa !9
  %54 = icmp eq i32 %53, 1
  br i1 %54, label %55, label %61

55:                                               ; preds = %52
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.mbedtls_rsa_context, ptr %56, i32 0, i32 15
  %58 = load i32, ptr %57, align 8, !tbaa !13
  %59 = icmp ne i32 %58, 1
  br i1 %59, label %60, label %61

60:                                               ; preds = %55
  store i32 -16512, ptr %11, align 4
  store i32 1, ptr %34, align 4
  br label %280

61:                                               ; preds = %55, %52
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.mbedtls_rsa_context, ptr %62, i32 0, i32 1
  %64 = load i64, ptr %63, align 8, !tbaa !16
  store i64 %64, ptr %23, align 8, !tbaa !11
  %65 = load i64, ptr %23, align 8, !tbaa !11
  %66 = icmp ult i64 %65, 16
  br i1 %66, label %70, label %67

67:                                               ; preds = %61
  %68 = load i64, ptr %23, align 8, !tbaa !11
  %69 = icmp ugt i64 %68, 1024
  br i1 %69, label %70, label %71

70:                                               ; preds = %67, %61
  store i32 -16512, ptr %11, align 4
  store i32 1, ptr %34, align 4
  br label %280

71:                                               ; preds = %67
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.mbedtls_rsa_context, ptr %72, i32 0, i32 16
  %74 = load i32, ptr %73, align 4, !tbaa !17
  %75 = call ptr @mbedtls_md_info_from_type(i32 noundef %74)
  store ptr %75, ptr %32, align 8, !tbaa !5
  %76 = load ptr, ptr %32, align 8, !tbaa !5
  %77 = icmp eq ptr %76, null
  br i1 %77, label %78, label %79

78:                                               ; preds = %71
  store i32 -16512, ptr %11, align 4
  store i32 1, ptr %34, align 4
  br label %280

79:                                               ; preds = %71
  %80 = load ptr, ptr %32, align 8, !tbaa !5
  %81 = call zeroext i8 @mbedtls_md_get_size(ptr noundef %80)
  %82 = zext i8 %81 to i32
  store i32 %82, ptr %31, align 4, !tbaa !9
  %83 = load i32, ptr %31, align 4, !tbaa !9
  %84 = mul i32 2, %83
  %85 = add i32 %84, 2
  %86 = zext i32 %85 to i64
  %87 = load i64, ptr %23, align 8, !tbaa !11
  %88 = icmp ugt i64 %86, %87
  br i1 %88, label %89, label %90

89:                                               ; preds = %79
  store i32 -16512, ptr %11, align 4
  store i32 1, ptr %34, align 4
  br label %280

90:                                               ; preds = %79
  %91 = load i32, ptr %15, align 4, !tbaa !9
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %98

93:                                               ; preds = %90
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  %95 = load ptr, ptr %19, align 8, !tbaa !5
  %96 = getelementptr inbounds [1024 x i8], ptr %29, i64 0, i64 0
  %97 = call i32 @mbedtls_rsa_public(ptr noundef %94, ptr noundef %95, ptr noundef %96)
  br label %105

98:                                               ; preds = %90
  %99 = load ptr, ptr %12, align 8, !tbaa !5
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = load ptr, ptr %14, align 8, !tbaa !5
  %102 = load ptr, ptr %19, align 8, !tbaa !5
  %103 = getelementptr inbounds [1024 x i8], ptr %29, i64 0, i64 0
  %104 = call i32 @mbedtls_rsa_private(ptr noundef %99, ptr noundef %100, ptr noundef %101, ptr noundef %102, ptr noundef %103)
  br label %105

105:                                              ; preds = %98, %93
  %106 = phi i32 [ %97, %93 ], [ %104, %98 ]
  store i32 %106, ptr %22, align 4, !tbaa !9
  %107 = load i32, ptr %22, align 4, !tbaa !9
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %110

109:                                              ; preds = %105
  br label %276

110:                                              ; preds = %105
  call void @mbedtls_md_init(ptr noundef %33)
  %111 = load ptr, ptr %32, align 8, !tbaa !5
  %112 = call i32 @mbedtls_md_setup(ptr noundef %33, ptr noundef %111, i32 noundef 0)
  store i32 %112, ptr %22, align 4, !tbaa !9
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %115

114:                                              ; preds = %110
  call void @mbedtls_md_free(ptr noundef %33)
  br label %276

115:                                              ; preds = %110
  %116 = getelementptr inbounds [1024 x i8], ptr %29, i64 0, i64 0
  %117 = getelementptr inbounds i8, ptr %116, i64 1
  %118 = load i32, ptr %31, align 4, !tbaa !9
  %119 = zext i32 %118 to i64
  %120 = getelementptr inbounds [1024 x i8], ptr %29, i64 0, i64 0
  %121 = load i32, ptr %31, align 4, !tbaa !9
  %122 = zext i32 %121 to i64
  %123 = getelementptr inbounds i8, ptr %120, i64 %122
  %124 = getelementptr inbounds i8, ptr %123, i64 1
  %125 = load i64, ptr %23, align 8, !tbaa !11
  %126 = load i32, ptr %31, align 4, !tbaa !9
  %127 = zext i32 %126 to i64
  %128 = sub i64 %125, %127
  %129 = sub i64 %128, 1
  %130 = call i32 @mgf_mask(ptr noundef %117, i64 noundef %119, ptr noundef %124, i64 noundef %129, ptr noundef %33)
  store i32 %130, ptr %22, align 4, !tbaa !9
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %149, label %132

132:                                              ; preds = %115
  %133 = getelementptr inbounds [1024 x i8], ptr %29, i64 0, i64 0
  %134 = load i32, ptr %31, align 4, !tbaa !9
  %135 = zext i32 %134 to i64
  %136 = getelementptr inbounds i8, ptr %133, i64 %135
  %137 = getelementptr inbounds i8, ptr %136, i64 1
  %138 = load i64, ptr %23, align 8, !tbaa !11
  %139 = load i32, ptr %31, align 4, !tbaa !9
  %140 = zext i32 %139 to i64
  %141 = sub i64 %138, %140
  %142 = sub i64 %141, 1
  %143 = getelementptr inbounds [1024 x i8], ptr %29, i64 0, i64 0
  %144 = getelementptr inbounds i8, ptr %143, i64 1
  %145 = load i32, ptr %31, align 4, !tbaa !9
  %146 = zext i32 %145 to i64
  %147 = call i32 @mgf_mask(ptr noundef %137, i64 noundef %142, ptr noundef %144, i64 noundef %146, ptr noundef %33)
  store i32 %147, ptr %22, align 4, !tbaa !9
  %148 = icmp ne i32 %147, 0
  br i1 %148, label %149, label %150

149:                                              ; preds = %132, %115
  call void @mbedtls_md_free(ptr noundef %33)
  br label %276

150:                                              ; preds = %132
  call void @mbedtls_md_free(ptr noundef %33)
  %151 = load ptr, ptr %32, align 8, !tbaa !5
  %152 = load ptr, ptr %16, align 8, !tbaa !5
  %153 = load i64, ptr %17, align 8, !tbaa !11
  %154 = getelementptr inbounds [64 x i8], ptr %30, i64 0, i64 0
  %155 = call i32 @mbedtls_md(ptr noundef %151, ptr noundef %152, i64 noundef %153, ptr noundef %154)
  store i32 %155, ptr %22, align 4, !tbaa !9
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %157, label %158

157:                                              ; preds = %150
  br label %276

158:                                              ; preds = %150
  %159 = getelementptr inbounds [1024 x i8], ptr %29, i64 0, i64 0
  store ptr %159, ptr %26, align 8, !tbaa !5
  store i8 0, ptr %27, align 1, !tbaa !18
  %160 = load ptr, ptr %26, align 8, !tbaa !5
  %161 = getelementptr inbounds i8, ptr %160, i32 1
  store ptr %161, ptr %26, align 8, !tbaa !5
  %162 = load i8, ptr %160, align 1, !tbaa !18
  %163 = zext i8 %162 to i32
  %164 = load i8, ptr %27, align 1, !tbaa !18
  %165 = zext i8 %164 to i32
  %166 = or i32 %165, %163
  %167 = trunc i32 %166 to i8
  store i8 %167, ptr %27, align 1, !tbaa !18
  %168 = load i32, ptr %31, align 4, !tbaa !9
  %169 = load ptr, ptr %26, align 8, !tbaa !5
  %170 = zext i32 %168 to i64
  %171 = getelementptr inbounds i8, ptr %169, i64 %170
  store ptr %171, ptr %26, align 8, !tbaa !5
  store i64 0, ptr %24, align 8, !tbaa !11
  br label %172

172:                                              ; preds = %191, %158
  %173 = load i64, ptr %24, align 8, !tbaa !11
  %174 = load i32, ptr %31, align 4, !tbaa !9
  %175 = zext i32 %174 to i64
  %176 = icmp ult i64 %173, %175
  br i1 %176, label %177, label %194

177:                                              ; preds = %172
  %178 = load i64, ptr %24, align 8, !tbaa !11
  %179 = getelementptr inbounds [64 x i8], ptr %30, i64 0, i64 %178
  %180 = load i8, ptr %179, align 1, !tbaa !18
  %181 = zext i8 %180 to i32
  %182 = load ptr, ptr %26, align 8, !tbaa !5
  %183 = getelementptr inbounds i8, ptr %182, i32 1
  store ptr %183, ptr %26, align 8, !tbaa !5
  %184 = load i8, ptr %182, align 1, !tbaa !18
  %185 = zext i8 %184 to i32
  %186 = xor i32 %181, %185
  %187 = load i8, ptr %27, align 1, !tbaa !18
  %188 = zext i8 %187 to i32
  %189 = or i32 %188, %186
  %190 = trunc i32 %189 to i8
  store i8 %190, ptr %27, align 1, !tbaa !18
  br label %191

191:                                              ; preds = %177
  %192 = load i64, ptr %24, align 8, !tbaa !11
  %193 = add i64 %192, 1
  store i64 %193, ptr %24, align 8, !tbaa !11
  br label %172, !llvm.loop !19

194:                                              ; preds = %172
  store i64 0, ptr %25, align 8, !tbaa !11
  store i8 0, ptr %28, align 1, !tbaa !18
  store i64 0, ptr %24, align 8, !tbaa !11
  br label %195

195:                                              ; preds = %227, %194
  %196 = load i64, ptr %24, align 8, !tbaa !11
  %197 = load i64, ptr %23, align 8, !tbaa !11
  %198 = load i32, ptr %31, align 4, !tbaa !9
  %199 = mul i32 2, %198
  %200 = zext i32 %199 to i64
  %201 = sub i64 %197, %200
  %202 = sub i64 %201, 2
  %203 = icmp ult i64 %196, %202
  br i1 %203, label %204, label %230

204:                                              ; preds = %195
  %205 = load ptr, ptr %26, align 8, !tbaa !5
  %206 = load i64, ptr %24, align 8, !tbaa !11
  %207 = getelementptr inbounds i8, ptr %205, i64 %206
  %208 = load i8, ptr %207, align 1, !tbaa !18
  %209 = zext i8 %208 to i32
  %210 = load i8, ptr %28, align 1, !tbaa !18
  %211 = zext i8 %210 to i32
  %212 = or i32 %211, %209
  %213 = trunc i32 %212 to i8
  store i8 %213, ptr %28, align 1, !tbaa !18
  %214 = load i8, ptr %28, align 1, !tbaa !18
  %215 = zext i8 %214 to i32
  %216 = load i8, ptr %28, align 1, !tbaa !18
  %217 = zext i8 %216 to i32
  %218 = sub nsw i32 0, %217
  %219 = trunc i32 %218 to i8
  %220 = zext i8 %219 to i32
  %221 = or i32 %215, %220
  %222 = ashr i32 %221, 7
  %223 = xor i32 %222, 1
  %224 = sext i32 %223 to i64
  %225 = load i64, ptr %25, align 8, !tbaa !11
  %226 = add i64 %225, %224
  store i64 %226, ptr %25, align 8, !tbaa !11
  br label %227

227:                                              ; preds = %204
  %228 = load i64, ptr %24, align 8, !tbaa !11
  %229 = add i64 %228, 1
  store i64 %229, ptr %24, align 8, !tbaa !11
  br label %195, !llvm.loop !21

230:                                              ; preds = %195
  %231 = load i64, ptr %25, align 8, !tbaa !11
  %232 = load ptr, ptr %26, align 8, !tbaa !5
  %233 = getelementptr inbounds i8, ptr %232, i64 %231
  store ptr %233, ptr %26, align 8, !tbaa !5
  %234 = load ptr, ptr %26, align 8, !tbaa !5
  %235 = getelementptr inbounds i8, ptr %234, i32 1
  store ptr %235, ptr %26, align 8, !tbaa !5
  %236 = load i8, ptr %234, align 1, !tbaa !18
  %237 = zext i8 %236 to i32
  %238 = xor i32 %237, 1
  %239 = load i8, ptr %27, align 1, !tbaa !18
  %240 = zext i8 %239 to i32
  %241 = or i32 %240, %238
  %242 = trunc i32 %241 to i8
  store i8 %242, ptr %27, align 1, !tbaa !18
  %243 = load i8, ptr %27, align 1, !tbaa !18
  %244 = zext i8 %243 to i32
  %245 = icmp ne i32 %244, 0
  br i1 %245, label %246, label %247

246:                                              ; preds = %230
  store i32 -16640, ptr %22, align 4, !tbaa !9
  br label %276

247:                                              ; preds = %230
  %248 = load i64, ptr %23, align 8, !tbaa !11
  %249 = load ptr, ptr %26, align 8, !tbaa !5
  %250 = getelementptr inbounds [1024 x i8], ptr %29, i64 0, i64 0
  %251 = ptrtoint ptr %249 to i64
  %252 = ptrtoint ptr %250 to i64
  %253 = sub i64 %251, %252
  %254 = sub i64 %248, %253
  %255 = load i64, ptr %21, align 8, !tbaa !11
  %256 = icmp ugt i64 %254, %255
  br i1 %256, label %257, label %258

257:                                              ; preds = %247
  store i32 -17408, ptr %22, align 4, !tbaa !9
  br label %276

258:                                              ; preds = %247
  %259 = load i64, ptr %23, align 8, !tbaa !11
  %260 = load ptr, ptr %26, align 8, !tbaa !5
  %261 = getelementptr inbounds [1024 x i8], ptr %29, i64 0, i64 0
  %262 = ptrtoint ptr %260 to i64
  %263 = ptrtoint ptr %261 to i64
  %264 = sub i64 %262, %263
  %265 = sub i64 %259, %264
  %266 = load ptr, ptr %18, align 8, !tbaa !5
  store i64 %265, ptr %266, align 8, !tbaa !11
  %267 = load ptr, ptr %18, align 8, !tbaa !5
  %268 = load i64, ptr %267, align 8, !tbaa !11
  %269 = icmp ne i64 %268, 0
  br i1 %269, label %270, label %275

270:                                              ; preds = %258
  %271 = load ptr, ptr %20, align 8, !tbaa !5
  %272 = load ptr, ptr %26, align 8, !tbaa !5
  %273 = load ptr, ptr %18, align 8, !tbaa !5
  %274 = load i64, ptr %273, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %271, ptr align 1 %272, i64 %274, i1 false)
  br label %275

275:                                              ; preds = %270, %258
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %276

276:                                              ; preds = %275, %257, %246, %157, %149, %114, %109
  %277 = getelementptr inbounds [1024 x i8], ptr %29, i64 0, i64 0
  call void @mbedtls_platform_zeroize(ptr noundef %277, i64 noundef 1024)
  %278 = getelementptr inbounds [64 x i8], ptr %30, i64 0, i64 0
  call void @mbedtls_platform_zeroize(ptr noundef %278, i64 noundef 64)
  %279 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %279, ptr %11, align 4
  store i32 1, ptr %34, align 4
  br label %280

280:                                              ; preds = %276, %89, %78, %70, %60
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 1024, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  %281 = load i32, ptr %11, align 4
  ret i32 %281
}

declare void @mbedtls_platform_zeroize(ptr noundef, i64 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 328}
!14 = !{!"mbedtls_rsa_context", !10, i64 0, !12, i64 8, !15, i64 16, !15, i64 40, !15, i64 64, !15, i64 88, !15, i64 112, !15, i64 136, !15, i64 160, !15, i64 184, !15, i64 208, !15, i64 232, !15, i64 256, !15, i64 280, !15, i64 304, !10, i64 328, !10, i64 332}
!15 = !{!"mbedtls_mpi", !10, i64 0, !12, i64 8, !6, i64 16}
!16 = !{!14, !12, i64 8}
!17 = !{!14, !10, i64 332}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


; 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.mbedtls_md_context_t = type { ptr, ptr, ptr }

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

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

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

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

declare ptr @mbedtls_md_info_from_type(i32 noundef) local_unnamed_addr #2

declare zeroext i8 @mbedtls_md_get_size(ptr noundef) local_unnamed_addr #2

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

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

declare void @mbedtls_md_init(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @mgf_mask(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare void @mbedtls_md_free(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i32 @mbedtls_rsa_rsaes_oaep_decrypt(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, i64 noundef %5, ptr nocapture noundef writeonly %6, ptr noundef %7, ptr nocapture noundef writeonly %8, i64 noundef %9) local_unnamed_addr #1 {
  %11 = alloca [1024 x i8], align 16
  %12 = alloca [64 x i8], align 16
  %13 = alloca %struct.mbedtls_md_context_t, align 8
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #5
  %14 = icmp eq i32 %3, 1
  br i1 %14, label %15, label %18

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %0, i64 328
  %17 = load i32, ptr %16, align 8, !tbaa !5
  %.not = icmp eq i32 %17, 1
  br i1 %.not, label %18, label %183

18:                                               ; preds = %15, %10
  %19 = getelementptr inbounds i8, ptr %0, i64 8
  %20 = load i64, ptr %19, align 8, !tbaa !13
  %21 = add i64 %20, -1025
  %or.cond = icmp ult i64 %21, -1009
  br i1 %or.cond, label %183, label %22

22:                                               ; preds = %18
  %23 = getelementptr inbounds i8, ptr %0, i64 332
  %24 = load i32, ptr %23, align 4, !tbaa !14
  %25 = tail call ptr @mbedtls_md_info_from_type(i32 noundef %24) #5
  %26 = icmp eq ptr %25, null
  br i1 %26, label %183, label %27

27:                                               ; preds = %22
  %28 = tail call zeroext i8 @mbedtls_md_get_size(ptr noundef nonnull %25) #5
  %29 = zext i8 %28 to i32
  %30 = shl nuw nsw i32 %29, 1
  %31 = add nuw nsw i32 %30, 2
  %32 = zext nneg i32 %31 to i64
  %33 = icmp ult i64 %20, %32
  br i1 %33, label %183, label %34

34:                                               ; preds = %27
  %35 = icmp eq i32 %3, 0
  br i1 %35, label %36, label %38

36:                                               ; preds = %34
  %37 = call i32 @mbedtls_rsa_public(ptr noundef nonnull %0, ptr noundef %7, ptr noundef nonnull %11)
  br label %40

38:                                               ; preds = %34
  %39 = call i32 @mbedtls_rsa_private(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %2, ptr noundef %7, ptr noundef nonnull %11)
  br label %40

40:                                               ; preds = %38, %36
  %41 = phi i32 [ %37, %36 ], [ %39, %38 ]
  %.not82 = icmp eq i32 %41, 0
  br i1 %.not82, label %42, label %182

42:                                               ; preds = %40
  call void @mbedtls_md_init(ptr noundef nonnull %13) #5
  %43 = call i32 @mbedtls_md_setup(ptr noundef nonnull %13, ptr noundef nonnull %25, i32 noundef 0) #5
  %.not83 = icmp eq i32 %43, 0
  br i1 %.not83, label %45, label %44

44:                                               ; preds = %42
  call void @mbedtls_md_free(ptr noundef nonnull %13) #5
  br label %182

45:                                               ; preds = %42
  %46 = getelementptr inbounds i8, ptr %11, i64 1
  %47 = zext i8 %28 to i64
  %48 = getelementptr inbounds i8, ptr %11, i64 %47
  %49 = getelementptr inbounds i8, ptr %48, i64 1
  %50 = xor i64 %47, -1
  %51 = add nsw i64 %20, %50
  %52 = call i32 @mgf_mask(ptr noundef nonnull %46, i64 noundef %47, ptr noundef nonnull %49, i64 noundef %51, ptr noundef nonnull %13)
  %.not84 = icmp eq i32 %52, 0
  br i1 %.not84, label %53, label %55

53:                                               ; preds = %45
  %54 = call i32 @mgf_mask(ptr noundef nonnull %49, i64 noundef %51, ptr noundef nonnull %46, i64 noundef %47, ptr noundef nonnull %13)
  %.not85 = icmp eq i32 %54, 0
  br i1 %.not85, label %56, label %55

55:                                               ; preds = %53, %45
  %.067 = phi i32 [ %52, %45 ], [ %54, %53 ]
  call void @mbedtls_md_free(ptr noundef nonnull %13) #5
  br label %182

56:                                               ; preds = %53
  call void @mbedtls_md_free(ptr noundef nonnull %13) #5
  %57 = call i32 @mbedtls_md(ptr noundef nonnull %25, ptr noundef %4, i64 noundef %5, ptr noundef nonnull %12) #5
  %.not86 = icmp eq i32 %57, 0
  br i1 %.not86, label %58, label %182

58:                                               ; preds = %56
  %59 = load i8, ptr %11, align 16, !tbaa !15
  %60 = getelementptr inbounds i8, ptr %46, i64 %47
  %.not99 = icmp eq i8 %28, 0
  br i1 %.not99, label %.preheader, label %iter.check

iter.check:                                       ; preds = %58
  %61 = shl nuw nsw i64 %47, 1
  %62 = or disjoint i64 %61, 1
  %min.iters.check = icmp ult i8 %28, 8
  br i1 %min.iters.check, label %.lr.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check106 = icmp ult i8 %28, 32
  br i1 %min.iters.check106, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %47, 224
  %63 = insertelement <16 x i8> <i8 poison, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, i8 %59, i64 0
  %64 = getelementptr inbounds i8, ptr %12, i64 16
  %wide.load = load <16 x i8>, ptr %12, align 16, !tbaa !15
  %wide.load109 = load <16 x i8>, ptr %64, align 16, !tbaa !15
  %65 = getelementptr i8, ptr %60, i64 16
  %wide.load110 = load <16 x i8>, ptr %60, align 1, !tbaa !15
  %wide.load111 = load <16 x i8>, ptr %65, align 1, !tbaa !15
  %66 = xor <16 x i8> %wide.load110, %wide.load
  %67 = xor <16 x i8> %wide.load111, %wide.load109
  %68 = or <16 x i8> %66, %63
  %69 = icmp eq i64 %n.vec, 32
  br i1 %69, label %middle.block, label %vector.body.1, !llvm.loop !16

vector.body.1:                                    ; preds = %vector.ph
  %next.gep.1 = getelementptr i8, ptr %60, i64 32
  %70 = getelementptr inbounds i8, ptr %12, i64 32
  %71 = getelementptr inbounds i8, ptr %12, i64 48
  %wide.load.1 = load <16 x i8>, ptr %70, align 16, !tbaa !15
  %wide.load109.1 = load <16 x i8>, ptr %71, align 16, !tbaa !15
  %72 = getelementptr i8, ptr %60, i64 48
  %wide.load110.1 = load <16 x i8>, ptr %next.gep.1, align 1, !tbaa !15
  %wide.load111.1 = load <16 x i8>, ptr %72, align 1, !tbaa !15
  %73 = xor <16 x i8> %wide.load110.1, %wide.load.1
  %74 = xor <16 x i8> %wide.load111.1, %wide.load109.1
  %75 = or <16 x i8> %73, %68
  %76 = or <16 x i8> %74, %67
  %77 = icmp eq i64 %n.vec, 64
  br i1 %77, label %middle.block, label %vector.body.2, !llvm.loop !16

vector.body.2:                                    ; preds = %vector.body.1
  %next.gep.2 = getelementptr i8, ptr %60, i64 64
  %78 = getelementptr inbounds i8, ptr %12, i64 64
  %79 = getelementptr inbounds i8, ptr %12, i64 80
  %wide.load.2 = load <16 x i8>, ptr %78, align 16, !tbaa !15
  %wide.load109.2 = load <16 x i8>, ptr %79, align 16, !tbaa !15
  %80 = getelementptr i8, ptr %60, i64 80
  %wide.load110.2 = load <16 x i8>, ptr %next.gep.2, align 1, !tbaa !15
  %wide.load111.2 = load <16 x i8>, ptr %80, align 1, !tbaa !15
  %81 = xor <16 x i8> %wide.load110.2, %wide.load.2
  %82 = xor <16 x i8> %wide.load111.2, %wide.load109.2
  %83 = or <16 x i8> %81, %75
  %84 = or <16 x i8> %82, %76
  %85 = icmp eq i64 %n.vec, 96
  br i1 %85, label %middle.block, label %vector.body.3, !llvm.loop !16

vector.body.3:                                    ; preds = %vector.body.2
  %next.gep.3 = getelementptr i8, ptr %60, i64 96
  %86 = getelementptr inbounds i8, ptr %12, i64 96
  %87 = getelementptr inbounds i8, ptr %12, i64 112
  %wide.load.3 = load <16 x i8>, ptr %86, align 16, !tbaa !15
  %wide.load109.3 = load <16 x i8>, ptr %87, align 16, !tbaa !15
  %88 = getelementptr i8, ptr %60, i64 112
  %wide.load110.3 = load <16 x i8>, ptr %next.gep.3, align 1, !tbaa !15
  %wide.load111.3 = load <16 x i8>, ptr %88, align 1, !tbaa !15
  %89 = xor <16 x i8> %wide.load110.3, %wide.load.3
  %90 = xor <16 x i8> %wide.load111.3, %wide.load109.3
  %91 = or <16 x i8> %89, %83
  %92 = or <16 x i8> %90, %84
  %93 = icmp eq i64 %n.vec, 128
  br i1 %93, label %middle.block, label %vector.body.4, !llvm.loop !16

vector.body.4:                                    ; preds = %vector.body.3
  %next.gep.4 = getelementptr i8, ptr %60, i64 128
  %94 = getelementptr inbounds i8, ptr %12, i64 128
  %95 = getelementptr inbounds i8, ptr %12, i64 144
  %wide.load.4 = load <16 x i8>, ptr %94, align 16, !tbaa !15
  %wide.load109.4 = load <16 x i8>, ptr %95, align 16, !tbaa !15
  %96 = getelementptr i8, ptr %60, i64 144
  %wide.load110.4 = load <16 x i8>, ptr %next.gep.4, align 1, !tbaa !15
  %wide.load111.4 = load <16 x i8>, ptr %96, align 1, !tbaa !15
  %97 = xor <16 x i8> %wide.load110.4, %wide.load.4
  %98 = xor <16 x i8> %wide.load111.4, %wide.load109.4
  %99 = or <16 x i8> %97, %91
  %100 = or <16 x i8> %98, %92
  %101 = icmp eq i64 %n.vec, 160
  br i1 %101, label %middle.block, label %vector.body.5, !llvm.loop !16

vector.body.5:                                    ; preds = %vector.body.4
  %next.gep.5 = getelementptr i8, ptr %60, i64 160
  %102 = getelementptr inbounds i8, ptr %12, i64 160
  %103 = getelementptr inbounds i8, ptr %12, i64 176
  %wide.load.5 = load <16 x i8>, ptr %102, align 16, !tbaa !15
  %wide.load109.5 = load <16 x i8>, ptr %103, align 16, !tbaa !15
  %104 = getelementptr i8, ptr %60, i64 176
  %wide.load110.5 = load <16 x i8>, ptr %next.gep.5, align 1, !tbaa !15
  %wide.load111.5 = load <16 x i8>, ptr %104, align 1, !tbaa !15
  %105 = xor <16 x i8> %wide.load110.5, %wide.load.5
  %106 = xor <16 x i8> %wide.load111.5, %wide.load109.5
  %107 = or <16 x i8> %105, %99
  %108 = or <16 x i8> %106, %100
  %109 = icmp eq i64 %n.vec, 192
  br i1 %109, label %middle.block, label %vector.body.6, !llvm.loop !16

vector.body.6:                                    ; preds = %vector.body.5
  %next.gep.6 = getelementptr i8, ptr %60, i64 192
  %110 = getelementptr inbounds i8, ptr %12, i64 192
  %111 = getelementptr inbounds i8, ptr %12, i64 208
  %wide.load.6 = load <16 x i8>, ptr %110, align 16, !tbaa !15
  %wide.load109.6 = load <16 x i8>, ptr %111, align 16, !tbaa !15
  %112 = getelementptr i8, ptr %60, i64 208
  %wide.load110.6 = load <16 x i8>, ptr %next.gep.6, align 1, !tbaa !15
  %wide.load111.6 = load <16 x i8>, ptr %112, align 1, !tbaa !15
  %113 = xor <16 x i8> %wide.load110.6, %wide.load.6
  %114 = xor <16 x i8> %wide.load111.6, %wide.load109.6
  %115 = or <16 x i8> %113, %107
  %116 = or <16 x i8> %114, %108
  br label %middle.block

middle.block:                                     ; preds = %vector.body.6, %vector.body.5, %vector.body.4, %vector.body.3, %vector.body.2, %vector.body.1, %vector.ph
  %.lcssa127 = phi <16 x i8> [ %68, %vector.ph ], [ %75, %vector.body.1 ], [ %83, %vector.body.2 ], [ %91, %vector.body.3 ], [ %99, %vector.body.4 ], [ %107, %vector.body.5 ], [ %115, %vector.body.6 ]
  %.lcssa126 = phi <16 x i8> [ %67, %vector.ph ], [ %76, %vector.body.1 ], [ %84, %vector.body.2 ], [ %92, %vector.body.3 ], [ %100, %vector.body.4 ], [ %108, %vector.body.5 ], [ %116, %vector.body.6 ]
  %bin.rdx = or <16 x i8> %.lcssa126, %.lcssa127
  %117 = call i8 @llvm.vector.reduce.or.v16i8(<16 x i8> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %47
  br i1 %cmp.n, label %.preheader.loopexit, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end114 = getelementptr i8, ptr %60, i64 %n.vec
  %n.vec.remaining = and i64 %47, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph.preheader, label %vec.epilog.ph

.lr.ph.preheader:                                 ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %.06992.ph = phi i8 [ %59, %iter.check ], [ %117, %vec.epilog.iter.check ], [ %123, %vec.epilog.middle.block ]
  %.07091.ph = phi ptr [ %60, %iter.check ], [ %ind.end114, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  %.07290.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec113, %vec.epilog.middle.block ]
  br label %.lr.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %bc.merge.rdx = phi i8 [ %117, %vec.epilog.iter.check ], [ %59, %vector.main.loop.iter.check ]
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec113 = and i64 %47, 248
  %ind.end = getelementptr i8, ptr %60, i64 %n.vec113
  %118 = insertelement <8 x i8> <i8 poison, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, i8 %bc.merge.rdx, i64 0
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index116 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next121, %vec.epilog.vector.body ]
  %vec.phi117 = phi <8 x i8> [ %118, %vec.epilog.ph ], [ %121, %vec.epilog.vector.body ]
  %next.gep118 = getelementptr i8, ptr %60, i64 %index116
  %119 = getelementptr inbounds [64 x i8], ptr %12, i64 0, i64 %index116
  %wide.load119 = load <8 x i8>, ptr %119, align 8, !tbaa !15
  %wide.load120 = load <8 x i8>, ptr %next.gep118, align 1, !tbaa !15
  %120 = xor <8 x i8> %wide.load120, %wide.load119
  %121 = or <8 x i8> %120, %vec.phi117
  %index.next121 = add nuw i64 %index116, 8
  %122 = icmp eq i64 %index.next121, %n.vec113
  br i1 %122, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !20

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %123 = call i8 @llvm.vector.reduce.or.v8i8(<8 x i8> %121)
  %cmp.n122 = icmp eq i64 %n.vec113, %47
  br i1 %cmp.n122, label %.preheader.loopexit, label %.lr.ph.preheader

.preheader.loopexit:                              ; preds = %.lr.ph, %vec.epilog.middle.block, %middle.block
  %.lcssa105 = phi i8 [ %117, %middle.block ], [ %123, %vec.epilog.middle.block ], [ %133, %.lr.ph ]
  %scevgep = getelementptr i8, ptr %11, i64 %62
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %58
  %.070.lcssa = phi ptr [ %60, %58 ], [ %scevgep, %.preheader.loopexit ]
  %.069.lcssa = phi i8 [ %59, %58 ], [ %.lcssa105, %.preheader.loopexit ]
  %124 = zext nneg i32 %30 to i64
  %125 = add nsw i64 %20, -2
  %.not100 = icmp eq i64 %125, %124
  br i1 %.not100, label %._crit_edge, label %.lr.ph97.preheader

.lr.ph97.preheader:                               ; preds = %.preheader
  %126 = sub nsw i64 %125, %124
  %umax = call i64 @llvm.umax.i64(i64 %126, i64 1)
  %xtraiter = and i64 %umax, 1
  %127 = icmp ult i64 %126, 2
  br i1 %127, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph97.preheader.new

.lr.ph97.preheader.new:                           ; preds = %.lr.ph97.preheader
  %unroll_iter = and i64 %umax, -2
  br label %.lr.ph97

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.06992 = phi i8 [ %133, %.lr.ph ], [ %.06992.ph, %.lr.ph.preheader ]
  %.07091 = phi ptr [ %130, %.lr.ph ], [ %.07091.ph, %.lr.ph.preheader ]
  %.07290 = phi i64 [ %134, %.lr.ph ], [ %.07290.ph, %.lr.ph.preheader ]
  %128 = getelementptr inbounds [64 x i8], ptr %12, i64 0, i64 %.07290
  %129 = load i8, ptr %128, align 1, !tbaa !15
  %130 = getelementptr inbounds i8, ptr %.07091, i64 1
  %131 = load i8, ptr %.07091, align 1, !tbaa !15
  %132 = xor i8 %131, %129
  %133 = or i8 %132, %.06992
  %134 = add nuw nsw i64 %.07290, 1
  %exitcond.not = icmp eq i64 %134, %47
  br i1 %exitcond.not, label %.preheader.loopexit, label %.lr.ph, !llvm.loop !21

.lr.ph97:                                         ; preds = %.lr.ph97, %.lr.ph97.preheader.new
  %.06896 = phi i32 [ 0, %.lr.ph97.preheader.new ], [ %150, %.lr.ph97 ]
  %.07195 = phi i64 [ 0, %.lr.ph97.preheader.new ], [ %157, %.lr.ph97 ]
  %.17394 = phi i64 [ 0, %.lr.ph97.preheader.new ], [ %158, %.lr.ph97 ]
  %niter = phi i64 [ 0, %.lr.ph97.preheader.new ], [ %niter.next.1, %.lr.ph97 ]
  %135 = getelementptr inbounds i8, ptr %.070.lcssa, i64 %.17394
  %136 = load i8, ptr %135, align 1, !tbaa !15
  %137 = zext i8 %136 to i32
  %138 = or i32 %.06896, %137
  %139 = sub nsw i32 0, %138
  %140 = and i32 %139, 128
  %141 = or i32 %140, %138
  %142 = lshr i32 %141, 7
  %143 = xor i32 %142, 1
  %144 = zext nneg i32 %143 to i64
  %145 = add i64 %.07195, %144
  %146 = or disjoint i64 %.17394, 1
  %147 = getelementptr inbounds i8, ptr %.070.lcssa, i64 %146
  %148 = load i8, ptr %147, align 1, !tbaa !15
  %149 = zext i8 %148 to i32
  %150 = or i32 %138, %149
  %151 = sub nsw i32 0, %150
  %152 = and i32 %151, 128
  %153 = or i32 %152, %150
  %154 = lshr i32 %153, 7
  %155 = xor i32 %154, 1
  %156 = zext nneg i32 %155 to i64
  %157 = add i64 %145, %156
  %158 = add nuw i64 %.17394, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph97, !llvm.loop !22

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph97, %.lr.ph97.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph97.preheader ], [ %157, %.lr.ph97 ]
  %.06896.unr = phi i32 [ 0, %.lr.ph97.preheader ], [ %150, %.lr.ph97 ]
  %.07195.unr = phi i64 [ 0, %.lr.ph97.preheader ], [ %157, %.lr.ph97 ]
  %.17394.unr = phi i64 [ 0, %.lr.ph97.preheader ], [ %158, %.lr.ph97 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph97.epil

.lr.ph97.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa
  %159 = getelementptr inbounds i8, ptr %.070.lcssa, i64 %.17394.unr
  %160 = load i8, ptr %159, align 1, !tbaa !15
  %161 = zext i8 %160 to i32
  %162 = or i32 %.06896.unr, %161
  %163 = sub nsw i32 0, %162
  %164 = and i32 %163, 128
  %165 = or i32 %164, %162
  %166 = lshr i32 %165, 7
  %167 = xor i32 %166, 1
  %168 = zext nneg i32 %167 to i64
  %169 = add i64 %.07195.unr, %168
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph97.epil, %._crit_edge.loopexit.unr-lcssa, %.preheader
  %.071.lcssa = phi i64 [ 0, %.preheader ], [ %.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %169, %.lr.ph97.epil ]
  %170 = getelementptr inbounds i8, ptr %.070.lcssa, i64 %.071.lcssa
  %171 = getelementptr inbounds i8, ptr %170, i64 1
  %172 = load i8, ptr %170, align 1, !tbaa !15
  %173 = xor i8 %172, 1
  %174 = or i8 %173, %.069.lcssa
  %.not87 = icmp eq i8 %174, 0
  br i1 %.not87, label %175, label %182

175:                                              ; preds = %._crit_edge
  %176 = ptrtoint ptr %171 to i64
  %177 = ptrtoint ptr %11 to i64
  %.neg = sub i64 %177, %176
  %178 = add i64 %.neg, %20
  %179 = icmp ugt i64 %178, %9
  br i1 %179, label %182, label %180

180:                                              ; preds = %175
  store i64 %178, ptr %6, align 8, !tbaa !23
  %.not88 = icmp eq i64 %178, 0
  br i1 %.not88, label %182, label %181

181:                                              ; preds = %180
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %8, ptr nonnull align 1 %171, i64 %178, i1 false)
  br label %182

182:                                              ; preds = %180, %181, %175, %._crit_edge, %56, %40, %55, %44
  %.1 = phi i32 [ %41, %40 ], [ %43, %44 ], [ %.067, %55 ], [ %57, %56 ], [ -16640, %._crit_edge ], [ -17408, %175 ], [ 0, %181 ], [ 0, %180 ]
  call void @mbedtls_platform_zeroize(ptr noundef nonnull %11, i64 noundef 1024) #5
  call void @mbedtls_platform_zeroize(ptr noundef nonnull %12, i64 noundef 64) #5
  br label %183

183:                                              ; preds = %27, %22, %18, %15, %182
  %.0 = phi i32 [ %.1, %182 ], [ -16512, %15 ], [ -16512, %18 ], [ -16512, %22 ], [ -16512, %27 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %11) #5
  ret i32 %.0
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i8 @llvm.vector.reduce.or.v16i8(<16 x i8>) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i8 @llvm.vector.reduce.or.v8i8(<8 x i8>) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 328}
!6 = !{!"mbedtls_rsa_context", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 40, !11, i64 64, !11, i64 88, !11, i64 112, !11, i64 136, !11, i64 160, !11, i64 184, !11, i64 208, !11, i64 232, !11, i64 256, !11, i64 280, !11, i64 304, !7, i64 328, !7, i64 332}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"mbedtls_mpi", !7, i64 0, !10, i64 8, !12, i64 16}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!6, !10, i64 8}
!14 = !{!6, !7, i64 332}
!15 = !{!8, !8, i64 0}
!16 = distinct !{!16, !17, !18, !19}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !17, !18, !19}
!21 = distinct !{!21, !17, !19, !18}
!22 = distinct !{!22, !17}
!23 = !{!10, !10, i64 0}


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