; LLVM IR from corentinartaud/graphics :: ThirdParty/FreeImage-3170/Source/LibPNG (pngwrite)

; 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, ptr, ptr, i64, i32, i32, ptr, i16, i32, i16, 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, i8, i8, ptr, ptr, ptr, ptr, ptr, i8, [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 }

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_set_filter_heuristics_fixed(ptr noalias noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) #1 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = load i32, ptr %7, align 4, !tbaa !9
  %15 = load i32, ptr %8, align 4, !tbaa !9
  %16 = call i32 @png_init_filter_heuristics(ptr noundef %13, i32 noundef %14, i32 noundef %15)
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %18, label %19

18:                                               ; preds = %5
  br label %143

19:                                               ; preds = %5
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = icmp eq i32 %20, 2
  br i1 %21, label %22, label %143

22:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %84, %22
  %24 = load i32, ptr %11, align 4, !tbaa !9
  %25 = load i32, ptr %8, align 4, !tbaa !9
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %27, label %87

27:                                               ; preds = %23
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = load i32, ptr %11, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i32, ptr %28, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %33 = icmp sle i32 %32, 0
  br i1 %33, label %34, label %47

34:                                               ; preds = %27
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.png_struct_def, ptr %35, i32 0, i32 114
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i16, ptr %37, i64 %39
  store i16 256, ptr %40, align 2, !tbaa !22
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.png_struct_def, ptr %41, i32 0, i32 115
  %43 = load ptr, ptr %42, align 8, !tbaa !23
  %44 = load i32, ptr %11, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i16, ptr %43, i64 %45
  store i16 256, ptr %46, align 2, !tbaa !22
  br label %83

47:                                               ; preds = %27
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %48, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !9
  %53 = mul nsw i32 256, %52
  %54 = add nsw i32 %53, 50000
  %55 = sdiv i32 %54, 100000
  %56 = trunc i32 %55 to i16
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_struct_def, ptr %57, i32 0, i32 115
  %59 = load ptr, ptr %58, align 8, !tbaa !23
  %60 = load i32, ptr %11, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i16, ptr %59, i64 %61
  store i16 %56, ptr %62, align 2, !tbaa !22
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr %63, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !9
  %68 = sdiv i32 %67, 2
  %69 = add nsw i32 25600000, %68
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = load i32, ptr %11, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds i32, ptr %70, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !9
  %75 = sdiv i32 %69, %74
  %76 = trunc i32 %75 to i16
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.png_struct_def, ptr %77, i32 0, i32 114
  %79 = load ptr, ptr %78, align 8, !tbaa !11
  %80 = load i32, ptr %11, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds i16, ptr %79, i64 %81
  store i16 %76, ptr %82, align 2, !tbaa !22
  br label %83

83:                                               ; preds = %47, %34
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %11, align 4, !tbaa !9
  br label %23, !llvm.loop !24

87:                                               ; preds = %23
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %139, %87
  %89 = load i32, ptr %11, align 4, !tbaa !9
  %90 = icmp slt i32 %89, 5
  br i1 %90, label %91, label %142

91:                                               ; preds = %88
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = load i32, ptr %11, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds i32, ptr %92, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !9
  %97 = icmp sge i32 %96, 100000
  br i1 %97, label %98, label %138

98:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  %99 = load ptr, ptr %10, align 8, !tbaa !5
  %100 = load i32, ptr %11, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i32, ptr %99, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = sdiv i32 %103, 2
  %105 = add nsw i32 800000, %104
  store i32 %105, ptr %12, align 4, !tbaa !9
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  %107 = load i32, ptr %11, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds i32, ptr %106, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !9
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = udiv i32 %111, %110
  store i32 %112, ptr %12, align 4, !tbaa !9
  %113 = load i32, ptr %12, align 4, !tbaa !9
  %114 = trunc i32 %113 to i16
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.png_struct_def, ptr %115, i32 0, i32 117
  %117 = load ptr, ptr %116, align 8, !tbaa !26
  %118 = load i32, ptr %11, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i16, ptr %117, i64 %119
  store i16 %114, ptr %120, align 2, !tbaa !22
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = load i32, ptr %11, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i32, ptr %121, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = mul nsw i32 8, %125
  %127 = add nsw i32 %126, 50000
  store i32 %127, ptr %12, align 4, !tbaa !9
  %128 = load i32, ptr %12, align 4, !tbaa !9
  %129 = udiv i32 %128, 100000
  store i32 %129, ptr %12, align 4, !tbaa !9
  %130 = load i32, ptr %12, align 4, !tbaa !9
  %131 = trunc i32 %130 to i16
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.png_struct_def, ptr %132, i32 0, i32 116
  %134 = load ptr, ptr %133, align 8, !tbaa !27
  %135 = load i32, ptr %11, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i16, ptr %134, i64 %136
  store i16 %131, ptr %137, align 2, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  br label %138

138:                                              ; preds = %98, %91
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %11, align 4, !tbaa !9
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %11, align 4, !tbaa !9
  br label %88, !llvm.loop !28

142:                                              ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  br label %143

143:                                              ; preds = %142, %19, %18
  ret void
}

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

!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 936}
!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, !6, i64 576, !6, i64 584, !13, i64 592, !10, i64 600, !10, i64 604, !6, i64 608, !15, i64 616, !10, i64 620, !15, i64 624, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !7, i64 637, !7, i64 638, !7, i64 639, !15, i64 640, !7, i64 642, !10, i64 644, !16, i64 648, !16, i64 658, !6, i64 672, !10, i64 680, !10, i64 684, !10, i64 688, !10, i64 692, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !17, i64 744, !17, i64 749, !6, i64 760, !16, i64 768, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !6, i64 848, !10, i64 856, !10, i64 860, !13, i64 864, !13, i64 872, !13, i64 880, !13, i64 888, !10, i64 896, !10, i64 900, !6, i64 904, !6, i64 912, !7, i64 920, !7, i64 921, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !7, i64 968, !7, i64 969, !10, i64 1000, !6, i64 1008, !6, i64 1016, !10, i64 1024, !10, i64 1028, !6, i64 1032, !7, i64 1040, !7, i64 1041, !15, i64 1042, !15, i64 1044, !10, i64 1048, !7, i64 1052, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !6, i64 1088, !6, i64 1096, !6, i64 1104, !7, i64 1112, !10, i64 1116, !10, i64 1120, !10, i64 1124, !13, i64 1128, !18, i64 1136, !13, i64 1168, !6, i64 1176, !13, i64 1184, !10, i64 1192, !10, i64 1196, !6, i64 1200, !7, i64 1208, !19, i64 1240}
!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 = !{!15, !15, i64 0}
!23 = !{!12, !6, i64 944}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!12, !6, i64 960}
!27 = !{!12, !6, i64 952}
!28 = distinct !{!28, !25}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

; Function Attrs: nounwind uwtable
define dso_local void @png_set_filter_heuristics_fixed(ptr noalias noundef %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4) local_unnamed_addr #0 {
  %6 = tail call i32 @png_init_filter_heuristics(ptr noundef %0, i32 noundef %1, i32 noundef %2)
  %7 = icmp ne i32 %6, 0
  %8 = icmp eq i32 %1, 2
  %or.cond = and i1 %8, %7
  br i1 %or.cond, label %.preheader43, label %.loopexit

.preheader43:                                     ; preds = %5
  %9 = icmp sgt i32 %2, 0
  br i1 %9, label %.lr.ph, label %.preheader

.lr.ph:                                           ; preds = %.preheader43
  %10 = getelementptr inbounds i8, ptr %0, i64 944
  %11 = getelementptr inbounds i8, ptr %0, i64 936
  %wide.trip.count = zext nneg i32 %2 to i64
  br label %16

.preheader:                                       ; preds = %34, %.preheader43
  %12 = getelementptr inbounds i8, ptr %0, i64 960
  %13 = getelementptr inbounds i8, ptr %0, i64 952
  %14 = load i32, ptr %4, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 99999
  br i1 %15, label %37, label %48

16:                                               ; preds = %.lr.ph, %34
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %34 ]
  %17 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = icmp slt i32 %18, 1
  br i1 %19, label %20, label %23

20:                                               ; preds = %16
  %21 = load ptr, ptr %11, align 8, !tbaa !9
  %22 = getelementptr inbounds i16, ptr %21, i64 %indvars.iv
  store i16 256, ptr %22, align 2, !tbaa !21
  br label %34

23:                                               ; preds = %16
  %24 = shl nsw i32 %18, 8
  %25 = add nuw nsw i32 %24, 50000
  %26 = udiv i32 %25, 100000
  %27 = trunc nuw i32 %26 to i16
  %28 = load ptr, ptr %10, align 8, !tbaa !22
  %29 = getelementptr inbounds i16, ptr %28, i64 %indvars.iv
  store i16 %27, ptr %29, align 2, !tbaa !21
  %30 = lshr i32 %18, 1
  %31 = add nuw nsw i32 %30, 25600000
  %32 = udiv i32 %31, %18
  %33 = trunc i32 %32 to i16
  br label %34

34:                                               ; preds = %20, %23
  %.sink53 = phi ptr [ %10, %20 ], [ %11, %23 ]
  %.sink = phi i16 [ 256, %20 ], [ %33, %23 ]
  %35 = load ptr, ptr %.sink53, align 8, !tbaa !23
  %36 = getelementptr inbounds i16, ptr %35, i64 %indvars.iv
  store i16 %.sink, ptr %36, align 2, !tbaa !21
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %16, !llvm.loop !24

37:                                               ; preds = %.preheader
  %38 = lshr i32 %14, 1
  %39 = add nuw nsw i32 %38, 800000
  %40 = udiv i32 %39, %14
  %41 = trunc nuw nsw i32 %40 to i16
  %42 = load ptr, ptr %12, align 8, !tbaa !26
  store i16 %41, ptr %42, align 2, !tbaa !21
  %43 = shl nsw i32 %14, 3
  %44 = add nuw nsw i32 %43, 50000
  %45 = udiv i32 %44, 100000
  %46 = trunc nuw i32 %45 to i16
  %47 = load ptr, ptr %13, align 8, !tbaa !27
  store i16 %46, ptr %47, align 2, !tbaa !21
  br label %48

48:                                               ; preds = %.preheader, %37
  %49 = getelementptr inbounds i8, ptr %4, i64 4
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = icmp sgt i32 %50, 99999
  br i1 %51, label %52, label %65

52:                                               ; preds = %48
  %53 = lshr i32 %50, 1
  %54 = add nuw nsw i32 %53, 800000
  %55 = udiv i32 %54, %50
  %56 = trunc nuw nsw i32 %55 to i16
  %57 = load ptr, ptr %12, align 8, !tbaa !26
  %58 = getelementptr inbounds i8, ptr %57, i64 2
  store i16 %56, ptr %58, align 2, !tbaa !21
  %59 = shl nsw i32 %50, 3
  %60 = add nuw nsw i32 %59, 50000
  %61 = udiv i32 %60, 100000
  %62 = trunc nuw i32 %61 to i16
  %63 = load ptr, ptr %13, align 8, !tbaa !27
  %64 = getelementptr inbounds i8, ptr %63, i64 2
  store i16 %62, ptr %64, align 2, !tbaa !21
  br label %65

65:                                               ; preds = %52, %48
  %66 = getelementptr inbounds i8, ptr %4, i64 8
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp sgt i32 %67, 99999
  br i1 %68, label %69, label %82

69:                                               ; preds = %65
  %70 = lshr i32 %67, 1
  %71 = add nuw nsw i32 %70, 800000
  %72 = udiv i32 %71, %67
  %73 = trunc nuw nsw i32 %72 to i16
  %74 = load ptr, ptr %12, align 8, !tbaa !26
  %75 = getelementptr inbounds i8, ptr %74, i64 4
  store i16 %73, ptr %75, align 2, !tbaa !21
  %76 = shl nsw i32 %67, 3
  %77 = add nuw nsw i32 %76, 50000
  %78 = udiv i32 %77, 100000
  %79 = trunc nuw i32 %78 to i16
  %80 = load ptr, ptr %13, align 8, !tbaa !27
  %81 = getelementptr inbounds i8, ptr %80, i64 4
  store i16 %79, ptr %81, align 2, !tbaa !21
  br label %82

82:                                               ; preds = %69, %65
  %83 = getelementptr inbounds i8, ptr %4, i64 12
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = icmp sgt i32 %84, 99999
  br i1 %85, label %86, label %99

86:                                               ; preds = %82
  %87 = lshr i32 %84, 1
  %88 = add nuw nsw i32 %87, 800000
  %89 = udiv i32 %88, %84
  %90 = trunc nuw nsw i32 %89 to i16
  %91 = load ptr, ptr %12, align 8, !tbaa !26
  %92 = getelementptr inbounds i8, ptr %91, i64 6
  store i16 %90, ptr %92, align 2, !tbaa !21
  %93 = shl nsw i32 %84, 3
  %94 = add nuw nsw i32 %93, 50000
  %95 = udiv i32 %94, 100000
  %96 = trunc nuw i32 %95 to i16
  %97 = load ptr, ptr %13, align 8, !tbaa !27
  %98 = getelementptr inbounds i8, ptr %97, i64 6
  store i16 %96, ptr %98, align 2, !tbaa !21
  br label %99

99:                                               ; preds = %86, %82
  %100 = getelementptr inbounds i8, ptr %4, i64 16
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = icmp sgt i32 %101, 99999
  br i1 %102, label %103, label %.loopexit

103:                                              ; preds = %99
  %104 = lshr i32 %101, 1
  %105 = add nuw nsw i32 %104, 800000
  %106 = udiv i32 %105, %101
  %107 = trunc nuw nsw i32 %106 to i16
  %108 = load ptr, ptr %12, align 8, !tbaa !26
  %109 = getelementptr inbounds i8, ptr %108, i64 8
  store i16 %107, ptr %109, align 2, !tbaa !21
  %110 = shl nsw i32 %101, 3
  %111 = add nuw nsw i32 %110, 50000
  %112 = udiv i32 %111, 100000
  %113 = trunc nuw i32 %112 to i16
  %114 = load ptr, ptr %13, align 8, !tbaa !27
  %115 = getelementptr inbounds i8, ptr %114, i64 8
  store i16 %113, ptr %115, align 2, !tbaa !21
  br label %.loopexit

.loopexit:                                        ; preds = %99, %103, %5
  ret void
}

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

!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, !11, i64 936}
!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, !11, i64 576, !11, i64 584, !12, i64 592, !6, i64 600, !6, i64 604, !11, i64 608, !14, i64 616, !6, i64 620, !14, i64 624, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !7, i64 637, !7, i64 638, !7, i64 639, !14, i64 640, !7, i64 642, !6, i64 644, !15, i64 648, !15, i64 658, !11, i64 672, !6, i64 680, !6, i64 684, !6, i64 688, !6, i64 692, !11, i64 696, !11, i64 704, !11, i64 712, !11, i64 720, !11, i64 728, !11, i64 736, !16, i64 744, !16, i64 749, !11, i64 760, !15, i64 768, !11, i64 784, !11, i64 792, !11, i64 800, !11, i64 808, !11, i64 816, !11, i64 824, !11, i64 832, !11, i64 840, !11, i64 848, !6, i64 856, !6, i64 860, !12, i64 864, !12, i64 872, !12, i64 880, !12, i64 888, !6, i64 896, !6, i64 900, !11, i64 904, !11, i64 912, !7, i64 920, !7, i64 921, !11, i64 928, !11, i64 936, !11, i64 944, !11, i64 952, !11, i64 960, !7, i64 968, !7, i64 969, !6, i64 1000, !11, i64 1008, !11, i64 1016, !6, i64 1024, !6, i64 1028, !11, i64 1032, !7, i64 1040, !7, i64 1041, !14, i64 1042, !14, i64 1044, !6, i64 1048, !7, i64 1052, !11, i64 1056, !11, i64 1064, !11, i64 1072, !11, i64 1080, !11, i64 1088, !11, i64 1096, !11, i64 1104, !7, i64 1112, !6, i64 1116, !6, i64 1120, !6, i64 1124, !12, i64 1128, !17, i64 1136, !12, i64 1168, !11, i64 1176, !12, i64 1184, !6, i64 1192, !6, i64 1196, !11, i64 1200, !7, i64 1208, !18, i64 1240}
!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 = !{!14, !14, i64 0}
!22 = !{!10, !11, i64 944}
!23 = !{!11, !11, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!10, !11, i64 960}
!27 = !{!10, !11, i64 952}


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