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

; 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_info_def = type { i32, i32, i32, i64, ptr, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, [8 x i8], %struct.png_colorspace, ptr, ptr, i32, i32, i32, ptr, %struct.png_time_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, %struct.png_color_16_struct, i32, i32, i8, i32, i32, i8, i32, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, i8, i8, i32, ptr, i32, ptr, i32, i8, ptr, ptr, ptr }
%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 }
%struct.png_time_struct = type { i16, i8, i8, i8, i8, i8 }
%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 }

@.str.43 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

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

declare void @png_free(ptr noundef, ptr noundef) #2

declare void @png_chunk_report(ptr noundef, ptr noundef, i32 noundef) #2

declare noalias ptr @png_realloc_array(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i64 noundef) #2

declare noalias ptr @png_malloc_base(ptr noundef, i64 noundef) #2

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

13:                                               ; preds = %4
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %22, label %16

16:                                               ; preds = %13
  %17 = load i32, ptr %8, align 4, !tbaa !9
  %18 = icmp sle i32 %17, 0
  br i1 %18, label %22, label %19

19:                                               ; preds = %16
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %19, %16, %13, %4
  store i32 1, ptr %10, align 4
  br label %127

23:                                               ; preds = %19
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.png_info_def, ptr %25, i32 0, i32 46
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.png_info_def, ptr %28, i32 0, i32 47
  %30 = load i32, ptr %29, align 8, !tbaa !21
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = call noalias ptr @png_realloc_array(ptr noundef %24, ptr noundef %27, i32 noundef %30, i32 noundef %31, i64 noundef 32)
  store ptr %32, ptr %9, align 8, !tbaa !5
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = icmp eq ptr %33, null
  br i1 %34, label %35, label %37

35:                                               ; preds = %23
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  call void @png_chunk_report(ptr noundef %36, ptr noundef @.str.43, i32 noundef 1)
  store i32 1, ptr %10, align 4
  br label %127

37:                                               ; preds = %23
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.png_info_def, ptr %39, i32 0, i32 46
  %41 = load ptr, ptr %40, align 8, !tbaa !11
  call void @png_free(ptr noundef %38, ptr noundef %41)
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.png_info_def, ptr %43, i32 0, i32 46
  store ptr %42, ptr %44, align 8, !tbaa !11
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.png_info_def, ptr %45, i32 0, i32 45
  %47 = load i32, ptr %46, align 4, !tbaa !22
  %48 = or i32 %47, 512
  store i32 %48, ptr %46, align 4, !tbaa !22
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.png_info_def, ptr %49, i32 0, i32 47
  %51 = load i32, ptr %50, align 8, !tbaa !21
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = sext i32 %51 to i64
  %54 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %52, i64 %53
  store ptr %54, ptr %9, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %121, %37
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %58, label %126

58:                                               ; preds = %55
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %59, i32 0, i32 0
  %61 = getelementptr inbounds [5 x i8], ptr %60, i64 0, i64 0
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds [5 x i8], ptr %63, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %61, ptr align 8 %64, i64 5, i1 false)
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %65, i32 0, i32 0
  %67 = getelementptr inbounds [5 x i8], ptr %66, i64 0, i64 4
  store i8 0, ptr %67, align 4, !tbaa !23
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %69, i32 0, i32 3
  %71 = load i8, ptr %70, align 8, !tbaa !24
  %72 = zext i8 %71 to i32
  %73 = call zeroext i8 @check_location(ptr noundef %68, i32 noundef %72)
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %74, i32 0, i32 3
  store i8 %73, ptr %75, align 8, !tbaa !24
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %76, i32 0, i32 2
  %78 = load i64, ptr %77, align 8, !tbaa !26
  %79 = icmp eq i64 %78, 0
  br i1 %79, label %80, label %85

80:                                               ; preds = %58
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %81, i32 0, i32 1
  store ptr null, ptr %82, align 8, !tbaa !27
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %83, i32 0, i32 2
  store i64 0, ptr %84, align 8, !tbaa !26
  br label %114

85:                                               ; preds = %58
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %87, i32 0, i32 2
  %89 = load i64, ptr %88, align 8, !tbaa !26
  %90 = call noalias ptr @png_malloc_base(ptr noundef %86, i64 noundef %89)
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %91, i32 0, i32 1
  store ptr %90, ptr %92, align 8, !tbaa !27
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %93, i32 0, i32 1
  %95 = load ptr, ptr %94, align 8, !tbaa !27
  %96 = icmp eq ptr %95, null
  br i1 %96, label %97, label %99

97:                                               ; preds = %85
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  call void @png_chunk_report(ptr noundef %98, ptr noundef @.str.44, i32 noundef 1)
  br label %121

99:                                               ; preds = %85
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %100, i32 0, i32 1
  %102 = load ptr, ptr %101, align 8, !tbaa !27
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !27
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %106, i32 0, i32 2
  %108 = load i64, ptr %107, align 8, !tbaa !26
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %102, ptr align 1 %105, i64 %108, i1 false)
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %109, i32 0, i32 2
  %111 = load i64, ptr %110, align 8, !tbaa !26
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %112, i32 0, i32 2
  store i64 %111, ptr %113, align 8, !tbaa !26
  br label %114

114:                                              ; preds = %99, %80
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %115, i32 1
  store ptr %116, ptr %9, align 8, !tbaa !5
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.png_info_def, ptr %117, i32 0, i32 47
  %119 = load i32, ptr %118, align 8, !tbaa !21
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %118, align 8, !tbaa !21
  br label %121

121:                                              ; preds = %114, %97
  %122 = load i32, ptr %8, align 4, !tbaa !9
  %123 = add nsw i32 %122, -1
  store i32 %123, ptr %8, align 4, !tbaa !9
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %124, i32 1
  store ptr %125, ptr %7, align 8, !tbaa !5
  br label %55, !llvm.loop !28

126:                                              ; preds = %55
  store i32 0, ptr %10, align 4
  br label %127

127:                                              ; preds = %126, %35, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %128 = load i32, ptr %10, align 4
  switch i32 %128, label %130 [
    i32 0, label %129
    i32 1, label %129
  ]

129:                                              ; preds = %127, %127
  ret void

130:                                              ; preds = %127
  unreachable
}

; Function Attrs: nounwind uwtable
declare hidden zeroext i8 @check_location(ptr noalias noundef, i32 noundef) #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 304}
!12 = !{!"png_info_def", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 16, !6, i64 24, !14, i64 32, !14, i64 34, !7, i64 36, !7, i64 37, !7, i64 38, !7, i64 39, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !7, i64 44, !15, i64 52, !6, i64 128, !6, i64 136, !10, i64 144, !10, i64 148, !10, i64 152, !6, i64 160, !18, i64 168, !19, i64 176, !6, i64 184, !20, i64 192, !20, i64 202, !10, i64 212, !10, i64 216, !7, i64 220, !10, i64 224, !10, i64 228, !7, i64 232, !10, i64 236, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !10, i64 272, !10, i64 276, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !10, i64 300, !6, i64 304, !10, i64 312, !6, i64 320, !10, i64 328, !7, i64 332, !6, i64 336, !6, i64 344, !6, i64 352}
!13 = !{!"long", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"png_colorspace", !10, i64 0, !16, i64 4, !17, i64 36, !14, i64 72, !14, i64 74}
!16 = !{!"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}
!17 = !{!"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}
!18 = !{!"png_time_struct", !14, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!19 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!20 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!21 = !{!12, !10, i64 312}
!22 = !{!12, !10, i64 300}
!23 = !{!7, !7, i64 0}
!24 = !{!25, !7, i64 24}
!25 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !13, i64 16, !7, i64 24}
!26 = !{!25, !13, i64 16}
!27 = !{!25, !6, i64 8}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


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

%struct.png_unknown_chunk_t = type { [5 x i8], ptr, i64, i8 }

@.str.43 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

declare void @png_free(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @png_chunk_report(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare noalias ptr @png_realloc_array(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #1

declare noalias ptr @png_malloc_base(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @png_set_unknown_chunks(ptr noalias noundef %0, ptr noalias noundef %1, ptr noundef readonly %2, i32 noundef %3) local_unnamed_addr #2 {
  %5 = icmp eq ptr %0, null
  %6 = icmp eq ptr %1, null
  %or.cond = or i1 %5, %6
  %7 = icmp slt i32 %3, 1
  %or.cond3 = or i1 %or.cond, %7
  %8 = icmp eq ptr %2, null
  %or.cond5 = or i1 %8, %or.cond3
  br i1 %or.cond5, label %.loopexit, label %9

9:                                                ; preds = %4
  %10 = getelementptr inbounds i8, ptr %1, i64 304
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %1, i64 312
  %13 = load i32, ptr %12, align 8, !tbaa !19
  %14 = tail call noalias ptr @png_realloc_array(ptr noundef nonnull %0, ptr noundef %11, i32 noundef %13, i32 noundef %3, i64 noundef 32) #4
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %.lr.ph.preheader

16:                                               ; preds = %9
  tail call void @png_chunk_report(ptr noundef nonnull %0, ptr noundef nonnull @.str.43, i32 noundef 1) #4
  br label %.loopexit

.lr.ph.preheader:                                 ; preds = %9
  %17 = load ptr, ptr %10, align 8, !tbaa !5
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %17) #4
  store ptr %14, ptr %10, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %1, i64 300
  %19 = load i32, ptr %18, align 4, !tbaa !20
  %20 = or i32 %19, 512
  store i32 %20, ptr %18, align 4, !tbaa !20
  %21 = load i32, ptr %12, align 8, !tbaa !19
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds %struct.png_unknown_chunk_t, ptr %14, i64 %22
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %49
  %.056 = phi ptr [ %.1, %49 ], [ %23, %.lr.ph.preheader ]
  %.04555 = phi i32 [ %50, %49 ], [ %3, %.lr.ph.preheader ]
  %.04654 = phi ptr [ %51, %49 ], [ %2, %.lr.ph.preheader ]
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(5) %.056, ptr noundef nonnull align 8 dereferenceable(5) %.04654, i64 5, i1 false)
  %24 = getelementptr inbounds i8, ptr %.056, i64 4
  store i8 0, ptr %24, align 4, !tbaa !21
  %25 = getelementptr inbounds i8, ptr %.04654, i64 24
  %26 = load i8, ptr %25, align 8, !tbaa !22
  %27 = zext i8 %26 to i32
  %28 = tail call zeroext i8 @check_location(ptr noundef %0, i32 noundef %27)
  %29 = getelementptr inbounds i8, ptr %.056, i64 24
  store i8 %28, ptr %29, align 8, !tbaa !22
  %30 = getelementptr inbounds i8, ptr %.04654, i64 16
  %31 = load i64, ptr %30, align 8, !tbaa !24
  %32 = icmp eq i64 %31, 0
  br i1 %32, label %33, label %35

33:                                               ; preds = %.lr.ph
  %34 = getelementptr inbounds i8, ptr %.056, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %34, i8 0, i64 16, i1 false)
  br label %45

35:                                               ; preds = %.lr.ph
  %36 = tail call noalias ptr @png_malloc_base(ptr noundef %0, i64 noundef %31) #4
  %37 = getelementptr inbounds i8, ptr %.056, i64 8
  store ptr %36, ptr %37, align 8, !tbaa !25
  %38 = icmp eq ptr %36, null
  br i1 %38, label %39, label %40

39:                                               ; preds = %35
  tail call void @png_chunk_report(ptr noundef %0, ptr noundef nonnull @.str.44, i32 noundef 1) #4
  br label %49

40:                                               ; preds = %35
  %41 = getelementptr inbounds i8, ptr %.04654, i64 8
  %42 = load ptr, ptr %41, align 8, !tbaa !25
  %43 = load i64, ptr %30, align 8, !tbaa !24
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %36, ptr align 1 %42, i64 %43, i1 false)
  %44 = getelementptr inbounds i8, ptr %.056, i64 16
  store i64 %43, ptr %44, align 8, !tbaa !24
  br label %45

45:                                               ; preds = %40, %33
  %46 = getelementptr inbounds i8, ptr %.056, i64 32
  %47 = load i32, ptr %12, align 8, !tbaa !19
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %12, align 8, !tbaa !19
  br label %49

49:                                               ; preds = %45, %39
  %.1 = phi ptr [ %46, %45 ], [ %.056, %39 ]
  %50 = add nsw i32 %.04555, -1
  %51 = getelementptr inbounds i8, ptr %.04654, i64 32
  %52 = icmp sgt i32 %.04555, 1
  br i1 %52, label %.lr.ph, label %.loopexit, !llvm.loop !26

.loopexit:                                        ; preds = %49, %4, %16
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden zeroext i8 @check_location(ptr noalias noundef, i32 noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !11, i64 304}
!6 = !{!"png_info_def", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !11, i64 24, !12, i64 32, !12, i64 34, !8, i64 36, !8, i64 37, !8, i64 38, !8, i64 39, !8, i64 40, !8, i64 41, !8, i64 42, !8, i64 43, !8, i64 44, !13, i64 52, !11, i64 128, !11, i64 136, !7, i64 144, !7, i64 148, !7, i64 152, !11, i64 160, !16, i64 168, !17, i64 176, !11, i64 184, !18, i64 192, !18, i64 202, !7, i64 212, !7, i64 216, !8, i64 220, !7, i64 224, !7, i64 228, !8, i64 232, !7, i64 236, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !7, i64 272, !7, i64 276, !11, i64 280, !11, i64 288, !8, i64 296, !8, i64 297, !7, i64 300, !11, i64 304, !7, i64 312, !11, i64 320, !7, i64 328, !8, i64 332, !11, i64 336, !11, i64 344, !11, i64 352}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"png_colorspace", !7, i64 0, !14, i64 4, !15, i64 36, !12, i64 72, !12, i64 74}
!14 = !{!"png_xy", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28}
!15 = !{!"png_XYZ", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32}
!16 = !{!"png_time_struct", !12, i64 0, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6}
!17 = !{!"png_color_8_struct", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4}
!18 = !{!"png_color_16_struct", !8, i64 0, !12, i64 2, !12, i64 4, !12, i64 6, !12, i64 8}
!19 = !{!6, !7, i64 312}
!20 = !{!6, !7, i64 300}
!21 = !{!8, !8, i64 0}
!22 = !{!23, !8, i64 24}
!23 = !{!"png_unknown_chunk_t", !8, i64 0, !11, i64 8, !10, i64 16, !8, i64 24}
!24 = !{!23, !10, i64 16}
!25 = !{!23, !11, i64 8}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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