; LLVM IR from chdb-io/chdb :: base/glibc-compatibility/musl (log2)

; 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.log2_data = type { double, double, [6 x double], [10 x double], [64 x %struct.anon], [64 x %struct.anon.6] }
%struct.anon = type { double, double }
%struct.anon.6 = type { double, double }
%union.anon = type { double }
%union.anon.0 = type { double }
%union.anon.1 = type { double }
%union.anon.2 = type { double }
%union.anon.3 = type { double }
%union.anon.4 = type { i64 }
%union.anon.5 = type { double }
%union.anon.7 = type { double }
%union.anon.8 = type { double }
%union.anon.9 = type { i64 }
%union.anon.10 = type { i64 }
%union.anon.11 = type { double }

@__log2_data = external hidden constant %struct.log2_data, align 8

; Function Attrs: nounwind uwtable
define dso_local double @log2(double noundef %0) #0 {
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, 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 double, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %union.anon, align 8
  %25 = alloca %union.anon.0, align 8
  %26 = alloca %union.anon.1, align 8
  %27 = alloca %union.anon.2, align 8
  %28 = alloca %union.anon.3, align 8
  %29 = alloca i32, align 4
  %30 = alloca double, align 8
  %31 = alloca double, align 8
  %32 = alloca %union.anon.4, align 8
  %33 = alloca %union.anon.5, align 8
  %34 = alloca %union.anon.7, align 8
  %35 = alloca %union.anon.8, align 8
  %36 = alloca %union.anon.9, align 8
  %37 = alloca double, align 8
  %38 = alloca double, align 8
  %39 = alloca %union.anon.10, align 8
  %40 = alloca %union.anon.11, align 8
  store double %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  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 8, 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
  %41 = load double, ptr %3, align 8, !tbaa !5
  store double %41, ptr %24, align 8, !tbaa !9
  %42 = load i64, ptr %24, align 8, !tbaa !9
  store i64 %42, ptr %18, align 8, !tbaa !10
  %43 = load double, ptr %3, align 8, !tbaa !5
  %44 = call i32 @top16(double noundef %43)
  store i32 %44, ptr %21, align 4, !tbaa !12
  %45 = load i64, ptr %18, align 8, !tbaa !10
  store double 0x3FEEA4AF00000000, ptr %25, align 8, !tbaa !9
  %46 = load i64, ptr %25, align 8, !tbaa !9
  %47 = sub i64 %45, %46
  store double 0x3FF0B55900000000, ptr %26, align 8, !tbaa !9
  %48 = load i64, ptr %26, align 8, !tbaa !9
  store double 0x3FEEA4AF00000000, ptr %27, align 8, !tbaa !9
  %49 = load i64, ptr %27, align 8, !tbaa !9
  %50 = sub i64 %48, %49
  %51 = icmp ult i64 %47, %50
  %52 = zext i1 %51 to i32
  %53 = sext i32 %52 to i64
  %54 = call i64 @llvm.expect.i64(i64 %53, i64 0)
  %55 = icmp ne i64 %54, 0
  br i1 %55, label %56, label %136

56:                                               ; preds = %1
  %57 = load i64, ptr %18, align 8, !tbaa !10
  store double 1.000000e+00, ptr %28, align 8, !tbaa !9
  %58 = load i64, ptr %28, align 8, !tbaa !9
  %59 = icmp eq i64 %57, %58
  %60 = zext i1 %59 to i32
  %61 = sext i32 %60 to i64
  %62 = call i64 @llvm.expect.i64(i64 %61, i64 0)
  %63 = icmp ne i64 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %56
  store double 0.000000e+00, ptr %2, align 8
  store i32 1, ptr %29, align 4
  br label %275

65:                                               ; preds = %56
  %66 = load double, ptr %3, align 8, !tbaa !5
  %67 = fsub double %66, 1.000000e+00
  store double %67, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  %68 = load double, ptr %5, align 8, !tbaa !5
  store double %68, ptr %33, align 8, !tbaa !9
  %69 = load i64, ptr %33, align 8, !tbaa !9
  %70 = and i64 %69, -4294967296
  store i64 %70, ptr %32, align 8, !tbaa !9
  %71 = load double, ptr %32, align 8, !tbaa !9
  store double %71, ptr %30, align 8, !tbaa !5
  %72 = load double, ptr %5, align 8, !tbaa !5
  %73 = load double, ptr %30, align 8, !tbaa !5
  %74 = fsub double %72, %73
  store double %74, ptr %31, align 8, !tbaa !5
  %75 = load double, ptr %30, align 8, !tbaa !5
  %76 = load double, ptr @__log2_data, align 8, !tbaa !14
  %77 = fmul double %75, %76
  store double %77, ptr %12, align 8, !tbaa !5
  %78 = load double, ptr %31, align 8, !tbaa !5
  %79 = load double, ptr @__log2_data, align 8, !tbaa !14
  %80 = load double, ptr %5, align 8, !tbaa !5
  %81 = load double, ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 1), align 8, !tbaa !16
  %82 = fmul double %80, %81
  %83 = call double @llvm.fmuladd.f64(double %78, double %79, double %82)
  store double %83, ptr %13, align 8, !tbaa !5
  %84 = load double, ptr %5, align 8, !tbaa !5
  %85 = load double, ptr %5, align 8, !tbaa !5
  %86 = fmul double %84, %85
  store double %86, ptr %6, align 8, !tbaa !5
  %87 = load double, ptr %6, align 8, !tbaa !5
  %88 = load double, ptr %6, align 8, !tbaa !5
  %89 = fmul double %87, %88
  store double %89, ptr %7, align 8, !tbaa !5
  %90 = load double, ptr %6, align 8, !tbaa !5
  %91 = load double, ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 3), align 8, !tbaa !5
  %92 = load double, ptr %5, align 8, !tbaa !5
  %93 = load double, ptr getelementptr inbounds ([10 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 3), i64 0, i64 1), align 8, !tbaa !5
  %94 = call double @llvm.fmuladd.f64(double %92, double %93, double %91)
  %95 = fmul double %90, %94
  store double %95, ptr %17, align 8, !tbaa !5
  %96 = load double, ptr %12, align 8, !tbaa !5
  %97 = load double, ptr %17, align 8, !tbaa !5
  %98 = fadd double %96, %97
  store double %98, ptr %8, align 8, !tbaa !5
  %99 = load double, ptr %12, align 8, !tbaa !5
  %100 = load double, ptr %8, align 8, !tbaa !5
  %101 = fsub double %99, %100
  %102 = load double, ptr %17, align 8, !tbaa !5
  %103 = fadd double %101, %102
  %104 = load double, ptr %13, align 8, !tbaa !5
  %105 = fadd double %104, %103
  store double %105, ptr %13, align 8, !tbaa !5
  %106 = load double, ptr %7, align 8, !tbaa !5
  %107 = load double, ptr getelementptr inbounds ([10 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 3), i64 0, i64 2), align 8, !tbaa !5
  %108 = load double, ptr %5, align 8, !tbaa !5
  %109 = load double, ptr getelementptr inbounds ([10 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 3), i64 0, i64 3), align 8, !tbaa !5
  %110 = call double @llvm.fmuladd.f64(double %108, double %109, double %107)
  %111 = load double, ptr %6, align 8, !tbaa !5
  %112 = load double, ptr getelementptr inbounds ([10 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 3), i64 0, i64 4), align 8, !tbaa !5
  %113 = load double, ptr %5, align 8, !tbaa !5
  %114 = load double, ptr getelementptr inbounds ([10 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 3), i64 0, i64 5), align 8, !tbaa !5
  %115 = call double @llvm.fmuladd.f64(double %113, double %114, double %112)
  %116 = call double @llvm.fmuladd.f64(double %111, double %115, double %110)
  %117 = load double, ptr %7, align 8, !tbaa !5
  %118 = load double, ptr getelementptr inbounds ([10 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 3), i64 0, i64 6), align 8, !tbaa !5
  %119 = load double, ptr %5, align 8, !tbaa !5
  %120 = load double, ptr getelementptr inbounds ([10 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 3), i64 0, i64 7), align 8, !tbaa !5
  %121 = call double @llvm.fmuladd.f64(double %119, double %120, double %118)
  %122 = load double, ptr %6, align 8, !tbaa !5
  %123 = load double, ptr getelementptr inbounds ([10 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 3), i64 0, i64 8), align 8, !tbaa !5
  %124 = load double, ptr %5, align 8, !tbaa !5
  %125 = load double, ptr getelementptr inbounds ([10 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 3), i64 0, i64 9), align 8, !tbaa !5
  %126 = call double @llvm.fmuladd.f64(double %124, double %125, double %123)
  %127 = call double @llvm.fmuladd.f64(double %122, double %126, double %121)
  %128 = call double @llvm.fmuladd.f64(double %117, double %127, double %116)
  %129 = load double, ptr %13, align 8, !tbaa !5
  %130 = call double @llvm.fmuladd.f64(double %106, double %128, double %129)
  store double %130, ptr %13, align 8, !tbaa !5
  %131 = load double, ptr %13, align 8, !tbaa !5
  %132 = load double, ptr %8, align 8, !tbaa !5
  %133 = fadd double %132, %131
  store double %133, ptr %8, align 8, !tbaa !5
  %134 = load double, ptr %8, align 8, !tbaa !5
  %135 = call double @eval_as_double(double noundef %134)
  store double %135, ptr %2, align 8
  store i32 1, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  br label %275

136:                                              ; preds = %1
  %137 = load i32, ptr %21, align 4, !tbaa !12
  %138 = sub i32 %137, 16
  %139 = icmp uge i32 %138, 32736
  %140 = zext i1 %139 to i32
  %141 = sext i32 %140 to i64
  %142 = call i64 @llvm.expect.i64(i64 %141, i64 0)
  %143 = icmp ne i64 %142, 0
  br i1 %143, label %144, label %173

144:                                              ; preds = %136
  %145 = load i64, ptr %18, align 8, !tbaa !10
  %146 = mul i64 %145, 2
  %147 = icmp eq i64 %146, 0
  br i1 %147, label %148, label %150

148:                                              ; preds = %144
  %149 = call double @__math_divzero(i32 noundef 1)
  store double %149, ptr %2, align 8
  store i32 1, ptr %29, align 4
  br label %275

150:                                              ; preds = %144
  %151 = load i64, ptr %18, align 8, !tbaa !10
  store double 0x7FF0000000000000, ptr %34, align 8, !tbaa !9
  %152 = load i64, ptr %34, align 8, !tbaa !9
  %153 = icmp eq i64 %151, %152
  br i1 %153, label %154, label %156

154:                                              ; preds = %150
  %155 = load double, ptr %3, align 8, !tbaa !5
  store double %155, ptr %2, align 8
  store i32 1, ptr %29, align 4
  br label %275

156:                                              ; preds = %150
  %157 = load i32, ptr %21, align 4, !tbaa !12
  %158 = and i32 %157, 32768
  %159 = icmp ne i32 %158, 0
  br i1 %159, label %164, label %160

160:                                              ; preds = %156
  %161 = load i32, ptr %21, align 4, !tbaa !12
  %162 = and i32 %161, 32752
  %163 = icmp eq i32 %162, 32752
  br i1 %163, label %164, label %167

164:                                              ; preds = %160, %156
  %165 = load double, ptr %3, align 8, !tbaa !5
  %166 = call double @__math_invalid(double noundef %165)
  store double %166, ptr %2, align 8
  store i32 1, ptr %29, align 4
  br label %275

167:                                              ; preds = %160
  %168 = load double, ptr %3, align 8, !tbaa !5
  %169 = fmul double %168, 0x4330000000000000
  store double %169, ptr %35, align 8, !tbaa !9
  %170 = load i64, ptr %35, align 8, !tbaa !9
  store i64 %170, ptr %18, align 8, !tbaa !10
  %171 = load i64, ptr %18, align 8, !tbaa !10
  %172 = sub i64 %171, 234187180623265792
  store i64 %172, ptr %18, align 8, !tbaa !10
  br label %173

173:                                              ; preds = %167, %136
  %174 = load i64, ptr %18, align 8, !tbaa !10
  %175 = sub i64 %174, 4604367669032910848
  store i64 %175, ptr %20, align 8, !tbaa !10
  %176 = load i64, ptr %20, align 8, !tbaa !10
  %177 = lshr i64 %176, 46
  %178 = urem i64 %177, 64
  %179 = trunc i64 %178 to i32
  store i32 %179, ptr %23, align 4, !tbaa !12
  %180 = load i64, ptr %20, align 8, !tbaa !10
  %181 = ashr i64 %180, 52
  %182 = trunc i64 %181 to i32
  store i32 %182, ptr %22, align 4, !tbaa !12
  %183 = load i64, ptr %18, align 8, !tbaa !10
  %184 = load i64, ptr %20, align 8, !tbaa !10
  %185 = and i64 %184, -4503599627370496
  %186 = sub i64 %183, %185
  store i64 %186, ptr %19, align 8, !tbaa !10
  %187 = load i32, ptr %23, align 4, !tbaa !12
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [64 x %struct.anon], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 4), i64 0, i64 %188
  %190 = getelementptr inbounds %struct.anon, ptr %189, i32 0, i32 0
  %191 = load double, ptr %190, align 8, !tbaa !17
  store double %191, ptr %9, align 8, !tbaa !5
  %192 = load i32, ptr %23, align 4, !tbaa !12
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [64 x %struct.anon], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 4), i64 0, i64 %193
  %195 = getelementptr inbounds %struct.anon, ptr %194, i32 0, i32 1
  %196 = load double, ptr %195, align 8, !tbaa !19
  store double %196, ptr %10, align 8, !tbaa !5
  %197 = load i64, ptr %19, align 8, !tbaa !10
  store i64 %197, ptr %36, align 8, !tbaa !9
  %198 = load double, ptr %36, align 8, !tbaa !9
  store double %198, ptr %4, align 8, !tbaa !5
  %199 = load i32, ptr %22, align 4, !tbaa !12
  %200 = sitofp i32 %199 to double
  store double %200, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #6
  %201 = load double, ptr %4, align 8, !tbaa !5
  %202 = load i32, ptr %23, align 4, !tbaa !12
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [64 x %struct.anon.6], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 5), i64 0, i64 %203
  %205 = getelementptr inbounds %struct.anon.6, ptr %204, i32 0, i32 0
  %206 = load double, ptr %205, align 8, !tbaa !17
  %207 = fsub double %201, %206
  %208 = load i32, ptr %23, align 4, !tbaa !12
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [64 x %struct.anon.6], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 5), i64 0, i64 %209
  %211 = getelementptr inbounds %struct.anon.6, ptr %210, i32 0, i32 1
  %212 = load double, ptr %211, align 8, !tbaa !19
  %213 = fsub double %207, %212
  %214 = load double, ptr %9, align 8, !tbaa !5
  %215 = fmul double %213, %214
  store double %215, ptr %5, align 8, !tbaa !5
  %216 = load double, ptr %5, align 8, !tbaa !5
  store double %216, ptr %40, align 8, !tbaa !9
  %217 = load i64, ptr %40, align 8, !tbaa !9
  %218 = and i64 %217, -4294967296
  store i64 %218, ptr %39, align 8, !tbaa !9
  %219 = load double, ptr %39, align 8, !tbaa !9
  store double %219, ptr %37, align 8, !tbaa !5
  %220 = load double, ptr %5, align 8, !tbaa !5
  %221 = load double, ptr %37, align 8, !tbaa !5
  %222 = fsub double %220, %221
  store double %222, ptr %38, align 8, !tbaa !5
  %223 = load double, ptr %37, align 8, !tbaa !5
  %224 = load double, ptr @__log2_data, align 8, !tbaa !14
  %225 = fmul double %223, %224
  store double %225, ptr %14, align 8, !tbaa !5
  %226 = load double, ptr %38, align 8, !tbaa !5
  %227 = load double, ptr @__log2_data, align 8, !tbaa !14
  %228 = load double, ptr %5, align 8, !tbaa !5
  %229 = load double, ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 1), align 8, !tbaa !16
  %230 = fmul double %228, %229
  %231 = call double @llvm.fmuladd.f64(double %226, double %227, double %230)
  store double %231, ptr %15, align 8, !tbaa !5
  %232 = load double, ptr %11, align 8, !tbaa !5
  %233 = load double, ptr %10, align 8, !tbaa !5
  %234 = fadd double %232, %233
  store double %234, ptr %16, align 8, !tbaa !5
  %235 = load double, ptr %16, align 8, !tbaa !5
  %236 = load double, ptr %14, align 8, !tbaa !5
  %237 = fadd double %235, %236
  store double %237, ptr %12, align 8, !tbaa !5
  %238 = load double, ptr %16, align 8, !tbaa !5
  %239 = load double, ptr %12, align 8, !tbaa !5
  %240 = fsub double %238, %239
  %241 = load double, ptr %14, align 8, !tbaa !5
  %242 = fadd double %240, %241
  %243 = load double, ptr %15, align 8, !tbaa !5
  %244 = fadd double %242, %243
  store double %244, ptr %13, align 8, !tbaa !5
  %245 = load double, ptr %5, align 8, !tbaa !5
  %246 = load double, ptr %5, align 8, !tbaa !5
  %247 = fmul double %245, %246
  store double %247, ptr %6, align 8, !tbaa !5
  %248 = load double, ptr %6, align 8, !tbaa !5
  %249 = load double, ptr %6, align 8, !tbaa !5
  %250 = fmul double %248, %249
  store double %250, ptr %7, align 8, !tbaa !5
  %251 = load double, ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 2), align 8, !tbaa !5
  %252 = load double, ptr %5, align 8, !tbaa !5
  %253 = load double, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 2), i64 0, i64 1), align 8, !tbaa !5
  %254 = call double @llvm.fmuladd.f64(double %252, double %253, double %251)
  %255 = load double, ptr %6, align 8, !tbaa !5
  %256 = load double, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 2), i64 0, i64 2), align 8, !tbaa !5
  %257 = load double, ptr %5, align 8, !tbaa !5
  %258 = load double, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 2), i64 0, i64 3), align 8, !tbaa !5
  %259 = call double @llvm.fmuladd.f64(double %257, double %258, double %256)
  %260 = call double @llvm.fmuladd.f64(double %255, double %259, double %254)
  %261 = load double, ptr %7, align 8, !tbaa !5
  %262 = load double, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 2), i64 0, i64 4), align 8, !tbaa !5
  %263 = load double, ptr %5, align 8, !tbaa !5
  %264 = load double, ptr getelementptr inbounds ([6 x double], ptr getelementptr inbounds (%struct.log2_data, ptr @__log2_data, i32 0, i32 2), i64 0, i64 5), align 8, !tbaa !5
  %265 = call double @llvm.fmuladd.f64(double %263, double %264, double %262)
  %266 = call double @llvm.fmuladd.f64(double %261, double %265, double %260)
  store double %266, ptr %17, align 8, !tbaa !5
  %267 = load double, ptr %13, align 8, !tbaa !5
  %268 = load double, ptr %6, align 8, !tbaa !5
  %269 = load double, ptr %17, align 8, !tbaa !5
  %270 = call double @llvm.fmuladd.f64(double %268, double %269, double %267)
  %271 = load double, ptr %12, align 8, !tbaa !5
  %272 = fadd double %270, %271
  store double %272, ptr %8, align 8, !tbaa !5
  %273 = load double, ptr %8, align 8, !tbaa !5
  %274 = call double @eval_as_double(double noundef %273)
  store double %274, ptr %2, align 8
  store i32 1, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  br label %275

275:                                              ; preds = %173, %164, %154, %148, %65, %64
  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 8, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %276 = load double, ptr %2, align 8
  ret double %276
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @top16(double noundef) #2

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden double @eval_as_double(double noundef) #2

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

declare hidden double @__math_divzero(i32 noundef) #5

declare hidden double @__math_invalid(double noundef) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { "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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"log2_data", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 64, !7, i64 144, !7, i64 1168}
!16 = !{!15, !6, i64 8}
!17 = !{!18, !6, i64 0}
!18 = !{!"", !6, i64 0, !6, i64 8}
!19 = !{!18, !6, i64 8}


; 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.log2_data = type { double, double, [6 x double], [10 x double], [64 x %struct.anon], [64 x %struct.anon.6] }
%struct.anon = type { double, double }
%struct.anon.6 = type { double, double }

@__log2_data = external hidden local_unnamed_addr constant %struct.log2_data, align 8

; Function Attrs: nounwind uwtable
define dso_local double @log2(double noundef %0) local_unnamed_addr #0 {
  %2 = bitcast double %0 to i64
  %3 = tail call i32 @top16(double noundef %0)
  %4 = add i64 %2, -4606800540372828160
  %5 = icmp ult i64 %4, 581272283906048
  br i1 %5, label %6, label %47, !prof !5

6:                                                ; preds = %1
  %7 = icmp eq i64 %2, 4607182418800017408
  br i1 %7, label %117, label %8, !prof !5

8:                                                ; preds = %6
  %9 = fadd double %0, -1.000000e+00
  %10 = bitcast double %9 to i64
  %11 = and i64 %10, -4294967296
  %12 = bitcast i64 %11 to double
  %13 = fsub double %9, %12
  %14 = load double, ptr @__log2_data, align 8, !tbaa !6
  %15 = fmul double %14, %12
  %16 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 8), align 8, !tbaa !11
  %17 = fmul double %9, %16
  %18 = tail call double @llvm.fmuladd.f64(double %13, double %14, double %17)
  %19 = fmul double %9, %9
  %20 = fmul double %19, %19
  %21 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 64), align 8, !tbaa !12
  %22 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 72), align 8, !tbaa !12
  %23 = tail call double @llvm.fmuladd.f64(double %9, double %22, double %21)
  %24 = fmul double %19, %23
  %25 = fadd double %15, %24
  %26 = fsub double %15, %25
  %27 = fadd double %24, %26
  %28 = fadd double %18, %27
  %29 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 80), align 8, !tbaa !12
  %30 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 88), align 8, !tbaa !12
  %31 = tail call double @llvm.fmuladd.f64(double %9, double %30, double %29)
  %32 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 96), align 8, !tbaa !12
  %33 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 104), align 8, !tbaa !12
  %34 = tail call double @llvm.fmuladd.f64(double %9, double %33, double %32)
  %35 = tail call double @llvm.fmuladd.f64(double %19, double %34, double %31)
  %36 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 112), align 8, !tbaa !12
  %37 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 120), align 8, !tbaa !12
  %38 = tail call double @llvm.fmuladd.f64(double %9, double %37, double %36)
  %39 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 128), align 8, !tbaa !12
  %40 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 136), align 8, !tbaa !12
  %41 = tail call double @llvm.fmuladd.f64(double %9, double %40, double %39)
  %42 = tail call double @llvm.fmuladd.f64(double %19, double %41, double %38)
  %43 = tail call double @llvm.fmuladd.f64(double %20, double %42, double %35)
  %44 = tail call double @llvm.fmuladd.f64(double %20, double %43, double %28)
  %45 = fadd double %25, %44
  %46 = tail call double @eval_as_double(double noundef %45)
  br label %117

47:                                               ; preds = %1
  %48 = add i32 %3, -32752
  %49 = icmp ult i32 %48, -32736
  br i1 %49, label %50, label %66, !prof !5

50:                                               ; preds = %47
  %51 = fcmp oeq double %0, 0.000000e+00
  br i1 %51, label %52, label %54

52:                                               ; preds = %50
  %53 = tail call double @__math_divzero(i32 noundef 1) #4
  br label %117

54:                                               ; preds = %50
  %55 = icmp eq i64 %2, 9218868437227405312
  br i1 %55, label %117, label %56

56:                                               ; preds = %54
  %57 = and i32 %3, 32768
  %.not = icmp ne i32 %57, 0
  %58 = and i32 %3, 32752
  %59 = icmp eq i32 %58, 32752
  %or.cond = or i1 %.not, %59
  br i1 %or.cond, label %60, label %62

60:                                               ; preds = %56
  %61 = tail call double @__math_invalid(double noundef %0) #4
  br label %117

62:                                               ; preds = %56
  %63 = fmul double %0, 0x4330000000000000
  %64 = bitcast double %63 to i64
  %65 = add i64 %64, -234187180623265792
  br label %66

66:                                               ; preds = %62, %47
  %.096 = phi i64 [ %65, %62 ], [ %2, %47 ]
  %67 = add i64 %.096, -4604367669032910848
  %68 = lshr i64 %67, 46
  %69 = and i64 %68, 63
  %70 = ashr i64 %67, 52
  %71 = trunc nsw i64 %70 to i32
  %72 = and i64 %67, -4503599627370496
  %73 = sub i64 %.096, %72
  %74 = getelementptr inbounds [64 x %struct.anon], ptr getelementptr inbounds (i8, ptr @__log2_data, i64 144), i64 0, i64 %69
  %75 = load double, ptr %74, align 8, !tbaa !13
  %76 = getelementptr inbounds i8, ptr %74, i64 8
  %77 = load double, ptr %76, align 8, !tbaa !15
  %78 = bitcast i64 %73 to double
  %79 = sitofp i32 %71 to double
  %80 = getelementptr inbounds [64 x %struct.anon.6], ptr getelementptr inbounds (i8, ptr @__log2_data, i64 1168), i64 0, i64 %69
  %81 = load double, ptr %80, align 8, !tbaa !13
  %82 = fsub double %78, %81
  %83 = getelementptr inbounds i8, ptr %80, i64 8
  %84 = load double, ptr %83, align 8, !tbaa !15
  %85 = fsub double %82, %84
  %86 = fmul double %75, %85
  %87 = bitcast double %86 to i64
  %88 = and i64 %87, -4294967296
  %89 = bitcast i64 %88 to double
  %90 = fsub double %86, %89
  %91 = load double, ptr @__log2_data, align 8, !tbaa !6
  %92 = fmul double %91, %89
  %93 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 8), align 8, !tbaa !11
  %94 = fmul double %93, %86
  %95 = tail call double @llvm.fmuladd.f64(double %90, double %91, double %94)
  %96 = fadd double %77, %79
  %97 = fadd double %96, %92
  %98 = fsub double %96, %97
  %99 = fadd double %92, %98
  %100 = fadd double %95, %99
  %101 = fmul double %86, %86
  %102 = fmul double %101, %101
  %103 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 16), align 8, !tbaa !12
  %104 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 24), align 8, !tbaa !12
  %105 = tail call double @llvm.fmuladd.f64(double %86, double %104, double %103)
  %106 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 32), align 8, !tbaa !12
  %107 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 40), align 8, !tbaa !12
  %108 = tail call double @llvm.fmuladd.f64(double %86, double %107, double %106)
  %109 = tail call double @llvm.fmuladd.f64(double %101, double %108, double %105)
  %110 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 48), align 8, !tbaa !12
  %111 = load double, ptr getelementptr inbounds (i8, ptr @__log2_data, i64 56), align 8, !tbaa !12
  %112 = tail call double @llvm.fmuladd.f64(double %86, double %111, double %110)
  %113 = tail call double @llvm.fmuladd.f64(double %102, double %112, double %109)
  %114 = tail call double @llvm.fmuladd.f64(double %101, double %113, double %100)
  %115 = fadd double %97, %114
  %116 = tail call double @eval_as_double(double noundef %115)
  br label %117

117:                                              ; preds = %54, %6, %66, %60, %52, %8
  %.0 = phi double [ %46, %8 ], [ %53, %52 ], [ %61, %60 ], [ %116, %66 ], [ 0.000000e+00, %6 ], [ %0, %54 ]
  ret double %.0
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @top16(double noundef) 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: inlinehint nounwind uwtable
declare hidden double @eval_as_double(double noundef) local_unnamed_addr #1

declare hidden double @__math_divzero(i32 noundef) local_unnamed_addr #3

declare hidden double @__math_invalid(double noundef) local_unnamed_addr #3

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 = { 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 = { "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 = { 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 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!6 = !{!7, !8, i64 0}
!7 = !{!"log2_data", !8, i64 0, !8, i64 8, !9, i64 16, !9, i64 64, !9, i64 144, !9, i64 1168}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!7, !8, i64 8}
!12 = !{!8, !8, i64 0}
!13 = !{!14, !8, i64 0}
!14 = !{!"", !8, i64 0, !8, i64 8}
!15 = !{!14, !8, i64 8}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LowerExpectIntrinsicPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass