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

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

@__const.main.aPalette = external hidden unnamed_addr constant [9 x i8], align 1
@__const.main.aPalette_local = external hidden unnamed_addr constant [9 x i8], align 1
@.str = external hidden unnamed_addr constant [39 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 i32, align 4
  %7 = alloca [9 x i8], align 1
  %8 = alloca [9 x i8], align 1
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %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) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 9, ptr %7) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %7, ptr align 1 @__const.main.aPalette, i64 9, i1 false)
  call void @llvm.lifetime.start.p0(i64 9, ptr %8) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %8, ptr align 1 @__const.main.aPalette_local, i64 9, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #7
  store i8 3, ptr %10, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #7
  store i8 3, ptr %11, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 10, ptr %12, align 4, !tbaa !8
  %14 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 0
  %15 = load i8, ptr %10, align 1, !tbaa !5
  %16 = zext i8 %15 to i16
  call void @initGIFConfig(ptr noundef %3, ptr noundef @.str, i16 noundef zeroext 40, i16 noundef zeroext 40, ptr noundef %14, i16 noundef zeroext %16)
  %17 = call ptr @cgif_newgif(ptr noundef %3)
  store ptr %17, ptr %2, align 8, !tbaa !10
  %18 = load ptr, ptr %2, align 8, !tbaa !10
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %23

20:                                               ; preds = %0
  %21 = load ptr, ptr @stderr, align 8, !tbaa !10
  %22 = call i32 @fputs(ptr noundef @.str.1, ptr noundef %21)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %13, align 4
  br label %124

23:                                               ; preds = %0
  %24 = call noalias ptr @malloc(i64 noundef 1600) #8
  store ptr %24, ptr %5, align 8, !tbaa !10
  %25 = load ptr, ptr %5, align 8, !tbaa !10
  call void @llvm.memset.p0.i64(ptr align 1 %25, i8 0, i64 1600, i1 false)
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %26

26:                                               ; preds = %44, %23
  %27 = load i32, ptr %6, align 4, !tbaa !8
  %28 = load i32, ptr %12, align 4, !tbaa !8
  %29 = sub nsw i32 %28, 2
  %30 = icmp slt i32 %27, %29
  br i1 %30, label %31, label %47

31:                                               ; preds = %26
  %32 = load ptr, ptr %5, align 8, !tbaa !10
  %33 = load i32, ptr %6, align 4, !tbaa !8
  %34 = add nsw i32 %33, 800
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i8, ptr %32, i64 %35
  store i8 1, ptr %36, align 1, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !10
  call void @initFrameConfig(ptr noundef %4, ptr noundef %37, i16 noundef zeroext 20)
  %38 = load ptr, ptr %2, align 8, !tbaa !10
  %39 = call i32 @cgif_addframe(ptr noundef %38, ptr noundef %4)
  store i32 %39, ptr %9, align 4, !tbaa !8
  %40 = load i32, ptr %9, align 4, !tbaa !8
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %31
  br label %47

43:                                               ; preds = %31
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %6, align 4, !tbaa !8
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %6, align 4, !tbaa !8
  br label %26, !llvm.loop !12

47:                                               ; preds = %42, %26
  %48 = load ptr, ptr %5, align 8, !tbaa !10
  %49 = load i32, ptr %6, align 4, !tbaa !8
  %50 = add nsw i32 800, %49
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i8, ptr %48, i64 %51
  store i8 2, ptr %52, align 1, !tbaa !5
  %53 = load ptr, ptr %5, align 8, !tbaa !10
  %54 = getelementptr inbounds %struct.st_frameconfig, ptr %4, i32 0, i32 1
  store ptr %53, ptr %54, align 8, !tbaa !14
  %55 = getelementptr inbounds [9 x i8], ptr %8, i64 0, i64 0
  %56 = getelementptr inbounds %struct.st_frameconfig, ptr %4, i32 0, i32 0
  store ptr %55, ptr %56, align 8, !tbaa !17
  %57 = load i8, ptr %11, align 1, !tbaa !5
  %58 = zext i8 %57 to i16
  %59 = getelementptr inbounds %struct.st_frameconfig, ptr %4, i32 0, i32 5
  store i16 %58, ptr %59, align 2, !tbaa !18
  %60 = getelementptr inbounds %struct.st_frameconfig, ptr %4, i32 0, i32 2
  store i32 1, ptr %60, align 8, !tbaa !19
  %61 = getelementptr inbounds %struct.st_frameconfig, ptr %4, i32 0, i32 4
  store i16 200, ptr %61, align 8, !tbaa !20
  %62 = load ptr, ptr %2, align 8, !tbaa !10
  %63 = call i32 @cgif_addframe(ptr noundef %62, ptr noundef %4)
  store i32 %63, ptr %9, align 4, !tbaa !8
  %64 = load ptr, ptr %5, align 8, !tbaa !10
  %65 = load i32, ptr %6, align 4, !tbaa !8
  %66 = add nsw i32 800, %65
  %67 = add nsw i32 %66, 2
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i8, ptr %64, i64 %68
  store i8 1, ptr %69, align 1, !tbaa !5
  %70 = load ptr, ptr %5, align 8, !tbaa !10
  %71 = load i32, ptr %6, align 4, !tbaa !8
  %72 = add nsw i32 800, %71
  %73 = add nsw i32 %72, 4
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %70, i64 %74
  store i8 1, ptr %75, align 1, !tbaa !5
  %76 = load ptr, ptr %5, align 8, !tbaa !10
  %77 = load i32, ptr %6, align 4, !tbaa !8
  %78 = add nsw i32 800, %77
  %79 = add nsw i32 %78, 6
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds i8, ptr %76, i64 %80
  store i8 1, ptr %81, align 1, !tbaa !5
  %82 = load ptr, ptr %5, align 8, !tbaa !10
  %83 = load i32, ptr %6, align 4, !tbaa !8
  %84 = add nsw i32 800, %83
  %85 = add nsw i32 %84, 8
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i8, ptr %82, i64 %86
  store i8 1, ptr %87, align 1, !tbaa !5
  %88 = load ptr, ptr %2, align 8, !tbaa !10
  %89 = call i32 @cgif_addframe(ptr noundef %88, ptr noundef %4)
  store i32 %89, ptr %9, align 4, !tbaa !8
  %90 = load ptr, ptr %5, align 8, !tbaa !10
  call void @llvm.memset.p0.i64(ptr align 1 %90, i8 0, i64 1600, i1 false)
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %91

91:                                               ; preds = %110, %47
  %92 = load i32, ptr %6, align 4, !tbaa !8
  %93 = load i32, ptr %12, align 4, !tbaa !8
  %94 = sub nsw i32 %93, 2
  %95 = icmp slt i32 %92, %94
  br i1 %95, label %96, label %113

96:                                               ; preds = %91
  %97 = load ptr, ptr %5, align 8, !tbaa !10
  %98 = load i32, ptr %6, align 4, !tbaa !8
  %99 = mul nsw i32 2, %98
  %100 = add nsw i32 %99, 800
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i8, ptr %97, i64 %101
  store i8 2, ptr %102, align 1, !tbaa !5
  %103 = load ptr, ptr %5, align 8, !tbaa !10
  call void @initFrameConfig(ptr noundef %4, ptr noundef %103, i16 noundef zeroext 50)
  %104 = load ptr, ptr %2, align 8, !tbaa !10
  %105 = call i32 @cgif_addframe(ptr noundef %104, ptr noundef %4)
  store i32 %105, ptr %9, align 4, !tbaa !8
  %106 = load i32, ptr %9, align 4, !tbaa !8
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %109

108:                                              ; preds = %96
  br label %113

109:                                              ; preds = %96
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %6, align 4, !tbaa !8
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %6, align 4, !tbaa !8
  br label %91, !llvm.loop !21

113:                                              ; preds = %108, %91
  %114 = load ptr, ptr %5, align 8, !tbaa !10
  call void @free(ptr noundef %114) #7
  %115 = load ptr, ptr %2, align 8, !tbaa !10
  %116 = call i32 @cgif_close(ptr noundef %115)
  store i32 %116, ptr %9, align 4, !tbaa !8
  %117 = load i32, ptr %9, align 4, !tbaa !8
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %123

119:                                              ; preds = %113
  %120 = load ptr, ptr @stderr, align 8, !tbaa !10
  %121 = load i32, ptr %9, align 4, !tbaa !8
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef @.str.2, i32 noundef %121) #7
  store i32 2, ptr %1, align 4
  store i32 1, ptr %13, align 4
  br label %124

123:                                              ; preds = %113
  store i32 0, ptr %1, align 4
  store i32 1, ptr %13, align 4
  br label %124

124:                                              ; preds = %123, %119, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 9, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 9, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %125 = load i32, ptr %1, align 4
  ret i32 %125
}

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare hidden void @initGIFConfig(ptr noundef, ptr noundef, i16 noundef zeroext, i16 noundef zeroext, ptr noundef, i16 noundef zeroext) #0

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

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

