; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R2Shapes/R2Image.ll (ZNK7R2Image9WriteJPEGEPKc)

; 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, ptr, [4 x ptr], [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, i8, i8, i8, i16, i16, i32, i32, i32, 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] }
%class.R2Image = type { i32, i32, i32, i32, ptr }

@stderr = external global ptr, align 8
@.str.26 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [3 x i8], align 1

; 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
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK7R2Image9WriteJPEGEPKc(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1) #2 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.jpeg_compress_struct, align 8
  %9 = alloca %struct.jpeg_error_mgr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = call noalias ptr @fopen(ptr noundef %13, ptr noundef @.str.39)
  store ptr %14, ptr %6, align 8, !tbaa !5
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %21, label %17

17:                                               ; preds = %2
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef @.str.26, ptr noundef %19) #4
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %83

21:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 520, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 168, ptr %9) #4
  %22 = call ptr @jpeg_std_error(ptr noundef %9)
  %23 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 0
  store ptr %22, ptr %23, align 8, !tbaa !9
  call void @jpeg_CreateCompress(ptr noundef %8, i32 noundef 62, i64 noundef 520)
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  call void @jpeg_stdio_dest(ptr noundef %8, ptr noundef %24)
  %25 = getelementptr inbounds %class.R2Image, ptr %12, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !16
  %27 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 7
  store i32 %26, ptr %27, align 8, !tbaa !18
  %28 = getelementptr inbounds %class.R2Image, ptr %12, i32 0, i32 1
  %29 = load i32, ptr %28, align 4, !tbaa !19
  %30 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 8
  store i32 %29, ptr %30, align 4, !tbaa !20
  %31 = getelementptr inbounds %class.R2Image, ptr %12, i32 0, i32 2
  %32 = load i32, ptr %31, align 8, !tbaa !21
  %33 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 9
  store i32 %32, ptr %33, align 8, !tbaa !22
  %34 = getelementptr inbounds %class.R2Image, ptr %12, i32 0, i32 2
  %35 = load i32, ptr %34, align 8, !tbaa !21
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %37, label %39

37:                                               ; preds = %21
  %38 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 10
  store i32 1, ptr %38, align 4, !tbaa !23
  br label %55

39:                                               ; preds = %21
  %40 = getelementptr inbounds %class.R2Image, ptr %12, i32 0, i32 2
  %41 = load i32, ptr %40, align 8, !tbaa !21
  %42 = icmp eq i32 %41, 3
  br i1 %42, label %43, label %45

43:                                               ; preds = %39
  %44 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 10
  store i32 2, ptr %44, align 4, !tbaa !23
  br label %54

45:                                               ; preds = %39
  %46 = getelementptr inbounds %class.R2Image, ptr %12, i32 0, i32 2
  %47 = load i32, ptr %46, align 8, !tbaa !21
  %48 = icmp eq i32 %47, 4
  br i1 %48, label %49, label %51

49:                                               ; preds = %45
  %50 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 10
  store i32 4, ptr %50, align 4, !tbaa !23
  br label %53

51:                                               ; preds = %45
  %52 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 10
  store i32 0, ptr %52, align 4, !tbaa !23
  br label %53

53:                                               ; preds = %51, %49
  br label %54

54:                                               ; preds = %53, %43
  br label %55

55:                                               ; preds = %54, %37
  %56 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 29
  store i32 0, ptr %56, align 4, !tbaa !24
  call void @jpeg_set_defaults(ptr noundef %8)
  %57 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 26
  store i32 1, ptr %57, align 8, !tbaa !25
  call void @jpeg_set_quality(ptr noundef %8, i32 noundef 75, i32 noundef 1)
  call void @jpeg_start_compress(ptr noundef %8, i32 noundef 1)
  br label %58

58:                                               ; preds = %64, %55
  %59 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 39
  %60 = load i32, ptr %59, align 8, !tbaa !26
  %61 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 8
  %62 = load i32, ptr %61, align 4, !tbaa !20
  %63 = icmp ult i32 %60, %62
  br i1 %63, label %64, label %80

64:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %65 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 8
  %66 = load i32, ptr %65, align 4, !tbaa !20
  %67 = getelementptr inbounds %struct.jpeg_compress_struct, ptr %8, i32 0, i32 39
  %68 = load i32, ptr %67, align 8, !tbaa !26
  %69 = sub i32 %66, %68
  %70 = sub i32 %69, 1
  store i32 %70, ptr %10, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %71 = getelementptr inbounds %class.R2Image, ptr %12, i32 0, i32 4
  %72 = load ptr, ptr %71, align 8, !tbaa !28
  %73 = load i32, ptr %10, align 4, !tbaa !27
  %74 = getelementptr inbounds %class.R2Image, ptr %12, i32 0, i32 3
  %75 = load i32, ptr %74, align 4, !tbaa !29
  %76 = mul nsw i32 %73, %75
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds i8, ptr %72, i64 %77
  store ptr %78, ptr %11, align 8, !tbaa !5
  %79 = call i32 @jpeg_write_scanlines(ptr noundef %8, ptr noundef %11, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %58, !llvm.loop !30

80:                                               ; preds = %58
  call void @jpeg_finish_compress(ptr noundef %8)
  call void @jpeg_destroy_compress(ptr noundef %8)
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = call i32 @fclose(ptr noundef %81)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 168, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 520, ptr %8) #4
  br label %83

83:                                               ; preds = %80, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %84 = load i32, ptr %3, align 4
  ret i32 %84
}

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

declare i32 @fclose(ptr noundef) #3

declare ptr @jpeg_std_error(ptr noundef) #3

declare void @jpeg_CreateCompress(ptr noundef, i32 noundef, i64 noundef) #3

declare void @jpeg_stdio_dest(ptr noundef, ptr noundef) #3

declare void @jpeg_set_defaults(ptr noundef) #3

declare void @jpeg_set_quality(ptr noundef, i32 noundef, i32 noundef) #3

declare void @jpeg_start_compress(ptr noundef, i32 noundef) #3

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

declare void @jpeg_finish_compress(ptr noundef) #3

declare void @jpeg_destroy_compress(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "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 = { mustprogress 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 = { "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 }

!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++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTS20jpeg_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, !12, i64 60, !13, i64 64, !11, i64 72, !11, i64 76, !12, 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, !11, i64 256, !11, i64 260, !11, i64 264, !11, i64 268, !11, i64 272, !14, i64 276, !11, i64 280, !11, i64 284, !11, i64 288, !7, i64 292, !7, i64 293, !7, i64 294, !15, i64 296, !15, i64 298, !11, i64 300, !11, i64 304, !11, i64 308, !11, i64 312, !11, i64 316, !11, i64 320, !11, i64 324, !7, i64 328, !11, i64 360, !11, i64 364, !11, i64 368, !7, i64 372, !11, i64 412, !11, i64 416, !11, i64 420, !11, 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, !6, i64 496, !6, i64 504, !11, i64 512}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS13J_COLOR_SPACE", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTS12J_DCT_METHOD", !7, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!17, !11, i64 0}
!17 = !{!"_ZTS7R2Image", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16}
!18 = !{!10, !11, i64 48}
!19 = !{!17, !11, i64 4}
!20 = !{!10, !11, i64 52}
!21 = !{!17, !11, i64 8}
!22 = !{!10, !11, i64 56}
!23 = !{!10, !12, i64 60}
!24 = !{!10, !14, i64 276}
!25 = !{!10, !11, i64 264}
!26 = !{!10, !11, i64 304}
!27 = !{!11, !11, i64 0}
!28 = !{!17, !6, i64 16}
!29 = !{!17, !11, i64 12}
!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"

%struct.jpeg_compress_struct = type { ptr, ptr, ptr, ptr, i32, 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, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i16, i16, i32, i32, i32, 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] }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.26 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [3 x i8], align 1
@switch.table._ZNK7R2Image9WriteJPEGEPKc = private unnamed_addr constant [4 x i32] [i32 1, i32 0, i32 2, i32 4], align 4

; 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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZNK7R2Image9WriteJPEGEPKc(ptr nocapture noundef nonnull readonly align 8 dereferenceable(24) %0, ptr noundef %1) local_unnamed_addr #2 align 2 {
  %3 = alloca %struct.jpeg_compress_struct, align 8
  %4 = alloca %struct.jpeg_error_mgr, align 8
  %5 = alloca ptr, align 8
  %6 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.39)
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %7, label %10

7:                                                ; preds = %2
  %8 = load ptr, ptr @stderr, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.26, ptr noundef %1) #4
  br label %45

10:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 520, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 168, ptr nonnull %4) #5
  %11 = call ptr @jpeg_std_error(ptr noundef nonnull %4)
  store ptr %11, ptr %3, align 8, !tbaa !9
  call void @jpeg_CreateCompress(ptr noundef nonnull %3, i32 noundef 62, i64 noundef 520)
  call void @jpeg_stdio_dest(ptr noundef nonnull %3, ptr noundef nonnull %6)
  %12 = getelementptr inbounds i8, ptr %3, i64 48
  %13 = getelementptr inbounds i8, ptr %3, i64 52
  %14 = load <2 x i32>, ptr %0, align 8, !tbaa !16
  store <2 x i32> %14, ptr %12, align 8, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = load i32, ptr %15, align 8, !tbaa !17
  %17 = getelementptr inbounds i8, ptr %3, i64 56
  store i32 %16, ptr %17, align 8, !tbaa !19
  %18 = getelementptr inbounds i8, ptr %3, i64 60
  %switch.tableidx = add i32 %16, -1
  %19 = icmp ult i32 %switch.tableidx, 4
  br i1 %19, label %switch.lookup, label %21

switch.lookup:                                    ; preds = %10
  %20 = zext nneg i32 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [4 x i32], ptr @switch.table._ZNK7R2Image9WriteJPEGEPKc, i64 0, i64 %20
  %switch.load = load i32, ptr %switch.gep, align 4
  br label %21

21:                                               ; preds = %10, %switch.lookup
  %.sink = phi i32 [ %switch.load, %switch.lookup ], [ 0, %10 ]
  store i32 %.sink, ptr %18, align 4, !tbaa !20
  %22 = getelementptr inbounds i8, ptr %3, i64 276
  store i32 0, ptr %22, align 4, !tbaa !21
  call void @jpeg_set_defaults(ptr noundef nonnull %3)
  %23 = getelementptr inbounds i8, ptr %3, i64 264
  store i32 1, ptr %23, align 8, !tbaa !22
  call void @jpeg_set_quality(ptr noundef nonnull %3, i32 noundef 75, i32 noundef 1)
  call void @jpeg_start_compress(ptr noundef nonnull %3, i32 noundef 1)
  %24 = getelementptr inbounds i8, ptr %3, i64 304
  %25 = load i32, ptr %24, align 8, !tbaa !23
  %26 = load i32, ptr %13, align 4, !tbaa !24
  %27 = icmp ult i32 %25, %26
  br i1 %27, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %21
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  %29 = getelementptr inbounds i8, ptr %0, i64 12
  br label %30

30:                                               ; preds = %.lr.ph, %30
  %31 = phi i32 [ %26, %.lr.ph ], [ %42, %30 ]
  %32 = phi i32 [ %25, %.lr.ph ], [ %41, %30 ]
  %33 = xor i32 %32, -1
  %34 = add i32 %31, %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %35 = load ptr, ptr %28, align 8, !tbaa !25
  %36 = load i32, ptr %29, align 4, !tbaa !26
  %37 = mul nsw i32 %36, %34
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i8, ptr %35, i64 %38
  store ptr %39, ptr %5, align 8, !tbaa !5
  %40 = call i32 @jpeg_write_scanlines(ptr noundef nonnull %3, ptr noundef nonnull %5, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %41 = load i32, ptr %24, align 8, !tbaa !23
  %42 = load i32, ptr %13, align 4, !tbaa !24
  %43 = icmp ult i32 %41, %42
  br i1 %43, label %30, label %._crit_edge, !llvm.loop !27

._crit_edge:                                      ; preds = %30, %21
  call void @jpeg_finish_compress(ptr noundef nonnull %3)
  call void @jpeg_destroy_compress(ptr noundef nonnull %3)
  %44 = call i32 @fclose(ptr noundef nonnull %6)
  call void @llvm.lifetime.end.p0(i64 168, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %3) #5
  br label %45

45:                                               ; preds = %._crit_edge, %7
  %.0 = phi i32 [ 1, %._crit_edge ], [ 0, %7 ]
  ret i32 %.0
}

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #1

declare ptr @jpeg_std_error(ptr noundef) local_unnamed_addr #3

declare void @jpeg_CreateCompress(ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #3

declare void @jpeg_stdio_dest(ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @jpeg_set_defaults(ptr noundef) local_unnamed_addr #3

declare void @jpeg_set_quality(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @jpeg_start_compress(ptr noundef, i32 noundef) local_unnamed_addr #3

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

declare void @jpeg_finish_compress(ptr noundef) local_unnamed_addr #3

declare void @jpeg_destroy_compress(ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nofree nounwind "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 = { mustprogress 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 = { "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 = { cold nounwind }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTS20jpeg_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, !12, i64 60, !13, i64 64, !11, i64 72, !11, i64 76, !12, 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, !11, i64 256, !11, i64 260, !11, i64 264, !11, i64 268, !11, i64 272, !14, i64 276, !11, i64 280, !11, i64 284, !11, i64 288, !7, i64 292, !7, i64 293, !7, i64 294, !15, i64 296, !15, i64 298, !11, i64 300, !11, i64 304, !11, i64 308, !11, i64 312, !11, i64 316, !11, i64 320, !11, i64 324, !7, i64 328, !11, i64 360, !11, i64 364, !11, i64 368, !7, i64 372, !11, i64 412, !11, i64 416, !11, i64 420, !11, 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, !6, i64 496, !6, i64 504, !11, i64 512}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS13J_COLOR_SPACE", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTS12J_DCT_METHOD", !7, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!11, !11, i64 0}
!17 = !{!18, !11, i64 8}
!18 = !{!"_ZTS7R2Image", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16}
!19 = !{!10, !11, i64 56}
!20 = !{!10, !12, i64 60}
!21 = !{!10, !14, i64 276}
!22 = !{!10, !11, i64 264}
!23 = !{!10, !11, i64 304}
!24 = !{!10, !11, i64 52}
!25 = !{!18, !6, i64 16}
!26 = !{!18, !11, i64 12}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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