; LLVM IR from square/subzero :: core/external-crypto/aes (modetest)

; 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.aes_crypt_ctx = type { [60 x i32], %union.aes_inf, [12 x i8] }
%union.aes_inf = type { i32 }

@.str.3 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1

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

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

; Function Attrs: 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) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @read_tsc() #3

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #5

declare void @block_rndfill(ptr noundef, i64 noundef) #6

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #7

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

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

declare i32 @aes_decrypt_key(ptr noundef, i32 noundef, ptr noundef) #6

; Function Attrs: nounwind uwtable
define dso_local i32 @time_cbc_dec(i32 noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca [32 x i8], align 16
  %18 = alloca [160000 x i8], align 16
  %19 = alloca [16 x i8], align 16
  %20 = alloca [160000 x i8], align 16
  %21 = alloca [16 x i8], align 16
  %22 = alloca [1 x %struct.aes_crypt_ctx], align 16
  %23 = alloca i32, align 4
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 160000, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #9
  call void @llvm.lifetime.start.p0(i64 160000, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #9
  call void @llvm.lifetime.start.p0(i64 256, ptr %22) #9
  %24 = getelementptr inbounds [32 x i8], ptr %17, i64 0, i64 0
  call void @block_rndfill(ptr noundef %24, i64 noundef 32)
  %25 = getelementptr inbounds [32 x i8], ptr %17, i64 0, i64 0
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %22, i64 0, i64 0
  %28 = call i32 @aes_decrypt_key(ptr noundef %25, i32 noundef %26, ptr noundef %27)
  %29 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  call void @block_rndfill(ptr noundef %29, i64 noundef 16)
  %30 = getelementptr inbounds [16 x i8], ptr %19, i64 0, i64 0
  %31 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %30, ptr align 16 %31, i64 16, i1 false)
  %32 = getelementptr inbounds [160000 x i8], ptr %20, i64 0, i64 0
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = mul nsw i32 %33, 16
  %35 = sext i32 %34 to i64
  call void @block_rndfill(ptr noundef %32, i64 noundef %35)
  %36 = getelementptr inbounds [160000 x i8], ptr %18, i64 0, i64 0
  %37 = getelementptr inbounds [160000 x i8], ptr %20, i64 0, i64 0
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = mul nsw i32 %38, 16
  %40 = sext i32 %39 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %36, ptr align 16 %37, i64 %40, i1 false)
  %41 = getelementptr inbounds [160000 x i8], ptr %20, i64 0, i64 0
  %42 = getelementptr inbounds [160000 x i8], ptr %20, i64 0, i64 0
  %43 = load i32, ptr %7, align 4, !tbaa !5
  %44 = mul nsw i32 %43, 16
  %45 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %46 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %22, i64 0, i64 0
  %47 = call i32 @aes_cbc_decrypt(ptr noundef %41, ptr noundef %42, i32 noundef %44, ptr noundef %45, ptr noundef %46)
  %48 = getelementptr inbounds [160000 x i8], ptr %18, i64 0, i64 0
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = mul nsw i32 %49, 16
  %51 = getelementptr inbounds [16 x i8], ptr %19, i64 0, i64 0
  %52 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %22, i64 0, i64 0
  call void @CBCdec(ptr noundef %48, i32 noundef %50, ptr noundef %51, ptr noundef %52)
  %53 = getelementptr inbounds [160000 x i8], ptr %20, i64 0, i64 0
  %54 = getelementptr inbounds [160000 x i8], ptr %18, i64 0, i64 0
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = mul nsw i32 %55, 16
  %57 = sext i32 %56 to i64
  %58 = call i32 @memcmp(ptr noundef %53, ptr noundef %54, i64 noundef %57) #10
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %61

60:                                               ; preds = %4
  br label %259

61:                                               ; preds = %4
  %62 = getelementptr inbounds [16 x i8], ptr %19, i64 0, i64 0
  %63 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %64 = call i32 @memcmp(ptr noundef %62, ptr noundef %63, i64 noundef 16) #10
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %61
  br label %261

67:                                               ; preds = %61
  store i32 10, ptr %11, align 4, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %257, %67
  %69 = load i32, ptr %13, align 4, !tbaa !5
  %70 = icmp ne i32 %69, 0
  %71 = xor i1 %70, true
  br i1 %71, label %72, label %258

72:                                               ; preds = %68
  store double 0.000000e+00, ptr %16, align 8, !tbaa !11
  store double 0.000000e+00, ptr %15, align 8, !tbaa !11
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %117, %72
  %74 = load i32, ptr %10, align 4, !tbaa !5
  %75 = icmp slt i32 %74, 1000
  br i1 %75, label %76, label %120

76:                                               ; preds = %73
  %77 = call i64 @read_tsc()
  %78 = uitofp i64 %77 to double
  store double %78, ptr %14, align 8, !tbaa !11
  %79 = getelementptr inbounds [160000 x i8], ptr %20, i64 0, i64 0
  %80 = getelementptr inbounds [160000 x i8], ptr %20, i64 0, i64 0
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = mul nsw i32 %81, 16
  %83 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %84 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %22, i64 0, i64 0
  %85 = call i32 @aes_cbc_decrypt(ptr noundef %79, ptr noundef %80, i32 noundef %82, ptr noundef %83, ptr noundef %84)
  %86 = call i64 @read_tsc()
  %87 = uitofp i64 %86 to double
  %88 = load double, ptr %14, align 8, !tbaa !11
  %89 = fsub double %87, %88
  store double %89, ptr %14, align 8, !tbaa !11
  %90 = load double, ptr %14, align 8, !tbaa !11
  %91 = load double, ptr %15, align 8, !tbaa !11
  %92 = fadd double %91, %90
  store double %92, ptr %15, align 8, !tbaa !11
  %93 = load double, ptr %14, align 8, !tbaa !11
  %94 = load double, ptr %14, align 8, !tbaa !11
  %95 = load double, ptr %16, align 8, !tbaa !11
  %96 = call double @llvm.fmuladd.f64(double %93, double %94, double %95)
  store double %96, ptr %16, align 8, !tbaa !11
  %97 = getelementptr inbounds [160000 x i8], ptr %18, i64 0, i64 0
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = mul nsw i32 %98, 16
  %100 = getelementptr inbounds [16 x i8], ptr %19, i64 0, i64 0
  %101 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %22, i64 0, i64 0
  call void @CBCdec(ptr noundef %97, i32 noundef %99, ptr noundef %100, ptr noundef %101)
  %102 = getelementptr inbounds [160000 x i8], ptr %20, i64 0, i64 0
  %103 = getelementptr inbounds [160000 x i8], ptr %18, i64 0, i64 0
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = mul nsw i32 %104, 16
  %106 = sext i32 %105 to i64
  %107 = call i32 @memcmp(ptr noundef %102, ptr noundef %103, i64 noundef %106) #10
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %110

109:                                              ; preds = %76
  br label %259

110:                                              ; preds = %76
  %111 = getelementptr inbounds [16 x i8], ptr %19, i64 0, i64 0
  %112 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %113 = call i32 @memcmp(ptr noundef %111, ptr noundef %112, i64 noundef 16) #10
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %116

115:                                              ; preds = %110
  br label %261

116:                                              ; preds = %110
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %10, align 4, !tbaa !5
  br label %73, !llvm.loop !13

120:                                              ; preds = %73
  %121 = load double, ptr %15, align 8, !tbaa !11
  %122 = fdiv double %121, 1.000000e+03
  store double %122, ptr %15, align 8, !tbaa !11
  %123 = load double, ptr %16, align 8, !tbaa !11
  %124 = load double, ptr %15, align 8, !tbaa !11
  %125 = load double, ptr %15, align 8, !tbaa !11
  %126 = fmul double %124, %125
  %127 = fneg double %126
  %128 = call double @llvm.fmuladd.f64(double %127, double 1.000000e+03, double %123)
  %129 = fdiv double %128, 1.000000e+03
  %130 = call double @sqrt(double noundef %129) #9
  store double %130, ptr %16, align 8, !tbaa !11
  %131 = load double, ptr %16, align 8, !tbaa !11
  %132 = load double, ptr %15, align 8, !tbaa !11
  %133 = fmul double 5.000000e-02, %132
  %134 = fcmp olt double %131, %133
  br i1 %134, label %135, label %138

135:                                              ; preds = %120
  %136 = load double, ptr %15, align 8, !tbaa !11
  %137 = fmul double 5.000000e-02, %136
  br label %140

138:                                              ; preds = %120
  %139 = load double, ptr %16, align 8, !tbaa !11
  br label %140

140:                                              ; preds = %138, %135
  %141 = phi double [ %137, %135 ], [ %139, %138 ]
  store double %141, ptr %16, align 8, !tbaa !11
  %142 = load ptr, ptr %9, align 8, !tbaa !9
  store double 0.000000e+00, ptr %142, align 8, !tbaa !11
  %143 = load ptr, ptr %8, align 8, !tbaa !9
  store double 0.000000e+00, ptr %143, align 8, !tbaa !11
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %205, %140
  %145 = load i32, ptr %10, align 4, !tbaa !5
  %146 = icmp slt i32 %145, 10000
  br i1 %146, label %147, label %208

147:                                              ; preds = %144
  %148 = call i64 @read_tsc()
  %149 = uitofp i64 %148 to double
  store double %149, ptr %14, align 8, !tbaa !11
  %150 = getelementptr inbounds [160000 x i8], ptr %20, i64 0, i64 0
  %151 = getelementptr inbounds [160000 x i8], ptr %20, i64 0, i64 0
  %152 = load i32, ptr %7, align 4, !tbaa !5
  %153 = mul nsw i32 %152, 16
  %154 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %155 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %22, i64 0, i64 0
  %156 = call i32 @aes_cbc_decrypt(ptr noundef %150, ptr noundef %151, i32 noundef %153, ptr noundef %154, ptr noundef %155)
  %157 = call i64 @read_tsc()
  %158 = uitofp i64 %157 to double
  %159 = load double, ptr %14, align 8, !tbaa !11
  %160 = fsub double %158, %159
  store double %160, ptr %14, align 8, !tbaa !11
  %161 = load double, ptr %14, align 8, !tbaa !11
  %162 = load double, ptr %15, align 8, !tbaa !11
  %163 = load double, ptr %16, align 8, !tbaa !11
  %164 = fsub double %162, %163
  %165 = fcmp ogt double %161, %164
  br i1 %165, label %166, label %184

166:                                              ; preds = %147
  %167 = load double, ptr %14, align 8, !tbaa !11
  %168 = load double, ptr %15, align 8, !tbaa !11
  %169 = load double, ptr %16, align 8, !tbaa !11
  %170 = fadd double %168, %169
  %171 = fcmp olt double %167, %170
  br i1 %171, label %172, label %184

172:                                              ; preds = %166
  %173 = load double, ptr %14, align 8, !tbaa !11
  %174 = load ptr, ptr %8, align 8, !tbaa !9
  %175 = load double, ptr %174, align 8, !tbaa !11
  %176 = fadd double %175, %173
  store double %176, ptr %174, align 8, !tbaa !11
  %177 = load double, ptr %14, align 8, !tbaa !11
  %178 = load double, ptr %14, align 8, !tbaa !11
  %179 = load ptr, ptr %9, align 8, !tbaa !9
  %180 = load double, ptr %179, align 8, !tbaa !11
  %181 = call double @llvm.fmuladd.f64(double %177, double %178, double %180)
  store double %181, ptr %179, align 8, !tbaa !11
  %182 = load i32, ptr %13, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %13, align 4, !tbaa !5
  br label %184

184:                                              ; preds = %172, %166, %147
  %185 = getelementptr inbounds [160000 x i8], ptr %18, i64 0, i64 0
  %186 = load i32, ptr %7, align 4, !tbaa !5
  %187 = mul nsw i32 %186, 16
  %188 = getelementptr inbounds [16 x i8], ptr %19, i64 0, i64 0
  %189 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %22, i64 0, i64 0
  call void @CBCdec(ptr noundef %185, i32 noundef %187, ptr noundef %188, ptr noundef %189)
  %190 = getelementptr inbounds [160000 x i8], ptr %20, i64 0, i64 0
  %191 = getelementptr inbounds [160000 x i8], ptr %18, i64 0, i64 0
  %192 = load i32, ptr %7, align 4, !tbaa !5
  %193 = mul nsw i32 %192, 16
  %194 = sext i32 %193 to i64
  %195 = call i32 @memcmp(ptr noundef %190, ptr noundef %191, i64 noundef %194) #10
  %196 = icmp ne i32 %195, 0
  br i1 %196, label %197, label %198

197:                                              ; preds = %184
  br label %259

198:                                              ; preds = %184
  %199 = getelementptr inbounds [16 x i8], ptr %19, i64 0, i64 0
  %200 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %201 = call i32 @memcmp(ptr noundef %199, ptr noundef %200, i64 noundef 16) #10
  %202 = icmp ne i32 %201, 0
  br i1 %202, label %203, label %204

203:                                              ; preds = %198
  br label %261

204:                                              ; preds = %198
  br label %205

205:                                              ; preds = %204
  %206 = load i32, ptr %10, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %10, align 4, !tbaa !5
  br label %144, !llvm.loop !15

208:                                              ; preds = %144
  %209 = load i32, ptr %13, align 4, !tbaa !5
  %210 = mul nsw i32 10, %209
  %211 = icmp sgt i32 %210, 90000
  br i1 %211, label %212, label %245

212:                                              ; preds = %208
  %213 = load i32, ptr %13, align 4, !tbaa !5
  %214 = sitofp i32 %213 to double
  %215 = load ptr, ptr %8, align 8, !tbaa !9
  %216 = load double, ptr %215, align 8, !tbaa !11
  %217 = fdiv double %216, %214
  store double %217, ptr %215, align 8, !tbaa !11
  %218 = load ptr, ptr %9, align 8, !tbaa !9
  %219 = load double, ptr %218, align 8, !tbaa !11
  %220 = load ptr, ptr %8, align 8, !tbaa !9
  %221 = load double, ptr %220, align 8, !tbaa !11
  %222 = load ptr, ptr %8, align 8, !tbaa !9
  %223 = load double, ptr %222, align 8, !tbaa !11
  %224 = fmul double %221, %223
  %225 = load i32, ptr %13, align 4, !tbaa !5
  %226 = sitofp i32 %225 to double
  %227 = fneg double %224
  %228 = call double @llvm.fmuladd.f64(double %227, double %226, double %219)
  %229 = load i32, ptr %13, align 4, !tbaa !5
  %230 = sitofp i32 %229 to double
  %231 = fdiv double %228, %230
  %232 = call double @sqrt(double noundef %231) #9
  %233 = load ptr, ptr %9, align 8, !tbaa !9
  store double %232, ptr %233, align 8, !tbaa !11
  %234 = load ptr, ptr %9, align 8, !tbaa !9
  %235 = load double, ptr %234, align 8, !tbaa !11
  %236 = load i32, ptr %11, align 4, !tbaa !5
  %237 = sitofp i32 %236 to double
  %238 = fdiv double %237, 1.000000e+02
  %239 = load ptr, ptr %8, align 8, !tbaa !9
  %240 = load double, ptr %239, align 8, !tbaa !11
  %241 = fmul double %238, %240
  %242 = fcmp ogt double %235, %241
  br i1 %242, label %243, label %244

243:                                              ; preds = %212
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %244

244:                                              ; preds = %243, %212
  br label %257

245:                                              ; preds = %208
  %246 = load i32, ptr %12, align 4, !tbaa !5
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %12, align 4, !tbaa !5
  %248 = icmp eq i32 %246, 10
  br i1 %248, label %249, label %256

249:                                              ; preds = %245
  store i32 0, ptr %12, align 4, !tbaa !5
  %250 = load i32, ptr %11, align 4, !tbaa !5
  %251 = add nsw i32 %250, 5
  store i32 %251, ptr %11, align 4, !tbaa !5
  %252 = load i32, ptr %11, align 4, !tbaa !5
  %253 = icmp sgt i32 %252, 30
  br i1 %253, label %254, label %255

254:                                              ; preds = %249
  store i32 0, ptr %5, align 4
  store i32 1, ptr %23, align 4
  br label %263

255:                                              ; preds = %249
  br label %256

256:                                              ; preds = %255, %245
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %257

257:                                              ; preds = %256, %244
  br label %68, !llvm.loop !16

258:                                              ; preds = %68
  store i32 1, ptr %5, align 4
  store i32 1, ptr %23, align 4
  br label %263

259:                                              ; preds = %197, %109, %60
  %260 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void @exit(i32 noundef 1) #11
  unreachable

261:                                              ; preds = %203, %115, %66
  %262 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  call void @exit(i32 noundef 1) #11
  unreachable

263:                                              ; preds = %258, %254
  call void @llvm.lifetime.end.p0(i64 256, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 160000, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 160000, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  %264 = load i32, ptr %5, align 4
  ret i32 %264
}

declare i32 @aes_cbc_decrypt(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { "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 willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; 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.aes_crypt_ctx = type { [60 x i32], %union.aes_inf, [12 x i8] }
%union.aes_inf = type { i32 }

@.str.3 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1

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

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

; Function Attrs: 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) #1

; Function Attrs: nounwind uwtable
declare dso_local void @CBCdec(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @read_tsc() local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #5

declare void @block_rndfill(ptr noundef, i64 noundef) local_unnamed_addr #6

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

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

declare i32 @aes_decrypt_key(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @time_cbc_dec(i32 noundef %0, i32 noundef %1, ptr nocapture noundef %2, ptr nocapture noundef %3) local_unnamed_addr #2 {
  %5 = alloca [32 x i8], align 16
  %6 = alloca [160000 x i8], align 16
  %7 = alloca [16 x i8], align 16
  %8 = alloca [160000 x i8], align 16
  %9 = alloca [16 x i8], align 16
  %10 = alloca [1 x %struct.aes_crypt_ctx], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #10
  call void @llvm.lifetime.start.p0(i64 160000, ptr nonnull %6) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #10
  call void @llvm.lifetime.start.p0(i64 160000, ptr nonnull %8) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #10
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %10) #10
  call void @block_rndfill(ptr noundef nonnull %5, i64 noundef 32) #10
  %11 = call i32 @aes_decrypt_key(ptr noundef nonnull %5, i32 noundef %0, ptr noundef nonnull %10) #10
  call void @block_rndfill(ptr noundef nonnull %9, i64 noundef 16) #10
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull align 16 dereferenceable(16) %9, i64 16, i1 false)
  %12 = shl nsw i32 %1, 4
  %13 = sext i32 %12 to i64
  call void @block_rndfill(ptr noundef nonnull %8, i64 noundef %13) #10
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %6, ptr nonnull align 16 %8, i64 %13, i1 false)
  %14 = call i32 @aes_cbc_decrypt(ptr noundef nonnull %8, ptr noundef nonnull %8, i32 noundef %12, ptr noundef nonnull %9, ptr noundef nonnull %10) #10
  call void @CBCdec(ptr noundef nonnull %6, i32 noundef %12, ptr noundef nonnull %7, ptr noundef nonnull %10)
  %bcmp = call i32 @bcmp(ptr nonnull %8, ptr nonnull %6, i64 %13)
  %.not = icmp eq i32 %bcmp, 0
  br i1 %.not, label %15, label %.loopexit

15:                                               ; preds = %4
  %bcmp74 = call i32 @bcmp(ptr noundef nonnull dereferenceable(16) %7, ptr noundef nonnull dereferenceable(16) %9, i64 16)
  %.not75 = icmp eq i32 %bcmp74, 0
  br i1 %.not75, label %.preheader.outer.outer, label %.loopexit86

.preheader.outer.outer:                           ; preds = %15, %79
  %.066101.ph.ph = phi i32 [ %80, %79 ], [ 10, %15 ]
  %16 = uitofp nneg i32 %.066101.ph.ph to double
  %17 = fdiv double %16, 1.000000e+02
  br label %.preheader.outer

.preheader.outer:                                 ; preds = %.preheader.outer.outer, %76
  %.063102.ph = phi i32 [ %77, %76 ], [ 0, %.preheader.outer.outer ]
  br label %.preheader

.preheader:                                       ; preds = %.preheader.outer, %63
  br label %20

18:                                               ; preds = %29
  %19 = add nuw nsw i32 %.06996, 1
  %exitcond.not = icmp eq i32 %19, 1000
  br i1 %exitcond.not, label %30, label %20, !llvm.loop !5

20:                                               ; preds = %.preheader, %18
  %.098 = phi double [ 0.000000e+00, %.preheader ], [ %28, %18 ]
  %.06197 = phi double [ 0.000000e+00, %.preheader ], [ %27, %18 ]
  %.06996 = phi i32 [ 0, %.preheader ], [ %19, %18 ]
  %21 = call i64 @read_tsc()
  %22 = uitofp i64 %21 to double
  %23 = call i32 @aes_cbc_decrypt(ptr noundef nonnull %8, ptr noundef nonnull %8, i32 noundef %12, ptr noundef nonnull %9, ptr noundef nonnull %10) #10
  %24 = call i64 @read_tsc()
  %25 = uitofp i64 %24 to double
  %26 = fsub double %25, %22
  %27 = fadd double %.06197, %26
  %28 = call double @llvm.fmuladd.f64(double %26, double %26, double %.098)
  call void @CBCdec(ptr noundef nonnull %6, i32 noundef %12, ptr noundef nonnull %7, ptr noundef nonnull %10)
  %bcmp81 = call i32 @bcmp(ptr nonnull %8, ptr nonnull %6, i64 %13)
  %.not82 = icmp eq i32 %bcmp81, 0
  br i1 %.not82, label %29, label %.loopexit

29:                                               ; preds = %20
  %bcmp83 = call i32 @bcmp(ptr noundef nonnull dereferenceable(16) %7, ptr noundef nonnull dereferenceable(16) %9, i64 16)
  %.not84 = icmp eq i32 %bcmp83, 0
  br i1 %.not84, label %18, label %.loopexit86

30:                                               ; preds = %18
  %31 = fdiv double %27, 1.000000e+03
  %32 = fneg double %31
  %33 = fmul double %31, %32
  %34 = call double @llvm.fmuladd.f64(double %33, double 1.000000e+03, double %28)
  %35 = fdiv double %34, 1.000000e+03
  %36 = call double @sqrt(double noundef %35) #10
  %37 = fmul double %31, 5.000000e-02
  %38 = fcmp olt double %36, %37
  %39 = select i1 %38, double %37, double %36
  store double 0.000000e+00, ptr %3, align 8, !tbaa !7
  store double 0.000000e+00, ptr %2, align 8, !tbaa !7
  %40 = fsub double %31, %39
  %41 = fadd double %31, %39
  br label %44

42:                                               ; preds = %60
  %43 = add nuw nsw i32 %.17099, 1
  %exitcond113.not = icmp eq i32 %43, 10000
  br i1 %exitcond113.not, label %61, label %44, !llvm.loop !11

44:                                               ; preds = %30, %42
  %.1100 = phi i32 [ 0, %30 ], [ %.2, %42 ]
  %.17099 = phi i32 [ 0, %30 ], [ %43, %42 ]
  %45 = call i64 @read_tsc()
  %46 = uitofp i64 %45 to double
  %47 = call i32 @aes_cbc_decrypt(ptr noundef nonnull %8, ptr noundef nonnull %8, i32 noundef %12, ptr noundef nonnull %9, ptr noundef nonnull %10) #10
  %48 = call i64 @read_tsc()
  %49 = uitofp i64 %48 to double
  %50 = fsub double %49, %46
  %51 = fcmp ogt double %50, %40
  %52 = fcmp olt double %50, %41
  %or.cond = and i1 %51, %52
  br i1 %or.cond, label %53, label %59

53:                                               ; preds = %44
  %54 = load double, ptr %2, align 8, !tbaa !7
  %55 = fadd double %50, %54
  store double %55, ptr %2, align 8, !tbaa !7
  %56 = load double, ptr %3, align 8, !tbaa !7
  %57 = call double @llvm.fmuladd.f64(double %50, double %50, double %56)
  store double %57, ptr %3, align 8, !tbaa !7
  %58 = add nsw i32 %.1100, 1
  br label %59

59:                                               ; preds = %53, %44
  %.2 = phi i32 [ %58, %53 ], [ %.1100, %44 ]
  call void @CBCdec(ptr noundef nonnull %6, i32 noundef %12, ptr noundef nonnull %7, ptr noundef nonnull %10)
  %bcmp77 = call i32 @bcmp(ptr nonnull %8, ptr nonnull %6, i64 %13)
  %.not78 = icmp eq i32 %bcmp77, 0
  br i1 %.not78, label %60, label %.loopexit

60:                                               ; preds = %59
  %bcmp79 = call i32 @bcmp(ptr noundef nonnull dereferenceable(16) %7, ptr noundef nonnull dereferenceable(16) %9, i64 16)
  %.not80 = icmp eq i32 %bcmp79, 0
  br i1 %.not80, label %42, label %.loopexit86

61:                                               ; preds = %42
  %62 = icmp sgt i32 %.2, 9000
  br i1 %62, label %63, label %76

63:                                               ; preds = %61
  %64 = uitofp nneg i32 %.2 to double
  %65 = load double, ptr %2, align 8, !tbaa !7
  %66 = fdiv double %65, %64
  store double %66, ptr %2, align 8, !tbaa !7
  %67 = load double, ptr %3, align 8, !tbaa !7
  %68 = fneg double %66
  %69 = fmul double %66, %68
  %70 = call double @llvm.fmuladd.f64(double %69, double %64, double %67)
  %71 = fdiv double %70, %64
  %72 = call double @sqrt(double noundef %71) #10
  store double %72, ptr %3, align 8, !tbaa !7
  %73 = load double, ptr %2, align 8, !tbaa !7
  %74 = fmul double %17, %73
  %75 = fcmp ogt double %72, %74
  br i1 %75, label %.preheader, label %.thread, !llvm.loop !12

76:                                               ; preds = %61
  %77 = add nuw nsw i32 %.063102.ph, 1
  %78 = icmp eq i32 %.063102.ph, 10
  br i1 %78, label %79, label %.preheader.outer, !llvm.loop !12

79:                                               ; preds = %76
  %80 = add nuw nsw i32 %.066101.ph.ph, 5
  %81 = icmp ugt i32 %.066101.ph.ph, 25
  br i1 %81, label %.thread, label %.preheader.outer.outer, !llvm.loop !12

.loopexit:                                        ; preds = %20, %59, %4
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @exit(i32 noundef 1) #11
  unreachable

.loopexit86:                                      ; preds = %29, %60, %15
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @exit(i32 noundef 1) #11
  unreachable

.thread:                                          ; preds = %79, %63
  %.071 = phi i32 [ 1, %63 ], [ 0, %79 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %10) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #10
  call void @llvm.lifetime.end.p0(i64 160000, ptr nonnull %8) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 160000, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #10
  ret i32 %.071
}

declare i32 @aes_cbc_decrypt(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #9

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { mustprogress nofree nounwind willreturn memory(write) "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 = { "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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { nofree nounwind willreturn memory(argmem: read) }
attributes #10 = { nounwind }
attributes #11 = { noreturn nounwind }

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

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


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