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

; 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_decompress_struct = type { ptr, ptr, ptr, ptr, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, ptr, [4 x ptr], [4 x ptr], [4 x ptr], i32, ptr, i32, i32, [16 x i8], [16 x i8], [16 x i8], i32, i32, i8, i8, i8, i16, i16, i32, i8, i32, ptr, i32, i32, i32, i32, ptr, i32, [4 x ptr], i32, i32, i32, [10 x i32], i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.jpeg_memory_mgr = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64 }
%struct.my_coef_controller = type { %struct.jpeg_d_coef_controller, i32, i32, i32, [10 x ptr], ptr, [10 x ptr] }
%struct.jpeg_d_coef_controller = type { ptr, ptr, ptr, ptr, ptr }
%struct.jpeg_component_info = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr }

; Function Attrs: nounwind uwtable
define dso_local void @jinit_d_coef_controller(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %11, i32 0, i32 1
  %13 = load ptr, ptr %12, align 8, !tbaa !11
  %14 = getelementptr inbounds %struct.jpeg_memory_mgr, ptr %13, i32 0, i32 0
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = call ptr %15(ptr noundef %16, i32 noundef 1, i64 noundef 224)
  store ptr %17, ptr %5, align 8, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %19, i32 0, i32 79
  store ptr %18, ptr %20, align 8, !tbaa !18
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.my_coef_controller, ptr %21, i32 0, i32 0
  %23 = getelementptr inbounds %struct.jpeg_d_coef_controller, ptr %22, i32 0, i32 0
  store ptr @start_input_pass, ptr %23, align 8, !tbaa !19
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.my_coef_controller, ptr %24, i32 0, i32 0
  %26 = getelementptr inbounds %struct.jpeg_d_coef_controller, ptr %25, i32 0, i32 2
  store ptr @start_output_pass, ptr %26, align 8, !tbaa !22
  %27 = load i32, ptr %4, align 4, !tbaa !9
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %94

29:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  store i32 0, ptr %6, align 4, !tbaa !9
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %30, i32 0, i32 44
  %32 = load ptr, ptr %31, align 8, !tbaa !23
  store ptr %32, ptr %8, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %76, %29
  %34 = load i32, ptr %6, align 4, !tbaa !9
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %35, i32 0, i32 9
  %37 = load i32, ptr %36, align 8, !tbaa !24
  %38 = icmp slt i32 %34, %37
  br i1 %38, label %39, label %81

39:                                               ; preds = %33
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.jpeg_component_info, ptr %40, i32 0, i32 3
  %42 = load i32, ptr %41, align 4, !tbaa !25
  store i32 %42, ptr %7, align 4, !tbaa !9
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %43, i32 0, i32 1
  %45 = load ptr, ptr %44, align 8, !tbaa !11
  %46 = getelementptr inbounds %struct.jpeg_memory_mgr, ptr %45, i32 0, i32 5
  %47 = load ptr, ptr %46, align 8, !tbaa !27
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.jpeg_component_info, ptr %49, i32 0, i32 7
  %51 = load i32, ptr %50, align 4, !tbaa !28
  %52 = zext i32 %51 to i64
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.jpeg_component_info, ptr %53, i32 0, i32 2
  %55 = load i32, ptr %54, align 8, !tbaa !29
  %56 = sext i32 %55 to i64
  %57 = call i64 @jround_up(i64 noundef %52, i64 noundef %56)
  %58 = trunc i64 %57 to i32
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.jpeg_component_info, ptr %59, i32 0, i32 8
  %61 = load i32, ptr %60, align 8, !tbaa !30
  %62 = zext i32 %61 to i64
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.jpeg_component_info, ptr %63, i32 0, i32 3
  %65 = load i32, ptr %64, align 4, !tbaa !25
  %66 = sext i32 %65 to i64
  %67 = call i64 @jround_up(i64 noundef %62, i64 noundef %66)
  %68 = trunc i64 %67 to i32
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = call ptr %47(ptr noundef %48, i32 noundef 1, i32 noundef 1, i32 noundef %58, i32 noundef %68, i32 noundef %69)
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.my_coef_controller, ptr %71, i32 0, i32 6
  %73 = load i32, ptr %6, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [10 x ptr], ptr %72, i64 0, i64 %74
  store ptr %70, ptr %75, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %39
  %77 = load i32, ptr %6, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %6, align 4, !tbaa !9
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.jpeg_component_info, ptr %79, i32 1
  store ptr %80, ptr %8, align 8, !tbaa !5
  br label %33, !llvm.loop !31

81:                                               ; preds = %33
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.my_coef_controller, ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds %struct.jpeg_d_coef_controller, ptr %83, i32 0, i32 1
  store ptr @consume_data, ptr %84, align 8, !tbaa !33
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.my_coef_controller, ptr %85, i32 0, i32 0
  %87 = getelementptr inbounds %struct.jpeg_d_coef_controller, ptr %86, i32 0, i32 3
  store ptr @decompress_data, ptr %87, align 8, !tbaa !34
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.my_coef_controller, ptr %88, i32 0, i32 6
  %90 = getelementptr inbounds [10 x ptr], ptr %89, i64 0, i64 0
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.my_coef_controller, ptr %91, i32 0, i32 0
  %93 = getelementptr inbounds %struct.jpeg_d_coef_controller, ptr %92, i32 0, i32 4
  store ptr %90, ptr %93, align 8, !tbaa !35
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %128

94:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %95, i32 0, i32 1
  %97 = load ptr, ptr %96, align 8, !tbaa !11
  %98 = getelementptr inbounds %struct.jpeg_memory_mgr, ptr %97, i32 0, i32 1
  %99 = load ptr, ptr %98, align 8, !tbaa !36
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = call ptr %99(ptr noundef %100, i32 noundef 1, i64 noundef 1280)
  store ptr %101, ptr %9, align 8, !tbaa !5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %115, %94
  %103 = load i32, ptr %10, align 4, !tbaa !9
  %104 = icmp slt i32 %103, 10
  br i1 %104, label %105, label %118

105:                                              ; preds = %102
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = load i32, ptr %10, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [64 x i16], ptr %106, i64 %108
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.my_coef_controller, ptr %110, i32 0, i32 4
  %112 = load i32, ptr %10, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [10 x ptr], ptr %111, i64 0, i64 %113
  store ptr %109, ptr %114, align 8, !tbaa !5
  br label %115

115:                                              ; preds = %105
  %116 = load i32, ptr %10, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %10, align 4, !tbaa !9
  br label %102, !llvm.loop !37

118:                                              ; preds = %102
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.my_coef_controller, ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds %struct.jpeg_d_coef_controller, ptr %120, i32 0, i32 1
  store ptr @dummy_consume_data, ptr %121, align 8, !tbaa !33
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.my_coef_controller, ptr %122, i32 0, i32 0
  %124 = getelementptr inbounds %struct.jpeg_d_coef_controller, ptr %123, i32 0, i32 3
  store ptr @decompress_onepass, ptr %124, align 8, !tbaa !34
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.my_coef_controller, ptr %125, i32 0, i32 0
  %127 = getelementptr inbounds %struct.jpeg_d_coef_controller, ptr %126, i32 0, i32 4
  store ptr null, ptr %127, align 8, !tbaa !35
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %128

128:                                              ; preds = %118, %81
  %129 = load ptr, ptr %3, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %129, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !11
  %132 = getelementptr inbounds %struct.jpeg_memory_mgr, ptr %131, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !15
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = call ptr %133(ptr noundef %134, i32 noundef 1, i64 noundef 128)
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.my_coef_controller, ptr %136, i32 0, i32 5
  store ptr %135, ptr %137, align 8, !tbaa !38
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

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

; Function Attrs: nounwind uwtable
declare hidden void @start_input_pass(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @start_output_pass(ptr noundef) #0

declare i64 @jround_up(i64 noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @consume_data(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @decompress_data(ptr noundef, ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare hidden i32 @dummy_consume_data(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @decompress_onepass(ptr noundef, ptr noundef) #0

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 = { 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 8}
!12 = !{!"jpeg_decompress_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, !10, i64 64, !10, i64 68, !10, i64 72, !13, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !10, i64 152, !10, i64 156, !6, i64 160, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !6, i64 192, !7, i64 200, !7, i64 232, !7, i64 264, !10, i64 296, !6, i64 304, !10, i64 312, !10, i64 316, !7, i64 320, !7, i64 336, !7, i64 352, !10, i64 368, !10, i64 372, !7, i64 376, !7, i64 377, !7, i64 378, !14, i64 380, !14, i64 382, !10, i64 384, !7, i64 388, !10, i64 392, !6, i64 400, !10, i64 408, !10, i64 412, !10, i64 416, !10, i64 420, !6, i64 424, !10, i64 432, !7, i64 440, !10, i64 472, !10, i64 476, !10, i64 480, !7, i64 484, !10, i64 524, !10, i64 528, !10, i64 532, !10, i64 536, !10, i64 540, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584, !6, i64 592, !6, i64 600, !6, i64 608, !6, i64 616, !6, i64 624}
!13 = !{!"double", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"jpeg_memory_mgr", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !17, i64 88, !17, i64 96}
!17 = !{!"long", !7, i64 0}
!18 = !{!12, !6, i64 560}
!19 = !{!20, !6, i64 0}
!20 = !{!"", !21, i64 0, !10, i64 40, !10, i64 44, !10, i64 48, !7, i64 56, !6, i64 136, !7, i64 144}
!21 = !{!"jpeg_d_coef_controller", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!22 = !{!20, !6, i64 16}
!23 = !{!12, !6, i64 304}
!24 = !{!12, !10, i64 56}
!25 = !{!26, !10, i64 12}
!26 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !6, i64 80, !6, i64 88}
!27 = !{!16, !6, i64 40}
!28 = !{!26, !10, i64 28}
!29 = !{!26, !10, i64 8}
!30 = !{!26, !10, i64 32}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!20, !6, i64 8}
!34 = !{!20, !6, i64 24}
!35 = !{!20, !6, i64 32}
!36 = !{!16, !6, i64 8}
!37 = distinct !{!37, !32}
!38 = !{!20, !6, i64 136}


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

; Function Attrs: nounwind uwtable
define dso_local void @jinit_d_coef_controller(ptr noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = load ptr, ptr %4, align 8, !tbaa !13
  %6 = tail call ptr %5(ptr noundef %0, i32 noundef 1, i64 noundef 224) #2
  %7 = getelementptr inbounds i8, ptr %0, i64 560
  store ptr %6, ptr %7, align 8, !tbaa !16
  store ptr @start_input_pass, ptr %6, align 8, !tbaa !17
  %8 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr @start_output_pass, ptr %8, align 8, !tbaa !20
  %.not = icmp eq i32 %1, 0
  br i1 %.not, label %46, label %9

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %0, i64 56
  %11 = load i32, ptr %10, align 8, !tbaa !21
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %9
  %13 = getelementptr inbounds i8, ptr %0, i64 304
  %14 = load ptr, ptr %13, align 8, !tbaa !22
  %15 = getelementptr inbounds i8, ptr %6, i64 144
  br label %16

16:                                               ; preds = %.lr.ph, %16
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %16 ]
  %.04041 = phi ptr [ %14, %.lr.ph ], [ %39, %16 ]
  %17 = getelementptr inbounds i8, ptr %.04041, i64 12
  %18 = load i32, ptr %17, align 4, !tbaa !23
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 40
  %21 = load ptr, ptr %20, align 8, !tbaa !25
  %22 = getelementptr inbounds i8, ptr %.04041, i64 28
  %23 = load i32, ptr %22, align 4, !tbaa !26
  %24 = zext i32 %23 to i64
  %25 = getelementptr inbounds i8, ptr %.04041, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !27
  %27 = sext i32 %26 to i64
  %28 = tail call i64 @jround_up(i64 noundef %24, i64 noundef %27) #2
  %29 = trunc i64 %28 to i32
  %30 = getelementptr inbounds i8, ptr %.04041, i64 32
  %31 = load i32, ptr %30, align 8, !tbaa !28
  %32 = zext i32 %31 to i64
  %33 = load i32, ptr %17, align 4, !tbaa !23
  %34 = sext i32 %33 to i64
  %35 = tail call i64 @jround_up(i64 noundef %32, i64 noundef %34) #2
  %36 = trunc i64 %35 to i32
  %37 = tail call ptr %21(ptr noundef nonnull %0, i32 noundef 1, i32 noundef 1, i32 noundef %29, i32 noundef %36, i32 noundef %18) #2
  %38 = getelementptr inbounds [10 x ptr], ptr %15, i64 0, i64 %indvars.iv
  store ptr %37, ptr %38, align 8, !tbaa !29
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = getelementptr inbounds i8, ptr %.04041, i64 96
  %40 = load i32, ptr %10, align 8, !tbaa !21
  %41 = sext i32 %40 to i64
  %42 = icmp slt i64 %indvars.iv.next, %41
  br i1 %42, label %16, label %._crit_edge, !llvm.loop !30

._crit_edge:                                      ; preds = %16, %9
  %43 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr @consume_data, ptr %43, align 8, !tbaa !32
  %44 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr @decompress_data, ptr %44, align 8, !tbaa !33
  %45 = getelementptr inbounds i8, ptr %6, i64 144
  br label %72

46:                                               ; preds = %2
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !34
  %50 = tail call ptr %49(ptr noundef nonnull %0, i32 noundef 1, i64 noundef 1280) #2
  %51 = getelementptr inbounds i8, ptr %6, i64 56
  store ptr %50, ptr %51, align 8, !tbaa !29
  %52 = getelementptr inbounds i8, ptr %50, i64 128
  %53 = getelementptr inbounds i8, ptr %6, i64 64
  store ptr %52, ptr %53, align 8, !tbaa !29
  %54 = getelementptr inbounds i8, ptr %50, i64 256
  %55 = getelementptr inbounds i8, ptr %6, i64 72
  store ptr %54, ptr %55, align 8, !tbaa !29
  %56 = getelementptr inbounds i8, ptr %50, i64 384
  %57 = getelementptr inbounds i8, ptr %6, i64 80
  store ptr %56, ptr %57, align 8, !tbaa !29
  %58 = getelementptr inbounds i8, ptr %50, i64 512
  %59 = getelementptr inbounds i8, ptr %6, i64 88
  store ptr %58, ptr %59, align 8, !tbaa !29
  %60 = getelementptr inbounds i8, ptr %50, i64 640
  %61 = getelementptr inbounds i8, ptr %6, i64 96
  store ptr %60, ptr %61, align 8, !tbaa !29
  %62 = getelementptr inbounds i8, ptr %50, i64 768
  %63 = getelementptr inbounds i8, ptr %6, i64 104
  store ptr %62, ptr %63, align 8, !tbaa !29
  %64 = getelementptr inbounds i8, ptr %50, i64 896
  %65 = getelementptr inbounds i8, ptr %6, i64 112
  store ptr %64, ptr %65, align 8, !tbaa !29
  %66 = getelementptr inbounds i8, ptr %50, i64 1024
  %67 = getelementptr inbounds i8, ptr %6, i64 120
  store ptr %66, ptr %67, align 8, !tbaa !29
  %68 = getelementptr inbounds i8, ptr %50, i64 1152
  %69 = getelementptr inbounds i8, ptr %6, i64 128
  store ptr %68, ptr %69, align 8, !tbaa !29
  %70 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr @dummy_consume_data, ptr %70, align 8, !tbaa !32
  %71 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr @decompress_onepass, ptr %71, align 8, !tbaa !33
  br label %72

72:                                               ; preds = %46, %._crit_edge
  %.sink = phi ptr [ null, %46 ], [ %45, %._crit_edge ]
  %73 = getelementptr inbounds i8, ptr %6, i64 32
  store ptr %.sink, ptr %73, align 8, !tbaa !35
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = load ptr, ptr %74, align 8, !tbaa !13
  %76 = tail call ptr %75(ptr noundef nonnull %0, i32 noundef 1, i64 noundef 128) #2
  %77 = getelementptr inbounds i8, ptr %6, i64 136
  store ptr %76, ptr %77, align 8, !tbaa !36
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @start_input_pass(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @start_output_pass(ptr noundef) #0

declare i64 @jround_up(i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @consume_data(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @decompress_data(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @dummy_consume_data(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @decompress_onepass(ptr noundef, ptr noundef) #0

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 = { "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 8}
!6 = !{!"jpeg_decompress_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, !10, i64 64, !10, i64 68, !10, i64 72, !11, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !10, i64 152, !10, i64 156, !7, i64 160, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !7, i64 192, !8, i64 200, !8, i64 232, !8, i64 264, !10, i64 296, !7, i64 304, !10, i64 312, !10, i64 316, !8, i64 320, !8, i64 336, !8, i64 352, !10, i64 368, !10, i64 372, !8, i64 376, !8, i64 377, !8, i64 378, !12, i64 380, !12, i64 382, !10, i64 384, !8, i64 388, !10, i64 392, !7, i64 400, !10, i64 408, !10, i64 412, !10, i64 416, !10, i64 420, !7, i64 424, !10, i64 432, !8, i64 440, !10, i64 472, !10, i64 476, !10, i64 480, !8, i64 484, !10, i64 524, !10, i64 528, !10, i64 532, !10, i64 536, !10, i64 540, !7, i64 544, !7, i64 552, !7, i64 560, !7, i64 568, !7, i64 576, !7, i64 584, !7, i64 592, !7, i64 600, !7, i64 608, !7, i64 616, !7, i64 624}
!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 = !{!14, !7, i64 0}
!14 = !{!"jpeg_memory_mgr", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !15, i64 88, !15, i64 96}
!15 = !{!"long", !8, i64 0}
!16 = !{!6, !7, i64 560}
!17 = !{!18, !7, i64 0}
!18 = !{!"", !19, i64 0, !10, i64 40, !10, i64 44, !10, i64 48, !8, i64 56, !7, i64 136, !8, i64 144}
!19 = !{!"jpeg_d_coef_controller", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!20 = !{!18, !7, i64 16}
!21 = !{!6, !10, i64 56}
!22 = !{!6, !7, i64 304}
!23 = !{!24, !10, i64 12}
!24 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !7, i64 80, !7, i64 88}
!25 = !{!14, !7, i64 40}
!26 = !{!24, !10, i64 28}
!27 = !{!24, !10, i64 8}
!28 = !{!24, !10, i64 32}
!29 = !{!7, !7, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!18, !7, i64 8}
!33 = !{!18, !7, i64 24}
!34 = !{!14, !7, i64 8}
!35 = !{!18, !7, i64 32}
!36 = !{!18, !7, i64 136}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass