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

; 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.bitread_working_state = type { ptr, i64, i64, i32, ptr }
%struct.jpeg_decompress_struct = type { ptr, ptr, ptr, ptr, i8, i32, ptr, i32, i32, i32, i32, i32, i32, i32, double, i8, i8, i32, i8, i8, i8, i32, i8, i32, i8, i8, i8, i32, i32, i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, ptr, [4 x ptr], [4 x ptr], [4 x ptr], i32, ptr, i8, i8, [16 x i8], [16 x i8], [16 x i8], i32, i8, i8, i8, i8, i16, i16, i8, i8, i8, 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_source_mgr = type { ptr, i64, ptr, ptr, ptr, ptr, ptr }
%struct.jpeg_entropy_decoder = type { ptr, ptr, i8 }
%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] }

; 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 zeroext i8 @jpeg_fill_bit_buffer(ptr noundef %0, i64 noundef %1, i32 noundef %2, i32 noundef %3) #1 {
  %5 = alloca i8, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !11
  store i32 %3, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.bitread_working_state, ptr %15, i32 0, i32 0
  %17 = load ptr, ptr %16, align 8, !tbaa !13
  store ptr %17, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #2
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.bitread_working_state, ptr %18, i32 0, i32 1
  %20 = load i64, ptr %19, align 8, !tbaa !15
  store i64 %20, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #2
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.bitread_working_state, ptr %21, i32 0, i32 4
  %23 = load ptr, ptr %22, align 8, !tbaa !16
  store ptr %23, ptr %12, align 8, !tbaa !5
  %24 = load ptr, ptr %12, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %24, i32 0, i32 76
  %26 = load i32, ptr %25, align 4, !tbaa !17
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %121

28:                                               ; preds = %4
  br label %29

29:                                               ; preds = %119, %28
  %30 = load i32, ptr %8, align 4, !tbaa !11
  %31 = icmp slt i32 %30, 25
  br i1 %31, label %32, label %120

32:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #2
  %33 = load i64, ptr %11, align 8, !tbaa !9
  %34 = icmp eq i64 %33, 0
  br i1 %34, label %35, label %56

35:                                               ; preds = %32
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %36, i32 0, i32 6
  %38 = load ptr, ptr %37, align 8, !tbaa !21
  %39 = getelementptr inbounds %struct.jpeg_source_mgr, ptr %38, i32 0, i32 3
  %40 = load ptr, ptr %39, align 8, !tbaa !22
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = call zeroext i8 %40(ptr noundef %41)
  %43 = icmp ne i8 %42, 0
  br i1 %43, label %45, label %44

44:                                               ; preds = %35
  store i8 0, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %117

45:                                               ; preds = %35
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %46, i32 0, i32 6
  %48 = load ptr, ptr %47, align 8, !tbaa !21
  %49 = getelementptr inbounds %struct.jpeg_source_mgr, ptr %48, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8, !tbaa !24
  store ptr %50, ptr %10, align 8, !tbaa !5
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %51, i32 0, i32 6
  %53 = load ptr, ptr %52, align 8, !tbaa !21
  %54 = getelementptr inbounds %struct.jpeg_source_mgr, ptr %53, i32 0, i32 1
  %55 = load i64, ptr %54, align 8, !tbaa !25
  store i64 %55, ptr %11, align 8, !tbaa !9
  br label %56

56:                                               ; preds = %45, %32
  %57 = load i64, ptr %11, align 8, !tbaa !9
  %58 = add i64 %57, -1
  store i64 %58, ptr %11, align 8, !tbaa !9
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i32 1
  store ptr %60, ptr %10, align 8, !tbaa !5
  %61 = load i8, ptr %59, align 1, !tbaa !26
  %62 = zext i8 %61 to i32
  store i32 %62, ptr %13, align 4, !tbaa !11
  %63 = load i32, ptr %13, align 4, !tbaa !11
  %64 = icmp eq i32 %63, 255
  br i1 %64, label %65, label %109

65:                                               ; preds = %56
  br label %66

66:                                               ; preds = %97, %65
  %67 = load i64, ptr %11, align 8, !tbaa !9
  %68 = icmp eq i64 %67, 0
  br i1 %68, label %69, label %90

69:                                               ; preds = %66
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %70, i32 0, i32 6
  %72 = load ptr, ptr %71, align 8, !tbaa !21
  %73 = getelementptr inbounds %struct.jpeg_source_mgr, ptr %72, i32 0, i32 3
  %74 = load ptr, ptr %73, align 8, !tbaa !22
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = call zeroext i8 %74(ptr noundef %75)
  %77 = icmp ne i8 %76, 0
  br i1 %77, label %79, label %78

78:                                               ; preds = %69
  store i8 0, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %117

79:                                               ; preds = %69
  %80 = load ptr, ptr %12, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %80, i32 0, i32 6
  %82 = load ptr, ptr %81, align 8, !tbaa !21
  %83 = getelementptr inbounds %struct.jpeg_source_mgr, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !24
  store ptr %84, ptr %10, align 8, !tbaa !5
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %85, i32 0, i32 6
  %87 = load ptr, ptr %86, align 8, !tbaa !21
  %88 = getelementptr inbounds %struct.jpeg_source_mgr, ptr %87, i32 0, i32 1
  %89 = load i64, ptr %88, align 8, !tbaa !25
  store i64 %89, ptr %11, align 8, !tbaa !9
  br label %90

90:                                               ; preds = %79, %66
  %91 = load i64, ptr %11, align 8, !tbaa !9
  %92 = add i64 %91, -1
  store i64 %92, ptr %11, align 8, !tbaa !9
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %93, i32 1
  store ptr %94, ptr %10, align 8, !tbaa !5
  %95 = load i8, ptr %93, align 1, !tbaa !26
  %96 = zext i8 %95 to i32
  store i32 %96, ptr %13, align 4, !tbaa !11
  br label %97

97:                                               ; preds = %90
  %98 = load i32, ptr %13, align 4, !tbaa !11
  %99 = icmp eq i32 %98, 255
  br i1 %99, label %66, label %100, !llvm.loop !27

100:                                              ; preds = %97
  %101 = load i32, ptr %13, align 4, !tbaa !11
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %100
  store i32 255, ptr %13, align 4, !tbaa !11
  br label %108

104:                                              ; preds = %100
  %105 = load i32, ptr %13, align 4, !tbaa !11
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %106, i32 0, i32 76
  store i32 %105, ptr %107, align 4, !tbaa !17
  store i32 6, ptr %14, align 4
  br label %117

108:                                              ; preds = %103
  br label %109

109:                                              ; preds = %108, %56
  %110 = load i64, ptr %7, align 8, !tbaa !9
  %111 = shl i64 %110, 8
  %112 = load i32, ptr %13, align 4, !tbaa !11
  %113 = sext i32 %112 to i64
  %114 = or i64 %111, %113
  store i64 %114, ptr %7, align 8, !tbaa !9
  %115 = load i32, ptr %8, align 4, !tbaa !11
  %116 = add nsw i32 %115, 8
  store i32 %116, ptr %8, align 4, !tbaa !11
  store i32 0, ptr %14, align 4
  br label %117

117:                                              ; preds = %109, %104, %78, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #2
  %118 = load i32, ptr %14, align 4
  switch i32 %118, label %168 [
    i32 0, label %119
    i32 6, label %122
  ]

119:                                              ; preds = %117
  br label %29, !llvm.loop !29

120:                                              ; preds = %29
  br label %155

121:                                              ; preds = %4
  br label %122

122:                                              ; preds = %121, %117
  %123 = load i32, ptr %9, align 4, !tbaa !11
  %124 = load i32, ptr %8, align 4, !tbaa !11
  %125 = icmp sgt i32 %123, %124
  br i1 %125, label %126, label %154

126:                                              ; preds = %122
  %127 = load ptr, ptr %12, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %127, i32 0, i32 83
  %129 = load ptr, ptr %128, align 8, !tbaa !30
  %130 = getelementptr inbounds %struct.jpeg_entropy_decoder, ptr %129, i32 0, i32 2
  %131 = load i8, ptr %130, align 8, !tbaa !31
  %132 = icmp ne i8 %131, 0
  br i1 %132, label %148, label %133

133:                                              ; preds = %126
  %134 = load ptr, ptr %12, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %134, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !33
  %137 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %136, i32 0, i32 5
  store i32 117, ptr %137, align 8, !tbaa !34
  %138 = load ptr, ptr %12, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !33
  %141 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %140, i32 0, i32 1
  %142 = load ptr, ptr %141, align 8, !tbaa !36
  %143 = load ptr, ptr %12, align 8, !tbaa !5
  call void %142(ptr noundef %143, i32 noundef -1)
  %144 = load ptr, ptr %12, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %144, i32 0, i32 83
  %146 = load ptr, ptr %145, align 8, !tbaa !30
  %147 = getelementptr inbounds %struct.jpeg_entropy_decoder, ptr %146, i32 0, i32 2
  store i8 1, ptr %147, align 8, !tbaa !31
  br label %148

148:                                              ; preds = %133, %126
  %149 = load i32, ptr %8, align 4, !tbaa !11
  %150 = sub nsw i32 25, %149
  %151 = load i64, ptr %7, align 8, !tbaa !9
  %152 = zext i32 %150 to i64
  %153 = shl i64 %151, %152
  store i64 %153, ptr %7, align 8, !tbaa !9
  store i32 25, ptr %8, align 4, !tbaa !11
  br label %154

154:                                              ; preds = %148, %122
  br label %155

155:                                              ; preds = %154, %120
  %156 = load ptr, ptr %10, align 8, !tbaa !5
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.bitread_working_state, ptr %157, i32 0, i32 0
  store ptr %156, ptr %158, align 8, !tbaa !13
  %159 = load i64, ptr %11, align 8, !tbaa !9
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.bitread_working_state, ptr %160, i32 0, i32 1
  store i64 %159, ptr %161, align 8, !tbaa !15
  %162 = load i64, ptr %7, align 8, !tbaa !9
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.bitread_working_state, ptr %163, i32 0, i32 2
  store i64 %162, ptr %164, align 8, !tbaa !37
  %165 = load i32, ptr %8, align 4, !tbaa !11
  %166 = load ptr, ptr %6, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.bitread_working_state, ptr %166, i32 0, i32 3
  store i32 %165, ptr %167, align 8, !tbaa !38
  store i8 1, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %168

168:                                              ; preds = %155, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  %169 = load i8, ptr %5, align 1
  ret i8 %169
}

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 }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"", !6, i64 0, !10, i64 8, !10, i64 16, !12, i64 24, !6, i64 32}
!15 = !{!14, !10, i64 8}
!16 = !{!14, !6, i64 32}
!17 = !{!18, !12, i64 508}
!18 = !{!"jpeg_decompress_struct", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !7, i64 32, !12, i64 36, !6, i64 40, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !19, i64 80, !7, i64 88, !7, i64 89, !12, i64 92, !7, i64 96, !7, i64 97, !7, i64 98, !12, i64 100, !7, i64 104, !12, i64 108, !7, i64 112, !7, i64 113, !7, i64 114, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !6, i64 144, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !6, i64 176, !7, i64 184, !7, i64 216, !7, i64 248, !12, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !7, i64 298, !7, i64 314, !7, i64 330, !12, i64 348, !7, i64 352, !7, i64 353, !7, i64 354, !7, i64 355, !20, i64 356, !20, i64 358, !7, i64 360, !7, i64 361, !7, i64 362, !6, i64 368, !12, i64 376, !12, i64 380, !12, i64 384, !12, i64 388, !6, i64 392, !12, i64 400, !7, i64 408, !12, i64 440, !12, i64 444, !12, i64 448, !7, i64 452, !12, i64 492, !12, i64 496, !12, i64 500, !12, i64 504, !12, i64 508, !6, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584, !6, i64 592}
!19 = !{!"double", !7, i64 0}
!20 = !{!"short", !7, i64 0}
!21 = !{!18, !6, i64 40}
!22 = !{!23, !6, i64 24}
!23 = !{!"jpeg_source_mgr", !6, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!24 = !{!23, !6, i64 0}
!25 = !{!23, !10, i64 8}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = !{!18, !6, i64 560}
!31 = !{!32, !7, i64 16}
!32 = !{!"jpeg_entropy_decoder", !6, i64 0, !6, i64 8, !7, i64 16}
!33 = !{!18, !6, i64 0}
!34 = !{!35, !12, i64 40}
!35 = !{!"jpeg_error_mgr", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !7, i64 44, !12, i64 124, !10, i64 128, !6, i64 136, !12, i64 144, !6, i64 152, !12, i64 160, !12, i64 164}
!36 = !{!35, !6, i64 8}
!37 = !{!14, !10, i64 16}
!38 = !{!14, !12, i64 24}


; 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 noundef zeroext i8 @jpeg_fill_bit_buffer(ptr nocapture noundef %0, i64 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = load ptr, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load i64, ptr %6, align 8, !tbaa !12
  %8 = getelementptr inbounds i8, ptr %0, i64 32
  %9 = load ptr, ptr %8, align 8, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %9, i64 508
  %11 = load i32, ptr %10, align 4, !tbaa !14
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %.preheader81, label %53

.preheader81:                                     ; preds = %4
  %13 = icmp slt i32 %2, 25
  br i1 %13, label %.lr.ph, label %.loopexit82

.lr.ph:                                           ; preds = %.preheader81
  %14 = getelementptr inbounds i8, ptr %9, i64 40
  br label %15

15:                                               ; preds = %.lr.ph, %.loopexit
  %.047104 = phi i64 [ %7, %.lr.ph ], [ %.4, %.loopexit ]
  %.050103 = phi ptr [ %5, %.lr.ph ], [ %.454, %.loopexit ]
  %.058102 = phi i64 [ %1, %.lr.ph ], [ %50, %.loopexit ]
  %.062101 = phi i32 [ %2, %.lr.ph ], [ %51, %.loopexit ]
  %16 = icmp eq i64 %.047104, 0
  br i1 %16, label %17, label %27

17:                                               ; preds = %15
  %18 = load ptr, ptr %14, align 8, !tbaa !18
  %19 = getelementptr inbounds i8, ptr %18, i64 24
  %20 = load ptr, ptr %19, align 8, !tbaa !19
  %21 = tail call zeroext i8 %20(ptr noundef %9) #1
  %.not = icmp eq i8 %21, 0
  br i1 %.not, label %.thread, label %22

22:                                               ; preds = %17
  %23 = load ptr, ptr %14, align 8, !tbaa !18
  %24 = load ptr, ptr %23, align 8, !tbaa !21
  %25 = getelementptr inbounds i8, ptr %23, i64 8
  %26 = load i64, ptr %25, align 8, !tbaa !22
  br label %27

27:                                               ; preds = %22, %15
  %.151 = phi ptr [ %24, %22 ], [ %.050103, %15 ]
  %.148 = phi i64 [ %26, %22 ], [ %.047104, %15 ]
  %28 = add i64 %.148, -1
  %29 = getelementptr inbounds i8, ptr %.151, i64 1
  %30 = load i8, ptr %.151, align 1, !tbaa !23
  %31 = zext i8 %30 to i64
  %32 = icmp eq i8 %30, -1
  br i1 %32, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %27, %44
  %.252 = phi ptr [ %46, %44 ], [ %29, %27 ]
  %.249 = phi i64 [ %45, %44 ], [ %28, %27 ]
  %33 = icmp eq i64 %.249, 0
  br i1 %33, label %34, label %44

34:                                               ; preds = %.preheader
  %35 = load ptr, ptr %14, align 8, !tbaa !18
  %36 = getelementptr inbounds i8, ptr %35, i64 24
  %37 = load ptr, ptr %36, align 8, !tbaa !19
  %38 = tail call zeroext i8 %37(ptr noundef %9) #1
  %.not68 = icmp eq i8 %38, 0
  br i1 %.not68, label %.thread, label %39

39:                                               ; preds = %34
  %40 = load ptr, ptr %14, align 8, !tbaa !18
  %41 = load ptr, ptr %40, align 8, !tbaa !21
  %42 = getelementptr inbounds i8, ptr %40, i64 8
  %43 = load i64, ptr %42, align 8, !tbaa !22
  br label %44

44:                                               ; preds = %39, %.preheader
  %.353 = phi ptr [ %41, %39 ], [ %.252, %.preheader ]
  %.3 = phi i64 [ %43, %39 ], [ %.249, %.preheader ]
  %45 = add i64 %.3, -1
  %46 = getelementptr inbounds i8, ptr %.353, i64 1
  %47 = load i8, ptr %.353, align 1, !tbaa !23
  switch i8 %47, label %.thread75 [
    i8 -1, label %.preheader
    i8 0, label %.loopexit
  ]

.thread75:                                        ; preds = %44
  %48 = zext i8 %47 to i32
  store i32 %48, ptr %10, align 4, !tbaa !14
  br label %53

.loopexit:                                        ; preds = %44, %27
  %.454 = phi ptr [ %29, %27 ], [ %46, %44 ]
  %.4 = phi i64 [ %28, %27 ], [ %45, %44 ]
  %.045 = phi i64 [ %31, %27 ], [ 255, %44 ]
  %49 = shl i64 %.058102, 8
  %50 = or disjoint i64 %.045, %49
  %51 = add nsw i32 %.062101, 8
  %52 = icmp slt i32 %.062101, 17
  br i1 %52, label %15, label %.loopexit82

53:                                               ; preds = %.thread75, %4
  %.264 = phi i32 [ %2, %4 ], [ %.062101, %.thread75 ]
  %.260 = phi i64 [ %1, %4 ], [ %.058102, %.thread75 ]
  %.656 = phi ptr [ %5, %4 ], [ %46, %.thread75 ]
  %.6 = phi i64 [ %7, %4 ], [ %45, %.thread75 ]
  %54 = icmp slt i32 %.264, %3
  br i1 %54, label %55, label %.loopexit82

55:                                               ; preds = %53
  %56 = getelementptr inbounds i8, ptr %9, i64 560
  %57 = load ptr, ptr %56, align 8, !tbaa !24
  %58 = getelementptr inbounds i8, ptr %57, i64 16
  %59 = load i8, ptr %58, align 8, !tbaa !25
  %.not69 = icmp eq i8 %59, 0
  br i1 %.not69, label %60, label %67

60:                                               ; preds = %55
  %61 = load ptr, ptr %9, align 8, !tbaa !27
  %62 = getelementptr inbounds i8, ptr %61, i64 40
  store i32 117, ptr %62, align 8, !tbaa !28
  %63 = getelementptr inbounds i8, ptr %61, i64 8
  %64 = load ptr, ptr %63, align 8, !tbaa !30
  tail call void %64(ptr noundef nonnull %9, i32 noundef -1) #1
  %65 = load ptr, ptr %56, align 8, !tbaa !24
  %66 = getelementptr inbounds i8, ptr %65, i64 16
  store i8 1, ptr %66, align 8, !tbaa !25
  br label %67

67:                                               ; preds = %60, %55
  %68 = sub nsw i32 25, %.264
  %69 = zext nneg i32 %68 to i64
  %70 = shl i64 %.260, %69
  br label %.loopexit82

.loopexit82:                                      ; preds = %.loopexit, %.preheader81, %53, %67
  %.365 = phi i32 [ 25, %67 ], [ %.264, %53 ], [ %2, %.preheader81 ], [ %51, %.loopexit ]
  %.361 = phi i64 [ %70, %67 ], [ %.260, %53 ], [ %1, %.preheader81 ], [ %50, %.loopexit ]
  %.757 = phi ptr [ %.656, %67 ], [ %.656, %53 ], [ %5, %.preheader81 ], [ %.454, %.loopexit ]
  %.7 = phi i64 [ %.6, %67 ], [ %.6, %53 ], [ %7, %.preheader81 ], [ %.4, %.loopexit ]
  store ptr %.757, ptr %0, align 8, !tbaa !5
  store i64 %.7, ptr %6, align 8, !tbaa !12
  %71 = getelementptr inbounds i8, ptr %0, i64 16
  store i64 %.361, ptr %71, align 8, !tbaa !31
  %72 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %.365, ptr %72, align 8, !tbaa !32
  br label %.thread

.thread:                                          ; preds = %17, %34, %.loopexit82
  %.2 = phi i8 [ 1, %.loopexit82 ], [ 0, %34 ], [ 0, %17 ]
  ret i8 %.2
}

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 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !7, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !10, i64 8}
!13 = !{!6, !7, i64 32}
!14 = !{!15, !11, i64 508}
!15 = !{!"jpeg_decompress_struct", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !8, i64 32, !11, i64 36, !7, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !16, i64 80, !8, i64 88, !8, i64 89, !11, i64 92, !8, i64 96, !8, i64 97, !8, i64 98, !11, i64 100, !8, i64 104, !11, i64 108, !8, i64 112, !8, i64 113, !8, i64 114, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !7, i64 144, !11, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !7, i64 176, !8, i64 184, !8, i64 216, !8, i64 248, !11, i64 280, !7, i64 288, !8, i64 296, !8, i64 297, !8, i64 298, !8, i64 314, !8, i64 330, !11, i64 348, !8, i64 352, !8, i64 353, !8, i64 354, !8, i64 355, !17, i64 356, !17, i64 358, !8, i64 360, !8, i64 361, !8, i64 362, !7, i64 368, !11, i64 376, !11, i64 380, !11, i64 384, !11, i64 388, !7, i64 392, !11, i64 400, !8, i64 408, !11, i64 440, !11, i64 444, !11, i64 448, !8, i64 452, !11, i64 492, !11, i64 496, !11, i64 500, !11, i64 504, !11, i64 508, !7, i64 512, !7, i64 520, !7, i64 528, !7, i64 536, !7, i64 544, !7, i64 552, !7, i64 560, !7, i64 568, !7, i64 576, !7, i64 584, !7, i64 592}
!16 = !{!"double", !8, i64 0}
!17 = !{!"short", !8, i64 0}
!18 = !{!15, !7, i64 40}
!19 = !{!20, !7, i64 24}
!20 = !{!"jpeg_source_mgr", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48}
!21 = !{!20, !7, i64 0}
!22 = !{!20, !10, i64 8}
!23 = !{!8, !8, i64 0}
!24 = !{!15, !7, i64 560}
!25 = !{!26, !8, i64 16}
!26 = !{!"jpeg_entropy_decoder", !7, i64 0, !7, i64 8, !8, i64 16}
!27 = !{!15, !7, i64 0}
!28 = !{!29, !11, i64 40}
!29 = !{!"jpeg_error_mgr", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !11, i64 40, !8, i64 44, !11, i64 124, !10, i64 128, !7, i64 136, !11, i64 144, !7, i64 152, !11, i64 160, !11, i64 164}
!30 = !{!29, !7, i64 8}
!31 = !{!6, !10, i64 16}
!32 = !{!6, !11, i64 24}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass