; LLVM IR from BoysTownOrg/chapro :: sha_prepare (cha_sha_prepare)

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

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [41 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @cha_sha_prepare(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, 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 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.CHA_SHA, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !9
  store i32 %29, ptr %20, align 4, !tbaa !13
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.CHA_SHA, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 4, !tbaa !14
  store i32 %32, ptr %22, align 4, !tbaa !13
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.CHA_SHA, ptr %33, i32 0, i32 2
  %35 = load i32, ptr %34, align 8, !tbaa !15
  store i32 %35, ptr %23, align 4, !tbaa !13
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.CHA_SHA, ptr %36, i32 0, i32 4
  %38 = load i32, ptr %37, align 8, !tbaa !16
  store i32 %38, ptr %24, align 4, !tbaa !13
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.CHA_SHA, ptr %39, i32 0, i32 6
  %41 = load double, ptr %40, align 8, !tbaa !17
  store double %41, ptr %6, align 8, !tbaa !18
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.CHA_SHA, ptr %42, i32 0, i32 15
  %44 = load ptr, ptr %43, align 8, !tbaa !19
  store ptr %44, ptr %18, align 8, !tbaa !5
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.CHA_SHA, ptr %45, i32 0, i32 5
  %47 = load i32, ptr %46, align 4, !tbaa !20
  store i32 %47, ptr %25, align 4, !tbaa !13
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.CHA_SHA, ptr %48, i32 0, i32 10
  %50 = load double, ptr %49, align 8, !tbaa !21
  store double %50, ptr %7, align 8, !tbaa !18
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.CHA_SHA, ptr %51, i32 0, i32 11
  %53 = load double, ptr %52, align 8, !tbaa !22
  store double %53, ptr %8, align 8, !tbaa !18
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.CHA_SHA, ptr %54, i32 0, i32 12
  %56 = load double, ptr %55, align 8, !tbaa !23
  store double %56, ptr %9, align 8, !tbaa !18
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.CHA_SHA, ptr %57, i32 0, i32 13
  %59 = load double, ptr %58, align 8, !tbaa !24
  store double %59, ptr %10, align 8, !tbaa !18
  %60 = load i32, ptr %22, align 4, !tbaa !13
  %61 = load i32, ptr %25, align 4, !tbaa !13
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %60, i32 noundef %61)
  %63 = load double, ptr %7, align 8, !tbaa !18
  %64 = load double, ptr %8, align 8, !tbaa !18
  %65 = load double, ptr %9, align 8, !tbaa !18
  %66 = load double, ptr %10, align 8, !tbaa !18
  %67 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %63, double noundef %64, double noundef %65, double noundef %66)
  %68 = load i32, ptr %20, align 4, !tbaa !13
  %69 = icmp sle i32 %68, 0
  br i1 %69, label %70, label %71

70:                                               ; preds = %2
  store i32 1, ptr %3, align 4
  store i32 1, ptr %26, align 4
  br label %270

71:                                               ; preds = %2
  %72 = load i32, ptr %20, align 4, !tbaa !13
  %73 = srem i32 %72, 2
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %79, label %75

75:                                               ; preds = %71
  %76 = load i32, ptr %22, align 4, !tbaa !13
  %77 = srem i32 %76, 2
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %80

79:                                               ; preds = %75, %71
  store i32 1, ptr %3, align 4
  store i32 1, ptr %26, align 4
  br label %270

80:                                               ; preds = %75
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  call void @cha_prepare(ptr noundef %81)
  %82 = load i32, ptr %20, align 4, !tbaa !13
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds ptr, ptr %83, i64 1
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  %86 = getelementptr inbounds i32, ptr %85, i64 0
  store i32 %82, ptr %86, align 4, !tbaa !13
  %87 = load double, ptr %6, align 8, !tbaa !18
  %88 = fdiv double %87, 1.000000e+03
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds ptr, ptr %89, i64 2
  %91 = load ptr, ptr %90, align 8, !tbaa !5
  %92 = getelementptr inbounds double, ptr %91, i64 0
  store double %88, ptr %92, align 8, !tbaa !18
  %93 = load i32, ptr %22, align 4, !tbaa !13
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds ptr, ptr %94, i64 1
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = getelementptr inbounds i32, ptr %96, i64 20
  store i32 %93, ptr %97, align 4, !tbaa !13
  %98 = load i32, ptr %23, align 4, !tbaa !13
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = getelementptr inbounds ptr, ptr %99, i64 1
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = getelementptr inbounds i32, ptr %101, i64 22
  store i32 %98, ptr %102, align 4, !tbaa !13
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds ptr, ptr %103, i64 1
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  %106 = getelementptr inbounds i32, ptr %105, i64 24
  store i32 0, ptr %106, align 4, !tbaa !13
  %107 = load i32, ptr %22, align 4, !tbaa !13
  %108 = sdiv i32 %107, 2
  %109 = load i32, ptr %20, align 4, !tbaa !13
  %110 = sdiv i32 %108, %109
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds ptr, ptr %111, i64 1
  %113 = load ptr, ptr %112, align 8, !tbaa !5
  %114 = getelementptr inbounds i32, ptr %113, i64 23
  store i32 %110, ptr %114, align 4, !tbaa !13
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = load i32, ptr %22, align 4, !tbaa !13
  %117 = call ptr @cha_allocate(ptr noundef %115, i32 noundef %116, i32 noundef 4, i32 noundef 43)
  store ptr %117, ptr %17, align 8, !tbaa !5
  %118 = load ptr, ptr %17, align 8, !tbaa !5
  %119 = load i32, ptr %22, align 4, !tbaa !13
  %120 = load i32, ptr %23, align 4, !tbaa !13
  call void @sha_window(ptr noundef %118, i32 noundef %119, i32 noundef %120, i32 noundef 2)
  %121 = load i32, ptr %22, align 4, !tbaa !13
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %21, align 4, !tbaa !13
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = load i32, ptr %22, align 4, !tbaa !13
  %125 = call ptr @cha_allocate(ptr noundef %123, i32 noundef %124, i32 noundef 4, i32 noundef 44)
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = load i32, ptr %21, align 4, !tbaa !13
  %128 = mul nsw i32 %127, 2
  %129 = call ptr @cha_allocate(ptr noundef %126, i32 noundef %128, i32 noundef 4, i32 noundef 46)
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = load i32, ptr %21, align 4, !tbaa !13
  %132 = mul nsw i32 %131, 2
  %133 = call ptr @cha_allocate(ptr noundef %130, i32 noundef %132, i32 noundef 4, i32 noundef 45)
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = load i32, ptr %21, align 4, !tbaa !13
  %136 = mul nsw i32 %135, 2
  %137 = call ptr @cha_allocate(ptr noundef %134, i32 noundef %136, i32 noundef 4, i32 noundef 47)
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.CHA_SHA, ptr %138, i32 0, i32 15
  %140 = load ptr, ptr %139, align 8, !tbaa !19
  %141 = icmp ne ptr %140, null
  br i1 %141, label %142, label %153

142:                                              ; preds = %80
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = load i32, ptr %22, align 4, !tbaa !13
  %145 = call ptr @cha_allocate(ptr noundef %143, i32 noundef %144, i32 noundef 4, i32 noundef 48)
  store ptr %145, ptr %18, align 8, !tbaa !5
  %146 = load ptr, ptr %18, align 8, !tbaa !5
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.CHA_SHA, ptr %147, i32 0, i32 15
  %149 = load ptr, ptr %148, align 8, !tbaa !19
  %150 = load i32, ptr %22, align 4, !tbaa !13
  %151 = sext i32 %150 to i64
  %152 = mul i64 %151, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %146, ptr align 4 %149, i64 %152, i1 false)
  br label %153

153:                                              ; preds = %142, %80
  %154 = load double, ptr %7, align 8, !tbaa !18
  %155 = fdiv double %154, 2.000000e+01
  %156 = call double @pow(double noundef 1.000000e+01, double noundef %155) #6
  store double %156, ptr %11, align 8, !tbaa !18
  %157 = load double, ptr %9, align 8, !tbaa !18
  %158 = fneg double %157
  %159 = fdiv double %158, 2.000000e+01
  %160 = call double @pow(double noundef 1.000000e+01, double noundef %159) #6
  store double %160, ptr %12, align 8, !tbaa !18
  %161 = load double, ptr %7, align 8, !tbaa !18
  %162 = load double, ptr %8, align 8, !tbaa !18
  %163 = fsub double %161, %162
  %164 = fdiv double %163, 1.000000e+01
  %165 = call double @pow(double noundef 1.000000e+01, double noundef %164) #6
  store double %165, ptr %13, align 8, !tbaa !18
  %166 = load double, ptr %13, align 8, !tbaa !18
  %167 = fmul double 1.000000e+12, %166
  %168 = load double, ptr %12, align 8, !tbaa !18
  %169 = call double @llvm.fmuladd.f64(double %168, double 1.000000e+06, double 1.000000e+00)
  %170 = load double, ptr %13, align 8, !tbaa !18
  %171 = call double @llvm.fmuladd.f64(double %170, double 1.000000e+12, double %169)
  %172 = fdiv double %167, %171
  store double %172, ptr %16, align 8, !tbaa !18
  %173 = load double, ptr %12, align 8, !tbaa !18
  %174 = load double, ptr %16, align 8, !tbaa !18
  %175 = fmul double %173, %174
  store double %175, ptr %12, align 8, !tbaa !18
  %176 = load double, ptr %13, align 8, !tbaa !18
  %177 = load double, ptr %16, align 8, !tbaa !18
  %178 = fmul double %176, %177
  store double %178, ptr %13, align 8, !tbaa !18
  %179 = load double, ptr %9, align 8, !tbaa !18
  %180 = fcmp ole double %179, 0.000000e+00
  br i1 %180, label %181, label %182

181:                                              ; preds = %153
  br label %189

182:                                              ; preds = %153
  %183 = load i32, ptr %24, align 4, !tbaa !13
  %184 = sitofp i32 %183 to double
  %185 = load double, ptr %10, align 8, !tbaa !18
  %186 = fmul double %184, %185
  %187 = fdiv double %186, 1.000000e+01
  %188 = call double @pow(double noundef 1.000000e+01, double noundef %187) #6
  br label %189

189:                                              ; preds = %182, %181
  %190 = phi double [ 0.000000e+00, %181 ], [ %188, %182 ]
  store double %190, ptr %14, align 8, !tbaa !18
  %191 = load ptr, ptr %5, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.CHA_SHA, ptr %191, i32 0, i32 9
  %193 = load double, ptr %192, align 8, !tbaa !25
  %194 = load i32, ptr %22, align 4, !tbaa !13
  %195 = sdiv i32 %194, 4
  %196 = sitofp i32 %195 to double
  %197 = fmul double %193, %196
  %198 = call double @sqrt(double noundef 2.000000e+00) #6
  %199 = fmul double %197, %198
  store double %199, ptr %15, align 8, !tbaa !18
  %200 = load double, ptr %15, align 8, !tbaa !18
  %201 = load double, ptr %15, align 8, !tbaa !18
  %202 = fmul double %200, %201
  %203 = fdiv double 1.000000e+00, %202
  store double %203, ptr %15, align 8, !tbaa !18
  %204 = load double, ptr %11, align 8, !tbaa !18
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = getelementptr inbounds ptr, ptr %205, i64 2
  %207 = load ptr, ptr %206, align 8, !tbaa !5
  %208 = getelementptr inbounds double, ptr %207, i64 17
  store double %204, ptr %208, align 8, !tbaa !18
  %209 = load double, ptr %12, align 8, !tbaa !18
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds ptr, ptr %210, i64 2
  %212 = load ptr, ptr %211, align 8, !tbaa !5
  %213 = getelementptr inbounds double, ptr %212, i64 18
  store double %209, ptr %213, align 8, !tbaa !18
  %214 = load double, ptr %13, align 8, !tbaa !18
  %215 = load ptr, ptr %4, align 8, !tbaa !5
  %216 = getelementptr inbounds ptr, ptr %215, i64 2
  %217 = load ptr, ptr %216, align 8, !tbaa !5
  %218 = getelementptr inbounds double, ptr %217, i64 19
  store double %214, ptr %218, align 8, !tbaa !18
  %219 = load double, ptr %14, align 8, !tbaa !18
  %220 = load ptr, ptr %4, align 8, !tbaa !5
  %221 = getelementptr inbounds ptr, ptr %220, i64 2
  %222 = load ptr, ptr %221, align 8, !tbaa !5
  %223 = getelementptr inbounds double, ptr %222, i64 20
  store double %219, ptr %223, align 8, !tbaa !18
  %224 = load double, ptr %15, align 8, !tbaa !18
  %225 = load ptr, ptr %4, align 8, !tbaa !5
  %226 = getelementptr inbounds ptr, ptr %225, i64 2
  %227 = load ptr, ptr %226, align 8, !tbaa !5
  %228 = getelementptr inbounds double, ptr %227, i64 21
  store double %224, ptr %228, align 8, !tbaa !18
  %229 = load i32, ptr %24, align 4, !tbaa !13
  %230 = load ptr, ptr %4, align 8, !tbaa !5
  %231 = getelementptr inbounds ptr, ptr %230, i64 1
  %232 = load ptr, ptr %231, align 8, !tbaa !5
  %233 = getelementptr inbounds i32, ptr %232, i64 25
  store i32 %229, ptr %233, align 4, !tbaa !13
  %234 = load i32, ptr %25, align 4, !tbaa !13
  %235 = load ptr, ptr %4, align 8, !tbaa !5
  %236 = getelementptr inbounds ptr, ptr %235, i64 1
  %237 = load ptr, ptr %236, align 8, !tbaa !5
  %238 = getelementptr inbounds i32, ptr %237, i64 26
  store i32 %234, ptr %238, align 4, !tbaa !13
  %239 = load ptr, ptr %4, align 8, !tbaa !5
  %240 = load i32, ptr %21, align 4, !tbaa !13
  %241 = call ptr @cha_allocate(ptr noundef %239, i32 noundef %240, i32 noundef 4, i32 noundef 51)
  %242 = load ptr, ptr %4, align 8, !tbaa !5
  %243 = load i32, ptr %21, align 4, !tbaa !13
  %244 = call ptr @cha_allocate(ptr noundef %242, i32 noundef %243, i32 noundef 4, i32 noundef 52)
  %245 = load ptr, ptr %4, align 8, !tbaa !5
  %246 = load i32, ptr %21, align 4, !tbaa !13
  %247 = call ptr @cha_allocate(ptr noundef %245, i32 noundef %246, i32 noundef 4, i32 noundef 53)
  %248 = load ptr, ptr %5, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.CHA_SHA, ptr %248, i32 0, i32 17
  %250 = load ptr, ptr %249, align 8, !tbaa !26
  %251 = icmp ne ptr %250, null
  br i1 %251, label %252, label %269

252:                                              ; preds = %189
  %253 = load i32, ptr %22, align 4, !tbaa !13
  %254 = add nsw i32 %253, 1
  store i32 %254, ptr %21, align 4, !tbaa !13
  %255 = load ptr, ptr %4, align 8, !tbaa !5
  %256 = load i32, ptr %21, align 4, !tbaa !13
  %257 = load i32, ptr %21, align 4, !tbaa !13
  %258 = mul nsw i32 %256, %257
  %259 = call ptr @cha_allocate(ptr noundef %255, i32 noundef %258, i32 noundef 4, i32 noundef 50)
  store ptr %259, ptr %19, align 8, !tbaa !5
  %260 = load ptr, ptr %19, align 8, !tbaa !5
  %261 = load ptr, ptr %5, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.CHA_SHA, ptr %261, i32 0, i32 17
  %263 = load ptr, ptr %262, align 8, !tbaa !26
  %264 = load i32, ptr %21, align 4, !tbaa !13
  %265 = load i32, ptr %21, align 4, !tbaa !13
  %266 = mul nsw i32 %264, %265
  %267 = sext i32 %266 to i64
  %268 = mul i64 %267, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %260, ptr align 4 %263, i64 %268, i1 false)
  br label %269

269:                                              ; preds = %252, %189
  store i32 0, ptr %3, align 4
  store i32 1, ptr %26, align 4
  br label %270

270:                                              ; preds = %269, %79, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, 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 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %271 = load i32, ptr %3, align 4
  ret i32 %271
}

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

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

declare void @cha_prepare(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare hidden void @sha_window(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #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) #3

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #4

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !11, i64 4}
!15 = !{!10, !11, i64 8}
!16 = !{!10, !11, i64 16}
!17 = !{!10, !12, i64 24}
!18 = !{!12, !12, i64 0}
!19 = !{!10, !6, i64 96}
!20 = !{!10, !11, i64 20}
!21 = !{!10, !12, i64 56}
!22 = !{!10, !12, i64 64}
!23 = !{!10, !12, i64 72}
!24 = !{!10, !12, i64 80}
!25 = !{!10, !12, i64 48}
!26 = !{!10, !6, i64 112}


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

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [41 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @cha_sha_prepare(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = load i32, ptr %1, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 4
  %5 = load i32, ptr %4, align 4, !tbaa !12
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  %7 = load i32, ptr %6, align 8, !tbaa !13
  %8 = getelementptr inbounds i8, ptr %1, i64 16
  %9 = load i32, ptr %8, align 8, !tbaa !14
  %10 = getelementptr inbounds i8, ptr %1, i64 24
  %11 = load double, ptr %10, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %1, i64 96
  %13 = getelementptr inbounds i8, ptr %1, i64 20
  %14 = load i32, ptr %13, align 4, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %1, i64 56
  %16 = load double, ptr %15, align 8, !tbaa !17
  %17 = getelementptr inbounds i8, ptr %1, i64 64
  %18 = load double, ptr %17, align 8, !tbaa !18
  %19 = getelementptr inbounds i8, ptr %1, i64 72
  %20 = load double, ptr %19, align 8, !tbaa !19
  %21 = getelementptr inbounds i8, ptr %1, i64 80
  %22 = load double, ptr %21, align 8, !tbaa !20
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5, i32 noundef %14)
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %16, double noundef %18, double noundef %20, double noundef %22)
  %25 = icmp slt i32 %3, 1
  br i1 %25, label %106, label %26

26:                                               ; preds = %2
  %27 = or i32 %5, %3
  %28 = and i32 %27, 1
  %or.cond = icmp eq i32 %28, 0
  br i1 %or.cond, label %29, label %106

29:                                               ; preds = %26
  tail call void @cha_prepare(ptr noundef %0) #6
  %30 = getelementptr inbounds i8, ptr %0, i64 8
  %31 = load ptr, ptr %30, align 8, !tbaa !21
  store i32 %3, ptr %31, align 4, !tbaa !22
  %32 = fdiv double %11, 1.000000e+03
  %33 = getelementptr inbounds i8, ptr %0, i64 16
  %34 = load ptr, ptr %33, align 8, !tbaa !21
  store double %32, ptr %34, align 8, !tbaa !23
  %35 = getelementptr inbounds i8, ptr %31, i64 80
  store i32 %5, ptr %35, align 4, !tbaa !22
  %36 = getelementptr inbounds i8, ptr %31, i64 88
  store i32 %7, ptr %36, align 4, !tbaa !22
  %37 = getelementptr inbounds i8, ptr %31, i64 96
  store i32 0, ptr %37, align 4, !tbaa !22
  %38 = ashr exact i32 %5, 1
  %39 = sdiv i32 %38, %3
  %40 = getelementptr inbounds i8, ptr %31, i64 92
  store i32 %39, ptr %40, align 4, !tbaa !22
  %41 = tail call ptr @cha_allocate(ptr noundef %0, i32 noundef %5, i32 noundef 4, i32 noundef 43) #6
  tail call void @sha_window(ptr noundef %41, i32 noundef %5, i32 noundef %7, i32 noundef 2)
  %42 = or disjoint i32 %5, 1
  %43 = tail call ptr @cha_allocate(ptr noundef %0, i32 noundef %5, i32 noundef 4, i32 noundef 44) #6
  %44 = shl nsw i32 %42, 1
  %45 = tail call ptr @cha_allocate(ptr noundef %0, i32 noundef %44, i32 noundef 4, i32 noundef 46) #6
  %46 = tail call ptr @cha_allocate(ptr noundef %0, i32 noundef %44, i32 noundef 4, i32 noundef 45) #6
  %47 = tail call ptr @cha_allocate(ptr noundef %0, i32 noundef %44, i32 noundef 4, i32 noundef 47) #6
  %48 = load ptr, ptr %12, align 8, !tbaa !24
  %.not102 = icmp eq ptr %48, null
  br i1 %.not102, label %54, label %49

49:                                               ; preds = %29
  %50 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %5, i32 noundef 4, i32 noundef 48) #6
  %51 = load ptr, ptr %12, align 8, !tbaa !24
  %52 = sext i32 %5 to i64
  %53 = shl nsw i64 %52, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %50, ptr align 4 %51, i64 %53, i1 false)
  br label %54

54:                                               ; preds = %49, %29
  %55 = fdiv double %16, 2.000000e+01
  %56 = tail call double @pow(double noundef 1.000000e+01, double noundef %55) #6
  %57 = fdiv double %20, -2.000000e+01
  %58 = tail call double @pow(double noundef 1.000000e+01, double noundef %57) #6
  %59 = fsub double %16, %18
  %60 = fdiv double %59, 1.000000e+01
  %61 = tail call double @pow(double noundef 1.000000e+01, double noundef %60) #6
  %62 = fmul double %61, 1.000000e+12
  %63 = tail call double @llvm.fmuladd.f64(double %58, double 1.000000e+06, double 1.000000e+00)
  %64 = tail call double @llvm.fmuladd.f64(double %61, double 1.000000e+12, double %63)
  %65 = fdiv double %62, %64
  %66 = insertelement <2 x double> poison, double %58, i64 0
  %67 = insertelement <2 x double> %66, double %61, i64 1
  %68 = insertelement <2 x double> poison, double %65, i64 0
  %69 = shufflevector <2 x double> %68, <2 x double> poison, <2 x i32> zeroinitializer
  %70 = fmul <2 x double> %67, %69
  %71 = fcmp ugt double %20, 0.000000e+00
  br i1 %71, label %72, label %77

72:                                               ; preds = %54
  %73 = sitofp i32 %9 to double
  %74 = fmul double %22, %73
  %75 = fdiv double %74, 1.000000e+01
  %76 = tail call double @pow(double noundef 1.000000e+01, double noundef %75) #6
  br label %77

77:                                               ; preds = %54, %72
  %78 = phi double [ %76, %72 ], [ 0.000000e+00, %54 ]
  %79 = getelementptr inbounds i8, ptr %1, i64 48
  %80 = load double, ptr %79, align 8, !tbaa !25
  %81 = sdiv i32 %5, 4
  %82 = sitofp i32 %81 to double
  %83 = fmul double %80, %82
  %84 = fmul double %83, 0x3FF6A09E667F3BCD
  %85 = fmul double %84, %84
  %86 = fdiv double 1.000000e+00, %85
  %87 = load ptr, ptr %33, align 8, !tbaa !21
  %88 = getelementptr inbounds i8, ptr %87, i64 136
  store double %56, ptr %88, align 8, !tbaa !23
  %89 = getelementptr inbounds i8, ptr %87, i64 144
  store <2 x double> %70, ptr %89, align 8, !tbaa !23
  %90 = getelementptr inbounds i8, ptr %87, i64 160
  store double %78, ptr %90, align 8, !tbaa !23
  %91 = getelementptr inbounds i8, ptr %87, i64 168
  store double %86, ptr %91, align 8, !tbaa !23
  %92 = load ptr, ptr %30, align 8, !tbaa !21
  %93 = getelementptr inbounds i8, ptr %92, i64 100
  store i32 %9, ptr %93, align 4, !tbaa !22
  %94 = getelementptr inbounds i8, ptr %92, i64 104
  store i32 %14, ptr %94, align 4, !tbaa !22
  %95 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %42, i32 noundef 4, i32 noundef 51) #6
  %96 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %42, i32 noundef 4, i32 noundef 52) #6
  %97 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %42, i32 noundef 4, i32 noundef 53) #6
  %98 = getelementptr inbounds i8, ptr %1, i64 112
  %99 = load ptr, ptr %98, align 8, !tbaa !26
  %.not103 = icmp eq ptr %99, null
  br i1 %.not103, label %106, label %100

100:                                              ; preds = %77
  %101 = mul nsw i32 %42, %42
  %102 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %101, i32 noundef 4, i32 noundef 50) #6
  %103 = load ptr, ptr %98, align 8, !tbaa !26
  %104 = zext nneg i32 %101 to i64
  %105 = shl nuw nsw i64 %104, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %102, ptr noundef nonnull align 4 dereferenceable(1) %103, i64 %105, i1 false)
  br label %106

106:                                              ; preds = %77, %100, %26, %2
  %.0 = phi i32 [ 1, %2 ], [ 1, %26 ], [ 0, %100 ], [ 0, %77 ]
  ret i32 %.0
}

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

declare void @cha_prepare(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden void @sha_window(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #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) #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #4

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!6, !7, i64 8}
!14 = !{!6, !7, i64 16}
!15 = !{!6, !10, i64 24}
!16 = !{!6, !7, i64 20}
!17 = !{!6, !10, i64 56}
!18 = !{!6, !10, i64 64}
!19 = !{!6, !10, i64 72}
!20 = !{!6, !10, i64 80}
!21 = !{!11, !11, i64 0}
!22 = !{!7, !7, i64 0}
!23 = !{!10, !10, i64 0}
!24 = !{!6, !11, i64 96}
!25 = !{!6, !10, i64 48}
!26 = !{!6, !11, i64 112}


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