; 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.11 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 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 @CTRcry(ptr noundef, i32 noundef, ptr 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

declare i32 @aes_encrypt_key(ptr noundef, i32 noundef, ptr 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

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

64:                                               ; preds = %5
  br label %267

65:                                               ; preds = %5
  %66 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %67 = getelementptr inbounds [16 x i8], ptr %23, i64 0, i64 0
  %68 = call i32 @memcmp(ptr noundef %66, ptr noundef %67, i64 noundef 16) #10
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %71

70:                                               ; preds = %65
  br label %269

71:                                               ; preds = %65
  store i32 10, ptr %13, align 4, !tbaa !5
  store i32 0, ptr %15, align 4, !tbaa !5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %265, %71
  %73 = load i32, ptr %15, align 4, !tbaa !5
  %74 = icmp ne i32 %73, 0
  %75 = xor i1 %74, true
  br i1 %75, label %76, label %266

76:                                               ; preds = %72
  store double 0.000000e+00, ptr %18, align 8, !tbaa !11
  store double 0.000000e+00, ptr %17, align 8, !tbaa !11
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %123, %76
  %78 = load i32, ptr %12, align 4, !tbaa !5
  %79 = icmp slt i32 %78, 1000
  br i1 %79, label %80, label %126

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

115:                                              ; preds = %80
  br label %267

116:                                              ; preds = %80
  %117 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %118 = getelementptr inbounds [16 x i8], ptr %23, i64 0, i64 0
  %119 = call i32 @memcmp(ptr noundef %117, ptr noundef %118, i64 noundef 16) #10
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %122

121:                                              ; preds = %116
  br label %269

122:                                              ; preds = %116
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %12, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %12, align 4, !tbaa !5
  br label %77, !llvm.loop !13

126:                                              ; preds = %77
  %127 = load double, ptr %17, align 8, !tbaa !11
  %128 = fdiv double %127, 1.000000e+03
  store double %128, ptr %17, align 8, !tbaa !11
  %129 = load double, ptr %18, align 8, !tbaa !11
  %130 = load double, ptr %17, align 8, !tbaa !11
  %131 = load double, ptr %17, align 8, !tbaa !11
  %132 = fmul double %130, %131
  %133 = fneg double %132
  %134 = call double @llvm.fmuladd.f64(double %133, double 1.000000e+03, double %129)
  %135 = fdiv double %134, 1.000000e+03
  %136 = call double @sqrt(double noundef %135) #9
  store double %136, ptr %18, align 8, !tbaa !11
  %137 = load double, ptr %18, align 8, !tbaa !11
  %138 = load double, ptr %17, align 8, !tbaa !11
  %139 = fmul double 5.000000e-02, %138
  %140 = fcmp olt double %137, %139
  br i1 %140, label %141, label %144

141:                                              ; preds = %126
  %142 = load double, ptr %17, align 8, !tbaa !11
  %143 = fmul double 5.000000e-02, %142
  br label %146

144:                                              ; preds = %126
  %145 = load double, ptr %18, align 8, !tbaa !11
  br label %146

146:                                              ; preds = %144, %141
  %147 = phi double [ %143, %141 ], [ %145, %144 ]
  store double %147, ptr %18, align 8, !tbaa !11
  %148 = load ptr, ptr %11, align 8, !tbaa !9
  store double 0.000000e+00, ptr %148, align 8, !tbaa !11
  %149 = load ptr, ptr %10, align 8, !tbaa !9
  store double 0.000000e+00, ptr %149, align 8, !tbaa !11
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %213, %146
  %151 = load i32, ptr %12, align 4, !tbaa !5
  %152 = icmp slt i32 %151, 10000
  br i1 %152, label %153, label %216

153:                                              ; preds = %150
  %154 = call i64 @read_tsc()
  %155 = uitofp i64 %154 to double
  store double %155, ptr %16, align 8, !tbaa !11
  %156 = getelementptr inbounds [160000 x i8], ptr %22, i64 0, i64 0
  %157 = getelementptr inbounds [160000 x i8], ptr %22, i64 0, i64 0
  %158 = load i32, ptr %8, align 4, !tbaa !5
  %159 = mul nsw i32 %158, 16
  %160 = getelementptr inbounds [16 x i8], ptr %23, i64 0, i64 0
  %161 = load ptr, ptr %9, align 8, !tbaa !9
  %162 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %24, i64 0, i64 0
  %163 = call i32 @aes_ctr_crypt(ptr noundef %156, ptr noundef %157, i32 noundef %159, ptr noundef %160, ptr noundef %161, ptr noundef %162)
  %164 = call i64 @read_tsc()
  %165 = uitofp i64 %164 to double
  %166 = load double, ptr %16, align 8, !tbaa !11
  %167 = fsub double %165, %166
  store double %167, ptr %16, align 8, !tbaa !11
  %168 = load double, ptr %16, align 8, !tbaa !11
  %169 = load double, ptr %17, align 8, !tbaa !11
  %170 = load double, ptr %18, align 8, !tbaa !11
  %171 = fsub double %169, %170
  %172 = fcmp ogt double %168, %171
  br i1 %172, label %173, label %191

173:                                              ; preds = %153
  %174 = load double, ptr %16, align 8, !tbaa !11
  %175 = load double, ptr %17, align 8, !tbaa !11
  %176 = load double, ptr %18, align 8, !tbaa !11
  %177 = fadd double %175, %176
  %178 = fcmp olt double %174, %177
  br i1 %178, label %179, label %191

179:                                              ; preds = %173
  %180 = load double, ptr %16, align 8, !tbaa !11
  %181 = load ptr, ptr %10, align 8, !tbaa !9
  %182 = load double, ptr %181, align 8, !tbaa !11
  %183 = fadd double %182, %180
  store double %183, ptr %181, align 8, !tbaa !11
  %184 = load double, ptr %16, align 8, !tbaa !11
  %185 = load double, ptr %16, align 8, !tbaa !11
  %186 = load ptr, ptr %11, align 8, !tbaa !9
  %187 = load double, ptr %186, align 8, !tbaa !11
  %188 = call double @llvm.fmuladd.f64(double %184, double %185, double %187)
  store double %188, ptr %186, align 8, !tbaa !11
  %189 = load i32, ptr %15, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %15, align 4, !tbaa !5
  br label %191

191:                                              ; preds = %179, %173, %153
  %192 = getelementptr inbounds [160000 x i8], ptr %20, i64 0, i64 0
  %193 = load i32, ptr %8, align 4, !tbaa !5
  %194 = mul nsw i32 %193, 16
  %195 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %196 = load ptr, ptr %9, align 8, !tbaa !9
  %197 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %24, i64 0, i64 0
  call void @CTRcry(ptr noundef %192, i32 noundef %194, ptr noundef %195, ptr noundef %196, ptr noundef %197)
  %198 = getelementptr inbounds [160000 x i8], ptr %22, i64 0, i64 0
  %199 = getelementptr inbounds [160000 x i8], ptr %20, i64 0, i64 0
  %200 = load i32, ptr %8, align 4, !tbaa !5
  %201 = mul nsw i32 %200, 16
  %202 = sext i32 %201 to i64
  %203 = call i32 @memcmp(ptr noundef %198, ptr noundef %199, i64 noundef %202) #10
  %204 = icmp ne i32 %203, 0
  br i1 %204, label %205, label %206

205:                                              ; preds = %191
  br label %267

206:                                              ; preds = %191
  %207 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %208 = getelementptr inbounds [16 x i8], ptr %23, i64 0, i64 0
  %209 = call i32 @memcmp(ptr noundef %207, ptr noundef %208, i64 noundef 16) #10
  %210 = icmp ne i32 %209, 0
  br i1 %210, label %211, label %212

211:                                              ; preds = %206
  br label %269

212:                                              ; preds = %206
  br label %213

213:                                              ; preds = %212
  %214 = load i32, ptr %12, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %12, align 4, !tbaa !5
  br label %150, !llvm.loop !15

216:                                              ; preds = %150
  %217 = load i32, ptr %15, align 4, !tbaa !5
  %218 = mul nsw i32 10, %217
  %219 = icmp sgt i32 %218, 90000
  br i1 %219, label %220, label %253

220:                                              ; preds = %216
  %221 = load i32, ptr %15, align 4, !tbaa !5
  %222 = sitofp i32 %221 to double
  %223 = load ptr, ptr %10, align 8, !tbaa !9
  %224 = load double, ptr %223, align 8, !tbaa !11
  %225 = fdiv double %224, %222
  store double %225, ptr %223, align 8, !tbaa !11
  %226 = load ptr, ptr %11, align 8, !tbaa !9
  %227 = load double, ptr %226, align 8, !tbaa !11
  %228 = load ptr, ptr %10, align 8, !tbaa !9
  %229 = load double, ptr %228, align 8, !tbaa !11
  %230 = load ptr, ptr %10, align 8, !tbaa !9
  %231 = load double, ptr %230, align 8, !tbaa !11
  %232 = fmul double %229, %231
  %233 = load i32, ptr %15, align 4, !tbaa !5
  %234 = sitofp i32 %233 to double
  %235 = fneg double %232
  %236 = call double @llvm.fmuladd.f64(double %235, double %234, double %227)
  %237 = load i32, ptr %15, align 4, !tbaa !5
  %238 = sitofp i32 %237 to double
  %239 = fdiv double %236, %238
  %240 = call double @sqrt(double noundef %239) #9
  %241 = load ptr, ptr %11, align 8, !tbaa !9
  store double %240, ptr %241, align 8, !tbaa !11
  %242 = load ptr, ptr %11, align 8, !tbaa !9
  %243 = load double, ptr %242, align 8, !tbaa !11
  %244 = load i32, ptr %13, align 4, !tbaa !5
  %245 = sitofp i32 %244 to double
  %246 = fdiv double %245, 1.000000e+02
  %247 = load ptr, ptr %10, align 8, !tbaa !9
  %248 = load double, ptr %247, align 8, !tbaa !11
  %249 = fmul double %246, %248
  %250 = fcmp ogt double %243, %249
  br i1 %250, label %251, label %252

251:                                              ; preds = %220
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %252

252:                                              ; preds = %251, %220
  br label %265

253:                                              ; preds = %216
  %254 = load i32, ptr %14, align 4, !tbaa !5
  %255 = add nsw i32 %254, 1
  store i32 %255, ptr %14, align 4, !tbaa !5
  %256 = icmp eq i32 %254, 10
  br i1 %256, label %257, label %264

257:                                              ; preds = %253
  store i32 0, ptr %14, align 4, !tbaa !5
  %258 = load i32, ptr %13, align 4, !tbaa !5
  %259 = add nsw i32 %258, 5
  store i32 %259, ptr %13, align 4, !tbaa !5
  %260 = load i32, ptr %13, align 4, !tbaa !5
  %261 = icmp sgt i32 %260, 30
  br i1 %261, label %262, label %263

262:                                              ; preds = %257
  store i32 0, ptr %6, align 4
  store i32 1, ptr %25, align 4
  br label %271

263:                                              ; preds = %257
  br label %264

264:                                              ; preds = %263, %253
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %265

265:                                              ; preds = %264, %252
  br label %72, !llvm.loop !16

266:                                              ; preds = %72
  store i32 1, ptr %6, align 4
  store i32 1, ptr %25, align 4
  br label %271

267:                                              ; preds = %205, %115, %64
  %268 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  call void @exit(i32 noundef 1) #11
  unreachable

269:                                              ; preds = %211, %121, %70
  %270 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  call void @exit(i32 noundef 1) #11
  unreachable

271:                                              ; preds = %266, %262
  call void @llvm.lifetime.end.p0(i64 256, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 160000, 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 32, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, 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
  %272 = load i32, ptr %6, align 4
  ret i32 %272
}

declare i32 @aes_ctr_crypt(ptr noundef, ptr noundef, i32 noundef, ptr 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.11 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 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 @CTRcry(ptr noundef, i32 noundef, ptr 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

declare i32 @aes_encrypt_key(ptr noundef, i32 noundef, ptr 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

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

16:                                               ; preds = %5
  %bcmp80 = call i32 @bcmp(ptr noundef nonnull dereferenceable(16) %8, ptr noundef nonnull dereferenceable(16) %10, i64 16)
  %.not81 = icmp eq i32 %bcmp80, 0
  br i1 %.not81, label %.preheader.outer.outer, label %.loopexit92

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

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

.preheader:                                       ; preds = %.preheader.outer, %64
  br label %21

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

21:                                               ; preds = %.preheader, %19
  %.0104 = phi double [ 0.000000e+00, %.preheader ], [ %29, %19 ]
  %.067103 = phi double [ 0.000000e+00, %.preheader ], [ %28, %19 ]
  %.075102 = phi i32 [ 0, %.preheader ], [ %20, %19 ]
  %22 = call i64 @read_tsc()
  %23 = uitofp i64 %22 to double
  %24 = call i32 @aes_ctr_crypt(ptr noundef nonnull %9, ptr noundef nonnull %9, i32 noundef %13, ptr noundef nonnull %10, ptr noundef %2, ptr noundef nonnull %11) #10
  %25 = call i64 @read_tsc()
  %26 = uitofp i64 %25 to double
  %27 = fsub double %26, %23
  %28 = fadd double %.067103, %27
  %29 = call double @llvm.fmuladd.f64(double %27, double %27, double %.0104)
  call void @CTRcry(ptr noundef nonnull %7, i32 noundef %13, ptr noundef nonnull %8, ptr noundef %2, ptr noundef nonnull %11)
  %bcmp87 = call i32 @bcmp(ptr nonnull %9, ptr nonnull %7, i64 %14)
  %.not88 = icmp eq i32 %bcmp87, 0
  br i1 %.not88, label %30, label %.loopexit

30:                                               ; preds = %21
  %bcmp89 = call i32 @bcmp(ptr noundef nonnull dereferenceable(16) %8, ptr noundef nonnull dereferenceable(16) %10, i64 16)
  %.not90 = icmp eq i32 %bcmp89, 0
  br i1 %.not90, label %19, label %.loopexit92

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

43:                                               ; preds = %61
  %44 = add nuw nsw i32 %.176105, 1
  %exitcond119.not = icmp eq i32 %44, 10000
  br i1 %exitcond119.not, label %62, label %45, !llvm.loop !11

45:                                               ; preds = %31, %43
  %.1106 = phi i32 [ 0, %31 ], [ %.2, %43 ]
  %.176105 = phi i32 [ 0, %31 ], [ %44, %43 ]
  %46 = call i64 @read_tsc()
  %47 = uitofp i64 %46 to double
  %48 = call i32 @aes_ctr_crypt(ptr noundef nonnull %9, ptr noundef nonnull %9, i32 noundef %13, ptr noundef nonnull %10, ptr noundef %2, ptr noundef nonnull %11) #10
  %49 = call i64 @read_tsc()
  %50 = uitofp i64 %49 to double
  %51 = fsub double %50, %47
  %52 = fcmp ogt double %51, %41
  %53 = fcmp olt double %51, %42
  %or.cond = and i1 %52, %53
  br i1 %or.cond, label %54, label %60

54:                                               ; preds = %45
  %55 = load double, ptr %3, align 8, !tbaa !7
  %56 = fadd double %51, %55
  store double %56, ptr %3, align 8, !tbaa !7
  %57 = load double, ptr %4, align 8, !tbaa !7
  %58 = call double @llvm.fmuladd.f64(double %51, double %51, double %57)
  store double %58, ptr %4, align 8, !tbaa !7
  %59 = add nsw i32 %.1106, 1
  br label %60

60:                                               ; preds = %54, %45
  %.2 = phi i32 [ %59, %54 ], [ %.1106, %45 ]
  call void @CTRcry(ptr noundef nonnull %7, i32 noundef %13, ptr noundef nonnull %8, ptr noundef %2, ptr noundef nonnull %11)
  %bcmp83 = call i32 @bcmp(ptr nonnull %9, ptr nonnull %7, i64 %14)
  %.not84 = icmp eq i32 %bcmp83, 0
  br i1 %.not84, label %61, label %.loopexit

61:                                               ; preds = %60
  %bcmp85 = call i32 @bcmp(ptr noundef nonnull dereferenceable(16) %8, ptr noundef nonnull dereferenceable(16) %10, i64 16)
  %.not86 = icmp eq i32 %bcmp85, 0
  br i1 %.not86, label %43, label %.loopexit92

62:                                               ; preds = %43
  %63 = icmp sgt i32 %.2, 9000
  br i1 %63, label %64, label %77

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

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

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

.loopexit:                                        ; preds = %21, %60, %5
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  call void @exit(i32 noundef 1) #11
  unreachable

.loopexit92:                                      ; preds = %30, %61, %16
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  call void @exit(i32 noundef 1) #11
  unreachable

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

declare i32 @aes_ctr_crypt(ptr noundef, ptr noundef, i32 noundef, ptr 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