; Function Attrs: nounwind uwtable
declare hidden void @initFrameConfig(ptr noundef, ptr noundef, i16 noundef zeroext) #0

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

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

declare i32 @cgif_close(ptr noundef) #3

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

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

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: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !11, i64 8}
!15 = !{!"st_frameconfig", !11, i64 0, !11, i64 8, !9, i64 16, !9, i64 20, !16, i64 24, !16, i64 26, !6, i64 28}
!16 = !{!"short", !6, i64 0}
!17 = !{!15, !11, i64 0}
!18 = !{!15, !16, i64 26}
!19 = !{!15, !9, i64 16}
!20 = !{!15, !16, i64 24}
!21 = distinct !{!21, !13}


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

@__const.main.aPalette = external hidden unnamed_addr constant [9 x i8], align 1
@__const.main.aPalette_local = external hidden unnamed_addr constant [9 x i8], align 1
@.str = external hidden unnamed_addr constant [39 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 [9 x i8], align 1
  %4 = alloca [9 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %3) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(9) %3, ptr noundef nonnull align 1 dereferenceable(9) @__const.main.aPalette, i64 9, i1 false)
  call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %4) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(9) %4, ptr noundef nonnull align 1 dereferenceable(9) @__const.main.aPalette_local, i64 9, i1 false)
  call void @initGIFConfig(ptr noundef nonnull %1, ptr noundef nonnull @.str, i16 noundef zeroext 40, i16 noundef zeroext 40, ptr noundef nonnull %3, i16 noundef zeroext 3)
  %5 = call ptr @cgif_newgif(ptr noundef nonnull %1) #8
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %10

7:                                                ; preds = %0
  %8 = load ptr, ptr @stderr, align 8, !tbaa !5
  %9 = call i32 @fputs(ptr noundef nonnull @.str.1, ptr noundef %8) #9
  br label %74

10:                                               ; preds = %0
  %calloc = call dereferenceable_or_null(1600) ptr @calloc(i64 1, i64 1600)
  %11 = getelementptr inbounds i8, ptr %calloc, i64 800
  store i8 1, ptr %11, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 20)
  %12 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %13, label %34

13:                                               ; preds = %10
  %14 = getelementptr inbounds i8, ptr %calloc, i64 801
  store i8 1, ptr %14, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 20)
  %15 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not.1 = icmp eq i32 %15, 0
  br i1 %.not.1, label %16, label %34

16:                                               ; preds = %13
  %17 = getelementptr inbounds i8, ptr %calloc, i64 802
  store i8 1, ptr %17, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 20)
  %18 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not.2 = icmp eq i32 %18, 0
  br i1 %.not.2, label %19, label %34

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %calloc, i64 803
  store i8 1, ptr %20, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 20)
  %21 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not.3 = icmp eq i32 %21, 0
  br i1 %.not.3, label %22, label %34

22:                                               ; preds = %19
  %23 = getelementptr inbounds i8, ptr %calloc, i64 804
  store i8 1, ptr %23, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 20)
  %24 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not.4 = icmp eq i32 %24, 0
  br i1 %.not.4, label %25, label %34

25:                                               ; preds = %22
  %26 = getelementptr inbounds i8, ptr %calloc, i64 805
  store i8 1, ptr %26, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 20)
  %27 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not.5 = icmp eq i32 %27, 0
  br i1 %.not.5, label %28, label %34

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %calloc, i64 806
  store i8 1, ptr %29, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 20)
  %30 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not.6 = icmp eq i32 %30, 0
  br i1 %.not.6, label %31, label %34

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %calloc, i64 807
  store i8 1, ptr %32, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 20)
  %33 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not.7 = icmp eq i32 %33, 0
  %spec.select = select i1 %.not.7, i64 8, i64 7
  br label %34

34:                                               ; preds = %31, %28, %25, %22, %19, %16, %13, %10
  %.038.lcssa = phi i64 [ 0, %10 ], [ 1, %13 ], [ 2, %16 ], [ 3, %19 ], [ 4, %22 ], [ 5, %25 ], [ 6, %28 ], [ %spec.select, %31 ]
  %35 = getelementptr inbounds i8, ptr %calloc, i64 %.038.lcssa
  %36 = getelementptr inbounds i8, ptr %35, i64 800
  store i8 2, ptr %36, align 1, !tbaa !9
  %37 = getelementptr inbounds i8, ptr %2, i64 8
  store ptr %calloc, ptr %37, align 8, !tbaa !10
  store ptr %4, ptr %2, align 8, !tbaa !14
  %38 = getelementptr inbounds i8, ptr %2, i64 26
  store i16 3, ptr %38, align 2, !tbaa !15
  %39 = getelementptr inbounds i8, ptr %2, i64 16
  store i32 1, ptr %39, align 8, !tbaa !16
  %40 = getelementptr inbounds i8, ptr %2, i64 24
  store i16 200, ptr %40, align 8, !tbaa !17
  %41 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %42 = getelementptr inbounds i8, ptr %35, i64 802
  store i8 1, ptr %42, align 1, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %35, i64 804
  store i8 1, ptr %43, align 1, !tbaa !9
  %44 = getelementptr inbounds i8, ptr %35, i64 806
  store i8 1, ptr %44, align 1, !tbaa !9
  %45 = getelementptr inbounds i8, ptr %35, i64 808
  store i8 1, ptr %45, align 1, !tbaa !9
  %46 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1600) %calloc, i8 0, i64 1600, i1 false)
  store i8 2, ptr %11, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 50)
  %47 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not41 = icmp eq i32 %47, 0
  br i1 %.not41, label %48, label %69

48:                                               ; preds = %34
  %49 = getelementptr inbounds i8, ptr %calloc, i64 802
  store i8 2, ptr %49, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 50)
  %50 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not41.1 = icmp eq i32 %50, 0
  br i1 %.not41.1, label %51, label %69

51:                                               ; preds = %48
  %52 = getelementptr inbounds i8, ptr %calloc, i64 804
  store i8 2, ptr %52, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 50)
  %53 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not41.2 = icmp eq i32 %53, 0
  br i1 %.not41.2, label %54, label %69

54:                                               ; preds = %51
  %55 = getelementptr inbounds i8, ptr %calloc, i64 806
  store i8 2, ptr %55, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 50)
  %56 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not41.3 = icmp eq i32 %56, 0
  br i1 %.not41.3, label %57, label %69

57:                                               ; preds = %54
  %58 = getelementptr inbounds i8, ptr %calloc, i64 808
  store i8 2, ptr %58, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 50)
  %59 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not41.4 = icmp eq i32 %59, 0
  br i1 %.not41.4, label %60, label %69

60:                                               ; preds = %57
  %61 = getelementptr inbounds i8, ptr %calloc, i64 810
  store i8 2, ptr %61, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 50)
  %62 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not41.5 = icmp eq i32 %62, 0
  br i1 %.not41.5, label %63, label %69

63:                                               ; preds = %60
  %64 = getelementptr inbounds i8, ptr %calloc, i64 812
  store i8 2, ptr %64, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 50)
  %65 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  %.not41.6 = icmp eq i32 %65, 0
  br i1 %.not41.6, label %66, label %69

66:                                               ; preds = %63
  %67 = getelementptr inbounds i8, ptr %calloc, i64 814
  store i8 2, ptr %67, align 1, !tbaa !9
  call void @initFrameConfig(ptr noundef nonnull %2, ptr noundef nonnull %calloc, i16 noundef zeroext 50)
  %68 = call i32 @cgif_addframe(ptr noundef nonnull %5, ptr noundef nonnull %2) #8
  br label %69

69:                                               ; preds = %66, %63, %60, %57, %54, %51, %48, %34
  call void @free(ptr noundef nonnull %calloc) #8
  %70 = call i32 @cgif_close(ptr noundef nonnull %5) #8
  %.not42 = icmp eq i32 %70, 0
  br i1 %.not42, label %74, label %71

71:                                               ; preds = %69
  %72 = load ptr, ptr @stderr, align 8, !tbaa !5
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.2, i32 noundef %70) #10
  br label %74

74:                                               ; preds = %69, %71, %7
  %.0 = phi i32 [ 1, %7 ], [ 2, %71 ], [ 0, %69 ]
  call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #8
  ret i32 %.0
}

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare hidden void @initGIFConfig(ptr noundef, ptr noundef, i16 noundef zeroext, i16 noundef zeroext, ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: nounwind uwtable
declare hidden void @initFrameConfig(ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

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

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

; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #7

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: readwrite) }
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 nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #8 = { nounwind }
attributes #9 = { cold }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 8}
!11 = !{!"st_frameconfig", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !13, i64 24, !13, i64 26, !7, i64 28}
!12 = !{!"int", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!11, !6, i64 0}
!15 = !{!11, !13, i64 26}
!16 = !{!11, !12, i64 16}
!17 = !{!11, !13, i64 24}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass