; LLVM IR from Try/Tempest :: Engine/thirdparty/libpng (pngrtran)

; 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.png_struct_def = type { [1 x %struct.__jmp_buf_tag], ptr, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, i32, %struct.z_stream_s, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, ptr, ptr, ptr, ptr, i64, i32, i32, ptr, i16, i32, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, i32, %struct.png_color_16_struct, %struct.png_color_16_struct, ptr, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_color_8_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i64, i64, i64, i32, i32, ptr, ptr, i32, [29 x i8], i32, ptr, ptr, i32, i32, ptr, i8, i8, i16, i16, i32, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32, i64, %struct.png_unknown_chunk_t, i64, ptr, i64, i32, i32, ptr, [4 x ptr], %struct.png_colorspace }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }
%struct.png_color_8_struct = type { i8, i8, i8, i8, i8 }
%struct.png_color_16_struct = type { i8, i16, i16, i16, i16 }
%struct.png_unknown_chunk_t = type { [5 x i8], ptr, i64, i8 }
%struct.png_colorspace = type { i32, %struct.png_xy, %struct.png_XYZ, i16, i16 }
%struct.png_xy = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.png_XYZ = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@.str.3 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [51 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local void @png_set_alpha_mode_fixed(ptr noalias noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = call i32 @png_rtran_ok(ptr noundef %10, i32 noundef 0)
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %14

13:                                               ; preds = %3
  store i32 1, ptr %9, align 4
  br label %119

14:                                               ; preds = %3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = load i32, ptr %6, align 4, !tbaa !9
  %17 = call i32 @translate_gamma_flags(ptr noundef %15, i32 noundef %16, i32 noundef 1)
  store i32 %17, ptr %6, align 4, !tbaa !9
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = icmp slt i32 %18, 1000
  br i1 %19, label %23, label %20

20:                                               ; preds = %14
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = icmp sgt i32 %21, 10000000
  br i1 %22, label %23, label %25

23:                                               ; preds = %20, %14
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %24, ptr noundef @.str.3) #6
  unreachable

25:                                               ; preds = %20
  %26 = load i32, ptr %6, align 4, !tbaa !9
  %27 = call i32 @png_reciprocal(i32 noundef %26)
  store i32 %27, ptr %8, align 4, !tbaa !9
  %28 = load i32, ptr %5, align 4, !tbaa !9
  switch i32 %28, label %65 [
    i32 0, label %29
    i32 1, label %38
    i32 2, label %47
    i32 3, label %56
  ]

29:                                               ; preds = %25
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.png_struct_def, ptr %30, i32 0, i32 17
  %32 = load i32, ptr %31, align 4, !tbaa !11
  %33 = and i32 %32, -8388609
  store i32 %33, ptr %31, align 4, !tbaa !11
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.png_struct_def, ptr %34, i32 0, i32 16
  %36 = load i32, ptr %35, align 8, !tbaa !22
  %37 = and i32 %36, -8193
  store i32 %37, ptr %35, align 8, !tbaa !22
  br label %67

38:                                               ; preds = %25
  store i32 1, ptr %7, align 4, !tbaa !9
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.png_struct_def, ptr %39, i32 0, i32 17
  %41 = load i32, ptr %40, align 4, !tbaa !11
  %42 = and i32 %41, -8388609
  store i32 %42, ptr %40, align 4, !tbaa !11
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.png_struct_def, ptr %43, i32 0, i32 16
  %45 = load i32, ptr %44, align 8, !tbaa !22
  %46 = and i32 %45, -8193
  store i32 %46, ptr %44, align 8, !tbaa !22
  store i32 100000, ptr %6, align 4, !tbaa !9
  br label %67

47:                                               ; preds = %25
  store i32 1, ptr %7, align 4, !tbaa !9
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.png_struct_def, ptr %48, i32 0, i32 17
  %50 = load i32, ptr %49, align 4, !tbaa !11
  %51 = and i32 %50, -8388609
  store i32 %51, ptr %49, align 4, !tbaa !11
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.png_struct_def, ptr %52, i32 0, i32 16
  %54 = load i32, ptr %53, align 8, !tbaa !22
  %55 = or i32 %54, 8192
  store i32 %55, ptr %53, align 8, !tbaa !22
  br label %67

56:                                               ; preds = %25
  store i32 1, ptr %7, align 4, !tbaa !9
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_struct_def, ptr %57, i32 0, i32 17
  %59 = load i32, ptr %58, align 4, !tbaa !11
  %60 = or i32 %59, 8388608
  store i32 %60, ptr %58, align 4, !tbaa !11
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.png_struct_def, ptr %61, i32 0, i32 16
  %63 = load i32, ptr %62, align 8, !tbaa !22
  %64 = and i32 %63, -8193
  store i32 %64, ptr %62, align 8, !tbaa !22
  br label %67

65:                                               ; preds = %25
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %66, ptr noundef @.str.4) #6
  unreachable

67:                                               ; preds = %56, %47, %38, %29
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.png_struct_def, ptr %68, i32 0, i32 144
  %70 = getelementptr inbounds %struct.png_colorspace, ptr %69, i32 0, i32 0
  %71 = load i32, ptr %70, align 8, !tbaa !23
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %73, label %85

73:                                               ; preds = %67
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.png_struct_def, ptr %75, i32 0, i32 144
  %77 = getelementptr inbounds %struct.png_colorspace, ptr %76, i32 0, i32 0
  store i32 %74, ptr %77, align 8, !tbaa !23
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.png_struct_def, ptr %78, i32 0, i32 144
  %80 = getelementptr inbounds %struct.png_colorspace, ptr %79, i32 0, i32 4
  %81 = load i16, ptr %80, align 2, !tbaa !24
  %82 = zext i16 %81 to i32
  %83 = or i32 %82, 1
  %84 = trunc i32 %83 to i16
  store i16 %84, ptr %80, align 2, !tbaa !24
  br label %85

85:                                               ; preds = %73, %67
  %86 = load i32, ptr %6, align 4, !tbaa !9
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.png_struct_def, ptr %87, i32 0, i32 80
  store i32 %86, ptr %88, align 4, !tbaa !25
  %89 = load i32, ptr %7, align 4, !tbaa !9
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %118

91:                                               ; preds = %85
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.png_struct_def, ptr %92, i32 0, i32 74
  call void @llvm.memset.p0.i64(ptr align 4 %93, i8 0, i64 10, i1 false)
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.png_struct_def, ptr %94, i32 0, i32 144
  %96 = getelementptr inbounds %struct.png_colorspace, ptr %95, i32 0, i32 0
  %97 = load i32, ptr %96, align 8, !tbaa !23
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.png_struct_def, ptr %98, i32 0, i32 73
  store i32 %97, ptr %99, align 8, !tbaa !26
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.png_struct_def, ptr %100, i32 0, i32 72
  store i8 2, ptr %101, align 4, !tbaa !27
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.png_struct_def, ptr %102, i32 0, i32 17
  %104 = load i32, ptr %103, align 4, !tbaa !11
  %105 = and i32 %104, -257
  store i32 %105, ptr %103, align 4, !tbaa !11
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.png_struct_def, ptr %106, i32 0, i32 17
  %108 = load i32, ptr %107, align 4, !tbaa !11
  %109 = and i32 %108, 128
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %113

111:                                              ; preds = %91
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %112, ptr noundef @.str.5) #6
  unreachable

113:                                              ; preds = %91
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.png_struct_def, ptr %114, i32 0, i32 17
  %116 = load i32, ptr %115, align 4, !tbaa !11
  %117 = or i32 %116, 128
  store i32 %117, ptr %115, align 4, !tbaa !11
  br label %118

118:                                              ; preds = %113, %85
  store i32 0, ptr %9, align 4
  br label %119

119:                                              ; preds = %118, %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %120 = load i32, ptr %9, align 4
  switch i32 %120, label %122 [
    i32 0, label %121
    i32 1, label %121
  ]

121:                                              ; preds = %119, %119
  ret void

122:                                              ; preds = %119
  unreachable
}

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

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

; Function Attrs: noreturn
declare void @png_error(ptr noundef, ptr noundef) #2

declare i32 @png_reciprocal(i32 noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; 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 "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
attributes #6 = { noreturn }

!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 308}
!12 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !13, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !10, i64 300, !10, i64 304, !10, i64 308, !10, i64 312, !14, i64 320, !6, i64 432, !10, i64 440, !10, i64 444, !10, i64 448, !10, i64 452, !10, i64 456, !10, i64 460, !10, i64 464, !10, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !10, i64 488, !10, i64 492, !10, i64 496, !10, i64 500, !10, i64 504, !10, i64 508, !10, i64 512, !10, i64 516, !13, i64 520, !10, i64 528, !10, i64 532, !10, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !13, i64 576, !10, i64 584, !10, i64 588, !6, i64 592, !15, i64 600, !10, i64 604, !15, i64 608, !7, i64 610, !7, i64 611, !7, i64 612, !7, i64 613, !7, i64 614, !7, i64 615, !7, i64 616, !7, i64 617, !7, i64 618, !7, i64 619, !7, i64 620, !7, i64 621, !7, i64 622, !7, i64 623, !7, i64 624, !15, i64 626, !7, i64 628, !10, i64 632, !16, i64 636, !16, i64 646, !6, i64 656, !10, i64 664, !10, i64 668, !10, i64 672, !10, i64 676, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !17, i64 728, !17, i64 733, !6, i64 744, !16, i64 752, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !10, i64 840, !10, i64 844, !13, i64 848, !13, i64 856, !13, i64 864, !13, i64 872, !10, i64 880, !10, i64 884, !6, i64 888, !6, i64 896, !10, i64 904, !7, i64 908, !10, i64 940, !6, i64 944, !6, i64 952, !10, i64 960, !10, i64 964, !6, i64 968, !7, i64 976, !7, i64 977, !15, i64 978, !15, i64 980, !10, i64 984, !7, i64 988, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !6, i64 1040, !7, i64 1048, !10, i64 1052, !10, i64 1056, !10, i64 1060, !13, i64 1064, !18, i64 1072, !13, i64 1104, !6, i64 1112, !13, i64 1120, !10, i64 1128, !10, i64 1132, !6, i64 1136, !7, i64 1144, !19, i64 1176}
!13 = !{!"long", !7, i64 0}
!14 = !{!"z_stream_s", !6, i64 0, !10, i64 8, !13, i64 16, !6, i64 24, !10, i64 32, !13, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !13, i64 96, !13, i64 104}
!15 = !{!"short", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, i64 8}
!17 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!18 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !13, i64 16, !7, i64 24}
!19 = !{!"png_colorspace", !10, i64 0, !20, i64 4, !21, i64 36, !15, i64 72, !15, i64 74}
!20 = !{!"png_xy", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!21 = !{!"png_XYZ", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32}
!22 = !{!12, !10, i64 304}
!23 = !{!12, !10, i64 1176}
!24 = !{!12, !15, i64 1250}
!25 = !{!12, !10, i64 676}
!26 = !{!12, !10, i64 632}
!27 = !{!12, !7, i64 628}


; 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.3 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [51 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local void @png_set_alpha_mode_fixed(ptr noalias noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = tail call i32 @png_rtran_ok(ptr noundef %0, i32 noundef 0)
  %5 = icmp eq i32 %4, 0
  br i1 %5, label %59, label %6

6:                                                ; preds = %3
  %7 = tail call i32 @translate_gamma_flags(ptr noundef %0, i32 noundef %2, i32 noundef 1)
  %8 = add i32 %7, -10000001
  %or.cond = icmp ult i32 %8, -9999001
  br i1 %or.cond, label %9, label %10

9:                                                ; preds = %6
  tail call void @png_error(ptr noundef %0, ptr noundef nonnull @.str.3) #4
  unreachable

10:                                               ; preds = %6
  %11 = tail call i32 @png_reciprocal(i32 noundef %7) #5
  switch i32 %1, label %36 [
    i32 0, label %12
    i32 1, label %17
    i32 2, label %22
    i32 3, label %29
  ]

12:                                               ; preds = %10
  %13 = getelementptr inbounds i8, ptr %0, i64 304
  %14 = load <2 x i32>, ptr %13, align 8, !tbaa !5
  %15 = and <2 x i32> %14, <i32 -8193, i32 -8388609>
  store <2 x i32> %15, ptr %13, align 8, !tbaa !5
  %16 = extractelement <2 x i32> %15, i64 1
  br label %37

17:                                               ; preds = %10
  %18 = getelementptr inbounds i8, ptr %0, i64 304
  %19 = load <2 x i32>, ptr %18, align 8, !tbaa !5
  %20 = and <2 x i32> %19, <i32 -8193, i32 -8388609>
  store <2 x i32> %20, ptr %18, align 8, !tbaa !5
  %21 = extractelement <2 x i32> %20, i64 1
  br label %37

22:                                               ; preds = %10
  %23 = getelementptr inbounds i8, ptr %0, i64 308
  %24 = load i32, ptr %23, align 4, !tbaa !9
  %25 = and i32 %24, -8388609
  store i32 %25, ptr %23, align 4, !tbaa !9
  %26 = getelementptr inbounds i8, ptr %0, i64 304
  %27 = load i32, ptr %26, align 8, !tbaa !21
  %28 = or i32 %27, 8192
  store i32 %28, ptr %26, align 8, !tbaa !21
  br label %37

29:                                               ; preds = %10
  %30 = getelementptr inbounds i8, ptr %0, i64 308
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = or i32 %31, 8388608
  store i32 %32, ptr %30, align 4, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %0, i64 304
  %34 = load i32, ptr %33, align 8, !tbaa !21
  %35 = and i32 %34, -8193
  store i32 %35, ptr %33, align 8, !tbaa !21
  br label %37

36:                                               ; preds = %10
  tail call void @png_error(ptr noundef %0, ptr noundef nonnull @.str.4) #4
  unreachable

37:                                               ; preds = %29, %22, %17, %12
  %38 = phi i32 [ %32, %29 ], [ %25, %22 ], [ %21, %17 ], [ %16, %12 ]
  %.not = phi i1 [ false, %29 ], [ false, %22 ], [ false, %17 ], [ true, %12 ]
  %.0 = phi i32 [ %7, %29 ], [ %7, %22 ], [ 100000, %17 ], [ %7, %12 ]
  %39 = getelementptr inbounds i8, ptr %0, i64 1176
  %40 = load i32, ptr %39, align 8, !tbaa !22
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %46

42:                                               ; preds = %37
  store i32 %11, ptr %39, align 8, !tbaa !22
  %43 = getelementptr inbounds i8, ptr %0, i64 1250
  %44 = load i16, ptr %43, align 2, !tbaa !23
  %45 = or i16 %44, 1
  store i16 %45, ptr %43, align 2, !tbaa !23
  br label %46

46:                                               ; preds = %42, %37
  %47 = phi i32 [ %11, %42 ], [ %40, %37 ]
  %48 = getelementptr inbounds i8, ptr %0, i64 676
  store i32 %.0, ptr %48, align 4, !tbaa !24
  br i1 %.not, label %59, label %49

49:                                               ; preds = %46
  %50 = getelementptr inbounds i8, ptr %0, i64 636
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(10) %50, i8 0, i64 10, i1 false)
  %51 = getelementptr inbounds i8, ptr %0, i64 632
  store i32 %47, ptr %51, align 8, !tbaa !25
  %52 = getelementptr inbounds i8, ptr %0, i64 628
  store i8 2, ptr %52, align 4, !tbaa !26
  %53 = getelementptr inbounds i8, ptr %0, i64 308
  %54 = and i32 %38, -257
  store i32 %54, ptr %53, align 4, !tbaa !9
  %55 = and i32 %38, 128
  %.not34 = icmp eq i32 %55, 0
  br i1 %.not34, label %57, label %56

56:                                               ; preds = %49
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.5) #4
  unreachable

57:                                               ; preds = %49
  %58 = or disjoint i32 %54, 128
  store i32 %58, ptr %53, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %46, %57, %3
  ret void
}

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

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

declare i32 @png_reciprocal(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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 "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 308}
!10 = !{!"png_struct_def", !7, i64 0, !11, i64 200, !11, i64 208, !12, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !11, i64 272, !11, i64 280, !11, i64 288, !7, i64 296, !7, i64 297, !6, i64 300, !6, i64 304, !6, i64 308, !6, i64 312, !13, i64 320, !11, i64 432, !6, i64 440, !6, i64 444, !6, i64 448, !6, i64 452, !6, i64 456, !6, i64 460, !6, i64 464, !6, i64 468, !6, i64 472, !6, i64 476, !6, i64 480, !6, i64 484, !6, i64 488, !6, i64 492, !6, i64 496, !6, i64 500, !6, i64 504, !6, i64 508, !6, i64 512, !6, i64 516, !12, i64 520, !6, i64 528, !6, i64 532, !6, i64 536, !11, i64 544, !11, i64 552, !11, i64 560, !11, i64 568, !12, i64 576, !6, i64 584, !6, i64 588, !11, i64 592, !14, i64 600, !6, i64 604, !14, i64 608, !7, i64 610, !7, i64 611, !7, i64 612, !7, i64 613, !7, i64 614, !7, i64 615, !7, i64 616, !7, i64 617, !7, i64 618, !7, i64 619, !7, i64 620, !7, i64 621, !7, i64 622, !7, i64 623, !7, i64 624, !14, i64 626, !7, i64 628, !6, i64 632, !15, i64 636, !15, i64 646, !11, i64 656, !6, i64 664, !6, i64 668, !6, i64 672, !6, i64 676, !11, i64 680, !11, i64 688, !11, i64 696, !11, i64 704, !11, i64 712, !11, i64 720, !16, i64 728, !16, i64 733, !11, i64 744, !15, i64 752, !11, i64 768, !11, i64 776, !11, i64 784, !11, i64 792, !11, i64 800, !11, i64 808, !11, i64 816, !11, i64 824, !11, i64 832, !6, i64 840, !6, i64 844, !12, i64 848, !12, i64 856, !12, i64 864, !12, i64 872, !6, i64 880, !6, i64 884, !11, i64 888, !11, i64 896, !6, i64 904, !7, i64 908, !6, i64 940, !11, i64 944, !11, i64 952, !6, i64 960, !6, i64 964, !11, i64 968, !7, i64 976, !7, i64 977, !14, i64 978, !14, i64 980, !6, i64 984, !7, i64 988, !11, i64 992, !11, i64 1000, !11, i64 1008, !11, i64 1016, !11, i64 1024, !11, i64 1032, !11, i64 1040, !7, i64 1048, !6, i64 1052, !6, i64 1056, !6, i64 1060, !12, i64 1064, !17, i64 1072, !12, i64 1104, !11, i64 1112, !12, i64 1120, !6, i64 1128, !6, i64 1132, !11, i64 1136, !7, i64 1144, !18, i64 1176}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"z_stream_s", !11, i64 0, !6, i64 8, !12, i64 16, !11, i64 24, !6, i64 32, !12, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !6, i64 88, !12, i64 96, !12, i64 104}
!14 = !{!"short", !7, i64 0}
!15 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!16 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!17 = !{!"png_unknown_chunk_t", !7, i64 0, !11, i64 8, !12, i64 16, !7, i64 24}
!18 = !{!"png_colorspace", !6, i64 0, !19, i64 4, !20, i64 36, !14, i64 72, !14, i64 74}
!19 = !{!"png_xy", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28}
!20 = !{!"png_XYZ", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32}
!21 = !{!10, !6, i64 304}
!22 = !{!10, !6, i64 1176}
!23 = !{!10, !14, i64 1250}
!24 = !{!10, !6, i64 676}
!25 = !{!10, !6, i64 632}
!26 = !{!10, !7, i64 628}


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