; LLVM IR from niessner/Matterport :: code/gaps/pkgs/png (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_struct = type { i32, i32, i32, i64, ptr, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, [8 x i8], float, i8, 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, ptr, float, float, float, float, float, float, float, float, ptr, i32, i32, ptr, ptr, i8, i8, i32, ptr, i64, ptr, ptr, i32, i8, ptr, i32, i8, double, double, ptr, ptr, ptr, 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 }

@.str.5 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 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

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

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

declare ptr @png_malloc_warn(ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @png_set_pCAL(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, ptr noundef %7, ptr noundef %8) #3 {
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !5
  store i32 %3, ptr %13, align 4, !tbaa !9
  store i32 %4, ptr %14, align 4, !tbaa !9
  store i32 %5, ptr %15, align 4, !tbaa !9
  store i32 %6, ptr %16, align 4, !tbaa !9
  store ptr %7, ptr %17, align 8, !tbaa !5
  store ptr %8, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %22 = load ptr, ptr %10, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %27, label %24

24:                                               ; preds = %9
  %25 = load ptr, ptr %11, align 8, !tbaa !5
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %24, %9
  store i32 1, ptr %21, align 4
  br label %162

28:                                               ; preds = %24
  %29 = load ptr, ptr %12, align 8, !tbaa !5
  %30 = call i64 @strlen(ptr noundef %29) #7
  %31 = add i64 %30, 1
  store i64 %31, ptr %19, align 8, !tbaa !11
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = load i64, ptr %19, align 8, !tbaa !11
  %34 = call ptr @png_malloc_warn(ptr noundef %32, i64 noundef %33)
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.png_info_struct, ptr %35, i32 0, i32 41
  store ptr %34, ptr %36, align 8, !tbaa !13
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.png_info_struct, ptr %37, i32 0, i32 41
  %39 = load ptr, ptr %38, align 8, !tbaa !13
  %40 = icmp eq ptr %39, null
  br i1 %40, label %41, label %43

41:                                               ; preds = %28
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  call void @png_warning(ptr noundef %42, ptr noundef @.str.5)
  store i32 1, ptr %21, align 4
  br label %162

43:                                               ; preds = %28
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.png_info_struct, ptr %44, i32 0, i32 41
  %46 = load ptr, ptr %45, align 8, !tbaa !13
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = load i64, ptr %19, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %46, ptr align 1 %47, i64 %48, i1 false)
  %49 = load i32, ptr %13, align 4, !tbaa !9
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.png_info_struct, ptr %50, i32 0, i32 42
  store i32 %49, ptr %51, align 8, !tbaa !21
  %52 = load i32, ptr %14, align 4, !tbaa !9
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.png_info_struct, ptr %53, i32 0, i32 43
  store i32 %52, ptr %54, align 4, !tbaa !22
  %55 = load i32, ptr %15, align 4, !tbaa !9
  %56 = trunc i32 %55 to i8
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_info_struct, ptr %57, i32 0, i32 46
  store i8 %56, ptr %58, align 8, !tbaa !23
  %59 = load i32, ptr %16, align 4, !tbaa !9
  %60 = trunc i32 %59 to i8
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.png_info_struct, ptr %61, i32 0, i32 47
  store i8 %60, ptr %62, align 1, !tbaa !24
  %63 = load ptr, ptr %17, align 8, !tbaa !5
  %64 = call i64 @strlen(ptr noundef %63) #7
  %65 = add i64 %64, 1
  store i64 %65, ptr %19, align 8, !tbaa !11
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = load i64, ptr %19, align 8, !tbaa !11
  %68 = call ptr @png_malloc_warn(ptr noundef %66, i64 noundef %67)
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.png_info_struct, ptr %69, i32 0, i32 44
  store ptr %68, ptr %70, align 8, !tbaa !25
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.png_info_struct, ptr %71, i32 0, i32 44
  %73 = load ptr, ptr %72, align 8, !tbaa !25
  %74 = icmp eq ptr %73, null
  br i1 %74, label %75, label %77

75:                                               ; preds = %43
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  call void @png_warning(ptr noundef %76, ptr noundef @.str.6)
  store i32 1, ptr %21, align 4
  br label %162

77:                                               ; preds = %43
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.png_info_struct, ptr %78, i32 0, i32 44
  %80 = load ptr, ptr %79, align 8, !tbaa !25
  %81 = load ptr, ptr %17, align 8, !tbaa !5
  %82 = load i64, ptr %19, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %80, ptr align 1 %81, i64 %82, i1 false)
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = load i32, ptr %16, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = mul i64 %86, 8
  %88 = call ptr @png_malloc_warn(ptr noundef %83, i64 noundef %87)
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.png_info_struct, ptr %89, i32 0, i32 45
  store ptr %88, ptr %90, align 8, !tbaa !26
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.png_info_struct, ptr %91, i32 0, i32 45
  %93 = load ptr, ptr %92, align 8, !tbaa !26
  %94 = icmp eq ptr %93, null
  br i1 %94, label %95, label %97

95:                                               ; preds = %77
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  call void @png_warning(ptr noundef %96, ptr noundef @.str.7)
  store i32 1, ptr %21, align 4
  br label %162

97:                                               ; preds = %77
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.png_info_struct, ptr %98, i32 0, i32 45
  %100 = load ptr, ptr %99, align 8, !tbaa !26
  %101 = load i32, ptr %16, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = mul i64 %103, 8
  call void @llvm.memset.p0.i64(ptr align 8 %100, i8 0, i64 %104, i1 false)
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %105

105:                                              ; preds = %150, %97
  %106 = load i32, ptr %20, align 4, !tbaa !9
  %107 = load i32, ptr %16, align 4, !tbaa !9
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %153

109:                                              ; preds = %105
  %110 = load ptr, ptr %18, align 8, !tbaa !5
  %111 = load i32, ptr %20, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds ptr, ptr %110, i64 %112
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  %115 = call i64 @strlen(ptr noundef %114) #7
  %116 = add i64 %115, 1
  store i64 %116, ptr %19, align 8, !tbaa !11
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = load i64, ptr %19, align 8, !tbaa !11
  %119 = call ptr @png_malloc_warn(ptr noundef %117, i64 noundef %118)
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.png_info_struct, ptr %120, i32 0, i32 45
  %122 = load ptr, ptr %121, align 8, !tbaa !26
  %123 = load i32, ptr %20, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds ptr, ptr %122, i64 %124
  store ptr %119, ptr %125, align 8, !tbaa !5
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.png_info_struct, ptr %126, i32 0, i32 45
  %128 = load ptr, ptr %127, align 8, !tbaa !26
  %129 = load i32, ptr %20, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds ptr, ptr %128, i64 %130
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  %133 = icmp eq ptr %132, null
  br i1 %133, label %134, label %136

134:                                              ; preds = %109
  %135 = load ptr, ptr %10, align 8, !tbaa !5
  call void @png_warning(ptr noundef %135, ptr noundef @.str.8)
  store i32 1, ptr %21, align 4
  br label %162

136:                                              ; preds = %109
  %137 = load ptr, ptr %11, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.png_info_struct, ptr %137, i32 0, i32 45
  %139 = load ptr, ptr %138, align 8, !tbaa !26
  %140 = load i32, ptr %20, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds ptr, ptr %139, i64 %141
  %143 = load ptr, ptr %142, align 8, !tbaa !5
  %144 = load ptr, ptr %18, align 8, !tbaa !5
  %145 = load i32, ptr %20, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds ptr, ptr %144, i64 %146
  %148 = load ptr, ptr %147, align 8, !tbaa !5
  %149 = load i64, ptr %19, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %143, ptr align 1 %148, i64 %149, i1 false)
  br label %150

150:                                              ; preds = %136
  %151 = load i32, ptr %20, align 4, !tbaa !9
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %20, align 4, !tbaa !9
  br label %105, !llvm.loop !27

153:                                              ; preds = %105
  %154 = load ptr, ptr %11, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.png_info_struct, ptr %154, i32 0, i32 2
  %156 = load i32, ptr %155, align 8, !tbaa !29
  %157 = or i32 %156, 1024
  store i32 %157, ptr %155, align 8, !tbaa !29
  %158 = load ptr, ptr %11, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.png_info_struct, ptr %158, i32 0, i32 48
  %160 = load i32, ptr %159, align 4, !tbaa !30
  %161 = or i32 %160, 128
  store i32 %161, ptr %159, align 4, !tbaa !30
  store i32 0, ptr %21, align 4
  br label %162

162:                                              ; preds = %153, %134, %95, %75, %41, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  %163 = load i32, ptr %21, align 4
  switch i32 %163, label %165 [
    i32 0, label %164
    i32 1, label %164
  ]

164:                                              ; preds = %162, %162
  ret void

165:                                              ; preds = %162
  unreachable
}

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

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

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

!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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 192}
!14 = !{!"png_info_struct", !10, i64 0, !10, i64 4, !10, i64 8, !12, i64 16, !6, i64 24, !15, i64 32, !15, 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, !16, i64 52, !7, i64 56, !10, i64 60, !10, i64 64, !6, i64 72, !17, i64 80, !18, i64 88, !6, i64 96, !19, i64 104, !19, i64 114, !10, i64 124, !10, i64 128, !7, i64 132, !10, i64 136, !10, i64 140, !7, i64 144, !6, i64 152, !16, i64 160, !16, i64 164, !16, i64 168, !16, i64 172, !16, i64 176, !16, i64 180, !16, i64 184, !16, i64 188, !6, i64 192, !10, i64 200, !10, i64 204, !6, i64 208, !6, i64 216, !7, i64 224, !7, i64 225, !10, i64 228, !6, i64 232, !12, i64 240, !6, i64 248, !6, i64 256, !10, i64 264, !7, i64 268, !6, i64 272, !10, i64 280, !7, i64 284, !20, i64 288, !20, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !10, i64 328, !10, i64 332, !10, i64 336, !10, i64 340, !10, i64 344, !10, i64 348, !10, i64 352, !10, i64 356, !10, i64 360}
!15 = !{!"short", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!"png_time_struct", !15, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!18 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!19 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, i64 8}
!20 = !{!"double", !7, i64 0}
!21 = !{!14, !10, i64 200}
!22 = !{!14, !10, i64 204}
!23 = !{!14, !7, i64 224}
!24 = !{!14, !7, i64 225}
!25 = !{!14, !6, i64 208}
!26 = !{!14, !6, i64 216}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!14, !10, i64 8}
!30 = !{!14, !10, i64 228}


; 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.5 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 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_warning(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @png_malloc_warn(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @png_set_pCAL(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readonly %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, ptr nocapture noundef readonly %7, ptr nocapture noundef readonly %8) local_unnamed_addr #2 {
  %10 = icmp eq ptr %0, null
  %11 = icmp eq ptr %1, null
  %or.cond = or i1 %10, %11
  br i1 %or.cond, label %62, label %12

12:                                               ; preds = %9
  %13 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #5
  %14 = add i64 %13, 1
  %15 = tail call ptr @png_malloc_warn(ptr noundef nonnull %0, i64 noundef %14) #6
  %16 = getelementptr inbounds i8, ptr %1, i64 192
  store ptr %15, ptr %16, align 8, !tbaa !5
  %17 = icmp eq ptr %15, null
  br i1 %17, label %18, label %19

18:                                               ; preds = %12
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.5) #6
  br label %62

19:                                               ; preds = %12
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %15, ptr align 1 %2, i64 %14, i1 false)
  %20 = getelementptr inbounds i8, ptr %1, i64 200
  store i32 %3, ptr %20, align 8, !tbaa !18
  %21 = getelementptr inbounds i8, ptr %1, i64 204
  store i32 %4, ptr %21, align 4, !tbaa !19
  %22 = trunc i32 %5 to i8
  %23 = getelementptr inbounds i8, ptr %1, i64 224
  store i8 %22, ptr %23, align 8, !tbaa !20
  %24 = trunc i32 %6 to i8
  %25 = getelementptr inbounds i8, ptr %1, i64 225
  store i8 %24, ptr %25, align 1, !tbaa !21
  %26 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %7) #5
  %27 = add i64 %26, 1
  %28 = tail call ptr @png_malloc_warn(ptr noundef nonnull %0, i64 noundef %27) #6
  %29 = getelementptr inbounds i8, ptr %1, i64 208
  store ptr %28, ptr %29, align 8, !tbaa !22
  %30 = icmp eq ptr %28, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %19
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.6) #6
  br label %62

32:                                               ; preds = %19
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %28, ptr align 1 %7, i64 %27, i1 false)
  %33 = add nsw i32 %6, 1
  %34 = sext i32 %33 to i64
  %35 = shl nsw i64 %34, 3
  %36 = tail call ptr @png_malloc_warn(ptr noundef nonnull %0, i64 noundef %35) #6
  %37 = getelementptr inbounds i8, ptr %1, i64 216
  store ptr %36, ptr %37, align 8, !tbaa !23
  %38 = icmp eq ptr %36, null
  br i1 %38, label %39, label %40

39:                                               ; preds = %32
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.7) #6
  br label %62

40:                                               ; preds = %32
  tail call void @llvm.memset.p0.i64(ptr nonnull align 8 %36, i8 0, i64 %35, i1 false)
  %41 = icmp sgt i32 %6, 0
  br i1 %41, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %40
  %wide.trip.count = zext nneg i32 %6 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %54
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %54 ]
  %42 = getelementptr inbounds ptr, ptr %8, i64 %indvars.iv
  %43 = load ptr, ptr %42, align 8, !tbaa !24
  %44 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %43) #5
  %45 = add i64 %44, 1
  %46 = tail call ptr @png_malloc_warn(ptr noundef %0, i64 noundef %45) #6
  %47 = load ptr, ptr %37, align 8, !tbaa !23
  %48 = getelementptr inbounds ptr, ptr %47, i64 %indvars.iv
  store ptr %46, ptr %48, align 8, !tbaa !24
  %49 = load ptr, ptr %37, align 8, !tbaa !23
  %50 = getelementptr inbounds ptr, ptr %49, i64 %indvars.iv
  %51 = load ptr, ptr %50, align 8, !tbaa !24
  %52 = icmp eq ptr %51, null
  br i1 %52, label %53, label %54

53:                                               ; preds = %.lr.ph
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.8) #6
  br label %62

54:                                               ; preds = %.lr.ph
  %55 = load ptr, ptr %42, align 8, !tbaa !24
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %51, ptr align 1 %55, i64 %45, i1 false)
  %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 %._crit_edge, label %.lr.ph, !llvm.loop !25

._crit_edge:                                      ; preds = %54, %40
  %56 = getelementptr inbounds i8, ptr %1, i64 8
  %57 = load i32, ptr %56, align 8, !tbaa !27
  %58 = or i32 %57, 1024
  store i32 %58, ptr %56, align 8, !tbaa !27
  %59 = getelementptr inbounds i8, ptr %1, i64 228
  %60 = load i32, ptr %59, align 4, !tbaa !28
  %61 = or i32 %60, 128
  store i32 %61, ptr %59, align 4, !tbaa !28
  br label %62

62:                                               ; preds = %9, %._crit_edge, %53, %39, %31, %18
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

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

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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind willreturn memory(read) }
attributes #6 = { 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 192}
!6 = !{!"png_info_struct", !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, !8, i64 56, !7, i64 60, !7, i64 64, !11, i64 72, !14, i64 80, !15, i64 88, !11, i64 96, !16, i64 104, !16, i64 114, !7, i64 124, !7, i64 128, !8, i64 132, !7, i64 136, !7, i64 140, !8, i64 144, !11, i64 152, !13, i64 160, !13, i64 164, !13, i64 168, !13, i64 172, !13, i64 176, !13, i64 180, !13, i64 184, !13, i64 188, !11, i64 192, !7, i64 200, !7, i64 204, !11, i64 208, !11, i64 216, !8, i64 224, !8, i64 225, !7, i64 228, !11, i64 232, !10, i64 240, !11, i64 248, !11, i64 256, !7, i64 264, !8, i64 268, !11, i64 272, !7, i64 280, !8, i64 284, !17, i64 288, !17, i64 296, !11, i64 304, !11, i64 312, !11, i64 320, !7, i64 328, !7, i64 332, !7, i64 336, !7, i64 340, !7, i64 344, !7, i64 348, !7, i64 352, !7, i64 356, !7, i64 360}
!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 = !{!"float", !8, i64 0}
!14 = !{!"png_time_struct", !12, i64 0, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6}
!15 = !{!"png_color_8_struct", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4}
!16 = !{!"png_color_16_struct", !8, i64 0, !12, i64 2, !12, i64 4, !12, i64 6, !12, i64 8}
!17 = !{!"double", !8, i64 0}
!18 = !{!6, !7, i64 200}
!19 = !{!6, !7, i64 204}
!20 = !{!6, !8, i64 224}
!21 = !{!6, !8, i64 225}
!22 = !{!6, !11, i64 208}
!23 = !{!6, !11, i64 216}
!24 = !{!11, !11, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!6, !7, i64 8}
!28 = !{!6, !7, i64 228}


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