; LLVM IR from aagdev/mlimgsynth :: src/ccommon (image_io_jpeg)

; 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.CodecJpegLoad = type { %struct.jpeg_decompress_struct, %struct.img_codec_jpeg_error_mgr }
%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, 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, i32, ptr, i32, [4 x ptr], i32, i32, i32, [10 x i32], i32, i32, i32, i32, i32, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.img_codec_jpeg_error_mgr = type { %struct.jpeg_error_mgr, [1 x %struct.__jmp_buf_tag] }
%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.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.ImageIO = type { ptr, ptr, ptr, ptr, i32, i32 }
%struct.Image = type { ptr, i32, i32, i32, i32, i32, i32 }

; 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 i32 @imgio_jpeg_load_op(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [1 x ptr], align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.CodecJpegLoad, ptr %13, i32 0, i32 0
  store ptr %14, ptr %8, align 8, !tbaa !5
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.CodecJpegLoad, ptr %15, i32 0, i32 1
  %17 = getelementptr inbounds %struct.img_codec_jpeg_error_mgr, ptr %16, i32 0, i32 1
  %18 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %17, i64 0, i64 0
  %19 = call i32 @_setjmp(ptr noundef %18) #5
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %3
  store i32 -779, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %116

22:                                               ; preds = %3
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ImageIO, ptr %24, i32 0, i32 1
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  call void @jpeg_stream_src(ptr noundef %23, ptr noundef %26)
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = call i32 @jpeg_read_header(ptr noundef %27, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !12
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %29, i32 0, i32 11
  %31 = load i32, ptr %30, align 8, !tbaa !13
  %32 = icmp eq i32 %31, 1
  br i1 %32, label %39, label %33

33:                                               ; preds = %22
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.ImageIO, ptr %34, i32 0, i32 4
  %36 = load i32, ptr %35, align 8, !tbaa !17
  %37 = and i32 %36, 8
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %42

39:                                               ; preds = %33, %22
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %40, i32 0, i32 11
  store i32 1, ptr %41, align 8, !tbaa !13
  store i32 1, ptr %10, align 4, !tbaa !12
  br label %45

42:                                               ; preds = %33
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %43, i32 0, i32 11
  store i32 2, ptr %44, align 8, !tbaa !13
  store i32 258, ptr %10, align 4, !tbaa !12
  br label %45

45:                                               ; preds = %42, %39
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %46, i32 0, i32 20
  store i32 0, ptr %47, align 4, !tbaa !18
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.ImageIO, ptr %48, i32 0, i32 4
  %50 = load i32, ptr %49, align 8, !tbaa !17
  %51 = and i32 %50, 4
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %62

53:                                               ; preds = %45
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %54, i32 0, i32 12
  store i32 1, ptr %55, align 4, !tbaa !19
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %56, i32 0, i32 13
  store i32 1, ptr %57, align 8, !tbaa !20
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %58, i32 0, i32 17
  store i32 1, ptr %59, align 8, !tbaa !21
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %60, i32 0, i32 18
  store i32 0, ptr %61, align 4, !tbaa !22
  br label %62

62:                                               ; preds = %53, %45
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  call void @jpeg_calc_output_dimensions(ptr noundef %63)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %65, i32 0, i32 27
  %67 = load i32, ptr %66, align 8, !tbaa !23
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %68, i32 0, i32 28
  %70 = load i32, ptr %69, align 4, !tbaa !24
  %71 = load i32, ptr %10, align 4, !tbaa !12
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %72, i32 0, i32 27
  %74 = load i32, ptr %73, align 8, !tbaa !23
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %75, i32 0, i32 30
  %77 = load i32, ptr %76, align 4, !tbaa !25
  %78 = mul i32 %74, %77
  %79 = call i32 @img_resize(ptr noundef %64, i32 noundef %67, i32 noundef %70, i32 noundef %71, i32 noundef %78)
  store i32 %79, ptr %11, align 4, !tbaa !12
  %80 = load i32, ptr %11, align 4, !tbaa !12
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %84

82:                                               ; preds = %62
  %83 = load i32, ptr %11, align 4, !tbaa !12
  store i32 %83, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %115

84:                                               ; preds = %62
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = call i32 @jpeg_start_decompress(ptr noundef %85)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  br label %87

87:                                               ; preds = %95, %84
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %88, i32 0, i32 34
  %90 = load i32, ptr %89, align 8, !tbaa !26
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %91, i32 0, i32 28
  %93 = load i32, ptr %92, align 4, !tbaa !24
  %94 = icmp ult i32 %90, %93
  br i1 %94, label %95, label %112

95:                                               ; preds = %87
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.Image, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !27
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.Image, ptr %99, i32 0, i32 3
  %101 = load i32, ptr %100, align 8, !tbaa !29
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %102, i32 0, i32 34
  %104 = load i32, ptr %103, align 8, !tbaa !26
  %105 = mul i32 %101, %104
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds i8, ptr %98, i64 %106
  %108 = getelementptr inbounds [1 x ptr], ptr %12, i64 0, i64 0
  store ptr %107, ptr %108, align 8, !tbaa !5
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = getelementptr inbounds [1 x ptr], ptr %12, i64 0, i64 0
  %111 = call i32 @jpeg_read_scanlines(ptr noundef %109, ptr noundef %110, i32 noundef 1)
  br label %87, !llvm.loop !30

112:                                              ; preds = %87
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = call i32 @jpeg_finish_decompress(ptr noundef %113)
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %115

115:                                              ; preds = %112, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %116

116:                                              ; preds = %115, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %117 = load i32, ptr %4, align 4
  ret i32 %117
}

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) #2

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

declare i32 @jpeg_read_header(ptr noundef, i32 noundef) #3

declare void @jpeg_calc_output_dimensions(ptr noundef) #3

declare i32 @img_resize(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

declare i32 @jpeg_start_decompress(ptr noundef) #3

declare i32 @jpeg_read_scanlines(ptr noundef, ptr noundef, i32 noundef) #3

declare i32 @jpeg_finish_decompress(ptr noundef) #3

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 returns_twice "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 = { "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 #4 = { nounwind }
attributes #5 = { nounwind returns_twice }

!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, !6, i64 8}
!10 = !{!"ImageIO", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 36}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !11, i64 64}
!14 = !{!"jpeg_decompress_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, !11, i64 64, !11, i64 68, !11, i64 72, !15, i64 80, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !11, i64 152, !11, i64 156, !6, i64 160, !11, i64 168, !11, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !6, i64 192, !7, i64 200, !7, i64 232, !7, i64 264, !11, i64 296, !6, i64 304, !11, i64 312, !11, i64 316, !11, i64 320, !7, i64 324, !7, i64 340, !7, i64 356, !11, i64 372, !11, i64 376, !7, i64 380, !7, i64 381, !7, i64 382, !16, i64 384, !16, i64 386, !11, i64 388, !7, i64 392, !11, i64 396, !6, i64 400, !11, i64 408, !11, i64 412, !11, i64 416, !11, i64 420, !11, i64 424, !6, i64 432, !11, i64 440, !7, i64 448, !11, i64 480, !11, i64 484, !11, i64 488, !7, i64 492, !11, i64 532, !11, i64 536, !11, i64 540, !11, i64 544, !11, i64 548, !6, i64 552, !11, i64 560, !11, i64 564, !6, i64 568, !6, i64 576, !6, i64 584, !6, i64 592, !6, i64 600, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !6, i64 640, !6, i64 648}
!15 = !{!"double", !7, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!10, !11, i64 32}
!18 = !{!14, !11, i64 108}
!19 = !{!14, !11, i64 68}
!20 = !{!14, !11, i64 72}
!21 = !{!14, !11, i64 96}
!22 = !{!14, !11, i64 100}
!23 = !{!14, !11, i64 136}
!24 = !{!14, !11, i64 140}
!25 = !{!14, !11, i64 148}
!26 = !{!14, !11, i64 168}
!27 = !{!28, !6, i64 0}
!28 = !{!"Image", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!29 = !{!28, !11, i64 16}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress 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 i32 @imgio_jpeg_load_op(ptr noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = alloca [1 x ptr], align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 824
  %6 = call i32 @_setjmp(ptr noundef nonnull %5) #4
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %._crit_edge39, label %49

._crit_edge39:                                    ; preds = %3
  %7 = getelementptr inbounds i8, ptr %1, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  call void @jpeg_stream_src(ptr noundef %0, ptr noundef %8)
  %9 = call i32 @jpeg_read_header(ptr noundef %0, i32 noundef 1) #5
  %10 = getelementptr inbounds i8, ptr %0, i64 64
  %11 = load i32, ptr %10, align 8, !tbaa !11
  %12 = icmp eq i32 %11, 1
  %.phi.trans.insert = getelementptr inbounds i8, ptr %1, i64 32
  %.pre = load i32, ptr %.phi.trans.insert, align 8, !tbaa !15
  %13 = and i32 %.pre, 8
  %.not35 = icmp eq i32 %13, 0
  %spec.select = select i1 %.not35, i32 2, i32 1
  %spec.select38 = select i1 %.not35, i32 258, i32 1
  %storemerge = select i1 %12, i32 1, i32 %spec.select
  %.032 = select i1 %12, i32 1, i32 %spec.select38
  store i32 %storemerge, ptr %10, align 8, !tbaa !11
  %14 = getelementptr inbounds i8, ptr %0, i64 108
  store i32 0, ptr %14, align 4, !tbaa !16
  %15 = and i32 %.pre, 4
  %.not36 = icmp eq i32 %15, 0
  br i1 %.not36, label %21, label %16

16:                                               ; preds = %._crit_edge39
  %17 = getelementptr inbounds i8, ptr %0, i64 68
  store i32 1, ptr %17, align 4, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 1, ptr %18, align 8, !tbaa !18
  %19 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 1, ptr %19, align 8, !tbaa !19
  %20 = getelementptr inbounds i8, ptr %0, i64 100
  store i32 0, ptr %20, align 4, !tbaa !20
  br label %21

21:                                               ; preds = %16, %._crit_edge39
  call void @jpeg_calc_output_dimensions(ptr noundef nonnull %0) #5
  %22 = getelementptr inbounds i8, ptr %0, i64 136
  %23 = load i32, ptr %22, align 8, !tbaa !21
  %24 = getelementptr inbounds i8, ptr %0, i64 140
  %25 = load i32, ptr %24, align 4, !tbaa !22
  %26 = getelementptr inbounds i8, ptr %0, i64 148
  %27 = load i32, ptr %26, align 4, !tbaa !23
  %28 = mul i32 %27, %23
  %29 = call i32 @img_resize(ptr noundef %2, i32 noundef %23, i32 noundef %25, i32 noundef %.032, i32 noundef %28) #5
  %.not37 = icmp eq i32 %29, 0
  br i1 %.not37, label %30, label %49

30:                                               ; preds = %21
  %31 = call i32 @jpeg_start_decompress(ptr noundef nonnull %0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %32 = getelementptr inbounds i8, ptr %0, i64 168
  %33 = load i32, ptr %32, align 8, !tbaa !24
  %34 = load i32, ptr %24, align 4, !tbaa !22
  %35 = icmp ult i32 %33, %34
  br i1 %35, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %30
  %36 = getelementptr inbounds i8, ptr %2, i64 16
  br label %37

37:                                               ; preds = %.lr.ph, %37
  %38 = phi i32 [ %33, %.lr.ph ], [ %45, %37 ]
  %39 = load ptr, ptr %2, align 8, !tbaa !25
  %40 = load i32, ptr %36, align 8, !tbaa !27
  %41 = mul i32 %40, %38
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds i8, ptr %39, i64 %42
  store ptr %43, ptr %4, align 8, !tbaa !28
  %44 = call i32 @jpeg_read_scanlines(ptr noundef nonnull %0, ptr noundef nonnull %4, i32 noundef 1) #5
  %45 = load i32, ptr %32, align 8, !tbaa !24
  %46 = load i32, ptr %24, align 4, !tbaa !22
  %47 = icmp ult i32 %45, %46
  br i1 %47, label %37, label %._crit_edge, !llvm.loop !29

._crit_edge:                                      ; preds = %37, %30
  %48 = call i32 @jpeg_finish_decompress(ptr noundef nonnull %0) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %49

49:                                               ; preds = %._crit_edge, %21, %3
  %.1 = phi i32 [ -779, %3 ], [ 0, %._crit_edge ], [ %29, %21 ]
  ret i32 %.1
}

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @jpeg_stream_src(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @jpeg_read_header(ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @jpeg_calc_output_dimensions(ptr noundef) local_unnamed_addr #3

declare i32 @img_resize(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @jpeg_start_decompress(ptr noundef) local_unnamed_addr #3

declare i32 @jpeg_read_scanlines(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @jpeg_finish_decompress(ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress 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 returns_twice "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 = { "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 #4 = { nounwind returns_twice }
attributes #5 = { 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 = !{!"ImageIO", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 36}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !10, i64 64}
!12 = !{!"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, !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, !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, !10, i64 320, !8, i64 324, !8, i64 340, !8, i64 356, !10, i64 372, !10, i64 376, !8, i64 380, !8, i64 381, !8, i64 382, !14, i64 384, !14, i64 386, !10, i64 388, !8, i64 392, !10, i64 396, !7, i64 400, !10, i64 408, !10, i64 412, !10, i64 416, !10, i64 420, !10, i64 424, !7, i64 432, !10, i64 440, !8, i64 448, !10, i64 480, !10, i64 484, !10, i64 488, !8, i64 492, !10, i64 532, !10, i64 536, !10, i64 540, !10, i64 544, !10, i64 548, !7, i64 552, !10, i64 560, !10, i64 564, !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, i64 632, !7, i64 640, !7, i64 648}
!13 = !{!"double", !8, i64 0}
!14 = !{!"short", !8, i64 0}
!15 = !{!6, !10, i64 32}
!16 = !{!12, !10, i64 108}
!17 = !{!12, !10, i64 68}
!18 = !{!12, !10, i64 72}
!19 = !{!12, !10, i64 96}
!20 = !{!12, !10, i64 100}
!21 = !{!12, !10, i64 136}
!22 = !{!12, !10, i64 140}
!23 = !{!12, !10, i64 148}
!24 = !{!12, !10, i64 168}
!25 = !{!26, !7, i64 0}
!26 = !{!"Image", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!27 = !{!26, !10, i64 16}
!28 = !{!7, !7, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass