; LLVM IR from EyalAr/lwip :: src/lib/jpeg (jcparam)

; 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, i32, i32, i32, i32, ptr, [4 x ptr], [4 x i32], [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, i32, i8, i8, i8, i16, i16, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x ptr], i32, i32, i32, [10 x i32], i32, i32, i32, i32, i32, ptr, 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_memory_mgr = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64 }

; 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 @jpeg_simple_progression(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %6, i32 0, i32 17
  %8 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %8, ptr %3, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  %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 !15
  %12 = icmp ne i32 %11, 100
  br i1 %12, label %13, label %32

13:                                               ; preds = %1
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !16
  %17 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %16, i32 0, i32 5
  store i32 21, ptr %17, align 8, !tbaa !17
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %18, i32 0, i32 5
  %20 = load i32, ptr %19, align 4, !tbaa !15
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %21, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !16
  %24 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %23, i32 0, i32 6
  %25 = getelementptr inbounds [8 x i32], ptr %24, i64 0, i64 0
  store i32 %20, ptr %25, align 4, !tbaa !20
  %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 !21
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  call void %30(ptr noundef %31)
  br label %32

32:                                               ; preds = %13, %1
  %33 = load i32, ptr %3, align 4, !tbaa !14
  %34 = icmp eq i32 %33, 3
  br i1 %34, label %35, label %46

35:                                               ; preds = %32
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %36, i32 0, i32 18
  %38 = load i32, ptr %37, align 8, !tbaa !22
  %39 = icmp eq i32 %38, 3
  br i1 %39, label %45, label %40

40:                                               ; preds = %35
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %41, i32 0, i32 18
  %43 = load i32, ptr %42, align 8, !tbaa !22
  %44 = icmp eq i32 %43, 7
  br i1 %44, label %45, label %46

45:                                               ; preds = %40, %35
  store i32 10, ptr %4, align 4, !tbaa !14
  br label %57

46:                                               ; preds = %40, %32
  %47 = load i32, ptr %3, align 4, !tbaa !14
  %48 = icmp sgt i32 %47, 4
  br i1 %48, label %49, label %52

49:                                               ; preds = %46
  %50 = load i32, ptr %3, align 4, !tbaa !14
  %51 = mul nsw i32 6, %50
  store i32 %51, ptr %4, align 4, !tbaa !14
  br label %56

52:                                               ; preds = %46
  %53 = load i32, ptr %3, align 4, !tbaa !14
  %54 = mul nsw i32 4, %53
  %55 = add nsw i32 2, %54
  store i32 %55, ptr %4, align 4, !tbaa !14
  br label %56

56:                                               ; preds = %52, %49
  br label %57

57:                                               ; preds = %56, %45
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %58, i32 0, i32 75
  %60 = load ptr, ptr %59, align 8, !tbaa !23
  %61 = icmp eq ptr %60, null
  br i1 %61, label %68, label %62

62:                                               ; preds = %57
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %63, i32 0, i32 76
  %65 = load i32, ptr %64, align 8, !tbaa !24
  %66 = load i32, ptr %4, align 4, !tbaa !14
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %68, label %92

68:                                               ; preds = %62, %57
  %69 = load i32, ptr %4, align 4, !tbaa !14
  %70 = icmp sgt i32 %69, 10
  br i1 %70, label %71, label %73

71:                                               ; preds = %68
  %72 = load i32, ptr %4, align 4, !tbaa !14
  br label %74

73:                                               ; preds = %68
  br label %74

74:                                               ; preds = %73, %71
  %75 = phi i32 [ %72, %71 ], [ 10, %73 ]
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %76, i32 0, i32 76
  store i32 %75, ptr %77, align 8, !tbaa !24
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %78, i32 0, i32 1
  %80 = load ptr, ptr %79, align 8, !tbaa !25
  %81 = getelementptr inbounds %struct.jpeg_memory_mgr, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !26
  %83 = load ptr, ptr %2, align 8, !tbaa !5
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %84, i32 0, i32 76
  %86 = load i32, ptr %85, align 8, !tbaa !24
  %87 = sext i32 %86 to i64
  %88 = mul i64 %87, 36
  %89 = call ptr %82(ptr noundef %83, i32 noundef 0, i64 noundef %88)
  %90 = load ptr, ptr %2, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %90, i32 0, i32 75
  store ptr %89, ptr %91, align 8, !tbaa !23
  br label %92

92:                                               ; preds = %74, %62
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %93, i32 0, i32 75
  %95 = load ptr, ptr %94, align 8, !tbaa !23
  store ptr %95, ptr %5, align 8, !tbaa !5
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %97, i32 0, i32 28
  store ptr %96, ptr %98, align 8, !tbaa !28
  %99 = load i32, ptr %4, align 4, !tbaa !14
  %100 = load ptr, ptr %2, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %100, i32 0, i32 27
  store i32 %99, ptr %101, align 8, !tbaa !29
  %102 = load i32, ptr %3, align 4, !tbaa !14
  %103 = icmp eq i32 %102, 3
  br i1 %103, label %104, label %137

104:                                              ; preds = %92
  %105 = load ptr, ptr %2, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %105, i32 0, i32 18
  %107 = load i32, ptr %106, align 8, !tbaa !22
  %108 = icmp eq i32 %107, 3
  br i1 %108, label %114, label %109

109:                                              ; preds = %104
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %110, i32 0, i32 18
  %112 = load i32, ptr %111, align 8, !tbaa !22
  %113 = icmp eq i32 %112, 7
  br i1 %113, label %114, label %137

114:                                              ; preds = %109, %104
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = load i32, ptr %3, align 4, !tbaa !14
  %117 = call ptr @fill_dc_scans(ptr noundef %115, i32 noundef %116, i32 noundef 0, i32 noundef 1)
  store ptr %117, ptr %5, align 8, !tbaa !5
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = call ptr @fill_a_scan(ptr noundef %118, i32 noundef 0, i32 noundef 1, i32 noundef 5, i32 noundef 0, i32 noundef 2)
  store ptr %119, ptr %5, align 8, !tbaa !5
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = call ptr @fill_a_scan(ptr noundef %120, i32 noundef 2, i32 noundef 1, i32 noundef 63, i32 noundef 0, i32 noundef 1)
  store ptr %121, ptr %5, align 8, !tbaa !5
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = call ptr @fill_a_scan(ptr noundef %122, i32 noundef 1, i32 noundef 1, i32 noundef 63, i32 noundef 0, i32 noundef 1)
  store ptr %123, ptr %5, align 8, !tbaa !5
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = call ptr @fill_a_scan(ptr noundef %124, i32 noundef 0, i32 noundef 6, i32 noundef 63, i32 noundef 0, i32 noundef 2)
  store ptr %125, ptr %5, align 8, !tbaa !5
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = call ptr @fill_a_scan(ptr noundef %126, i32 noundef 0, i32 noundef 1, i32 noundef 63, i32 noundef 2, i32 noundef 1)
  store ptr %127, ptr %5, align 8, !tbaa !5
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = load i32, ptr %3, align 4, !tbaa !14
  %130 = call ptr @fill_dc_scans(ptr noundef %128, i32 noundef %129, i32 noundef 1, i32 noundef 0)
  store ptr %130, ptr %5, align 8, !tbaa !5
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = call ptr @fill_a_scan(ptr noundef %131, i32 noundef 2, i32 noundef 1, i32 noundef 63, i32 noundef 1, i32 noundef 0)
  store ptr %132, ptr %5, align 8, !tbaa !5
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = call ptr @fill_a_scan(ptr noundef %133, i32 noundef 1, i32 noundef 1, i32 noundef 63, i32 noundef 1, i32 noundef 0)
  store ptr %134, ptr %5, align 8, !tbaa !5
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = call ptr @fill_a_scan(ptr noundef %135, i32 noundef 0, i32 noundef 1, i32 noundef 63, i32 noundef 1, i32 noundef 0)
  store ptr %136, ptr %5, align 8, !tbaa !5
  br label %156

137:                                              ; preds = %109, %92
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = load i32, ptr %3, align 4, !tbaa !14
  %140 = call ptr @fill_dc_scans(ptr noundef %138, i32 noundef %139, i32 noundef 0, i32 noundef 1)
  store ptr %140, ptr %5, align 8, !tbaa !5
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  %142 = load i32, ptr %3, align 4, !tbaa !14
  %143 = call ptr @fill_scans(ptr noundef %141, i32 noundef %142, i32 noundef 1, i32 noundef 5, i32 noundef 0, i32 noundef 2)
  store ptr %143, ptr %5, align 8, !tbaa !5
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = load i32, ptr %3, align 4, !tbaa !14
  %146 = call ptr @fill_scans(ptr noundef %144, i32 noundef %145, i32 noundef 6, i32 noundef 63, i32 noundef 0, i32 noundef 2)
  store ptr %146, ptr %5, align 8, !tbaa !5
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = load i32, ptr %3, align 4, !tbaa !14
  %149 = call ptr @fill_scans(ptr noundef %147, i32 noundef %148, i32 noundef 1, i32 noundef 63, i32 noundef 2, i32 noundef 1)
  store ptr %149, ptr %5, align 8, !tbaa !5
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = load i32, ptr %3, align 4, !tbaa !14
  %152 = call ptr @fill_dc_scans(ptr noundef %150, i32 noundef %151, i32 noundef 1, i32 noundef 0)
  store ptr %152, ptr %5, align 8, !tbaa !5
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = load i32, ptr %3, align 4, !tbaa !14
  %155 = call ptr @fill_scans(ptr noundef %153, i32 noundef %154, i32 noundef 1, i32 noundef 63, i32 noundef 1, i32 noundef 0)
  store ptr %155, ptr %5, align 8, !tbaa !5
  br label %156

156:                                              ; preds = %137, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret void
}

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

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

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

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, !11, i64 92}
!10 = !{!"jpeg_compress_struct", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, 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, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !6, i64 104, !7, i64 112, !7, i64 144, !7, i64 160, !7, i64 192, !7, i64 224, !7, i64 240, !7, i64 256, !11, i64 272, !6, i64 280, !11, i64 288, !11, i64 292, !11, i64 296, !11, i64 300, !11, i64 304, !11, i64 308, !11, i64 312, !11, i64 316, !11, i64 320, !11, i64 324, !7, i64 328, !7, i64 329, !7, i64 330, !13, i64 332, !13, i64 334, !11, i64 336, !11, i64 340, !11, i64 344, !11, i64 348, !11, i64 352, !11, i64 356, !11, i64 360, !11, i64 364, !11, i64 368, !11, i64 372, !7, i64 376, !11, i64 408, !11, i64 412, !11, i64 416, !7, i64 420, !11, i64 460, !11, i64 464, !11, i64 468, !11, i64 472, !11, i64 476, !6, i64 480, !11, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !11, i64 576}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !11, i64 36}
!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 = !{!7, !7, i64 0}
!21 = !{!18, !6, i64 0}
!22 = !{!10, !11, i64 96}
!23 = !{!10, !6, i64 568}
!24 = !{!10, !11, i64 576}
!25 = !{!10, !6, i64 8}
!26 = !{!27, !6, i64 0}
!27 = !{!"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, !19, i64 88, !19, i64 96}
!28 = !{!10, !6, i64 280}
!29 = !{!10, !11, i64 272}


; 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 @jpeg_simple_progression(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 92
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 36
  %5 = load i32, ptr %4, align 4, !tbaa !13
  %.not = icmp eq i32 %5, 100
  br i1 %.not, label %12, label %6

6:                                                ; preds = %1
  %7 = load ptr, ptr %0, align 8, !tbaa !14
  %8 = getelementptr inbounds i8, ptr %7, i64 40
  store i32 21, ptr %8, align 8, !tbaa !15
  %9 = getelementptr inbounds i8, ptr %7, i64 44
  store i32 %5, ptr %9, align 4, !tbaa !18
  %10 = load ptr, ptr %0, align 8, !tbaa !14
  %11 = load ptr, ptr %10, align 8, !tbaa !19
  tail call void %11(ptr noundef nonnull %0) #2
  br label %12

12:                                               ; preds = %6, %1
  %13 = icmp eq i32 %3, 3
  br i1 %13, label %14, label %17

14:                                               ; preds = %12
  %15 = getelementptr inbounds i8, ptr %0, i64 96
  %16 = load i32, ptr %15, align 8, !tbaa !20
  switch i32 %16, label %.thread [
    i32 3, label %23
    i32 7, label %23
  ]

17:                                               ; preds = %12
  %18 = icmp sgt i32 %3, 4
  br i1 %18, label %19, label %.thread

19:                                               ; preds = %17
  %20 = mul nuw nsw i32 %3, 6
  br label %23

.thread:                                          ; preds = %14, %17
  %21 = shl nsw i32 %3, 2
  %22 = or disjoint i32 %21, 2
  br label %23

23:                                               ; preds = %14, %14, %19, %.thread
  %.0 = phi i32 [ %20, %19 ], [ %22, %.thread ], [ 10, %14 ], [ 10, %14 ]
  %24 = getelementptr inbounds i8, ptr %0, i64 568
  %25 = load ptr, ptr %24, align 8, !tbaa !21
  %26 = icmp eq ptr %25, null
  br i1 %26, label %31, label %27

27:                                               ; preds = %23
  %28 = getelementptr inbounds i8, ptr %0, i64 576
  %29 = load i32, ptr %28, align 8, !tbaa !22
  %30 = icmp slt i32 %29, %.0
  br i1 %30, label %31, label %40

31:                                               ; preds = %27, %23
  %32 = tail call i32 @llvm.smax.i32(i32 %.0, i32 10)
  %33 = getelementptr inbounds i8, ptr %0, i64 576
  store i32 %32, ptr %33, align 8, !tbaa !22
  %34 = getelementptr inbounds i8, ptr %0, i64 8
  %35 = load ptr, ptr %34, align 8, !tbaa !23
  %36 = load ptr, ptr %35, align 8, !tbaa !24
  %37 = zext nneg i32 %32 to i64
  %38 = mul nuw nsw i64 %37, 36
  %39 = tail call ptr %36(ptr noundef nonnull %0, i32 noundef 0, i64 noundef %38) #2
  store ptr %39, ptr %24, align 8, !tbaa !21
  br label %40

40:                                               ; preds = %31, %27
  %41 = phi ptr [ %39, %31 ], [ %25, %27 ]
  %42 = getelementptr inbounds i8, ptr %0, i64 280
  store ptr %41, ptr %42, align 8, !tbaa !26
  %43 = getelementptr inbounds i8, ptr %0, i64 272
  store i32 %.0, ptr %43, align 8, !tbaa !27
  br i1 %13, label %44, label %58

44:                                               ; preds = %40
  %45 = getelementptr inbounds i8, ptr %0, i64 96
  %46 = load i32, ptr %45, align 8, !tbaa !20
  switch i32 %46, label %58 [
    i32 3, label %47
    i32 7, label %47
  ]

47:                                               ; preds = %44, %44
  %48 = tail call ptr @fill_dc_scans(ptr noundef %41, i32 noundef 3, i32 noundef 0, i32 noundef 1)
  %49 = tail call ptr @fill_a_scan(ptr noundef %48, i32 noundef 0, i32 noundef 1, i32 noundef 5, i32 noundef 0, i32 noundef 2)
  %50 = tail call ptr @fill_a_scan(ptr noundef %49, i32 noundef 2, i32 noundef 1, i32 noundef 63, i32 noundef 0, i32 noundef 1)
  %51 = tail call ptr @fill_a_scan(ptr noundef %50, i32 noundef 1, i32 noundef 1, i32 noundef 63, i32 noundef 0, i32 noundef 1)
  %52 = tail call ptr @fill_a_scan(ptr noundef %51, i32 noundef 0, i32 noundef 6, i32 noundef 63, i32 noundef 0, i32 noundef 2)
  %53 = tail call ptr @fill_a_scan(ptr noundef %52, i32 noundef 0, i32 noundef 1, i32 noundef 63, i32 noundef 2, i32 noundef 1)
  %54 = tail call ptr @fill_dc_scans(ptr noundef %53, i32 noundef 3, i32 noundef 1, i32 noundef 0)
  %55 = tail call ptr @fill_a_scan(ptr noundef %54, i32 noundef 2, i32 noundef 1, i32 noundef 63, i32 noundef 1, i32 noundef 0)
  %56 = tail call ptr @fill_a_scan(ptr noundef %55, i32 noundef 1, i32 noundef 1, i32 noundef 63, i32 noundef 1, i32 noundef 0)
  %57 = tail call ptr @fill_a_scan(ptr noundef %56, i32 noundef 0, i32 noundef 1, i32 noundef 63, i32 noundef 1, i32 noundef 0)
  br label %65

58:                                               ; preds = %44, %40
  %59 = tail call ptr @fill_dc_scans(ptr noundef %41, i32 noundef %3, i32 noundef 0, i32 noundef 1)
  %60 = tail call ptr @fill_scans(ptr noundef %59, i32 noundef %3, i32 noundef 1, i32 noundef 5, i32 noundef 0, i32 noundef 2)
  %61 = tail call ptr @fill_scans(ptr noundef %60, i32 noundef %3, i32 noundef 6, i32 noundef 63, i32 noundef 0, i32 noundef 2)
  %62 = tail call ptr @fill_scans(ptr noundef %61, i32 noundef %3, i32 noundef 1, i32 noundef 63, i32 noundef 2, i32 noundef 1)
  %63 = tail call ptr @fill_dc_scans(ptr noundef %62, i32 noundef %3, i32 noundef 1, i32 noundef 0)
  %64 = tail call ptr @fill_scans(ptr noundef %63, i32 noundef %3, i32 noundef 1, i32 noundef 63, i32 noundef 1, i32 noundef 0)
  br label %65

65:                                               ; preds = %58, %47
  ret void
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #1

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 speculatable willreturn memory(none) }
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 92}
!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, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !7, i64 104, !8, i64 112, !8, i64 144, !8, i64 160, !8, i64 192, !8, i64 224, !8, i64 240, !8, i64 256, !10, i64 272, !7, i64 280, !10, i64 288, !10, i64 292, !10, i64 296, !10, i64 300, !10, i64 304, !10, i64 308, !10, i64 312, !10, i64 316, !10, i64 320, !10, i64 324, !8, i64 328, !8, i64 329, !8, i64 330, !12, i64 332, !12, i64 334, !10, i64 336, !10, i64 340, !10, i64 344, !10, i64 348, !10, i64 352, !10, i64 356, !10, i64 360, !10, i64 364, !10, i64 368, !10, i64 372, !8, i64 376, !10, i64 408, !10, i64 412, !10, i64 416, !8, i64 420, !10, i64 460, !10, i64 464, !10, i64 468, !10, i64 472, !10, i64 476, !7, i64 480, !10, i64 488, !7, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !7, i64 528, !7, i64 536, !7, i64 544, !7, i64 552, !7, i64 560, !7, i64 568, !10, i64 576}
!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 36}
!14 = !{!6, !7, i64 0}
!15 = !{!16, !10, i64 40}
!16 = !{!"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, !17, i64 128, !7, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 164}
!17 = !{!"long", !8, i64 0}
!18 = !{!8, !8, i64 0}
!19 = !{!16, !7, i64 0}
!20 = !{!6, !10, i64 96}
!21 = !{!6, !7, i64 568}
!22 = !{!6, !10, i64 576}
!23 = !{!6, !7, i64 8}
!24 = !{!25, !7, i64 0}
!25 = !{!"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, !17, i64 88, !17, i64 96}
!26 = !{!6, !7, i64 280}
!27 = !{!6, !10, i64 272}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass