; LLVM IR from dloebl/cgif :: tests (animated_color_gradient)

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

@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [44 x i8], align 1
@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca %struct.st_gifconfig, align 8
  %4 = alloca %struct.st_frameconfig, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [768 x i8], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i16, align 2
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 768, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %35, %0
  %15 = load i32, ptr %8, align 4, !tbaa !5
  %16 = icmp slt i32 %15, 256
  br i1 %16, label %18, label %17

17:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %38

18:                                               ; preds = %14
  %19 = load i32, ptr %8, align 4, !tbaa !5
  %20 = trunc i32 %19 to i8
  %21 = load i32, ptr %8, align 4, !tbaa !5
  %22 = mul nsw i32 %21, 3
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [768 x i8], ptr %6, i64 0, i64 %23
  store i8 %20, ptr %24, align 1, !tbaa !9
  %25 = load i32, ptr %8, align 4, !tbaa !5
  %26 = mul nsw i32 %25, 3
  %27 = add nsw i32 %26, 1
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [768 x i8], ptr %6, i64 0, i64 %28
  store i8 0, ptr %29, align 1, !tbaa !9
  %30 = load i32, ptr %8, align 4, !tbaa !5
  %31 = mul nsw i32 %30, 3
  %32 = add nsw i32 %31, 2
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [768 x i8], ptr %6, i64 0, i64 %33
  store i8 0, ptr %34, align 1, !tbaa !9
  br label %35

35:                                               ; preds = %18
  %36 = load i32, ptr %8, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %8, align 4, !tbaa !5
  br label %14, !llvm.loop !10

38:                                               ; preds = %17
  %39 = getelementptr inbounds [768 x i8], ptr %6, i64 0, i64 0
  store i8 0, ptr %39, align 16, !tbaa !9
  %40 = getelementptr inbounds [768 x i8], ptr %6, i64 0, i64 1
  store i8 0, ptr %40, align 1, !tbaa !9
  %41 = getelementptr inbounds [768 x i8], ptr %6, i64 0, i64 2
  store i8 -1, ptr %41, align 2, !tbaa !9
  %42 = getelementptr inbounds [768 x i8], ptr %6, i64 0, i64 765
  store i8 0, ptr %42, align 1, !tbaa !9
  %43 = getelementptr inbounds [768 x i8], ptr %6, i64 0, i64 766
  store i8 -1, ptr %43, align 2, !tbaa !9
  %44 = getelementptr inbounds [768 x i8], ptr %6, i64 0, i64 767
  store i8 0, ptr %44, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #6
  store i16 256, ptr %9, align 2, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 256, ptr %10, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 48, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 32, i1 false)
  %45 = getelementptr inbounds %struct.st_gifconfig, ptr %3, i32 0, i32 2
  store i32 2, ptr %45, align 8, !tbaa !14
  %46 = getelementptr inbounds %struct.st_gifconfig, ptr %3, i32 0, i32 4
  store i16 256, ptr %46, align 8, !tbaa !17
  %47 = getelementptr inbounds %struct.st_gifconfig, ptr %3, i32 0, i32 5
  store i16 16, ptr %47, align 2, !tbaa !18
  %48 = getelementptr inbounds [768 x i8], ptr %6, i64 0, i64 0
  %49 = getelementptr inbounds %struct.st_gifconfig, ptr %3, i32 0, i32 0
  store ptr %48, ptr %49, align 8, !tbaa !19
  %50 = load i16, ptr %9, align 2, !tbaa !12
  %51 = getelementptr inbounds %struct.st_gifconfig, ptr %3, i32 0, i32 6
  store i16 %50, ptr %51, align 4, !tbaa !20
  %52 = getelementptr inbounds %struct.st_gifconfig, ptr %3, i32 0, i32 1
  store ptr @.str, ptr %52, align 8, !tbaa !21
  %53 = call ptr @cgif_newgif(ptr noundef %3)
  store ptr %53, ptr %2, align 8, !tbaa !22
  %54 = load ptr, ptr %2, align 8, !tbaa !22
  %55 = icmp eq ptr %54, null
  br i1 %55, label %56, label %59

56:                                               ; preds = %38
  %57 = load ptr, ptr @stderr, align 8, !tbaa !22
  %58 = call i32 @fputs(ptr noundef @.str.1, ptr noundef %57)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %11, align 4
  br label %110

59:                                               ; preds = %38
  %60 = call noalias ptr @malloc(i64 noundef 4096) #7
  store ptr %60, ptr %5, align 8, !tbaa !22
  %61 = getelementptr inbounds %struct.st_frameconfig, ptr %4, i32 0, i32 3
  store i32 3, ptr %61, align 4, !tbaa !23
  %62 = load ptr, ptr %5, align 8, !tbaa !22
  %63 = getelementptr inbounds %struct.st_frameconfig, ptr %4, i32 0, i32 1
  store ptr %62, ptr %63, align 8, !tbaa !25
  %64 = getelementptr inbounds %struct.st_frameconfig, ptr %4, i32 0, i32 4
  store i16 5, ptr %64, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %95, %59
  %66 = load i32, ptr %12, align 4, !tbaa !5
  %67 = load i32, ptr %10, align 4, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 5, ptr %11, align 4
  br label %98

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %85, %70
  %72 = load i32, ptr %13, align 4, !tbaa !5
  %73 = icmp slt i32 %72, 4096
  br i1 %73, label %75, label %74

74:                                               ; preds = %71
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %88

75:                                               ; preds = %71
  %76 = load i32, ptr %13, align 4, !tbaa !5
  %77 = load i32, ptr %12, align 4, !tbaa !5
  %78 = add nsw i32 %76, %77
  %79 = srem i32 %78, 256
  %80 = trunc i32 %79 to i8
  %81 = load ptr, ptr %5, align 8, !tbaa !22
  %82 = load i32, ptr %13, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i8, ptr %81, i64 %83
  store i8 %80, ptr %84, align 1, !tbaa !9
  br label %85

85:                                               ; preds = %75
  %86 = load i32, ptr %13, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %13, align 4, !tbaa !5
  br label %71, !llvm.loop !27

88:                                               ; preds = %74
  %89 = load ptr, ptr %2, align 8, !tbaa !22
  %90 = call i32 @cgif_addframe(ptr noundef %89, ptr noundef %4)
  store i32 %90, ptr %7, align 4, !tbaa !5
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %94

93:                                               ; preds = %88
  store i32 5, ptr %11, align 4
  br label %98

94:                                               ; preds = %88
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %12, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %12, align 4, !tbaa !5
  br label %65, !llvm.loop !28

98:                                               ; preds = %93, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %99

99:                                               ; preds = %98
  %100 = load ptr, ptr %5, align 8, !tbaa !22
  call void @free(ptr noundef %100) #6
  %101 = load ptr, ptr %2, align 8, !tbaa !22
  %102 = call i32 @cgif_close(ptr noundef %101)
  store i32 %102, ptr %7, align 4, !tbaa !5
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %109

105:                                              ; preds = %99
  %106 = load ptr, ptr @stderr, align 8, !tbaa !22
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef @.str.2, i32 noundef %107) #6
  store i32 2, ptr %1, align 4
  store i32 1, ptr %11, align 4
  br label %110

109:                                              ; preds = %99
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  br label %110

110:                                              ; preds = %109, %105, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 768, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %111 = load i32, ptr %1, align 4
  ret i32 %111
}

; 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

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

declare ptr @cgif_newgif(ptr noundef) #3

declare i32 @fputs(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

declare i32 @cgif_addframe(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

declare i32 @cgif_close(ptr noundef) #3

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #5

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

!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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!15, !6, i64 16}
!15 = !{!"st_gifconfig", !16, i64 0, !16, i64 8, !6, i64 16, !6, i64 20, !13, i64 24, !13, i64 26, !13, i64 28, !13, i64 30, !16, i64 32, !16, i64 40}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!15, !13, i64 24}
!18 = !{!15, !13, i64 26}
!19 = !{!15, !16, i64 0}
!20 = !{!15, !13, i64 28}
!21 = !{!15, !16, i64 8}
!22 = !{!16, !16, i64 0}
!23 = !{!24, !6, i64 20}
!24 = !{!"st_frameconfig", !16, i64 0, !16, i64 8, !6, i64 16, !6, i64 20, !13, i64 24, !13, i64 26, !7, i64 28}
!25 = !{!24, !16, i64 8}
!26 = !{!24, !13, i64 24}
!27 = distinct !{!27, !11}
!28 = distinct !{!28, !11}


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

@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [44 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 3) i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.st_gifconfig, align 8
  %2 = alloca %struct.st_frameconfig, align 8
  %3 = alloca [768 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 768, ptr nonnull %3) #7
  br label %18

4:                                                ; preds = %18
  store i8 0, ptr %3, align 16, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %3, i64 1
  store i8 0, ptr %5, align 1, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %3, i64 2
  store i8 -1, ptr %6, align 2, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %3, i64 765
  store i8 0, ptr %7, align 1, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %3, i64 766
  store i8 -1, ptr %8, align 2, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %3, i64 767
  store i8 0, ptr %9, align 1, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %1, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %10, i8 0, i64 32, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %2, i8 0, i64 32, i1 false)
  %11 = getelementptr inbounds i8, ptr %1, i64 16
  store i32 2, ptr %11, align 8, !tbaa !8
  %12 = getelementptr inbounds i8, ptr %1, i64 24
  store i16 256, ptr %12, align 8, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %1, i64 26
  store i16 16, ptr %13, align 2, !tbaa !14
  store ptr %3, ptr %1, align 8, !tbaa !15
  %14 = getelementptr inbounds i8, ptr %1, i64 28
  store i16 256, ptr %14, align 4, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr @.str, ptr %15, align 8, !tbaa !17
  %16 = call ptr @cgif_newgif(ptr noundef nonnull %1) #7
  %17 = icmp eq ptr %16, null
  br i1 %17, label %33, label %36

18:                                               ; preds = %18, %0
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next.1, %18 ]
  %19 = trunc i64 %indvars.iv to i8
  %20 = mul nuw nsw i64 %indvars.iv, 3
  %21 = getelementptr inbounds [768 x i8], ptr %3, i64 0, i64 %20
  store i8 %19, ptr %21, align 2, !tbaa !5
  %22 = or disjoint i64 %20, 1
  %23 = getelementptr inbounds [768 x i8], ptr %3, i64 0, i64 %22
  store i8 0, ptr %23, align 1, !tbaa !5
  %24 = add nuw nsw i64 %20, 2
  %25 = getelementptr inbounds [768 x i8], ptr %3, i64 0, i64 %24
  store i8 0, ptr %25, align 2, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %26 = trunc i64 %indvars.iv.next to i8
  %27 = mul nuw nsw i64 %indvars.iv.next, 3
  %28 = getelementptr inbounds [768 x i8], ptr %3, i64 0, i64 %27
  store i8 %26, ptr %28, align 1, !tbaa !5
  %29 = add nuw nsw i64 %27, 1
  %30 = getelementptr inbounds [768 x i8], ptr %3, i64 0, i64 %29
  store i8 0, ptr %30, align 2, !tbaa !5
  %31 = add nuw nsw i64 %27, 2
  %32 = getelementptr inbounds [768 x i8], ptr %3, i64 0, i64 %31
  store i8 0, ptr %32, align 1, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 256
  br i1 %exitcond.not.1, label %4, label %18, !llvm.loop !18

33:                                               ; preds = %4
  %34 = load ptr, ptr @stderr, align 8, !tbaa !20
  %35 = call i32 @fputs(ptr noundef nonnull @.str.1, ptr noundef %34) #8
  br label %51

36:                                               ; preds = %4
  %37 = call noalias dereferenceable_or_null(4096) ptr @malloc(i64 noundef 4096) #9
  %38 = getelementptr inbounds i8, ptr %2, i64 20
  store i32 3, ptr %38, align 4, !tbaa !21
  %39 = getelementptr inbounds i8, ptr %2, i64 8
  store ptr %37, ptr %39, align 8, !tbaa !23
  %40 = getelementptr inbounds i8, ptr %2, i64 24
  store i16 5, ptr %40, align 8, !tbaa !24
  br label %vector.ph

vector.ph:                                        ; preds = %36, %middle.block
  %indvars.iv38 = phi i64 [ 0, %36 ], [ %indvars.iv.next39, %middle.block ]
  %broadcast.splatinsert = insertelement <16 x i64> poison, i64 %indvars.iv38, i64 0
  %broadcast.splat = shufflevector <16 x i64> %broadcast.splatinsert, <16 x i64> poison, <16 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <16 x i64> [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %41 = add nuw nsw <16 x i64> %vec.ind, %broadcast.splat
  %42 = trunc <16 x i64> %41 to <16 x i8>
  %43 = getelementptr inbounds i8, ptr %37, i64 %index
  store <16 x i8> %42, ptr %43, align 1, !tbaa !5
  %index.next = add nuw i64 %index, 16
  %vec.ind.next = add <16 x i64> %vec.ind, <i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16>
  %44 = icmp eq i64 %index.next, 4096
  br i1 %44, label %middle.block, label %vector.body, !llvm.loop !25

middle.block:                                     ; preds = %vector.body
  %45 = call i32 @cgif_addframe(ptr noundef nonnull %16, ptr noundef nonnull %2) #7
  %.not = icmp ne i32 %45, 0
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %exitcond41.not = icmp eq i64 %indvars.iv.next39, 256
  %or.cond = select i1 %.not, i1 true, i1 %exitcond41.not
  br i1 %or.cond, label %46, label %vector.ph, !llvm.loop !28

46:                                               ; preds = %middle.block
  call void @free(ptr noundef nonnull %37) #7
  %47 = call i32 @cgif_close(ptr noundef nonnull %16) #7
  %.not29 = icmp eq i32 %47, 0
  br i1 %.not29, label %51, label %48

48:                                               ; preds = %46
  %49 = load ptr, ptr @stderr, align 8, !tbaa !20
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str.2, i32 noundef %47) #10
  br label %51

51:                                               ; preds = %46, %48, %33
  %.025 = phi i32 [ 1, %33 ], [ 2, %48 ], [ 0, %46 ]
  call void @llvm.lifetime.end.p0(i64 768, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #7
  ret i32 %.025
}

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

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

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

declare ptr @cgif_newgif(ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fputs(ptr nocapture noundef readonly, ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5

declare i32 @cgif_addframe(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

declare i32 @cgif_close(ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #7 = { nounwind }
attributes #8 = { cold }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { cold 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !11, i64 16}
!9 = !{!"st_gifconfig", !10, i64 0, !10, i64 8, !11, i64 16, !11, i64 20, !12, i64 24, !12, i64 26, !12, i64 28, !12, i64 30, !10, i64 32, !10, i64 40}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = !{!"short", !6, i64 0}
!13 = !{!9, !12, i64 24}
!14 = !{!9, !12, i64 26}
!15 = !{!9, !10, i64 0}
!16 = !{!9, !12, i64 28}
!17 = !{!9, !10, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!10, !10, i64 0}
!21 = !{!22, !11, i64 20}
!22 = !{!"st_frameconfig", !10, i64 0, !10, i64 8, !11, i64 16, !11, i64 20, !12, i64 24, !12, i64 26, !6, i64 28}
!23 = !{!22, !10, i64 8}
!24 = !{!22, !12, i64 24}
!25 = distinct !{!25, !19, !26, !27}
!26 = !{!"llvm.loop.isvectorized", i32 1}
!27 = !{!"llvm.loop.unroll.runtime.disable"}
!28 = distinct !{!28, !19}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass