; LLVM IR from JayXon/Leanify :: lib/mozjpeg (jcarith)

; 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.jpeg_compress_struct = type { ptr, ptr, ptr, ptr, i32, i32, ptr, i32, i32, i32, i32, double, i32, i32, i32, ptr, [4 x ptr], [4 x ptr], [4 x ptr], [16 x i8], [16 x i8], [16 x i8], i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i16, i16, i32, i32, i32, i32, i32, i32, i32, [4 x ptr], i32, i32, i32, [10 x i32], i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.arith_rates = type { [64 x [2 x float]], [256 x [2 x float]], i32, i32, i32 }
%struct.arith_entropy_encoder = type { %struct.jpeg_entropy_encoder, i64, i64, i64, i64, i32, i32, [4 x i32], [4 x i32], i32, i32, [16 x ptr], [16 x ptr], [4 x i8] }
%struct.jpeg_entropy_encoder = type { ptr, ptr, ptr }

@jpeg_aritab = external constant [0 x i64], align 8

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

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

; Function Attrs: nounwind uwtable
define dso_local void @jget_arith_rates(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %21, i32 0, i32 62
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  store ptr %23, ptr %10, align 8, !tbaa !5
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %24, i32 0, i32 19
  %26 = load i32, ptr %6, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [16 x i8], ptr %25, i64 0, i64 %27
  %29 = load i8, ptr %28, align 1, !tbaa !15
  %30 = zext i8 %29 to i32
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.arith_rates, ptr %31, i32 0, i32 2
  store i32 %30, ptr %32, align 4, !tbaa !16
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %33, i32 0, i32 20
  %35 = load i32, ptr %6, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [16 x i8], ptr %34, i64 0, i64 %36
  %38 = load i8, ptr %37, align 1, !tbaa !15
  %39 = zext i8 %38 to i32
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.arith_rates, ptr %40, i32 0, i32 3
  store i32 %39, ptr %41, align 4, !tbaa !18
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %42, i32 0, i32 21
  %44 = load i32, ptr %7, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [16 x i8], ptr %43, i64 0, i64 %45
  %47 = load i8, ptr %46, align 1, !tbaa !15
  %48 = zext i8 %47 to i32
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.arith_rates, ptr %49, i32 0, i32 4
  store i32 %48, ptr %50, align 4, !tbaa !19
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %119, %4
  %52 = load i32, ptr %9, align 4, !tbaa !9
  %53 = icmp slt i32 %52, 64
  br i1 %53, label %54, label %122

54:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.arith_entropy_encoder, ptr %55, i32 0, i32 11
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [16 x ptr], ptr %56, i64 0, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i8, ptr %60, i64 %62
  %64 = load i8, ptr %63, align 1, !tbaa !15
  %65 = zext i8 %64 to i32
  store i32 %65, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = ashr i32 %66, 7
  store i32 %67, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %68 = load i32, ptr %11, align 4, !tbaa !9
  %69 = and i32 %68, 127
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [0 x i64], ptr @jpeg_aritab, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !20
  %73 = ashr i64 %72, 16
  %74 = sitofp i64 %73 to double
  %75 = fdiv double %74, 0x40E6A09E66666666
  %76 = fptrunc double %75 to float
  store float %76, ptr %13, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %77 = load i32, ptr %12, align 4, !tbaa !9
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %82

79:                                               ; preds = %54
  %80 = load float, ptr %13, align 4, !tbaa !22
  %81 = fpext float %80 to double
  br label %86

82:                                               ; preds = %54
  %83 = load float, ptr %13, align 4, !tbaa !22
  %84 = fpext float %83 to double
  %85 = fsub double 1.000000e+00, %84
  br label %86

86:                                               ; preds = %82, %79
  %87 = phi double [ %81, %79 ], [ %85, %82 ]
  %88 = fptrunc double %87 to float
  store float %88, ptr %14, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %89 = load float, ptr %14, align 4, !tbaa !22
  %90 = fpext float %89 to double
  %91 = fsub double 1.000000e+00, %90
  %92 = fptrunc double %91 to float
  store float %92, ptr %15, align 4, !tbaa !22
  %93 = load float, ptr %14, align 4, !tbaa !22
  %94 = fpext float %93 to double
  %95 = call double @log(double noundef %94) #3
  %96 = fneg double %95
  %97 = call double @log(double noundef 2.000000e+00) #3
  %98 = fdiv double %96, %97
  %99 = fptrunc double %98 to float
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.arith_rates, ptr %100, i32 0, i32 0
  %102 = load i32, ptr %9, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [64 x [2 x float]], ptr %101, i64 0, i64 %103
  %105 = getelementptr inbounds [2 x float], ptr %104, i64 0, i64 0
  store float %99, ptr %105, align 4, !tbaa !22
  %106 = load float, ptr %15, align 4, !tbaa !22
  %107 = fpext float %106 to double
  %108 = call double @log(double noundef %107) #3
  %109 = fneg double %108
  %110 = call double @log(double noundef 2.000000e+00) #3
  %111 = fdiv double %109, %110
  %112 = fptrunc double %111 to float
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.arith_rates, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [64 x [2 x float]], ptr %114, i64 0, i64 %116
  %118 = getelementptr inbounds [2 x float], ptr %117, i64 0, i64 1
  store float %112, ptr %118, align 4, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %119

119:                                              ; preds = %86
  %120 = load i32, ptr %9, align 4, !tbaa !9
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %9, align 4, !tbaa !9
  br label %51, !llvm.loop !24

122:                                              ; preds = %51
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %191, %122
  %124 = load i32, ptr %9, align 4, !tbaa !9
  %125 = icmp slt i32 %124, 256
  br i1 %125, label %126, label %194

126:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.arith_entropy_encoder, ptr %127, i32 0, i32 12
  %129 = load i32, ptr %7, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [16 x ptr], ptr %128, i64 0, i64 %130
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  %133 = load i32, ptr %9, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds i8, ptr %132, i64 %134
  %136 = load i8, ptr %135, align 1, !tbaa !15
  %137 = zext i8 %136 to i32
  store i32 %137, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %138 = load i32, ptr %16, align 4, !tbaa !9
  %139 = ashr i32 %138, 7
  store i32 %139, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %140 = load i32, ptr %16, align 4, !tbaa !9
  %141 = and i32 %140, 127
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [0 x i64], ptr @jpeg_aritab, i64 0, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !20
  %145 = ashr i64 %144, 16
  %146 = sitofp i64 %145 to double
  %147 = fdiv double %146, 0x40E6A09E66666666
  %148 = fptrunc double %147 to float
  store float %148, ptr %18, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  %149 = load i32, ptr %17, align 4, !tbaa !9
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %154

151:                                              ; preds = %126
  %152 = load float, ptr %18, align 4, !tbaa !22
  %153 = fpext float %152 to double
  br label %158

154:                                              ; preds = %126
  %155 = load float, ptr %18, align 4, !tbaa !22
  %156 = fpext float %155 to double
  %157 = fsub double 1.000000e+00, %156
  br label %158

158:                                              ; preds = %154, %151
  %159 = phi double [ %153, %151 ], [ %157, %154 ]
  %160 = fptrunc double %159 to float
  store float %160, ptr %19, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %161 = load float, ptr %19, align 4, !tbaa !22
  %162 = fpext float %161 to double
  %163 = fsub double 1.000000e+00, %162
  %164 = fptrunc double %163 to float
  store float %164, ptr %20, align 4, !tbaa !22
  %165 = load float, ptr %19, align 4, !tbaa !22
  %166 = fpext float %165 to double
  %167 = call double @log(double noundef %166) #3
  %168 = fneg double %167
  %169 = call double @log(double noundef 2.000000e+00) #3
  %170 = fdiv double %168, %169
  %171 = fptrunc double %170 to float
  %172 = load ptr, ptr %8, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.arith_rates, ptr %172, i32 0, i32 1
  %174 = load i32, ptr %9, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [256 x [2 x float]], ptr %173, i64 0, i64 %175
  %177 = getelementptr inbounds [2 x float], ptr %176, i64 0, i64 0
  store float %171, ptr %177, align 4, !tbaa !22
  %178 = load float, ptr %20, align 4, !tbaa !22
  %179 = fpext float %178 to double
  %180 = call double @log(double noundef %179) #3
  %181 = fneg double %180
  %182 = call double @log(double noundef 2.000000e+00) #3
  %183 = fdiv double %181, %182
  %184 = fptrunc double %183 to float
  %185 = load ptr, ptr %8, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.arith_rates, ptr %185, i32 0, i32 1
  %187 = load i32, ptr %9, align 4, !tbaa !9
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [256 x [2 x float]], ptr %186, i64 0, i64 %188
  %190 = getelementptr inbounds [2 x float], ptr %189, i64 0, i64 1
  store float %184, ptr %190, align 4, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %191

191:                                              ; preds = %158
  %192 = load i32, ptr %9, align 4, !tbaa !9
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %9, align 4, !tbaa !9
  br label %123, !llvm.loop !26

194:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret void
}

; Function Attrs: nounwind
declare double @log(double noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #3 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 496}
!12 = !{!"jpeg_compress_struct", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !6, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !13, i64 64, !10, i64 72, !10, i64 76, !10, i64 80, !6, i64 88, !7, i64 96, !7, i64 128, !7, i64 160, !7, i64 192, !7, i64 208, !7, i64 224, !10, i64 240, !6, i64 248, !10, i64 256, !10, i64 260, !10, i64 264, !10, i64 268, !10, i64 272, !10, i64 276, !10, i64 280, !10, i64 284, !10, i64 288, !7, i64 292, !7, i64 293, !7, i64 294, !14, i64 296, !14, i64 298, !10, i64 300, !10, i64 304, !10, i64 308, !10, i64 312, !10, i64 316, !10, i64 320, !10, i64 324, !7, i64 328, !10, i64 360, !10, i64 364, !10, i64 368, !7, i64 372, !10, i64 412, !10, i64 416, !10, i64 420, !10, i64 424, !6, i64 432, !6, i64 440, !6, i64 448, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !6, i64 488, !6, i64 496, !6, i64 504, !10, i64 512}
!13 = !{!"double", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !10, i64 2560}
!17 = !{!"", !7, i64 0, !7, i64 512, !10, i64 2560, !10, i64 2564, !10, i64 2568}
!18 = !{!17, !10, i64 2564}
!19 = !{!17, !10, i64 2568}
!20 = !{!21, !21, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"float", !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}


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

@jpeg_aritab = external local_unnamed_addr constant [0 x i64], align 8

; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: write) uwtable
define dso_local void @jget_arith_rates(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 {
  %5 = getelementptr inbounds i8, ptr %0, i64 496
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 192
  %8 = sext i32 %1 to i64
  %9 = getelementptr inbounds [16 x i8], ptr %7, i64 0, i64 %8
  %10 = load i8, ptr %9, align 1, !tbaa !13
  %11 = zext i8 %10 to i32
  %12 = getelementptr inbounds i8, ptr %3, i64 2560
  store i32 %11, ptr %12, align 4, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %0, i64 208
  %14 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 %8
  %15 = load i8, ptr %14, align 1, !tbaa !13
  %16 = zext i8 %15 to i32
  %17 = getelementptr inbounds i8, ptr %3, i64 2564
  store i32 %16, ptr %17, align 4, !tbaa !16
  %18 = getelementptr inbounds i8, ptr %0, i64 224
  %19 = sext i32 %2 to i64
  %20 = getelementptr inbounds [16 x i8], ptr %18, i64 0, i64 %19
  %21 = load i8, ptr %20, align 1, !tbaa !13
  %22 = zext i8 %21 to i32
  %23 = getelementptr inbounds i8, ptr %3, i64 2568
  store i32 %22, ptr %23, align 4, !tbaa !17
  %24 = getelementptr inbounds i8, ptr %6, i64 104
  %25 = getelementptr inbounds [16 x ptr], ptr %24, i64 0, i64 %8
  br label %29

.preheader:                                       ; preds = %29
  %26 = getelementptr inbounds i8, ptr %6, i64 232
  %27 = getelementptr inbounds [16 x ptr], ptr %26, i64 0, i64 %19
  %28 = getelementptr inbounds i8, ptr %3, i64 512
  br label %53

29:                                               ; preds = %4, %29
  %indvars.iv = phi i64 [ 0, %4 ], [ %indvars.iv.next, %29 ]
  %30 = load ptr, ptr %25, align 8, !tbaa !18
  %31 = getelementptr inbounds i8, ptr %30, i64 %indvars.iv
  %32 = load i8, ptr %31, align 1, !tbaa !13
  %33 = and i8 %32, 127
  %34 = zext nneg i8 %33 to i64
  %35 = getelementptr inbounds [0 x i64], ptr @jpeg_aritab, i64 0, i64 %34
  %36 = load i64, ptr %35, align 8, !tbaa !19
  %37 = ashr i64 %36, 16
  %38 = sitofp i64 %37 to double
  %39 = fdiv double %38, 0x40E6A09E66666666
  %40 = fptrunc double %39 to float
  %.not4345 = icmp slt i8 %32, 0
  %41 = fsub float 1.000000e+00, %40
  %narrow.sel46 = select i1 %.not4345, float %40, float %41
  %42 = fpext float %narrow.sel46 to double
  %43 = fsub float 1.000000e+00, %narrow.sel46
  %44 = tail call double @log(double noundef %42) #2
  %45 = fdiv double %44, 0xBFE62E42FEFA39EF
  %46 = fptrunc double %45 to float
  %47 = getelementptr inbounds [64 x [2 x float]], ptr %3, i64 0, i64 %indvars.iv
  store float %46, ptr %47, align 4, !tbaa !21
  %48 = fpext float %43 to double
  %49 = tail call double @log(double noundef %48) #2
  %50 = fdiv double %49, 0xBFE62E42FEFA39EF
  %51 = fptrunc double %50 to float
  %52 = getelementptr inbounds i8, ptr %47, i64 4
  store float %51, ptr %52, align 4, !tbaa !21
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 64
  br i1 %exitcond.not, label %.preheader, label %29, !llvm.loop !23

53:                                               ; preds = %.preheader, %53
  %indvars.iv50 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next51, %53 ]
  %54 = load ptr, ptr %27, align 8, !tbaa !18
  %55 = getelementptr inbounds i8, ptr %54, i64 %indvars.iv50
  %56 = load i8, ptr %55, align 1, !tbaa !13
  %57 = and i8 %56, 127
  %58 = zext nneg i8 %57 to i64
  %59 = getelementptr inbounds [0 x i64], ptr @jpeg_aritab, i64 0, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !19
  %61 = ashr i64 %60, 16
  %62 = sitofp i64 %61 to double
  %63 = fdiv double %62, 0x40E6A09E66666666
  %64 = fptrunc double %63 to float
  %.not44 = icmp slt i8 %56, 0
  %65 = fsub float 1.000000e+00, %64
  %narrow.sel = select i1 %.not44, float %64, float %65
  %66 = fpext float %narrow.sel to double
  %67 = fsub float 1.000000e+00, %narrow.sel
  %68 = tail call double @log(double noundef %66) #2
  %69 = fdiv double %68, 0xBFE62E42FEFA39EF
  %70 = fptrunc double %69 to float
  %71 = getelementptr inbounds [256 x [2 x float]], ptr %28, i64 0, i64 %indvars.iv50
  store float %70, ptr %71, align 4, !tbaa !21
  %72 = fpext float %67 to double
  %73 = tail call double @log(double noundef %72) #2
  %74 = fdiv double %73, 0xBFE62E42FEFA39EF
  %75 = fptrunc double %74 to float
  %76 = getelementptr inbounds i8, ptr %71, i64 4
  store float %75, ptr %76, align 4, !tbaa !21
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %exitcond53.not = icmp eq i64 %indvars.iv.next51, 256
  br i1 %exitcond53.not, label %77, label %53, !llvm.loop !25

77:                                               ; preds = %53
  ret void
}

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

attributes #0 = { nofree nounwind memory(readwrite, inaccessiblemem: write) 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 = { 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 #2 = { 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 496}
!6 = !{!"jpeg_compress_struct", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 36, !7, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !11, i64 64, !10, i64 72, !10, i64 76, !10, i64 80, !7, i64 88, !8, i64 96, !8, i64 128, !8, i64 160, !8, i64 192, !8, i64 208, !8, i64 224, !10, i64 240, !7, i64 248, !10, i64 256, !10, i64 260, !10, i64 264, !10, i64 268, !10, i64 272, !10, i64 276, !10, i64 280, !10, i64 284, !10, i64 288, !8, i64 292, !8, i64 293, !8, i64 294, !12, i64 296, !12, i64 298, !10, i64 300, !10, i64 304, !10, i64 308, !10, i64 312, !10, i64 316, !10, i64 320, !10, i64 324, !8, i64 328, !10, i64 360, !10, i64 364, !10, i64 368, !8, i64 372, !10, i64 412, !10, i64 416, !10, i64 420, !10, i64 424, !7, i64 432, !7, i64 440, !7, i64 448, !7, i64 456, !7, i64 464, !7, i64 472, !7, i64 480, !7, i64 488, !7, i64 496, !7, i64 504, !10, i64 512}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!8, !8, i64 0}
!14 = !{!15, !10, i64 2560}
!15 = !{!"", !8, i64 0, !8, i64 512, !10, i64 2560, !10, i64 2564, !10, i64 2568}
!16 = !{!15, !10, i64 2564}
!17 = !{!15, !10, i64 2568}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"long", !8, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"float", !8, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass