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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @time_dks8(i32 noundef %0, ptr noundef %1, ptr noundef %2) #5 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca [8 x [32 x i8]], align 16
  %16 = alloca [1 x %struct.aes_crypt_ctx], align 16
  %17 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 256, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 256, ptr %16) #6
  %18 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 0
  %19 = getelementptr inbounds [32 x i8], ptr %18, i64 0, i64 0
  call void @block_rndfill(ptr noundef %19, i64 noundef 256)
  store i32 10, ptr %9, align 4, !tbaa !5
  store i32 0, ptr %11, align 4, !tbaa !5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %235, %3
  %21 = load i32, ptr %11, align 4, !tbaa !5
  %22 = icmp ne i32 %21, 0
  %23 = xor i1 %22, true
  br i1 %23, label %24, label %236

24:                                               ; preds = %20
  store double 0.000000e+00, ptr %14, align 8, !tbaa !11
  store double 0.000000e+00, ptr %13, align 8, !tbaa !11
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %82, %24
  %26 = load i32, ptr %8, align 4, !tbaa !5
  %27 = icmp slt i32 %26, 1000
  br i1 %27, label %28, label %85

28:                                               ; preds = %25
  %29 = call i64 @read_tsc()
  %30 = uitofp i64 %29 to double
  store double %30, ptr %12, align 8, !tbaa !11
  %31 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 0
  %32 = getelementptr inbounds [32 x i8], ptr %31, i64 0, i64 0
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %35 = call i32 @aes_decrypt_key(ptr noundef %32, i32 noundef %33, ptr noundef %34)
  %36 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 1
  %37 = getelementptr inbounds [32 x i8], ptr %36, i64 0, i64 0
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %40 = call i32 @aes_decrypt_key(ptr noundef %37, i32 noundef %38, ptr noundef %39)
  %41 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 2
  %42 = getelementptr inbounds [32 x i8], ptr %41, i64 0, i64 0
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %45 = call i32 @aes_decrypt_key(ptr noundef %42, i32 noundef %43, ptr noundef %44)
  %46 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 3
  %47 = getelementptr inbounds [32 x i8], ptr %46, i64 0, i64 0
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %50 = call i32 @aes_decrypt_key(ptr noundef %47, i32 noundef %48, ptr noundef %49)
  %51 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 4
  %52 = getelementptr inbounds [32 x i8], ptr %51, i64 0, i64 0
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %55 = call i32 @aes_decrypt_key(ptr noundef %52, i32 noundef %53, ptr noundef %54)
  %56 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 5
  %57 = getelementptr inbounds [32 x i8], ptr %56, i64 0, i64 0
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %60 = call i32 @aes_decrypt_key(ptr noundef %57, i32 noundef %58, ptr noundef %59)
  %61 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 6
  %62 = getelementptr inbounds [32 x i8], ptr %61, i64 0, i64 0
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %65 = call i32 @aes_decrypt_key(ptr noundef %62, i32 noundef %63, ptr noundef %64)
  %66 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 7
  %67 = getelementptr inbounds [32 x i8], ptr %66, i64 0, i64 0
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %70 = call i32 @aes_decrypt_key(ptr noundef %67, i32 noundef %68, ptr noundef %69)
  %71 = call i64 @read_tsc()
  %72 = uitofp i64 %71 to double
  %73 = load double, ptr %12, align 8, !tbaa !11
  %74 = fsub double %72, %73
  store double %74, ptr %12, align 8, !tbaa !11
  %75 = load double, ptr %12, align 8, !tbaa !11
  %76 = load double, ptr %13, align 8, !tbaa !11
  %77 = fadd double %76, %75
  store double %77, ptr %13, align 8, !tbaa !11
  %78 = load double, ptr %12, align 8, !tbaa !11
  %79 = load double, ptr %12, align 8, !tbaa !11
  %80 = load double, ptr %14, align 8, !tbaa !11
  %81 = call double @llvm.fmuladd.f64(double %78, double %79, double %80)
  store double %81, ptr %14, align 8, !tbaa !11
  br label %82

82:                                               ; preds = %28
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %8, align 4, !tbaa !5
  br label %25, !llvm.loop !13

85:                                               ; preds = %25
  %86 = load double, ptr %13, align 8, !tbaa !11
  %87 = fdiv double %86, 1.000000e+03
  store double %87, ptr %13, align 8, !tbaa !11
  %88 = load double, ptr %14, align 8, !tbaa !11
  %89 = load double, ptr %13, align 8, !tbaa !11
  %90 = load double, ptr %13, align 8, !tbaa !11
  %91 = fmul double %89, %90
  %92 = fneg double %91
  %93 = call double @llvm.fmuladd.f64(double %92, double 1.000000e+03, double %88)
  %94 = fdiv double %93, 1.000000e+03
  %95 = call double @sqrt(double noundef %94) #6
  store double %95, ptr %14, align 8, !tbaa !11
  %96 = load double, ptr %14, align 8, !tbaa !11
  %97 = load double, ptr %13, align 8, !tbaa !11
  %98 = fmul double 5.000000e-02, %97
  %99 = fcmp olt double %96, %98
  br i1 %99, label %100, label %103

100:                                              ; preds = %85
  %101 = load double, ptr %13, align 8, !tbaa !11
  %102 = fmul double 5.000000e-02, %101
  br label %105

103:                                              ; preds = %85
  %104 = load double, ptr %14, align 8, !tbaa !11
  br label %105

105:                                              ; preds = %103, %100
  %106 = phi double [ %102, %100 ], [ %104, %103 ]
  store double %106, ptr %14, align 8, !tbaa !11
  %107 = load ptr, ptr %7, align 8, !tbaa !9
  store double 0.000000e+00, ptr %107, align 8, !tbaa !11
  %108 = load ptr, ptr %6, align 8, !tbaa !9
  store double 0.000000e+00, ptr %108, align 8, !tbaa !11
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %183, %105
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = icmp slt i32 %110, 10000
  br i1 %111, label %112, label %186

112:                                              ; preds = %109
  %113 = call i64 @read_tsc()
  %114 = uitofp i64 %113 to double
  store double %114, ptr %12, align 8, !tbaa !11
  %115 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 0
  %116 = getelementptr inbounds [32 x i8], ptr %115, i64 0, i64 0
  %117 = load i32, ptr %5, align 4, !tbaa !5
  %118 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %119 = call i32 @aes_decrypt_key(ptr noundef %116, i32 noundef %117, ptr noundef %118)
  %120 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 1
  %121 = getelementptr inbounds [32 x i8], ptr %120, i64 0, i64 0
  %122 = load i32, ptr %5, align 4, !tbaa !5
  %123 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %124 = call i32 @aes_decrypt_key(ptr noundef %121, i32 noundef %122, ptr noundef %123)
  %125 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 2
  %126 = getelementptr inbounds [32 x i8], ptr %125, i64 0, i64 0
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %129 = call i32 @aes_decrypt_key(ptr noundef %126, i32 noundef %127, ptr noundef %128)
  %130 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 3
  %131 = getelementptr inbounds [32 x i8], ptr %130, i64 0, i64 0
  %132 = load i32, ptr %5, align 4, !tbaa !5
  %133 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %134 = call i32 @aes_decrypt_key(ptr noundef %131, i32 noundef %132, ptr noundef %133)
  %135 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 4
  %136 = getelementptr inbounds [32 x i8], ptr %135, i64 0, i64 0
  %137 = load i32, ptr %5, align 4, !tbaa !5
  %138 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %139 = call i32 @aes_decrypt_key(ptr noundef %136, i32 noundef %137, ptr noundef %138)
  %140 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 5
  %141 = getelementptr inbounds [32 x i8], ptr %140, i64 0, i64 0
  %142 = load i32, ptr %5, align 4, !tbaa !5
  %143 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %144 = call i32 @aes_decrypt_key(ptr noundef %141, i32 noundef %142, ptr noundef %143)
  %145 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 6
  %146 = getelementptr inbounds [32 x i8], ptr %145, i64 0, i64 0
  %147 = load i32, ptr %5, align 4, !tbaa !5
  %148 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %149 = call i32 @aes_decrypt_key(ptr noundef %146, i32 noundef %147, ptr noundef %148)
  %150 = getelementptr inbounds [8 x [32 x i8]], ptr %15, i64 0, i64 7
  %151 = getelementptr inbounds [32 x i8], ptr %150, i64 0, i64 0
  %152 = load i32, ptr %5, align 4, !tbaa !5
  %153 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %16, i64 0, i64 0
  %154 = call i32 @aes_decrypt_key(ptr noundef %151, i32 noundef %152, ptr noundef %153)
  %155 = call i64 @read_tsc()
  %156 = uitofp i64 %155 to double
  %157 = load double, ptr %12, align 8, !tbaa !11
  %158 = fsub double %156, %157
  store double %158, ptr %12, align 8, !tbaa !11
  %159 = load double, ptr %12, align 8, !tbaa !11
  %160 = load double, ptr %13, align 8, !tbaa !11
  %161 = load double, ptr %14, align 8, !tbaa !11
  %162 = fsub double %160, %161
  %163 = fcmp ogt double %159, %162
  br i1 %163, label %164, label %182

164:                                              ; preds = %112
  %165 = load double, ptr %12, align 8, !tbaa !11
  %166 = load double, ptr %13, align 8, !tbaa !11
  %167 = load double, ptr %14, align 8, !tbaa !11
  %168 = fadd double %166, %167
  %169 = fcmp olt double %165, %168
  br i1 %169, label %170, label %182

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

182:                                              ; preds = %170, %164, %112
  br label %183

183:                                              ; preds = %182
  %184 = load i32, ptr %8, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %8, align 4, !tbaa !5
  br label %109, !llvm.loop !15

186:                                              ; preds = %109
  %187 = load i32, ptr %11, align 4, !tbaa !5
  %188 = mul nsw i32 10, %187
  %189 = icmp sgt i32 %188, 90000
  br i1 %189, label %190, label %223

190:                                              ; preds = %186
  %191 = load i32, ptr %11, align 4, !tbaa !5
  %192 = sitofp i32 %191 to double
  %193 = load ptr, ptr %6, align 8, !tbaa !9
  %194 = load double, ptr %193, align 8, !tbaa !11
  %195 = fdiv double %194, %192
  store double %195, ptr %193, align 8, !tbaa !11
  %196 = load ptr, ptr %7, align 8, !tbaa !9
  %197 = load double, ptr %196, align 8, !tbaa !11
  %198 = load ptr, ptr %6, align 8, !tbaa !9
  %199 = load double, ptr %198, align 8, !tbaa !11
  %200 = load ptr, ptr %6, align 8, !tbaa !9
  %201 = load double, ptr %200, align 8, !tbaa !11
  %202 = fmul double %199, %201
  %203 = load i32, ptr %11, align 4, !tbaa !5
  %204 = sitofp i32 %203 to double
  %205 = fneg double %202
  %206 = call double @llvm.fmuladd.f64(double %205, double %204, double %197)
  %207 = load i32, ptr %11, align 4, !tbaa !5
  %208 = sitofp i32 %207 to double
  %209 = fdiv double %206, %208
  %210 = call double @sqrt(double noundef %209) #6
  %211 = load ptr, ptr %7, align 8, !tbaa !9
  store double %210, ptr %211, align 8, !tbaa !11
  %212 = load ptr, ptr %7, align 8, !tbaa !9
  %213 = load double, ptr %212, align 8, !tbaa !11
  %214 = load i32, ptr %9, align 4, !tbaa !5
  %215 = sitofp i32 %214 to double
  %216 = fdiv double %215, 1.000000e+02
  %217 = load ptr, ptr %6, align 8, !tbaa !9
  %218 = load double, ptr %217, align 8, !tbaa !11
  %219 = fmul double %216, %218
  %220 = fcmp ogt double %213, %219
  br i1 %220, label %221, label %222

221:                                              ; preds = %190
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %222

222:                                              ; preds = %221, %190
  br label %235

223:                                              ; preds = %186
  %224 = load i32, ptr %10, align 4, !tbaa !5
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %10, align 4, !tbaa !5
  %226 = icmp eq i32 %224, 10
  br i1 %226, label %227, label %234

227:                                              ; preds = %223
  store i32 0, ptr %10, align 4, !tbaa !5
  %228 = load i32, ptr %9, align 4, !tbaa !5
  %229 = add nsw i32 %228, 5
  store i32 %229, ptr %9, align 4, !tbaa !5
  %230 = load i32, ptr %9, align 4, !tbaa !5
  %231 = icmp sgt i32 %230, 30
  br i1 %231, label %232, label %233

232:                                              ; preds = %227
  store i32 0, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %237

233:                                              ; preds = %227
  br label %234

234:                                              ; preds = %233, %223
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %235

235:                                              ; preds = %234, %222
  br label %20, !llvm.loop !16

236:                                              ; preds = %20
  store i32 1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %237

237:                                              ; preds = %236, %232
  call void @llvm.lifetime.end.p0(i64 256, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %238 = load i32, ptr %4, align 4
  ret i32 %238
}

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @time_dks8(i32 noundef %0, ptr nocapture noundef %1, ptr nocapture noundef %2) local_unnamed_addr #5 {
  %4 = alloca [8 x [32 x i8]], align 16
  %5 = alloca [1 x %struct.aes_crypt_ctx], align 16
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #6
  call void @block_rndfill(ptr noundef nonnull %4, i64 noundef 256) #6
  %6 = getelementptr inbounds i8, ptr %4, i64 32
  %7 = getelementptr inbounds i8, ptr %4, i64 64
  %8 = getelementptr inbounds i8, ptr %4, i64 96
  %9 = getelementptr inbounds i8, ptr %4, i64 128
  %10 = getelementptr inbounds i8, ptr %4, i64 160
  %11 = getelementptr inbounds i8, ptr %4, i64 192
  %12 = getelementptr inbounds i8, ptr %4, i64 224
  br label %.preheader.outer.outer

.preheader.outer.outer:                           ; preds = %3, %86
  %.07084.ph.ph = phi i32 [ 10, %3 ], [ %87, %86 ]
  %13 = uitofp nneg i32 %.07084.ph.ph to double
  %14 = fdiv double %13, 1.000000e+02
  br label %.preheader.outer

.preheader.outer:                                 ; preds = %.preheader.outer.outer, %83
  %.06785.ph = phi i32 [ %84, %83 ], [ 0, %.preheader.outer.outer ]
  br label %.preheader

.preheader:                                       ; preds = %.preheader.outer, %70
  br label %15

15:                                               ; preds = %.preheader, %15
  %.081 = phi double [ 0.000000e+00, %.preheader ], [ %30, %15 ]
  %.06580 = phi double [ 0.000000e+00, %.preheader ], [ %29, %15 ]
  %.07379 = phi i32 [ 0, %.preheader ], [ %31, %15 ]
  %16 = call i64 @read_tsc()
  %17 = uitofp i64 %16 to double
  %18 = call i32 @aes_decrypt_key(ptr noundef nonnull %4, i32 noundef %0, ptr noundef nonnull %5) #6
  %19 = call i32 @aes_decrypt_key(ptr noundef nonnull %6, i32 noundef %0, ptr noundef nonnull %5) #6
  %20 = call i32 @aes_decrypt_key(ptr noundef nonnull %7, i32 noundef %0, ptr noundef nonnull %5) #6
  %21 = call i32 @aes_decrypt_key(ptr noundef nonnull %8, i32 noundef %0, ptr noundef nonnull %5) #6
  %22 = call i32 @aes_decrypt_key(ptr noundef nonnull %9, i32 noundef %0, ptr noundef nonnull %5) #6
  %23 = call i32 @aes_decrypt_key(ptr noundef nonnull %10, i32 noundef %0, ptr noundef nonnull %5) #6
  %24 = call i32 @aes_decrypt_key(ptr noundef nonnull %11, i32 noundef %0, ptr noundef nonnull %5) #6
  %25 = call i32 @aes_decrypt_key(ptr noundef nonnull %12, i32 noundef %0, ptr noundef nonnull %5) #6
  %26 = call i64 @read_tsc()
  %27 = uitofp i64 %26 to double
  %28 = fsub double %27, %17
  %29 = fadd double %.06580, %28
  %30 = call double @llvm.fmuladd.f64(double %28, double %28, double %.081)
  %31 = add nuw nsw i32 %.07379, 1
  %exitcond.not = icmp eq i32 %31, 1000
  br i1 %exitcond.not, label %32, label %15, !llvm.loop !5

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

44:                                               ; preds = %32, %66
  %.183 = phi i32 [ 0, %32 ], [ %.2, %66 ]
  %.17482 = phi i32 [ 0, %32 ], [ %67, %66 ]
  %45 = call i64 @read_tsc()
  %46 = uitofp i64 %45 to double
  %47 = call i32 @aes_decrypt_key(ptr noundef nonnull %4, i32 noundef %0, ptr noundef nonnull %5) #6
  %48 = call i32 @aes_decrypt_key(ptr noundef nonnull %6, i32 noundef %0, ptr noundef nonnull %5) #6
  %49 = call i32 @aes_decrypt_key(ptr noundef nonnull %7, i32 noundef %0, ptr noundef nonnull %5) #6
  %50 = call i32 @aes_decrypt_key(ptr noundef nonnull %8, i32 noundef %0, ptr noundef nonnull %5) #6
  %51 = call i32 @aes_decrypt_key(ptr noundef nonnull %9, i32 noundef %0, ptr noundef nonnull %5) #6
  %52 = call i32 @aes_decrypt_key(ptr noundef nonnull %10, i32 noundef %0, ptr noundef nonnull %5) #6
  %53 = call i32 @aes_decrypt_key(ptr noundef nonnull %11, i32 noundef %0, ptr noundef nonnull %5) #6
  %54 = call i32 @aes_decrypt_key(ptr noundef nonnull %12, i32 noundef %0, ptr noundef nonnull %5) #6
  %55 = call i64 @read_tsc()
  %56 = uitofp i64 %55 to double
  %57 = fsub double %56, %46
  %58 = fcmp ogt double %57, %42
  %59 = fcmp olt double %57, %43
  %or.cond = and i1 %58, %59
  br i1 %or.cond, label %60, label %66

60:                                               ; preds = %44
  %61 = load double, ptr %1, align 8, !tbaa !7
  %62 = fadd double %57, %61
  store double %62, ptr %1, align 8, !tbaa !7
  %63 = load double, ptr %2, align 8, !tbaa !7
  %64 = call double @llvm.fmuladd.f64(double %57, double %57, double %63)
  store double %64, ptr %2, align 8, !tbaa !7
  %65 = add nsw i32 %.183, 1
  br label %66

66:                                               ; preds = %44, %60
  %.2 = phi i32 [ %65, %60 ], [ %.183, %44 ]
  %67 = add nuw nsw i32 %.17482, 1
  %exitcond88.not = icmp eq i32 %67, 10000
  br i1 %exitcond88.not, label %68, label %44, !llvm.loop !11

68:                                               ; preds = %66
  %69 = icmp sgt i32 %.2, 9000
  br i1 %69, label %70, label %83

70:                                               ; preds = %68
  %71 = uitofp nneg i32 %.2 to double
  %72 = load double, ptr %1, align 8, !tbaa !7
  %73 = fdiv double %72, %71
  store double %73, ptr %1, align 8, !tbaa !7
  %74 = load double, ptr %2, align 8, !tbaa !7
  %75 = fneg double %73
  %76 = fmul double %73, %75
  %77 = call double @llvm.fmuladd.f64(double %76, double %71, double %74)
  %78 = fdiv double %77, %71
  %79 = call double @sqrt(double noundef %78) #6
  store double %79, ptr %2, align 8, !tbaa !7
  %80 = load double, ptr %1, align 8, !tbaa !7
  %81 = fmul double %14, %80
  %82 = fcmp ogt double %79, %81
  br i1 %82, label %.preheader, label %.thread, !llvm.loop !12

83:                                               ; preds = %68
  %84 = add nuw nsw i32 %.06785.ph, 1
  %85 = icmp eq i32 %.06785.ph, 10
  br i1 %85, label %86, label %.preheader.outer, !llvm.loop !12

86:                                               ; preds = %83
  %87 = add nuw nsw i32 %.07084.ph.ph, 5
  %88 = icmp ugt i32 %.07084.ph.ph, 25
  br i1 %88, label %.thread, label %.preheader.outer.outer, !llvm.loop !12

.thread:                                          ; preds = %86, %70
  %.075 = phi i32 [ 1, %70 ], [ 0, %86 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #6
  ret i32 %.075
}

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = 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,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass