; LLVM IR from mkazhdan/DMG :: Util/TIFF (tif_tile)

; 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.tiff = type { ptr, i32, i32, i32, i32, i32, ptr, i16, %struct.TIFFDirectory, %struct.TIFFHeader, ptr, ptr, i32, i16, i32, i32, i32, i16, i32, i32, i32, i32, i32, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr, %struct.TIFFTagMethods, ptr }
%struct.TIFFDirectory = type { [4 x i64], i32, i32, i32, i32, i32, i32, i32, i16, i16, i16, i16, i16, i16, i16, i16, i32, i16, i16, double, double, float, float, i16, i16, float, float, [2 x i16], [3 x ptr], [2 x i16], i16, ptr, i32, i32, ptr, ptr, i32, i16, ptr, [2 x i16], i16, [3 x ptr], i32, ptr, i32, ptr }
%struct.TIFFHeader = type { i16, i16, i32 }
%struct.TIFFTagMethods = type { ptr, ptr, ptr }

@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [26 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

declare void @TIFFErrorExt(ptr noundef, ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @multiply(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @TIFFTileRowSize(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @TIFFVTileSize(ptr noundef %0, i32 noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.tiff, ptr %12, i32 0, i32 8
  store ptr %13, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.TIFFDirectory, ptr %14, i32 0, i32 5
  %16 = load i32, ptr %15, align 8, !tbaa !11
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %28, label %18

18:                                               ; preds = %2
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.TIFFDirectory, ptr %19, i32 0, i32 4
  %21 = load i32, ptr %20, align 4, !tbaa !16
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %28, label %23

23:                                               ; preds = %18
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.TIFFDirectory, ptr %24, i32 0, i32 6
  %26 = load i32, ptr %25, align 4, !tbaa !17
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %23, %18, %2
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %181

29:                                               ; preds = %23
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.TIFFDirectory, ptr %30, i32 0, i32 24
  %32 = load i16, ptr %31, align 2, !tbaa !18
  %33 = zext i16 %32 to i32
  %34 = icmp eq i32 %33, 1
  br i1 %34, label %35, label %164

35:                                               ; preds = %29
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.TIFFDirectory, ptr %36, i32 0, i32 11
  %38 = load i16, ptr %37, align 2, !tbaa !19
  %39 = zext i16 %38 to i32
  %40 = icmp eq i32 %39, 6
  br i1 %40, label %41, label %164

41:                                               ; preds = %35
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.tiff, ptr %42, i32 0, i32 3
  %44 = load i32, ptr %43, align 8, !tbaa !20
  %45 = and i32 %44, 16384
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %164, label %47

47:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.TIFFDirectory, ptr %48, i32 0, i32 4
  %50 = load i32, ptr %49, align 4, !tbaa !16
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.TIFFDirectory, ptr %51, i32 0, i32 39
  %53 = getelementptr inbounds [2 x i16], ptr %52, i64 0, i64 0
  %54 = load i16, ptr %53, align 8, !tbaa !25
  %55 = zext i16 %54 to i32
  %56 = sub i32 %55, 1
  %57 = add i32 %50, %56
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.TIFFDirectory, ptr %58, i32 0, i32 39
  %60 = getelementptr inbounds [2 x i16], ptr %59, i64 0, i64 0
  %61 = load i16, ptr %60, align 8, !tbaa !25
  %62 = zext i16 %61 to i32
  %63 = udiv i32 %57, %62
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.TIFFDirectory, ptr %64, i32 0, i32 39
  %66 = getelementptr inbounds [2 x i16], ptr %65, i64 0, i64 0
  %67 = load i16, ptr %66, align 8, !tbaa !25
  %68 = zext i16 %67 to i32
  %69 = mul i32 %63, %68
  store i32 %69, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = load i32, ptr %9, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.TIFFDirectory, ptr %73, i32 0, i32 8
  %75 = load i16, ptr %74, align 4, !tbaa !26
  %76 = zext i16 %75 to i64
  %77 = call i32 @multiply(ptr noundef %70, i64 noundef %72, i64 noundef %76, ptr noundef @.str.6)
  %78 = and i32 %77, 7
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %91

80:                                               ; preds = %47
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = load i32, ptr %9, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.TIFFDirectory, ptr %84, i32 0, i32 8
  %86 = load i16, ptr %85, align 4, !tbaa !26
  %87 = zext i16 %86 to i64
  %88 = call i32 @multiply(ptr noundef %81, i64 noundef %83, i64 noundef %87, ptr noundef @.str.6)
  %89 = lshr i32 %88, 3
  %90 = add i32 %89, 1
  br label %101

91:                                               ; preds = %47
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.TIFFDirectory, ptr %95, i32 0, i32 8
  %97 = load i16, ptr %96, align 4, !tbaa !26
  %98 = zext i16 %97 to i64
  %99 = call i32 @multiply(ptr noundef %92, i64 noundef %94, i64 noundef %98, ptr noundef @.str.6)
  %100 = lshr i32 %99, 3
  br label %101

101:                                              ; preds = %91, %80
  %102 = phi i32 [ %90, %80 ], [ %100, %91 ]
  store i32 %102, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.TIFFDirectory, ptr %103, i32 0, i32 39
  %105 = getelementptr inbounds [2 x i16], ptr %104, i64 0, i64 0
  %106 = load i16, ptr %105, align 8, !tbaa !25
  %107 = zext i16 %106 to i32
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.TIFFDirectory, ptr %108, i32 0, i32 39
  %110 = getelementptr inbounds [2 x i16], ptr %109, i64 0, i64 1
  %111 = load i16, ptr %110, align 2, !tbaa !25
  %112 = zext i16 %111 to i32
  %113 = mul nsw i32 %107, %112
  store i32 %113, ptr %11, align 4, !tbaa !9
  %114 = load i32, ptr %11, align 4, !tbaa !9
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %116, label %123

116:                                              ; preds = %101
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.tiff, ptr %117, i32 0, i32 51
  %119 = load ptr, ptr %118, align 8, !tbaa !27
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.tiff, ptr %120, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !28
  call void (ptr, ptr, ptr, ...) @TIFFErrorExt(ptr noundef %119, ptr noundef %122, ptr noundef @.str.7)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %161

123:                                              ; preds = %101
  %124 = load i32, ptr %5, align 4, !tbaa !9
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.TIFFDirectory, ptr %125, i32 0, i32 39
  %127 = getelementptr inbounds [2 x i16], ptr %126, i64 0, i64 1
  %128 = load i16, ptr %127, align 2, !tbaa !25
  %129 = zext i16 %128 to i32
  %130 = sub i32 %129, 1
  %131 = add i32 %124, %130
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.TIFFDirectory, ptr %132, i32 0, i32 39
  %134 = getelementptr inbounds [2 x i16], ptr %133, i64 0, i64 1
  %135 = load i16, ptr %134, align 2, !tbaa !25
  %136 = zext i16 %135 to i32
  %137 = udiv i32 %131, %136
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.TIFFDirectory, ptr %138, i32 0, i32 39
  %140 = getelementptr inbounds [2 x i16], ptr %139, i64 0, i64 1
  %141 = load i16, ptr %140, align 2, !tbaa !25
  %142 = zext i16 %141 to i32
  %143 = mul i32 %137, %142
  store i32 %143, ptr %5, align 4, !tbaa !9
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = load i32, ptr %5, align 4, !tbaa !9
  %146 = zext i32 %145 to i64
  %147 = load i32, ptr %10, align 4, !tbaa !9
  %148 = sext i32 %147 to i64
  %149 = call i32 @multiply(ptr noundef %144, i64 noundef %146, i64 noundef %148, ptr noundef @.str.6)
  store i32 %149, ptr %7, align 4, !tbaa !9
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = load i32, ptr %7, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = load i32, ptr %7, align 4, !tbaa !9
  %155 = load i32, ptr %11, align 4, !tbaa !9
  %156 = sdiv i32 %154, %155
  %157 = sext i32 %156 to i64
  %158 = call i32 @multiply(ptr noundef %153, i64 noundef 2, i64 noundef %157, ptr noundef @.str.6)
  %159 = zext i32 %158 to i64
  %160 = call i32 @summarize(ptr noundef %150, i64 noundef %152, i64 noundef %159, ptr noundef @.str.6)
  store i32 %160, ptr %7, align 4, !tbaa !9
  store i32 0, ptr %8, align 4
  br label %161

161:                                              ; preds = %123, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  %162 = load i32, ptr %8, align 4
  switch i32 %162, label %181 [
    i32 0, label %163
  ]

163:                                              ; preds = %161
  br label %172

164:                                              ; preds = %41, %35, %29
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = load i32, ptr %5, align 4, !tbaa !9
  %167 = zext i32 %166 to i64
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = call i32 @TIFFTileRowSize(ptr noundef %168)
  %170 = sext i32 %169 to i64
  %171 = call i32 @multiply(ptr noundef %165, i64 noundef %167, i64 noundef %170, ptr noundef @.str.6)
  store i32 %171, ptr %7, align 4, !tbaa !9
  br label %172

172:                                              ; preds = %164, %163
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = load i32, ptr %7, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.TIFFDirectory, ptr %176, i32 0, i32 6
  %178 = load i32, ptr %177, align 4, !tbaa !17
  %179 = zext i32 %178 to i64
  %180 = call i32 @multiply(ptr noundef %173, i64 noundef %175, i64 noundef %179, ptr noundef @.str.6)
  store i32 %180, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %181

181:                                              ; preds = %172, %161, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %182 = load i32, ptr %3, align 4
  ret i32 %182
}

; Function Attrs: nounwind uwtable
declare hidden i32 @summarize(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 48}
!12 = !{!"", !7, i64 0, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !13, i64 60, !13, i64 62, !13, i64 64, !13, i64 66, !13, i64 68, !13, i64 70, !13, i64 72, !13, i64 74, !10, i64 76, !13, i64 80, !13, i64 82, !14, i64 88, !14, i64 96, !15, i64 104, !15, i64 108, !13, i64 112, !13, i64 114, !15, i64 116, !15, i64 120, !7, i64 124, !7, i64 128, !7, i64 152, !13, i64 156, !6, i64 160, !10, i64 168, !10, i64 172, !6, i64 176, !6, i64 184, !10, i64 192, !13, i64 196, !6, i64 200, !7, i64 208, !13, i64 212, !7, i64 216, !10, i64 240, !6, i64 248, !10, i64 256, !6, i64 264}
!13 = !{!"short", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!12, !10, i64 44}
!17 = !{!12, !10, i64 52}
!18 = !{!12, !13, i64 114}
!19 = !{!12, !13, i64 66}
!20 = !{!21, !10, i64 16}
!21 = !{!"tiff", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !6, i64 32, !13, i64 40, !12, i64 48, !22, i64 320, !6, i64 328, !6, i64 336, !10, i64 344, !13, i64 348, !10, i64 352, !10, i64 356, !10, i64 360, !13, i64 364, !10, i64 368, !10, i64 372, !10, i64 376, !10, i64 380, !10, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !10, i64 416, !6, i64 424, !6, i64 432, !6, i64 440, !6, i64 448, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !10, i64 536, !10, i64 540, !6, i64 544, !10, i64 552, !6, i64 560, !10, i64 568, !6, i64 576, !10, 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, !6, i64 656, !6, i64 664, !23, i64 672, !6, i64 680, !24, i64 688, !6, i64 712}
!22 = !{!"", !13, i64 0, !13, i64 2, !10, i64 4}
!23 = !{!"long", !7, i64 0}
!24 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!13, !13, i64 0}
!26 = !{!12, !13, i64 60}
!27 = !{!21, !6, i64 608}
!28 = !{!21, !6, i64 0}


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

@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [26 x i8], align 1

declare void @TIFFErrorExt(ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @TIFFTileRowSize(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @TIFFVTileSize(ptr noundef %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 96
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = icmp eq i32 %4, 0
  br i1 %5, label %79, label %6

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 92
  %8 = load i32, ptr %7, align 4, !tbaa !14
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %79, label %10

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %0, i64 100
  %12 = load i32, ptr %11, align 4, !tbaa !15
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %79, label %14

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 162
  %16 = load i16, ptr %15, align 2, !tbaa !16
  %17 = icmp eq i16 %16, 1
  br i1 %17, label %18, label %69

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 114
  %20 = load i16, ptr %19, align 2, !tbaa !17
  %21 = icmp eq i16 %20, 6
  br i1 %21, label %22, label %69

22:                                               ; preds = %18
  %23 = getelementptr inbounds i8, ptr %0, i64 16
  %24 = load i32, ptr %23, align 8, !tbaa !18
  %25 = and i32 %24, 16384
  %.not = icmp eq i32 %25, 0
  br i1 %.not, label %26, label %69

26:                                               ; preds = %22
  %27 = getelementptr inbounds i8, ptr %0, i64 256
  %28 = load i16, ptr %27, align 8, !tbaa !23
  %29 = zext i16 %28 to i32
  %30 = add i32 %8, -1
  %31 = add i32 %30, %29
  %.fr = freeze i32 %31
  %32 = urem i32 %.fr, %29
  %33 = sub nuw i32 %.fr, %32
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i8, ptr %0, i64 108
  %36 = load i16, ptr %35, align 4, !tbaa !24
  %37 = zext i16 %36 to i64
  %38 = tail call i32 @multiply(ptr noundef nonnull %0, i64 noundef %34, i64 noundef %37, ptr noundef nonnull @.str.6)
  %39 = load i16, ptr %35, align 4, !tbaa !24
  %40 = zext i16 %39 to i64
  %41 = tail call i32 @multiply(ptr noundef nonnull %0, i64 noundef %34, i64 noundef %40, ptr noundef nonnull @.str.6)
  %42 = load i16, ptr %27, align 8, !tbaa !23
  %43 = zext i16 %42 to i32
  %44 = getelementptr inbounds i8, ptr %0, i64 258
  %45 = load i16, ptr %44, align 2, !tbaa !23
  %.fr52 = freeze i16 %45
  %46 = zext i16 %.fr52 to i32
  %47 = mul nuw nsw i32 %46, %43
  %.not53 = icmp eq i32 %47, 0
  br i1 %.not53, label %.thread, label %51

.thread:                                          ; preds = %26
  %48 = getelementptr inbounds i8, ptr %0, i64 608
  %49 = load ptr, ptr %48, align 8, !tbaa !25
  %50 = load ptr, ptr %0, align 8, !tbaa !26
  tail call void (ptr, ptr, ptr, ...) @TIFFErrorExt(ptr noundef %49, ptr noundef %50, ptr noundef nonnull @.str.7) #2
  br label %79

51:                                               ; preds = %26
  %52 = and i32 %38, 7
  %.not48 = icmp ne i32 %52, 0
  %53 = lshr i32 %41, 3
  %54 = zext i1 %.not48 to i32
  %55 = add nuw nsw i32 %53, %54
  %56 = add i32 %1, -1
  %57 = add i32 %56, %46
  %58 = urem i32 %57, %46
  %59 = sub nuw i32 %57, %58
  %60 = zext i32 %59 to i64
  %61 = zext nneg i32 %55 to i64
  %62 = tail call i32 @multiply(ptr noundef nonnull %0, i64 noundef %60, i64 noundef %61, ptr noundef nonnull @.str.6)
  %63 = sext i32 %62 to i64
  %64 = sdiv i32 %62, %47
  %65 = sext i32 %64 to i64
  %66 = tail call i32 @multiply(ptr noundef nonnull %0, i64 noundef 2, i64 noundef %65, ptr noundef nonnull @.str.6)
  %67 = zext i32 %66 to i64
  %68 = tail call i32 @summarize(ptr noundef nonnull %0, i64 noundef %63, i64 noundef %67, ptr noundef nonnull @.str.6)
  br label %74

69:                                               ; preds = %22, %18, %14
  %70 = zext i32 %1 to i64
  %71 = tail call i32 @TIFFTileRowSize(ptr noundef nonnull %0)
  %72 = sext i32 %71 to i64
  %73 = tail call i32 @multiply(ptr noundef nonnull %0, i64 noundef %70, i64 noundef %72, ptr noundef nonnull @.str.6)
  br label %74

74:                                               ; preds = %51, %69
  %.145 = phi i32 [ %73, %69 ], [ %68, %51 ]
  %75 = sext i32 %.145 to i64
  %76 = load i32, ptr %11, align 4, !tbaa !15
  %77 = zext i32 %76 to i64
  %78 = tail call i32 @multiply(ptr noundef nonnull %0, i64 noundef %75, i64 noundef %77, ptr noundef nonnull @.str.6)
  br label %79

79:                                               ; preds = %.thread, %2, %6, %10, %74
  %.1 = phi i32 [ %78, %74 ], [ 0, %10 ], [ 0, %6 ], [ 0, %2 ], [ 0, %.thread ]
  ret i32 %.1
}

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

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !9, i64 48}
!6 = !{!"", !7, i64 0, !9, i64 32, !9, i64 36, !9, i64 40, !9, i64 44, !9, i64 48, !9, i64 52, !9, i64 56, !10, i64 60, !10, i64 62, !10, i64 64, !10, i64 66, !10, i64 68, !10, i64 70, !10, i64 72, !10, i64 74, !9, i64 76, !10, i64 80, !10, i64 82, !11, i64 88, !11, i64 96, !12, i64 104, !12, i64 108, !10, i64 112, !10, i64 114, !12, i64 116, !12, i64 120, !7, i64 124, !7, i64 128, !7, i64 152, !10, i64 156, !13, i64 160, !9, i64 168, !9, i64 172, !13, i64 176, !13, i64 184, !9, i64 192, !10, i64 196, !13, i64 200, !7, i64 208, !10, i64 212, !7, i64 216, !9, i64 240, !13, i64 248, !9, i64 256, !13, i64 264}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!"double", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!6, !9, i64 44}
!15 = !{!6, !9, i64 52}
!16 = !{!6, !10, i64 114}
!17 = !{!6, !10, i64 66}
!18 = !{!19, !9, i64 16}
!19 = !{!"tiff", !13, i64 0, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20, !9, i64 24, !13, i64 32, !10, i64 40, !6, i64 48, !20, i64 320, !13, i64 328, !13, i64 336, !9, i64 344, !10, i64 348, !9, i64 352, !9, i64 356, !9, i64 360, !10, i64 364, !9, i64 368, !9, i64 372, !9, i64 376, !9, i64 380, !9, i64 384, !13, i64 392, !13, i64 400, !13, i64 408, !9, i64 416, !13, i64 424, !13, i64 432, !13, i64 440, !13, i64 448, !13, i64 456, !13, i64 464, !13, i64 472, !13, i64 480, !13, i64 488, !13, i64 496, !13, i64 504, !13, i64 512, !13, i64 520, !13, i64 528, !9, i64 536, !9, i64 540, !13, i64 544, !9, i64 552, !13, i64 560, !9, i64 568, !13, i64 576, !9, i64 584, !13, i64 592, !13, i64 600, !13, i64 608, !13, i64 616, !13, i64 624, !13, i64 632, !13, i64 640, !13, i64 648, !13, i64 656, !13, i64 664, !21, i64 672, !13, i64 680, !22, i64 688, !13, i64 712}
!20 = !{!"", !10, i64 0, !10, i64 2, !9, i64 4}
!21 = !{!"long", !7, i64 0}
!22 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16}
!23 = !{!10, !10, i64 0}
!24 = !{!6, !10, i64 60}
!25 = !{!19, !13, i64 608}
!26 = !{!19, !13, i64 0}


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