; LLVM IR from ponylang/ponyc :: src/libponyc/pkg (buildflagset)

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

@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@_os_flags = external hidden global [9 x ptr], align 16
@_arch_flags = external hidden global [4 x ptr], align 16
@_size_flags = external hidden global [5 x ptr], align 16
@_endian_flags = external hidden global [4 x ptr], align 16
@__func__.buildflagset_print = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [25 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @flagtab_next(ptr noundef, ptr noundef) #1

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #2

declare noalias ptr @ponyint_pool_alloc_size(i64 noundef) #2

declare void @ponyint_pool_free_size(i64 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local ptr @buildflagset_print(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = icmp ne ptr %7, null
  br i1 %8, label %9, label %10

9:                                                ; preds = %1
  br label %11

10:                                               ; preds = %1
  call void @ponyint_assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i64 noundef 528, ptr noundef @__func__.buildflagset_print)
  br label %11

11:                                               ; preds = %10, %9
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.buildflagset_t, ptr %12, i32 0, i32 6
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %11
  br label %18

17:                                               ; preds = %11
  call void @ponyint_assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i64 noundef 529, ptr noundef @__func__.buildflagset_print)
  br label %18

18:                                               ; preds = %17, %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.buildflagset_t, ptr %19, i32 0, i32 11
  %21 = load ptr, ptr %20, align 8, !tbaa !14
  store ptr %21, ptr %3, align 8, !tbaa !5
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.buildflagset_t, ptr %22, i32 0, i32 0
  %24 = load i8, ptr %23, align 8, !tbaa !15, !range !16, !noundef !17
  %25 = trunc i8 %24 to i1
  br i1 %25, label %26, label %34

26:                                               ; preds = %18
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.buildflagset_t, ptr %27, i32 0, i32 7
  %29 = load i32, ptr %28, align 8, !tbaa !18
  %30 = zext i32 %29 to i64
  %31 = getelementptr inbounds [9 x ptr], ptr @_os_flags, i64 0, i64 %30
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  call void @print_flag(ptr noundef %32, i1 noundef zeroext true, ptr noundef %33, ptr noundef %3)
  br label %34

34:                                               ; preds = %26, %18
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.buildflagset_t, ptr %35, i32 0, i32 1
  %37 = load i8, ptr %36, align 1, !tbaa !19, !range !16, !noundef !17
  %38 = trunc i8 %37 to i1
  br i1 %38, label %39, label %47

39:                                               ; preds = %34
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.buildflagset_t, ptr %40, i32 0, i32 8
  %42 = load i32, ptr %41, align 4, !tbaa !20
  %43 = zext i32 %42 to i64
  %44 = getelementptr inbounds [4 x ptr], ptr @_arch_flags, i64 0, i64 %43
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  call void @print_flag(ptr noundef %45, i1 noundef zeroext true, ptr noundef %46, ptr noundef %3)
  br label %47

47:                                               ; preds = %39, %34
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.buildflagset_t, ptr %48, i32 0, i32 2
  %50 = load i8, ptr %49, align 2, !tbaa !21, !range !16, !noundef !17
  %51 = trunc i8 %50 to i1
  br i1 %51, label %52, label %60

52:                                               ; preds = %47
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.buildflagset_t, ptr %53, i32 0, i32 9
  %55 = load i32, ptr %54, align 8, !tbaa !22
  %56 = zext i32 %55 to i64
  %57 = getelementptr inbounds [5 x ptr], ptr @_size_flags, i64 0, i64 %56
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  call void @print_flag(ptr noundef %58, i1 noundef zeroext true, ptr noundef %59, ptr noundef %3)
  br label %60

60:                                               ; preds = %52, %47
  %61 = load ptr, ptr %2, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.buildflagset_t, ptr %61, i32 0, i32 3
  %63 = load i8, ptr %62, align 1, !tbaa !23, !range !16, !noundef !17
  %64 = trunc i8 %63 to i1
  br i1 %64, label %65, label %73

65:                                               ; preds = %60
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.buildflagset_t, ptr %66, i32 0, i32 10
  %68 = load i32, ptr %67, align 4, !tbaa !24
  %69 = zext i32 %68 to i64
  %70 = getelementptr inbounds [4 x ptr], ptr @_endian_flags, i64 0, i64 %69
  %71 = load ptr, ptr %70, align 8, !tbaa !5
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  call void @print_flag(ptr noundef %71, i1 noundef zeroext true, ptr noundef %72, ptr noundef %3)
  br label %73

73:                                               ; preds = %65, %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  store i64 -1, ptr %4, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  br label %74

74:                                               ; preds = %80, %73
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.buildflagset_t, ptr %75, i32 0, i32 6
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = call ptr @flagtab_next(ptr noundef %77, ptr noundef %4)
  store ptr %78, ptr %5, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %89

80:                                               ; preds = %74
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.flag_t, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !26
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.flag_t, ptr %84, i32 0, i32 1
  %86 = load i8, ptr %85, align 8, !tbaa !28, !range !16, !noundef !17
  %87 = trunc i8 %86 to i1
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  call void @print_flag(ptr noundef %83, i1 noundef zeroext %87, ptr noundef %88, ptr noundef %3)
  br label %74, !llvm.loop !29

89:                                               ; preds = %74
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = load ptr, ptr %2, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.buildflagset_t, ptr %91, i32 0, i32 11
  %93 = load ptr, ptr %92, align 8, !tbaa !14
  %94 = icmp eq ptr %90, %93
  br i1 %94, label %95, label %97

95:                                               ; preds = %89
  %96 = load ptr, ptr %2, align 8, !tbaa !5
  call void @print_str(ptr noundef @.str.8, ptr noundef %96, ptr noundef %3)
  br label %97

97:                                               ; preds = %95, %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.buildflagset_t, ptr %99, i32 0, i32 11
  %101 = load ptr, ptr %100, align 8, !tbaa !14
  %102 = ptrtoint ptr %98 to i64
  %103 = ptrtoint ptr %101 to i64
  %104 = sub i64 %102, %103
  %105 = add nsw i64 %104, 1
  store i64 %105, ptr %6, align 8, !tbaa !25
  %106 = load i64, ptr %6, align 8, !tbaa !25
  %107 = load ptr, ptr %2, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.buildflagset_t, ptr %107, i32 0, i32 12
  %109 = load i64, ptr %108, align 8, !tbaa !31
  %110 = icmp ugt i64 %106, %109
  br i1 %110, label %111, label %137

111:                                              ; preds = %97
  %112 = load ptr, ptr %2, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.buildflagset_t, ptr %112, i32 0, i32 12
  %114 = load i64, ptr %113, align 8, !tbaa !31
  %115 = icmp ugt i64 %114, 0
  br i1 %115, label %116, label %123

116:                                              ; preds = %111
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.buildflagset_t, ptr %117, i32 0, i32 12
  %119 = load i64, ptr %118, align 8, !tbaa !31
  %120 = load ptr, ptr %2, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.buildflagset_t, ptr %120, i32 0, i32 11
  %122 = load ptr, ptr %121, align 8, !tbaa !14
  call void @ponyint_pool_free_size(i64 noundef %119, ptr noundef %122)
  br label %123

123:                                              ; preds = %116, %111
  %124 = load i64, ptr %6, align 8, !tbaa !25
  %125 = call noalias ptr @ponyint_pool_alloc_size(i64 noundef %124)
  %126 = load ptr, ptr %2, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.buildflagset_t, ptr %126, i32 0, i32 11
  store ptr %125, ptr %127, align 8, !tbaa !14
  %128 = load i64, ptr %6, align 8, !tbaa !25
  %129 = load ptr, ptr %2, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.buildflagset_t, ptr %129, i32 0, i32 12
  store i64 %128, ptr %130, align 8, !tbaa !31
  %131 = load ptr, ptr %2, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.buildflagset_t, ptr %131, i32 0, i32 11
  %133 = load ptr, ptr %132, align 8, !tbaa !14
  %134 = getelementptr inbounds i8, ptr %133, i64 0
  store i8 0, ptr %134, align 1, !tbaa !32
  %135 = load ptr, ptr %2, align 8, !tbaa !5
  %136 = call ptr @buildflagset_print(ptr noundef %135)
  br label %137

137:                                              ; preds = %123, %97
  %138 = load ptr, ptr %2, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.buildflagset_t, ptr %138, i32 0, i32 11
  %140 = load ptr, ptr %139, align 8, !tbaa !14
  %141 = icmp ne ptr %140, null
  br i1 %141, label %142, label %143

142:                                              ; preds = %137
  br label %144

143:                                              ; preds = %137
  call void @ponyint_assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i64 noundef 572, ptr noundef @__func__.buildflagset_print)
  br label %144

144:                                              ; preds = %143, %142
  %145 = load ptr, ptr %2, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.buildflagset_t, ptr %145, i32 0, i32 11
  %147 = load ptr, ptr %146, align 8, !tbaa !14
  %148 = load i64, ptr %6, align 8, !tbaa !25
  %149 = sub i64 %148, 1
  %150 = getelementptr inbounds i8, ptr %147, i64 %149
  store i8 0, ptr %150, align 1, !tbaa !32
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.buildflagset_t, ptr %151, i32 0, i32 11
  %153 = load ptr, ptr %152, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret ptr %153
}

; Function Attrs: nounwind uwtable
declare hidden void @print_flag(ptr noundef, i1 noundef zeroext, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @print_str(ptr noundef, ptr noundef, ptr noundef) #1

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

!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, !6, i64 8}
!10 = !{!"buildflagset_t", !11, i64 0, !11, i64 1, !11, i64 2, !11, i64 3, !11, i64 4, !11, i64 5, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !6, i64 32, !13, i64 40}
!11 = !{!"_Bool", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !6, i64 32}
!15 = !{!10, !11, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!10, !12, i64 16}
!19 = !{!10, !11, i64 1}
!20 = !{!10, !12, i64 20}
!21 = !{!10, !11, i64 2}
!22 = !{!10, !12, i64 24}
!23 = !{!10, !11, i64 3}
!24 = !{!10, !12, i64 28}
!25 = !{!13, !13, i64 0}
!26 = !{!27, !6, i64 0}
!27 = !{!"flag_t", !6, i64 0, !11, i64 8}
!28 = !{!27, !11, i64 8}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!10, !13, i64 40}
!32 = !{!7, !7, i64 0}


; 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.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@_os_flags = external hidden local_unnamed_addr global [9 x ptr], align 16
@_arch_flags = external hidden local_unnamed_addr global [4 x ptr], align 16
@_size_flags = external hidden local_unnamed_addr global [5 x ptr], align 16
@_endian_flags = external hidden local_unnamed_addr global [4 x ptr], align 16
@__func__.buildflagset_print = external hidden unnamed_addr constant [19 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [25 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @flagtab_next(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare noalias ptr @ponyint_pool_alloc_size(i64 noundef) local_unnamed_addr #2

declare void @ponyint_pool_free_size(i64 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local ptr @buildflagset_print(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %5

4:                                                ; preds = %1
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i64 noundef 528, ptr noundef nonnull @__func__.buildflagset_print) #3
  br label %5

5:                                                ; preds = %1, %4
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %.not38 = icmp eq ptr %7, null
  br i1 %.not38, label %8, label %9

8:                                                ; preds = %5
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i64 noundef 529, ptr noundef nonnull @__func__.buildflagset_print) #3
  br label %9

9:                                                ; preds = %5, %8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  %10 = getelementptr inbounds i8, ptr %0, i64 32
  %11 = load ptr, ptr %10, align 8, !tbaa !13
  store ptr %11, ptr %2, align 8, !tbaa !14
  %12 = load i8, ptr %0, align 8, !tbaa !15, !range !16, !noundef !17
  %13 = trunc nuw i8 %12 to i1
  br i1 %13, label %14, label %20

14:                                               ; preds = %9
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load i32, ptr %15, align 8, !tbaa !18
  %17 = zext i32 %16 to i64
  %18 = getelementptr inbounds [9 x ptr], ptr @_os_flags, i64 0, i64 %17
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  call void @print_flag(ptr noundef %19, i1 noundef zeroext true, ptr noundef nonnull %0, ptr noundef nonnull %2)
  br label %20

20:                                               ; preds = %14, %9
  %21 = getelementptr inbounds i8, ptr %0, i64 1
  %22 = load i8, ptr %21, align 1, !tbaa !19, !range !16, !noundef !17
  %23 = trunc nuw i8 %22 to i1
  br i1 %23, label %24, label %30

24:                                               ; preds = %20
  %25 = getelementptr inbounds i8, ptr %0, i64 20
  %26 = load i32, ptr %25, align 4, !tbaa !20
  %27 = zext i32 %26 to i64
  %28 = getelementptr inbounds [4 x ptr], ptr @_arch_flags, i64 0, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  call void @print_flag(ptr noundef %29, i1 noundef zeroext true, ptr noundef nonnull %0, ptr noundef nonnull %2)
  br label %30

30:                                               ; preds = %24, %20
  %31 = getelementptr inbounds i8, ptr %0, i64 2
  %32 = load i8, ptr %31, align 2, !tbaa !21, !range !16, !noundef !17
  %33 = trunc nuw i8 %32 to i1
  br i1 %33, label %34, label %40

34:                                               ; preds = %30
  %35 = getelementptr inbounds i8, ptr %0, i64 24
  %36 = load i32, ptr %35, align 8, !tbaa !22
  %37 = zext i32 %36 to i64
  %38 = getelementptr inbounds [5 x ptr], ptr @_size_flags, i64 0, i64 %37
  %39 = load ptr, ptr %38, align 8, !tbaa !14
  call void @print_flag(ptr noundef %39, i1 noundef zeroext true, ptr noundef nonnull %0, ptr noundef nonnull %2)
  br label %40

40:                                               ; preds = %34, %30
  %41 = getelementptr inbounds i8, ptr %0, i64 3
  %42 = load i8, ptr %41, align 1, !tbaa !23, !range !16, !noundef !17
  %43 = trunc nuw i8 %42 to i1
  br i1 %43, label %44, label %50

44:                                               ; preds = %40
  %45 = getelementptr inbounds i8, ptr %0, i64 28
  %46 = load i32, ptr %45, align 4, !tbaa !24
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds [4 x ptr], ptr @_endian_flags, i64 0, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !14
  call void @print_flag(ptr noundef %49, i1 noundef zeroext true, ptr noundef nonnull %0, ptr noundef nonnull %2)
  br label %50

50:                                               ; preds = %44, %40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  store i64 -1, ptr %3, align 8, !tbaa !25
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = call ptr @flagtab_next(ptr noundef %51, ptr noundef nonnull %3)
  %.not3942 = icmp eq ptr %52, null
  br i1 %.not3942, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %50, %.lr.ph
  %53 = phi ptr [ %59, %.lr.ph ], [ %52, %50 ]
  %54 = load ptr, ptr %53, align 8, !tbaa !26
  %55 = getelementptr inbounds i8, ptr %53, i64 8
  %56 = load i8, ptr %55, align 8, !tbaa !28, !range !16, !noundef !17
  %57 = trunc nuw i8 %56 to i1
  call void @print_flag(ptr noundef %54, i1 noundef zeroext %57, ptr noundef nonnull %0, ptr noundef nonnull %2)
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = call ptr @flagtab_next(ptr noundef %58, ptr noundef nonnull %3)
  %.not39 = icmp eq ptr %59, null
  br i1 %.not39, label %._crit_edge, label %.lr.ph, !llvm.loop !29

._crit_edge:                                      ; preds = %.lr.ph, %50
  %60 = load ptr, ptr %2, align 8, !tbaa !14
  %61 = load ptr, ptr %10, align 8, !tbaa !13
  %62 = icmp eq ptr %60, %61
  br i1 %62, label %63, label %64

63:                                               ; preds = %._crit_edge
  call void @print_str(ptr noundef nonnull @.str.8, ptr noundef nonnull %0, ptr noundef nonnull %2)
  %.pre = load ptr, ptr %2, align 8, !tbaa !14
  %.pre43 = load ptr, ptr %10, align 8, !tbaa !13
  br label %64

64:                                               ; preds = %63, %._crit_edge
  %65 = phi ptr [ %.pre43, %63 ], [ %61, %._crit_edge ]
  %66 = phi ptr [ %.pre, %63 ], [ %60, %._crit_edge ]
  %67 = ptrtoint ptr %66 to i64
  %68 = ptrtoint ptr %65 to i64
  %69 = sub i64 %67, %68
  %70 = add nsw i64 %69, 1
  %71 = getelementptr inbounds i8, ptr %0, i64 40
  %72 = load i64, ptr %71, align 8, !tbaa !31
  %73 = icmp ugt i64 %70, %72
  br i1 %73, label %74, label %79

74:                                               ; preds = %64
  %.not40 = icmp eq i64 %72, 0
  br i1 %.not40, label %76, label %75

75:                                               ; preds = %74
  call void @ponyint_pool_free_size(i64 noundef %72, ptr noundef %65) #3
  br label %76

76:                                               ; preds = %75, %74
  %77 = call noalias ptr @ponyint_pool_alloc_size(i64 noundef %70) #3
  store ptr %77, ptr %10, align 8, !tbaa !13
  store i64 %70, ptr %71, align 8, !tbaa !31
  store i8 0, ptr %77, align 1, !tbaa !32
  %78 = call ptr @buildflagset_print(ptr noundef nonnull %0)
  %.pre44 = load ptr, ptr %10, align 8, !tbaa !13
  br label %79

79:                                               ; preds = %76, %64
  %80 = phi ptr [ %.pre44, %76 ], [ %65, %64 ]
  %.not41 = icmp eq ptr %80, null
  br i1 %.not41, label %81, label %82

81:                                               ; preds = %79
  call void @ponyint_assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i64 noundef 572, ptr noundef nonnull @__func__.buildflagset_print) #3
  %.pre45 = load ptr, ptr %10, align 8, !tbaa !13
  br label %82

82:                                               ; preds = %79, %81
  %83 = phi ptr [ %80, %79 ], [ %.pre45, %81 ]
  %84 = getelementptr inbounds i8, ptr %83, i64 %69
  store i8 0, ptr %84, align 1, !tbaa !32
  %85 = load ptr, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret ptr %85
}

; Function Attrs: nounwind uwtable
declare hidden void @print_flag(ptr noundef, i1 noundef zeroext, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @print_str(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

!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, !10, i64 8}
!6 = !{!"buildflagset_t", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !10, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !10, i64 32, !12, i64 40}
!7 = !{!"_Bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!6, !10, i64 32}
!14 = !{!10, !10, i64 0}
!15 = !{!6, !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!6, !11, i64 16}
!19 = !{!6, !7, i64 1}
!20 = !{!6, !11, i64 20}
!21 = !{!6, !7, i64 2}
!22 = !{!6, !11, i64 24}
!23 = !{!6, !7, i64 3}
!24 = !{!6, !11, i64 28}
!25 = !{!12, !12, i64 0}
!26 = !{!27, !10, i64 0}
!27 = !{!"flag_t", !10, i64 0, !7, i64 8}
!28 = !{!27, !7, i64 8}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!6, !12, i64 40}
!32 = !{!8, !8, i64 0}


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