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

; 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.TIFFFieldInfo = type { i32, i16, i16, i32, i16, i8, i8, ptr }
%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 }
%struct.PixarLogState = type { %struct.TIFFPredictorState, %struct.z_stream_s, ptr, i16, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.TIFFPredictorState = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }

@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@__PRETTY_FUNCTION__.TIFFInitPixarLog = external hidden unnamed_addr constant [34 x i8], align 1
@pixarlogFieldInfo = external hidden constant [2 x %struct.TIFFFieldInfo], align 16
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @TIFFInitPixarLog(ptr noundef %0, i32 noundef %1) #0 {
  %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
  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) #4
  %8 = load i32, ptr %5, align 4, !tbaa !9
  %9 = icmp eq i32 %8, 32909
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  br label %12

11:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1283, ptr noundef @__PRETTY_FUNCTION__.TIFFInitPixarLog) #5
  unreachable

12:                                               ; preds = %10
  %13 = call ptr @_TIFFmalloc(i32 noundef 288)
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.tiff, ptr %14, i32 0, i32 40
  store ptr %13, ptr %15, align 8, !tbaa !11
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.tiff, ptr %16, i32 0, i32 40
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %12
  br label %84

21:                                               ; preds = %12
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.tiff, ptr %22, i32 0, i32 40
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  store ptr %24, ptr %6, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_TIFFmemset(ptr noundef %25, i32 noundef 0, i32 noundef 288)
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.PixarLogState, ptr %26, i32 0, i32 1
  %28 = getelementptr inbounds %struct.z_stream_s, ptr %27, i32 0, i32 11
  store i32 0, ptr %28, align 8, !tbaa !20
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.PixarLogState, ptr %29, i32 0, i32 5
  store i32 -1, ptr %30, align 8, !tbaa !24
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.tiff, ptr %31, i32 0, i32 23
  store ptr @PixarLogSetupDecode, ptr %32, align 8, !tbaa !25
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.tiff, ptr %33, i32 0, i32 24
  store ptr @PixarLogPreDecode, ptr %34, align 8, !tbaa !26
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.tiff, ptr %35, i32 0, i32 29
  store ptr @PixarLogDecode, ptr %36, align 8, !tbaa !27
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.tiff, ptr %37, i32 0, i32 31
  store ptr @PixarLogDecode, ptr %38, align 8, !tbaa !28
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.tiff, ptr %39, i32 0, i32 33
  store ptr @PixarLogDecode, ptr %40, align 8, !tbaa !29
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.tiff, ptr %41, i32 0, i32 25
  store ptr @PixarLogSetupEncode, ptr %42, align 8, !tbaa !30
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.tiff, ptr %43, i32 0, i32 27
  store ptr @PixarLogPreEncode, ptr %44, align 8, !tbaa !31
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.tiff, ptr %45, i32 0, i32 28
  store ptr @PixarLogPostEncode, ptr %46, align 8, !tbaa !32
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.tiff, ptr %47, i32 0, i32 30
  store ptr @PixarLogEncode, ptr %48, align 8, !tbaa !33
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.tiff, ptr %49, i32 0, i32 32
  store ptr @PixarLogEncode, ptr %50, align 8, !tbaa !34
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.tiff, ptr %51, i32 0, i32 34
  store ptr @PixarLogEncode, ptr %52, align 8, !tbaa !35
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.tiff, ptr %53, i32 0, i32 35
  store ptr @PixarLogClose, ptr %54, align 8, !tbaa !36
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.tiff, ptr %55, i32 0, i32 37
  store ptr @PixarLogCleanup, ptr %56, align 8, !tbaa !37
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  call void @TIFFMergeFieldInfo(ptr noundef %57, ptr noundef @pixarlogFieldInfo, i32 noundef 2)
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.tiff, ptr %58, i32 0, i32 61
  %60 = getelementptr inbounds %struct.TIFFTagMethods, ptr %59, i32 0, i32 1
  %61 = load ptr, ptr %60, align 8, !tbaa !38
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.PixarLogState, ptr %62, i32 0, i32 7
  store ptr %61, ptr %63, align 8, !tbaa !39
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.tiff, ptr %64, i32 0, i32 61
  %66 = getelementptr inbounds %struct.TIFFTagMethods, ptr %65, i32 0, i32 1
  store ptr @PixarLogVGetField, ptr %66, align 8, !tbaa !38
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.tiff, ptr %67, i32 0, i32 61
  %69 = getelementptr inbounds %struct.TIFFTagMethods, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !40
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.PixarLogState, ptr %71, i32 0, i32 8
  store ptr %70, ptr %72, align 8, !tbaa !41
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.tiff, ptr %73, i32 0, i32 61
  %75 = getelementptr inbounds %struct.TIFFTagMethods, ptr %74, i32 0, i32 0
  store ptr @PixarLogVSetField, ptr %75, align 8, !tbaa !40
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.PixarLogState, ptr %76, i32 0, i32 6
  store i32 -1, ptr %77, align 4, !tbaa !42
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.PixarLogState, ptr %78, i32 0, i32 4
  store i32 0, ptr %79, align 4, !tbaa !43
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = call i32 @TIFFPredictorInit(ptr noundef %80)
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = call i32 @PixarLogMakeTables(ptr noundef %82)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %88

84:                                               ; preds = %20
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.tiff, ptr %85, i32 0, i32 51
  %87 = load ptr, ptr %86, align 8, !tbaa !44
  call void (ptr, ptr, ptr, ...) @TIFFErrorExt(ptr noundef %87, ptr noundef @.str.2, ptr noundef @.str.3)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %88

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

declare ptr @_TIFFmalloc(i32 noundef) #3

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @PixarLogPreDecode(ptr noundef, i16 noundef zeroext) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @PixarLogDecode(ptr noundef, ptr noundef, i32 noundef, i16 noundef zeroext) #0

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

; Function Attrs: nounwind uwtable
declare hidden i32 @PixarLogPreEncode(ptr noundef, i16 noundef zeroext) #0

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

; Function Attrs: nounwind uwtable
declare hidden i32 @PixarLogEncode(ptr noundef, ptr noundef, i32 noundef, i16 noundef zeroext) #0

; Function Attrs: nounwind uwtable
declare hidden void @PixarLogClose(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @PixarLogCleanup(ptr noundef) #0

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

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

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

declare i32 @TIFFPredictorInit(ptr noundef) #3

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn 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 #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 = { noreturn 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, !6, i64 528}
!12 = !{!"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, !14, i64 48, !17, 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, !18, i64 672, !6, i64 680, !19, i64 688, !6, i64 712}
!13 = !{!"short", !7, i64 0}
!14 = !{!"", !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, !15, i64 88, !15, i64 96, !16, i64 104, !16, i64 108, !13, i64 112, !13, i64 114, !16, i64 116, !16, 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}
!15 = !{!"double", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!"", !13, i64 0, !13, i64 2, !10, i64 4}
!18 = !{!"long", !7, i64 0}
!19 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!21, !10, i64 176}
!21 = !{!"", !22, i64 0, !23, i64 88, !6, i64 200, !13, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280}
!22 = !{!"", !10, i64 0, !10, i64 4, !10, 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}
!23 = !{!"z_stream_s", !6, i64 0, !10, i64 8, !18, i64 16, !6, i64 24, !10, i64 32, !18, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !18, i64 96, !18, i64 104}
!24 = !{!21, !10, i64 216}
!25 = !{!12, !6, i64 392}
!26 = !{!12, !6, i64 400}
!27 = !{!12, !6, i64 440}
!28 = !{!12, !6, i64 456}
!29 = !{!12, !6, i64 472}
!30 = !{!12, !6, i64 408}
!31 = !{!12, !6, i64 424}
!32 = !{!12, !6, i64 432}
!33 = !{!12, !6, i64 448}
!34 = !{!12, !6, i64 464}
!35 = !{!12, !6, i64 480}
!36 = !{!12, !6, i64 488}
!37 = !{!12, !6, i64 504}
!38 = !{!12, !6, i64 696}
!39 = !{!21, !6, i64 224}
!40 = !{!12, !6, i64 688}
!41 = !{!21, !6, i64 232}
!42 = !{!21, !10, i64 220}
!43 = !{!21, !10, i64 212}
!44 = !{!12, !6, i64 608}


; 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.TIFFFieldInfo = type { i32, i16, i16, i32, i16, i8, i8, ptr }

@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@__PRETTY_FUNCTION__.TIFFInitPixarLog = external hidden unnamed_addr constant [34 x i8], align 1
@pixarlogFieldInfo = external hidden constant [2 x %struct.TIFFFieldInfo], align 16
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @TIFFInitPixarLog(ptr noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = icmp eq i32 %1, 32909
  br i1 %3, label %5, label %4

4:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1283, ptr noundef nonnull @__PRETTY_FUNCTION__.TIFFInitPixarLog) #3
  unreachable

5:                                                ; preds = %2
  %6 = tail call ptr @_TIFFmalloc(i32 noundef 288) #4
  %7 = getelementptr inbounds i8, ptr %0, i64 528
  store ptr %6, ptr %7, align 8, !tbaa !5
  %8 = icmp eq ptr %6, null
  br i1 %8, label %34, label %9

9:                                                ; preds = %5
  tail call void @_TIFFmemset(ptr noundef nonnull %6, i32 noundef 0, i32 noundef 288) #4
  %10 = getelementptr inbounds i8, ptr %6, i64 176
  store i32 0, ptr %10, align 8, !tbaa !18
  %11 = getelementptr inbounds i8, ptr %6, i64 216
  store i32 -1, ptr %11, align 8, !tbaa !22
  %12 = getelementptr inbounds i8, ptr %0, i64 392
  store ptr @PixarLogSetupDecode, ptr %12, align 8, !tbaa !23
  %13 = getelementptr inbounds i8, ptr %0, i64 400
  store ptr @PixarLogPreDecode, ptr %13, align 8, !tbaa !24
  %14 = getelementptr inbounds i8, ptr %0, i64 440
  store ptr @PixarLogDecode, ptr %14, align 8, !tbaa !25
  %15 = getelementptr inbounds i8, ptr %0, i64 456
  store ptr @PixarLogDecode, ptr %15, align 8, !tbaa !26
  %16 = getelementptr inbounds i8, ptr %0, i64 472
  store ptr @PixarLogDecode, ptr %16, align 8, !tbaa !27
  %17 = getelementptr inbounds i8, ptr %0, i64 408
  store ptr @PixarLogSetupEncode, ptr %17, align 8, !tbaa !28
  %18 = getelementptr inbounds i8, ptr %0, i64 424
  store ptr @PixarLogPreEncode, ptr %18, align 8, !tbaa !29
  %19 = getelementptr inbounds i8, ptr %0, i64 432
  store ptr @PixarLogPostEncode, ptr %19, align 8, !tbaa !30
  %20 = getelementptr inbounds i8, ptr %0, i64 448
  store ptr @PixarLogEncode, ptr %20, align 8, !tbaa !31
  %21 = getelementptr inbounds i8, ptr %0, i64 464
  store ptr @PixarLogEncode, ptr %21, align 8, !tbaa !32
  %22 = getelementptr inbounds i8, ptr %0, i64 480
  store ptr @PixarLogEncode, ptr %22, align 8, !tbaa !33
  %23 = getelementptr inbounds i8, ptr %0, i64 488
  store ptr @PixarLogClose, ptr %23, align 8, !tbaa !34
  %24 = getelementptr inbounds i8, ptr %0, i64 504
  store ptr @PixarLogCleanup, ptr %24, align 8, !tbaa !35
  tail call void @TIFFMergeFieldInfo(ptr noundef nonnull %0, ptr noundef nonnull @pixarlogFieldInfo, i32 noundef 2) #4
  %25 = getelementptr inbounds i8, ptr %0, i64 688
  %26 = getelementptr inbounds i8, ptr %0, i64 696
  %27 = getelementptr inbounds i8, ptr %6, i64 224
  %28 = load <2 x ptr>, ptr %25, align 8, !tbaa !36
  store ptr @PixarLogVGetField, ptr %26, align 8, !tbaa !37
  %29 = shufflevector <2 x ptr> %28, <2 x ptr> poison, <2 x i32> <i32 1, i32 0>
  store <2 x ptr> %29, ptr %27, align 8, !tbaa !36
  store ptr @PixarLogVSetField, ptr %25, align 8, !tbaa !38
  %30 = getelementptr inbounds i8, ptr %6, i64 220
  store i32 -1, ptr %30, align 4, !tbaa !39
  %31 = getelementptr inbounds i8, ptr %6, i64 212
  store i32 0, ptr %31, align 4, !tbaa !40
  %32 = tail call i32 @TIFFPredictorInit(ptr noundef nonnull %0) #4
  %33 = tail call i32 @PixarLogMakeTables(ptr noundef nonnull %6)
  br label %37

34:                                               ; preds = %5
  %35 = getelementptr inbounds i8, ptr %0, i64 608
  %36 = load ptr, ptr %35, align 8, !tbaa !41
  tail call void (ptr, ptr, ptr, ...) @TIFFErrorExt(ptr noundef %36, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3) #4
  br label %37

37:                                               ; preds = %34, %9
  %.0 = phi i32 [ 0, %34 ], [ 1, %9 ]
  ret i32 %.0
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare ptr @_TIFFmalloc(i32 noundef) local_unnamed_addr #2

declare void @_TIFFmemset(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @PixarLogPreDecode(ptr noundef, i16 noundef zeroext) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @PixarLogDecode(ptr noundef, ptr noundef, i32 noundef, i16 noundef zeroext) #0

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

; Function Attrs: nounwind uwtable
declare hidden i32 @PixarLogPreEncode(ptr noundef, i16 noundef zeroext) #0

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

; Function Attrs: nounwind uwtable
declare hidden i32 @PixarLogEncode(ptr noundef, ptr noundef, i32 noundef, i16 noundef zeroext) #0

; Function Attrs: nounwind uwtable
declare hidden void @PixarLogClose(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @PixarLogCleanup(ptr noundef) #0

declare void @TIFFMergeFieldInfo(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

declare i32 @TIFFPredictorInit(ptr noundef) local_unnamed_addr #2

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { noreturn 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 = { "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 = { noreturn nounwind }
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, !7, i64 528}
!6 = !{!"tiff", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !7, i64 32, !11, i64 40, !12, i64 48, !15, i64 320, !7, i64 328, !7, i64 336, !10, i64 344, !11, i64 348, !10, i64 352, !10, i64 356, !10, i64 360, !11, i64 364, !10, i64 368, !10, i64 372, !10, i64 376, !10, i64 380, !10, i64 384, !7, i64 392, !7, i64 400, !7, i64 408, !10, i64 416, !7, i64 424, !7, i64 432, !7, i64 440, !7, i64 448, !7, i64 456, !7, i64 464, !7, i64 472, !7, i64 480, !7, i64 488, !7, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !7, i64 528, !10, i64 536, !10, i64 540, !7, i64 544, !10, i64 552, !7, i64 560, !10, i64 568, !7, i64 576, !10, 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, !7, i64 656, !7, i64 664, !16, i64 672, !7, i64 680, !17, i64 688, !7, i64 712}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!"", !8, i64 0, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !11, i64 60, !11, i64 62, !11, i64 64, !11, i64 66, !11, i64 68, !11, i64 70, !11, i64 72, !11, i64 74, !10, i64 76, !11, i64 80, !11, i64 82, !13, i64 88, !13, i64 96, !14, i64 104, !14, i64 108, !11, i64 112, !11, i64 114, !14, i64 116, !14, i64 120, !8, i64 124, !8, i64 128, !8, i64 152, !11, i64 156, !7, i64 160, !10, i64 168, !10, i64 172, !7, i64 176, !7, i64 184, !10, i64 192, !11, i64 196, !7, i64 200, !8, i64 208, !11, i64 212, !8, i64 216, !10, i64 240, !7, i64 248, !10, i64 256, !7, i64 264}
!13 = !{!"double", !8, i64 0}
!14 = !{!"float", !8, i64 0}
!15 = !{!"", !11, i64 0, !11, i64 2, !10, i64 4}
!16 = !{!"long", !8, i64 0}
!17 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16}
!18 = !{!19, !10, i64 176}
!19 = !{!"", !20, i64 0, !21, i64 88, !7, i64 200, !11, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !7, i64 280}
!20 = !{!"", !10, i64 0, !10, i64 4, !10, 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}
!21 = !{!"z_stream_s", !7, i64 0, !10, i64 8, !16, i64 16, !7, i64 24, !10, i64 32, !16, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !10, i64 88, !16, i64 96, !16, i64 104}
!22 = !{!19, !10, i64 216}
!23 = !{!6, !7, i64 392}
!24 = !{!6, !7, i64 400}
!25 = !{!6, !7, i64 440}
!26 = !{!6, !7, i64 456}
!27 = !{!6, !7, i64 472}
!28 = !{!6, !7, i64 408}
!29 = !{!6, !7, i64 424}
!30 = !{!6, !7, i64 432}
!31 = !{!6, !7, i64 448}
!32 = !{!6, !7, i64 464}
!33 = !{!6, !7, i64 480}
!34 = !{!6, !7, i64 488}
!35 = !{!6, !7, i64 504}
!36 = !{!7, !7, i64 0}
!37 = !{!6, !7, i64 696}
!38 = !{!6, !7, i64 688}
!39 = !{!19, !10, i64 220}
!40 = !{!19, !10, i64 212}
!41 = !{!6, !7, i64 608}


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