; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode/modules/juce_graphics/image_formats/jpglib (compress)

; 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, i8, 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, i8, i8, i8, i8, i32, i32, i32, i32, i8, i8, i8, i8, i16, i16, i8, i32, i8, 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.jpeg_error_mgr = type { ptr, ptr, ptr, ptr, ptr, i32, %union.anon, i32, i64, ptr, i32, ptr, i32, i32 }
%union.anon = type { [8 x i32], [48 x i8] }
%struct.jpeg_comp_master = type { ptr, ptr, ptr, i8, i8 }
%struct.jpeg_progress_mgr = type { ptr, i64, i64, i32, i32 }
%struct.jpeg_c_coef_controller = type { ptr, ptr }
%struct.jpeg_marker_writer = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.jpeg_destination_mgr = type { ptr, i64, ptr, ptr, ptr }

; 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

declare void @jpeg_abort(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @jpeg_finish_compress(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %4, i32 0, i32 5
  %6 = load i32, ptr %5, align 4, !tbaa !9
  %7 = icmp eq i32 %6, 101
  br i1 %7, label %13, label %8

8:                                                ; preds = %1
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %9, i32 0, i32 5
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = icmp eq i32 %11, 102
  br i1 %12, label %13, label %39

13:                                               ; preds = %8, %1
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %14, i32 0, i32 39
  %16 = load i32, ptr %15, align 8, !tbaa !14
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %17, i32 0, i32 8
  %19 = load i32, ptr %18, align 4, !tbaa !15
  %20 = icmp ult i32 %16, %19
  br i1 %20, label %21, label %32

21:                                               ; preds = %13
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %22, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %24, i32 0, i32 5
  store i32 67, ptr %25, align 8, !tbaa !17
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  %29 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %28, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8, !tbaa !20
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  call void %30(ptr noundef %31)
  br label %32

32:                                               ; preds = %21, %13
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %33, i32 0, i32 54
  %35 = load ptr, ptr %34, align 8, !tbaa !21
  %36 = getelementptr inbounds %struct.jpeg_comp_master, ptr %35, i32 0, i32 2
  %37 = load ptr, ptr %36, align 8, !tbaa !22
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  call void %37(ptr noundef %38)
  br label %64

39:                                               ; preds = %8
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %40, i32 0, i32 5
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = icmp ne i32 %42, 103
  br i1 %43, label %44, label %63

44:                                               ; preds = %39
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %45, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8, !tbaa !16
  %48 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %47, i32 0, i32 5
  store i32 20, ptr %48, align 8, !tbaa !17
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %49, i32 0, i32 5
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %52, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  %55 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %54, i32 0, i32 6
  %56 = getelementptr inbounds [8 x i32], ptr %55, i64 0, i64 0
  store i32 %51, ptr %56, align 4, !tbaa !24
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  %60 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !20
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  call void %61(ptr noundef %62)
  br label %63

63:                                               ; preds = %44, %39
  br label %64

64:                                               ; preds = %63, %32
  br label %65

65:                                               ; preds = %136, %64
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %66, i32 0, i32 54
  %68 = load ptr, ptr %67, align 8, !tbaa !21
  %69 = getelementptr inbounds %struct.jpeg_comp_master, ptr %68, i32 0, i32 4
  %70 = load i8, ptr %69, align 1, !tbaa !25
  %71 = icmp ne i8 %70, 0
  %72 = xor i1 %71, true
  br i1 %72, label %73, label %143

73:                                               ; preds = %65
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %74, i32 0, i32 54
  %76 = load ptr, ptr %75, align 8, !tbaa !21
  %77 = getelementptr inbounds %struct.jpeg_comp_master, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !26
  %79 = load ptr, ptr %2, align 8, !tbaa !5
  call void %78(ptr noundef %79)
  store i32 0, ptr %3, align 4, !tbaa !27
  br label %80

80:                                               ; preds = %133, %73
  %81 = load i32, ptr %3, align 4, !tbaa !27
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %82, i32 0, i32 43
  %84 = load i32, ptr %83, align 8, !tbaa !28
  %85 = icmp ult i32 %81, %84
  br i1 %85, label %86, label %136

86:                                               ; preds = %80
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %87, i32 0, i32 2
  %89 = load ptr, ptr %88, align 8, !tbaa !29
  %90 = icmp ne ptr %89, null
  br i1 %90, label %91, label %112

91:                                               ; preds = %86
  %92 = load i32, ptr %3, align 4, !tbaa !27
  %93 = zext i32 %92 to i64
  %94 = load ptr, ptr %2, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %94, i32 0, i32 2
  %96 = load ptr, ptr %95, align 8, !tbaa !29
  %97 = getelementptr inbounds %struct.jpeg_progress_mgr, ptr %96, i32 0, i32 1
  store i64 %93, ptr %97, align 8, !tbaa !30
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %98, i32 0, i32 43
  %100 = load i32, ptr %99, align 8, !tbaa !28
  %101 = zext i32 %100 to i64
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %102, i32 0, i32 2
  %104 = load ptr, ptr %103, align 8, !tbaa !29
  %105 = getelementptr inbounds %struct.jpeg_progress_mgr, ptr %104, i32 0, i32 2
  store i64 %101, ptr %105, align 8, !tbaa !32
  %106 = load ptr, ptr %2, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %106, i32 0, i32 2
  %108 = load ptr, ptr %107, align 8, !tbaa !29
  %109 = getelementptr inbounds %struct.jpeg_progress_mgr, ptr %108, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !33
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  call void %110(ptr noundef %111)
  br label %112

112:                                              ; preds = %91, %86
  %113 = load ptr, ptr %2, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %113, i32 0, i32 57
  %115 = load ptr, ptr %114, align 8, !tbaa !34
  %116 = getelementptr inbounds %struct.jpeg_c_coef_controller, ptr %115, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !35
  %118 = load ptr, ptr %2, align 8, !tbaa !5
  %119 = call zeroext i8 %117(ptr noundef %118, ptr noundef null)
  %120 = icmp ne i8 %119, 0
  br i1 %120, label %132, label %121

121:                                              ; preds = %112
  %122 = load ptr, ptr %2, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !16
  %125 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %124, i32 0, i32 5
  store i32 24, ptr %125, align 8, !tbaa !17
  %126 = load ptr, ptr %2, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %126, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8, !tbaa !16
  %129 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !20
  %131 = load ptr, ptr %2, align 8, !tbaa !5
  call void %130(ptr noundef %131)
  br label %132

132:                                              ; preds = %121, %112
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %3, align 4, !tbaa !27
  %135 = add i32 %134, 1
  store i32 %135, ptr %3, align 4, !tbaa !27
  br label %80, !llvm.loop !37

136:                                              ; preds = %80
  %137 = load ptr, ptr %2, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %137, i32 0, i32 54
  %139 = load ptr, ptr %138, align 8, !tbaa !21
  %140 = getelementptr inbounds %struct.jpeg_comp_master, ptr %139, i32 0, i32 2
  %141 = load ptr, ptr %140, align 8, !tbaa !22
  %142 = load ptr, ptr %2, align 8, !tbaa !5
  call void %141(ptr noundef %142)
  br label %65, !llvm.loop !39

143:                                              ; preds = %65
  %144 = load ptr, ptr %2, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %144, i32 0, i32 58
  %146 = load ptr, ptr %145, align 8, !tbaa !40
  %147 = getelementptr inbounds %struct.jpeg_marker_writer, ptr %146, i32 0, i32 3
  %148 = load ptr, ptr %147, align 8, !tbaa !41
  %149 = load ptr, ptr %2, align 8, !tbaa !5
  call void %148(ptr noundef %149)
  %150 = load ptr, ptr %2, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %150, i32 0, i32 6
  %152 = load ptr, ptr %151, align 8, !tbaa !43
  %153 = getelementptr inbounds %struct.jpeg_destination_mgr, ptr %152, i32 0, i32 4
  %154 = load ptr, ptr %153, align 8, !tbaa !44
  %155 = load ptr, ptr %2, align 8, !tbaa !5
  call void %154(ptr noundef %155)
  %156 = load ptr, ptr %2, align 8, !tbaa !5
  call void @jpeg_abort(ptr noundef %156)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 36}
!10 = !{!"jpeg_compress_struct", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !7, i64 32, !11, i64 36, !6, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !12, i64 64, !11, i64 72, !11, i64 76, !11, i64 80, !6, i64 88, !7, i64 96, !7, i64 128, !7, i64 160, !7, i64 192, !7, i64 208, !7, i64 224, !11, i64 240, !6, i64 248, !7, i64 256, !7, i64 257, !7, i64 258, !7, i64 259, !11, i64 260, !11, i64 264, !11, i64 268, !11, i64 272, !7, i64 276, !7, i64 277, !7, i64 278, !7, i64 279, !13, i64 280, !13, i64 282, !7, i64 284, !11, i64 288, !7, i64 292, !11, i64 296, !11, i64 300, !11, i64 304, !11, i64 308, !7, i64 312, !11, i64 344, !11, i64 348, !11, i64 352, !7, i64 356, !11, i64 396, !11, i64 400, !11, i64 404, !11, i64 408, !6, i64 416, !6, 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, !11, i64 496}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !11, i64 288}
!15 = !{!10, !11, i64 52}
!16 = !{!10, !6, i64 0}
!17 = !{!18, !11, i64 40}
!18 = !{!"jpeg_error_mgr", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !7, i64 44, !11, i64 124, !19, i64 128, !6, i64 136, !11, i64 144, !6, i64 152, !11, i64 160, !11, i64 164}
!19 = !{!"long", !7, i64 0}
!20 = !{!18, !6, i64 0}
!21 = !{!10, !6, i64 416}
!22 = !{!23, !6, i64 16}
!23 = !{!"jpeg_comp_master", !6, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !7, i64 25}
!24 = !{!7, !7, i64 0}
!25 = !{!23, !7, i64 25}
!26 = !{!23, !6, i64 0}
!27 = !{!11, !11, i64 0}
!28 = !{!10, !11, i64 304}
!29 = !{!10, !6, i64 16}
!30 = !{!31, !19, i64 8}
!31 = !{!"jpeg_progress_mgr", !6, i64 0, !19, i64 8, !19, i64 16, !11, i64 24, !11, i64 28}
!32 = !{!31, !19, i64 16}
!33 = !{!31, !6, i64 0}
!34 = !{!10, !6, i64 440}
!35 = !{!36, !6, i64 8}
!36 = !{!"jpeg_c_coef_controller", !6, i64 0, !6, i64 8}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}
!40 = !{!10, !6, i64 448}
!41 = !{!42, !6, i64 24}
!42 = !{!"jpeg_marker_writer", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!43 = !{!10, !6, i64 40}
!44 = !{!45, !6, i64 32}
!45 = !{!"jpeg_destination_mgr", !6, i64 0, !19, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}


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

declare void @jpeg_abort(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @jpeg_finish_compress(ptr noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 36
  %3 = load i32, ptr %2, align 4, !tbaa !5
  switch i32 %3, label %18 [
    i32 101, label %4
    i32 102, label %4
    i32 103, label %24
  ]

4:                                                ; preds = %1, %1
  %5 = getelementptr inbounds i8, ptr %0, i64 288
  %6 = load i32, ptr %5, align 8, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %0, i64 52
  %8 = load i32, ptr %7, align 4, !tbaa !14
  %9 = icmp ult i32 %6, %8
  br i1 %9, label %10, label %14

10:                                               ; preds = %4
  %11 = load ptr, ptr %0, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %11, i64 40
  store i32 67, ptr %12, align 8, !tbaa !16
  %13 = load ptr, ptr %11, align 8, !tbaa !19
  tail call void %13(ptr noundef nonnull %0) #2
  br label %14

14:                                               ; preds = %10, %4
  %15 = getelementptr inbounds i8, ptr %0, i64 416
  %16 = load ptr, ptr %15, align 8, !tbaa !20
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  br label %.sink.split

18:                                               ; preds = %1
  %19 = load ptr, ptr %0, align 8, !tbaa !15
  %20 = getelementptr inbounds i8, ptr %19, i64 40
  store i32 20, ptr %20, align 8, !tbaa !16
  %21 = getelementptr inbounds i8, ptr %19, i64 44
  store i32 %3, ptr %21, align 4, !tbaa !21
  %22 = load ptr, ptr %0, align 8, !tbaa !15
  br label %.sink.split

.sink.split:                                      ; preds = %14, %18
  %.sink50 = phi ptr [ %22, %18 ], [ %17, %14 ]
  %23 = load ptr, ptr %.sink50, align 8, !tbaa !22
  tail call void %23(ptr noundef nonnull %0) #2
  br label %24

24:                                               ; preds = %.sink.split, %1
  %25 = getelementptr inbounds i8, ptr %0, i64 416
  %26 = load ptr, ptr %25, align 8, !tbaa !20
  %27 = getelementptr inbounds i8, ptr %26, i64 25
  %28 = load i8, ptr %27, align 1, !tbaa !23
  %.not4145 = icmp eq i8 %28, 0
  br i1 %.not4145, label %.lr.ph47, label %._crit_edge48

.lr.ph47:                                         ; preds = %24
  %29 = getelementptr inbounds i8, ptr %0, i64 304
  %30 = getelementptr inbounds i8, ptr %0, i64 16
  %31 = getelementptr inbounds i8, ptr %0, i64 440
  br label %32

32:                                               ; preds = %.lr.ph47, %._crit_edge
  %33 = phi ptr [ %26, %.lr.ph47 ], [ %59, %._crit_edge ]
  %34 = load ptr, ptr %33, align 8, !tbaa !25
  tail call void %34(ptr noundef nonnull %0) #2
  %35 = load i32, ptr %29, align 8, !tbaa !26
  %.not = icmp eq i32 %35, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %32, %52
  %indvars.iv = phi i64 [ %indvars.iv.next, %52 ], [ 0, %32 ]
  %36 = phi i32 [ %53, %52 ], [ %35, %32 ]
  %37 = load ptr, ptr %30, align 8, !tbaa !27
  %.not42 = icmp eq ptr %37, null
  br i1 %.not42, label %43, label %38

38:                                               ; preds = %.lr.ph
  %39 = getelementptr inbounds i8, ptr %37, i64 8
  store i64 %indvars.iv, ptr %39, align 8, !tbaa !28
  %40 = zext i32 %36 to i64
  %41 = getelementptr inbounds i8, ptr %37, i64 16
  store i64 %40, ptr %41, align 8, !tbaa !30
  %42 = load ptr, ptr %37, align 8, !tbaa !31
  tail call void %42(ptr noundef nonnull %0) #2
  br label %43

43:                                               ; preds = %38, %.lr.ph
  %44 = load ptr, ptr %31, align 8, !tbaa !32
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  %46 = load ptr, ptr %45, align 8, !tbaa !33
  %47 = tail call zeroext i8 %46(ptr noundef nonnull %0, ptr noundef null) #2
  %.not43 = icmp eq i8 %47, 0
  br i1 %.not43, label %48, label %52

48:                                               ; preds = %43
  %49 = load ptr, ptr %0, align 8, !tbaa !15
  %50 = getelementptr inbounds i8, ptr %49, i64 40
  store i32 24, ptr %50, align 8, !tbaa !16
  %51 = load ptr, ptr %49, align 8, !tbaa !19
  tail call void %51(ptr noundef nonnull %0) #2
  br label %52

52:                                               ; preds = %43, %48
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %53 = load i32, ptr %29, align 8, !tbaa !26
  %54 = zext i32 %53 to i64
  %55 = icmp ult i64 %indvars.iv.next, %54
  br i1 %55, label %.lr.ph, label %._crit_edge, !llvm.loop !35

._crit_edge:                                      ; preds = %52, %32
  %56 = load ptr, ptr %25, align 8, !tbaa !20
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %58 = load ptr, ptr %57, align 8, !tbaa !37
  tail call void %58(ptr noundef nonnull %0) #2
  %59 = load ptr, ptr %25, align 8, !tbaa !20
  %60 = getelementptr inbounds i8, ptr %59, i64 25
  %61 = load i8, ptr %60, align 1, !tbaa !23
  %.not41 = icmp eq i8 %61, 0
  br i1 %.not41, label %32, label %._crit_edge48, !llvm.loop !38

._crit_edge48:                                    ; preds = %._crit_edge, %24
  %62 = getelementptr inbounds i8, ptr %0, i64 448
  %63 = load ptr, ptr %62, align 8, !tbaa !39
  %64 = getelementptr inbounds i8, ptr %63, i64 24
  %65 = load ptr, ptr %64, align 8, !tbaa !40
  tail call void %65(ptr noundef nonnull %0) #2
  %66 = getelementptr inbounds i8, ptr %0, i64 40
  %67 = load ptr, ptr %66, align 8, !tbaa !42
  %68 = getelementptr inbounds i8, ptr %67, i64 32
  %69 = load ptr, ptr %68, align 8, !tbaa !43
  tail call void %69(ptr noundef nonnull %0) #2
  tail call void @jpeg_abort(ptr noundef nonnull %0) #2
  ret void
}

attributes #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 = { 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 }

!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, !10, i64 36}
!6 = !{!"jpeg_compress_struct", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !8, 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, !8, i64 256, !8, i64 257, !8, i64 258, !8, i64 259, !10, i64 260, !10, i64 264, !10, i64 268, !10, i64 272, !8, i64 276, !8, i64 277, !8, i64 278, !8, i64 279, !12, i64 280, !12, i64 282, !8, i64 284, !10, i64 288, !8, i64 292, !10, i64 296, !10, i64 300, !10, i64 304, !10, i64 308, !8, i64 312, !10, i64 344, !10, i64 348, !10, i64 352, !8, i64 356, !10, i64 396, !10, i64 400, !10, i64 404, !10, i64 408, !7, i64 416, !7, 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, !10, i64 496}
!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 = !{!6, !10, i64 288}
!14 = !{!6, !10, i64 52}
!15 = !{!6, !7, i64 0}
!16 = !{!17, !10, i64 40}
!17 = !{!"jpeg_error_mgr", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !8, i64 44, !10, i64 124, !18, i64 128, !7, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 164}
!18 = !{!"long", !8, i64 0}
!19 = !{!17, !7, i64 0}
!20 = !{!6, !7, i64 416}
!21 = !{!8, !8, i64 0}
!22 = !{!7, !7, i64 0}
!23 = !{!24, !8, i64 25}
!24 = !{!"jpeg_comp_master", !7, i64 0, !7, i64 8, !7, i64 16, !8, i64 24, !8, i64 25}
!25 = !{!24, !7, i64 0}
!26 = !{!6, !10, i64 304}
!27 = !{!6, !7, i64 16}
!28 = !{!29, !18, i64 8}
!29 = !{!"jpeg_progress_mgr", !7, i64 0, !18, i64 8, !18, i64 16, !10, i64 24, !10, i64 28}
!30 = !{!29, !18, i64 16}
!31 = !{!29, !7, i64 0}
!32 = !{!6, !7, i64 440}
!33 = !{!34, !7, i64 8}
!34 = !{!"jpeg_c_coef_controller", !7, i64 0, !7, i64 8}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!24, !7, i64 16}
!38 = distinct !{!38, !36}
!39 = !{!6, !7, i64 448}
!40 = !{!41, !7, i64 24}
!41 = !{!"jpeg_marker_writer", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48}
!42 = !{!6, !7, i64 40}
!43 = !{!44, !7, i64 32}
!44 = !{!"jpeg_destination_mgr", !7, i64 0, !18, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}


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