; 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 }
%struct.png_sPLT_struct = type { ptr, i8, ptr, i32 }

@.str.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [42 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 willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
define dso_local void @png_set_sPLT(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #4 {
  %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
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = 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) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %20, label %17

17:                                               ; preds = %4
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %17, %4
  store i32 1, ptr %11, align 4
  br label %162

21:                                               ; preds = %17
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.png_info_struct, ptr %23, i32 0, i32 56
  %25 = load i32, ptr %24, align 8, !tbaa !11
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = add i32 %25, %26
  %28 = zext i32 %27 to i64
  %29 = mul i64 %28, 32
  %30 = call ptr @png_malloc_warn(ptr noundef %22, i64 noundef %29)
  store ptr %30, ptr %9, align 8, !tbaa !5
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %35

33:                                               ; preds = %21
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  call void @png_warning(ptr noundef %34, ptr noundef @.str.14)
  store i32 1, ptr %11, align 4
  br label %162

35:                                               ; preds = %21
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.png_info_struct, ptr %37, i32 0, i32 55
  %39 = load ptr, ptr %38, align 8, !tbaa !20
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.png_info_struct, ptr %40, i32 0, i32 56
  %42 = load i32, ptr %41, align 8, !tbaa !11
  %43 = zext i32 %42 to i64
  %44 = mul i64 %43, 32
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %36, ptr align 8 %39, i64 %44, i1 false)
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.png_info_struct, ptr %46, i32 0, i32 55
  %48 = load ptr, ptr %47, align 8, !tbaa !20
  call void @png_free(ptr noundef %45, ptr noundef %48)
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.png_info_struct, ptr %49, i32 0, i32 55
  store ptr null, ptr %50, align 8, !tbaa !20
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %142, %35
  %52 = load i32, ptr %10, align 4, !tbaa !9
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %55, label %145

55:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_info_struct, ptr %57, i32 0, i32 56
  %59 = load i32, ptr %58, align 8, !tbaa !11
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds %struct.png_sPLT_struct, ptr %56, i64 %60
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds %struct.png_sPLT_struct, ptr %61, i64 %63
  store ptr %64, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = load i32, ptr %10, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds %struct.png_sPLT_struct, ptr %65, i64 %67
  store ptr %68, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.png_sPLT_struct, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !21
  %72 = call i64 @strlen(ptr noundef %71) #6
  %73 = add i64 %72, 1
  %74 = trunc i64 %73 to i32
  store i32 %74, ptr %14, align 4, !tbaa !9
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = load i32, ptr %14, align 4, !tbaa !9
  %77 = zext i32 %76 to i64
  %78 = call ptr @png_malloc_warn(ptr noundef %75, i64 noundef %77)
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.png_sPLT_struct, ptr %79, i32 0, i32 0
  store ptr %78, ptr %80, align 8, !tbaa !21
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.png_sPLT_struct, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !21
  %84 = icmp eq ptr %83, null
  br i1 %84, label %85, label %87

85:                                               ; preds = %55
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  call void @png_warning(ptr noundef %86, ptr noundef @.str.15)
  store i32 4, ptr %11, align 4
  br label %139

87:                                               ; preds = %55
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.png_sPLT_struct, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !21
  %91 = load ptr, ptr %13, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.png_sPLT_struct, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !21
  %94 = load i32, ptr %14, align 4, !tbaa !9
  %95 = zext i32 %94 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %90, ptr align 1 %93, i64 %95, i1 false)
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = load ptr, ptr %13, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.png_sPLT_struct, ptr %97, i32 0, i32 3
  %99 = load i32, ptr %98, align 8, !tbaa !23
  %100 = sext i32 %99 to i64
  %101 = mul i64 %100, 10
  %102 = call ptr @png_malloc_warn(ptr noundef %96, i64 noundef %101)
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.png_sPLT_struct, ptr %103, i32 0, i32 2
  store ptr %102, ptr %104, align 8, !tbaa !24
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.png_sPLT_struct, ptr %105, i32 0, i32 2
  %107 = load ptr, ptr %106, align 8, !tbaa !24
  %108 = icmp eq ptr %107, null
  br i1 %108, label %109, label %117

109:                                              ; preds = %87
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  call void @png_warning(ptr noundef %110, ptr noundef @.str.15)
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = load ptr, ptr %12, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.png_sPLT_struct, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !21
  call void @png_free(ptr noundef %111, ptr noundef %114)
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.png_sPLT_struct, ptr %115, i32 0, i32 0
  store ptr null, ptr %116, align 8, !tbaa !21
  store i32 4, ptr %11, align 4
  br label %139

117:                                              ; preds = %87
  %118 = load ptr, ptr %12, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.png_sPLT_struct, ptr %118, i32 0, i32 2
  %120 = load ptr, ptr %119, align 8, !tbaa !24
  %121 = load ptr, ptr %13, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.png_sPLT_struct, ptr %121, i32 0, i32 2
  %123 = load ptr, ptr %122, align 8, !tbaa !24
  %124 = load ptr, ptr %13, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.png_sPLT_struct, ptr %124, i32 0, i32 3
  %126 = load i32, ptr %125, align 8, !tbaa !23
  %127 = sext i32 %126 to i64
  %128 = mul i64 %127, 10
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %120, ptr align 2 %123, i64 %128, i1 false)
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.png_sPLT_struct, ptr %129, i32 0, i32 3
  %131 = load i32, ptr %130, align 8, !tbaa !23
  %132 = load ptr, ptr %12, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.png_sPLT_struct, ptr %132, i32 0, i32 3
  store i32 %131, ptr %133, align 8, !tbaa !23
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.png_sPLT_struct, ptr %134, i32 0, i32 1
  %136 = load i8, ptr %135, align 8, !tbaa !25
  %137 = load ptr, ptr %12, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.png_sPLT_struct, ptr %137, i32 0, i32 1
  store i8 %136, ptr %138, align 8, !tbaa !25
  store i32 0, ptr %11, align 4
  br label %139

139:                                              ; preds = %117, %109, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  %140 = load i32, ptr %11, align 4
  switch i32 %140, label %165 [
    i32 0, label %141
    i32 4, label %142
  ]

141:                                              ; preds = %139
  br label %142

142:                                              ; preds = %141, %139
  %143 = load i32, ptr %10, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %10, align 4, !tbaa !9
  br label %51, !llvm.loop !26

145:                                              ; preds = %51
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.png_info_struct, ptr %147, i32 0, i32 55
  store ptr %146, ptr %148, align 8, !tbaa !20
  %149 = load i32, ptr %8, align 4, !tbaa !9
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.png_info_struct, ptr %150, i32 0, i32 56
  %152 = load i32, ptr %151, align 8, !tbaa !11
  %153 = add i32 %152, %149
  store i32 %153, ptr %151, align 8, !tbaa !11
  %154 = load ptr, ptr %6, 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 !28
  %157 = or i32 %156, 8192
  store i32 %157, ptr %155, align 8, !tbaa !28
  %158 = load ptr, ptr %6, 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 !29
  %161 = or i32 %160, 32
  store i32 %161, ptr %159, align 4, !tbaa !29
  store i32 0, ptr %11, align 4
  br label %162

162:                                              ; preds = %145, %33, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  %163 = load i32, ptr %11, align 4
  switch i32 %163, label %165 [
    i32 0, label %164
    i32 1, label %164
  ]

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

165:                                              ; preds = %162, %139
  unreachable
}

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 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { 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, !10, i64 280}
!12 = !{!"png_info_struct", !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, !7, i64 56, !10, i64 60, !10, i64 64, !6, i64 72, !16, i64 80, !17, i64 88, !6, i64 96, !18, i64 104, !18, i64 114, !10, i64 124, !10, i64 128, !7, i64 132, !10, i64 136, !10, i64 140, !7, i64 144, !6, i64 152, !15, i64 160, !15, i64 164, !15, i64 168, !15, i64 172, !15, i64 176, !15, i64 180, !15, i64 184, !15, 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, !13, i64 240, !6, i64 248, !6, i64 256, !10, i64 264, !7, i64 268, !6, i64 272, !10, i64 280, !7, i64 284, !19, i64 288, !19, 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}
!13 = !{!"long", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"png_time_struct", !14, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!17 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!18 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!19 = !{!"double", !7, i64 0}
!20 = !{!12, !6, i64 272}
!21 = !{!22, !6, i64 0}
!22 = !{!"png_sPLT_struct", !6, i64 0, !7, i64 8, !6, i64 16, !10, i64 24}
!23 = !{!22, !10, i64 24}
!24 = !{!22, !6, i64 16}
!25 = !{!22, !7, i64 8}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!12, !10, i64 8}
!29 = !{!12, !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"

%struct.png_sPLT_struct = type { ptr, i8, ptr, i32 }

@.str.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [42 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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2

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

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

7:                                                ; preds = %4
  %8 = getelementptr inbounds i8, ptr %1, i64 280
  %9 = load i32, ptr %8, align 8, !tbaa !5
  %10 = add i32 %9, %3
  %11 = zext i32 %10 to i64
  %12 = shl nuw nsw i64 %11, 5
  %13 = tail call ptr @png_malloc_warn(ptr noundef nonnull %0, i64 noundef %12) #4
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %16

15:                                               ; preds = %7
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.14) #4
  br label %67

16:                                               ; preds = %7
  %17 = getelementptr inbounds i8, ptr %1, i64 272
  %18 = load ptr, ptr %17, align 8, !tbaa !18
  %19 = load i32, ptr %8, align 8, !tbaa !5
  %20 = zext i32 %19 to i64
  %21 = shl nuw nsw i64 %20, 5
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %13, ptr align 8 %18, i64 %21, i1 false)
  %22 = load ptr, ptr %17, align 8, !tbaa !18
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %22) #4
  store ptr null, ptr %17, align 8, !tbaa !18
  %23 = icmp sgt i32 %3, 0
  br i1 %23, label %.lr.ph.preheader, label %._crit_edge

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %58
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %58 ]
  %24 = load i32, ptr %8, align 8, !tbaa !5
  %25 = zext i32 %24 to i64
  %26 = getelementptr inbounds %struct.png_sPLT_struct, ptr %13, i64 %25
  %27 = getelementptr inbounds %struct.png_sPLT_struct, ptr %26, i64 %indvars.iv
  %28 = getelementptr inbounds %struct.png_sPLT_struct, ptr %2, i64 %indvars.iv
  %29 = load ptr, ptr %28, align 8, !tbaa !19
  %30 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %29) #5
  %31 = add i64 %30, 1
  %32 = and i64 %31, 4294967295
  %33 = tail call ptr @png_malloc_warn(ptr noundef %0, i64 noundef %32) #4
  store ptr %33, ptr %27, align 8, !tbaa !19
  %34 = icmp eq ptr %33, null
  br i1 %34, label %35, label %36

35:                                               ; preds = %.lr.ph
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.15) #4
  br label %58

36:                                               ; preds = %.lr.ph
  %37 = load ptr, ptr %28, align 8, !tbaa !19
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %33, ptr align 1 %37, i64 %32, i1 false)
  %38 = getelementptr inbounds i8, ptr %28, i64 24
  %39 = load i32, ptr %38, align 8, !tbaa !21
  %40 = sext i32 %39 to i64
  %41 = mul nsw i64 %40, 10
  %42 = tail call ptr @png_malloc_warn(ptr noundef %0, i64 noundef %41) #4
  %43 = getelementptr inbounds i8, ptr %27, i64 16
  store ptr %42, ptr %43, align 8, !tbaa !22
  %44 = icmp eq ptr %42, null
  br i1 %44, label %45, label %47

45:                                               ; preds = %36
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.15) #4
  %46 = load ptr, ptr %27, align 8, !tbaa !19
  tail call void @png_free(ptr noundef %0, ptr noundef %46) #4
  store ptr null, ptr %27, align 8, !tbaa !19
  br label %58

47:                                               ; preds = %36
  %48 = getelementptr inbounds i8, ptr %28, i64 16
  %49 = load ptr, ptr %48, align 8, !tbaa !22
  %50 = load i32, ptr %38, align 8, !tbaa !21
  %51 = sext i32 %50 to i64
  %52 = mul nsw i64 %51, 10
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 2 %42, ptr align 2 %49, i64 %52, i1 false)
  %53 = load i32, ptr %38, align 8, !tbaa !21
  %54 = getelementptr inbounds i8, ptr %27, i64 24
  store i32 %53, ptr %54, align 8, !tbaa !21
  %55 = getelementptr inbounds i8, ptr %28, i64 8
  %56 = load i8, ptr %55, align 8, !tbaa !23
  %57 = getelementptr inbounds i8, ptr %27, i64 8
  store i8 %56, ptr %57, align 8, !tbaa !23
  br label %58

58:                                               ; preds = %47, %45, %35
  %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 !24

._crit_edge:                                      ; preds = %58, %16
  store ptr %13, ptr %17, align 8, !tbaa !18
  %59 = load i32, ptr %8, align 8, !tbaa !5
  %60 = add i32 %59, %3
  store i32 %60, ptr %8, align 8, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %1, i64 8
  %62 = load i32, ptr %61, align 8, !tbaa !26
  %63 = or i32 %62, 8192
  store i32 %63, ptr %61, align 8, !tbaa !26
  %64 = getelementptr inbounds i8, ptr %1, i64 228
  %65 = load i32, ptr %64, align 4, !tbaa !27
  %66 = or i32 %65, 32
  store i32 %66, ptr %64, align 4, !tbaa !27
  br label %67

67:                                               ; preds = %4, %._crit_edge, %15
  ret void
}

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 = { 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 #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 }
attributes #5 = { 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, !7, i64 280}
!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, !11, i64 272}
!19 = !{!20, !11, i64 0}
!20 = !{!"png_sPLT_struct", !11, i64 0, !8, i64 8, !11, i64 16, !7, i64 24}
!21 = !{!20, !7, i64 24}
!22 = !{!20, !11, i64 16}
!23 = !{!20, !8, i64 8}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!6, !7, i64 8}
!27 = !{!6, !7, i64 228}


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