; LLVM IR from ponylang/ponyc :: src/libponyrt/mem (heap)

; 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.heap_t = type { [5 x ptr], [5 x ptr], ptr, [4 x ptr], i64, i64 }
%struct.chunk_t = type { ptr, %union.anon, ptr }
%union.anon = type { %struct.anon.0, [8 x i8] }
%struct.anon.0 = type { i64 }
%struct.anon = type { i32, i32, i32 }

@.str = external hidden unnamed_addr constant [94 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@__func__.ponyint_heap_alloc_small = external hidden unnamed_addr constant [25 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@sizeclass_init = external hidden constant [5 x i32], align 16

; 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

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

; Function Attrs: nounwind uwtable
define dso_local noalias ptr @ponyint_heap_alloc_small(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %14 = load i32, ptr %8, align 4, !tbaa !9
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %19, label %16

16:                                               ; preds = %4
  %17 = load i32, ptr %8, align 4, !tbaa !9
  %18 = icmp eq i32 %17, -1
  br i1 %18, label %19, label %20

19:                                               ; preds = %16, %4
  br label %21

20:                                               ; preds = %16
  call void @ponyint_assert_fail(ptr noundef @.str, ptr noundef @.str.1, i64 noundef 675, ptr noundef @__func__.ponyint_heap_alloc_small)
  br label %21

21:                                               ; preds = %20, %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.heap_t, ptr %22, i32 0, i32 0
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = zext i32 %24 to i64
  %26 = getelementptr inbounds [5 x ptr], ptr %23, i64 0, i64 %25
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  store ptr %27, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %87

30:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.chunk_t, ptr %31, i32 0, i32 1
  %33 = getelementptr inbounds %struct.anon, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !11
  store i32 %34, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %35 = load i32, ptr %11, align 4, !tbaa !9
  %36 = call i32 @__pony_ctz(i32 noundef %35)
  store i32 %36, ptr %12, align 4, !tbaa !9
  %37 = load i32, ptr %12, align 4, !tbaa !9
  %38 = shl i32 1, %37
  %39 = xor i32 %38, -1
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = and i32 %40, %39
  store i32 %41, ptr %11, align 4, !tbaa !9
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = call ptr @get_m(ptr noundef %42)
  %44 = load i32, ptr %12, align 4, !tbaa !9
  %45 = shl i32 %44, 5
  %46 = zext i32 %45 to i64
  %47 = getelementptr inbounds i8, ptr %43, i64 %46
  store ptr %47, ptr %10, align 8, !tbaa !5
  %48 = load i32, ptr %11, align 4, !tbaa !9
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.chunk_t, ptr %49, i32 0, i32 1
  %51 = getelementptr inbounds %struct.anon, ptr %50, i32 0, i32 0
  store i32 %48, ptr %51, align 8, !tbaa !11
  %52 = load i32, ptr %8, align 4, !tbaa !9
  %53 = load i32, ptr %12, align 4, !tbaa !9
  %54 = shl i32 1, %53
  %55 = and i32 %52, %54
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.chunk_t, ptr %56, i32 0, i32 1
  %58 = getelementptr inbounds %struct.anon, ptr %57, i32 0, i32 2
  %59 = load i32, ptr %58, align 8, !tbaa !11
  %60 = or i32 %59, %55
  store i32 %60, ptr %58, align 8, !tbaa !11
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %86

63:                                               ; preds = %30
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.chunk_t, ptr %64, i32 0, i32 2
  %66 = load ptr, ptr %65, align 8, !tbaa !12
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.heap_t, ptr %67, i32 0, i32 0
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds [5 x ptr], ptr %68, i64 0, i64 %70
  store ptr %66, ptr %71, align 8, !tbaa !5
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.heap_t, ptr %72, i32 0, i32 1
  %74 = load i32, ptr %7, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds [5 x ptr], ptr %73, i64 0, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.chunk_t, ptr %78, i32 0, i32 2
  store ptr %77, ptr %79, align 8, !tbaa !12
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.heap_t, ptr %81, i32 0, i32 1
  %83 = load i32, ptr %7, align 4, !tbaa !9
  %84 = zext i32 %83 to i64
  %85 = getelementptr inbounds [5 x ptr], ptr %82, i64 0, i64 %84
  store ptr %80, ptr %85, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %63, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %158

87:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store ptr null, ptr %13, align 8, !tbaa !5
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.heap_t, ptr %88, i32 0, i32 3
  %90 = getelementptr inbounds [4 x ptr], ptr %89, i64 0, i64 0
  %91 = load ptr, ptr %90, align 8, !tbaa !5
  %92 = icmp ne ptr null, %91
  br i1 %92, label %93, label %105

93:                                               ; preds = %87
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.heap_t, ptr %94, i32 0, i32 3
  %96 = getelementptr inbounds [4 x ptr], ptr %95, i64 0, i64 0
  %97 = load ptr, ptr %96, align 8, !tbaa !5
  store ptr %97, ptr %13, align 8, !tbaa !5
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.chunk_t, ptr %98, i32 0, i32 2
  %100 = load ptr, ptr %99, align 8, !tbaa !12
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.heap_t, ptr %101, i32 0, i32 3
  %103 = getelementptr inbounds [4 x ptr], ptr %102, i64 0, i64 0
  store ptr %100, ptr %103, align 8, !tbaa !5
  %104 = load ptr, ptr %13, align 8, !tbaa !5
  call void @clear_chunk_flags(ptr noundef %104)
  br label %105

105:                                              ; preds = %93, %87
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = icmp eq ptr null, %106
  br i1 %107, label %108, label %117

108:                                              ; preds = %105
  %109 = call noalias ptr @ponyint_pool_alloc(i64 noundef 0)
  store ptr %109, ptr %13, align 8, !tbaa !5
  %110 = call noalias ptr @ponyint_pool_alloc(i64 noundef 5)
  %111 = load ptr, ptr %13, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.chunk_t, ptr %111, i32 0, i32 0
  store ptr %110, ptr %112, align 8, !tbaa !14
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = call ptr @get_m(ptr noundef %113)
  %115 = load ptr, ptr %13, align 8, !tbaa !5
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  call void @ponyint_pagemap_set(ptr noundef %114, ptr noundef %115, ptr noundef %116)
  br label %117

117:                                              ; preds = %108, %105
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  %119 = icmp ne ptr %118, null
  br i1 %119, label %120, label %121

120:                                              ; preds = %117
  br label %122

121:                                              ; preds = %117
  call void @ponyint_assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i64 noundef 726, ptr noundef @__func__.ponyint_heap_alloc_small)
  br label %122

122:                                              ; preds = %121, %120
  %123 = load ptr, ptr %13, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.chunk_t, ptr %123, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8, !tbaa !14
  %126 = icmp ne ptr %125, null
  br i1 %126, label %127, label %128

127:                                              ; preds = %122
  br label %129

128:                                              ; preds = %122
  call void @ponyint_assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i64 noundef 727, ptr noundef @__func__.ponyint_heap_alloc_small)
  br label %129

129:                                              ; preds = %128, %127
  %130 = load ptr, ptr %13, align 8, !tbaa !5
  call void @set_chunk_is_small_chunk(ptr noundef %130)
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  %132 = load i32, ptr %7, align 4, !tbaa !9
  %133 = zext i32 %132 to i64
  call void @set_small_chunk_size(ptr noundef %131, i64 noundef %133)
  %134 = load i32, ptr %8, align 4, !tbaa !9
  %135 = and i32 %134, 1
  %136 = load ptr, ptr %13, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.chunk_t, ptr %136, i32 0, i32 1
  %138 = getelementptr inbounds %struct.anon, ptr %137, i32 0, i32 2
  store i32 %135, ptr %138, align 8, !tbaa !11
  %139 = load i32, ptr %7, align 4, !tbaa !9
  %140 = zext i32 %139 to i64
  %141 = getelementptr inbounds [5 x i32], ptr @sizeclass_init, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !9
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.chunk_t, ptr %143, i32 0, i32 1
  %145 = getelementptr inbounds %struct.anon, ptr %144, i32 0, i32 0
  store i32 %142, ptr %145, align 8, !tbaa !11
  %146 = load ptr, ptr %13, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.chunk_t, ptr %146, i32 0, i32 2
  store ptr null, ptr %147, align 8, !tbaa !12
  %148 = load ptr, ptr %13, align 8, !tbaa !5
  call void @set_chunk_needs_clearing(ptr noundef %148)
  %149 = load ptr, ptr %13, align 8, !tbaa !5
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.heap_t, ptr %150, i32 0, i32 0
  %152 = load i32, ptr %7, align 4, !tbaa !9
  %153 = zext i32 %152 to i64
  %154 = getelementptr inbounds [5 x ptr], ptr %151, i64 0, i64 %153
  store ptr %149, ptr %154, align 8, !tbaa !5
  %155 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %155, ptr %9, align 8, !tbaa !5
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = call ptr @get_m(ptr noundef %156)
  store ptr %157, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %158

158:                                              ; preds = %129, %86
  %159 = load i32, ptr %7, align 4, !tbaa !9
  %160 = shl i32 32, %159
  %161 = sext i32 %160 to i64
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.heap_t, ptr %162, i32 0, i32 4
  %164 = load i64, ptr %163, align 8, !tbaa !15
  %165 = add i64 %164, %161
  store i64 %165, ptr %163, align 8, !tbaa !15
  %166 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret ptr %166
}

; Function Attrs: inlinehint nounwind uwtable
declare dso_local i32 @__pony_ctz(i32 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @get_m(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @clear_chunk_flags(ptr noundef) #2

declare noalias ptr @ponyint_pool_alloc(i64 noundef) #1

declare void @ponyint_pagemap_set(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @set_chunk_is_small_chunk(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @set_small_chunk_size(ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @set_chunk_needs_clearing(ptr noundef) #2

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

!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 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 24}
!13 = !{!"chunk_t", !6, i64 0, !7, i64 8, !6, i64 24}
!14 = !{!13, !6, i64 0}
!15 = !{!16, !17, i64 120}
!16 = !{!"heap_t", !7, i64 0, !7, i64 40, !6, i64 80, !7, i64 88, !17, i64 120, !17, i64 128}
!17 = !{!"long", !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 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@__func__.ponyint_heap_alloc_small = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@sizeclass_init = external hidden local_unnamed_addr constant [5 x i32], align 16

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

; Function Attrs: nounwind uwtable
define dso_local noalias ptr @ponyint_heap_alloc_small(ptr noundef %0, ptr nocapture noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #1 {
  %5 = add i32 %3, 1
  %or.cond = icmp ult i32 %5, 2
  br i1 %or.cond, label %7, label %6

6:                                                ; preds = %4
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 675, ptr noundef nonnull @__func__.ponyint_heap_alloc_small) #3
  br label %7

7:                                                ; preds = %4, %6
  %8 = zext i32 %2 to i64
  %9 = getelementptr inbounds [5 x ptr], ptr %1, i64 0, i64 %8
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %33, label %11

11:                                               ; preds = %7
  %12 = getelementptr inbounds i8, ptr %10, i64 8
  %13 = load i32, ptr %12, align 8, !tbaa !9
  %14 = tail call i32 @__pony_ctz(i32 noundef %13)
  %15 = shl nuw i32 1, %14
  %16 = xor i32 %15, -1
  %17 = and i32 %13, %16
  %18 = tail call ptr @get_m(ptr noundef nonnull %10)
  %19 = shl i32 %14, 5
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds i8, ptr %18, i64 %20
  store i32 %17, ptr %12, align 8, !tbaa !9
  %22 = and i32 %15, %3
  %23 = getelementptr inbounds i8, ptr %10, i64 16
  %24 = load i32, ptr %23, align 8, !tbaa !9
  %25 = or i32 %24, %22
  store i32 %25, ptr %23, align 8, !tbaa !9
  %26 = icmp eq i32 %17, 0
  br i1 %26, label %27, label %54

27:                                               ; preds = %11
  %28 = getelementptr inbounds i8, ptr %10, i64 24
  %29 = load ptr, ptr %28, align 8, !tbaa !10
  store ptr %29, ptr %9, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %1, i64 40
  %31 = getelementptr inbounds [5 x ptr], ptr %30, i64 0, i64 %8
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  store ptr %32, ptr %28, align 8, !tbaa !10
  store ptr %10, ptr %31, align 8, !tbaa !5
  br label %54

33:                                               ; preds = %7
  %34 = getelementptr inbounds i8, ptr %1, i64 88
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  %.not58 = icmp eq ptr %35, null
  br i1 %.not58, label %39, label %36

36:                                               ; preds = %33
  %37 = getelementptr inbounds i8, ptr %35, i64 24
  %38 = load ptr, ptr %37, align 8, !tbaa !10
  store ptr %38, ptr %34, align 8, !tbaa !5
  tail call void @clear_chunk_flags(ptr noundef nonnull %35)
  br label %43

39:                                               ; preds = %33
  %40 = tail call noalias ptr @ponyint_pool_alloc(i64 noundef 0) #3
  %41 = tail call noalias ptr @ponyint_pool_alloc(i64 noundef 5) #3
  store ptr %41, ptr %40, align 8, !tbaa !12
  %42 = tail call ptr @get_m(ptr noundef nonnull %40)
  tail call void @ponyint_pagemap_set(ptr noundef %42, ptr noundef nonnull %40, ptr noundef %0) #3
  br label %43

43:                                               ; preds = %36, %39
  %.1 = phi ptr [ %40, %39 ], [ %35, %36 ]
  %44 = load ptr, ptr %.1, align 8, !tbaa !12
  %.not59 = icmp eq ptr %44, null
  br i1 %.not59, label %45, label %46

45:                                               ; preds = %43
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i64 noundef 727, ptr noundef nonnull @__func__.ponyint_heap_alloc_small) #3
  br label %46

46:                                               ; preds = %43, %45
  tail call void @set_chunk_is_small_chunk(ptr noundef nonnull %.1)
  tail call void @set_small_chunk_size(ptr noundef nonnull %.1, i64 noundef %8)
  %47 = and i32 %3, 1
  %48 = getelementptr inbounds i8, ptr %.1, i64 8
  %49 = getelementptr inbounds i8, ptr %.1, i64 16
  store i32 %47, ptr %49, align 8, !tbaa !9
  %50 = getelementptr inbounds [5 x i32], ptr @sizeclass_init, i64 0, i64 %8
  %51 = load i32, ptr %50, align 4, !tbaa !13
  store i32 %51, ptr %48, align 8, !tbaa !9
  %52 = getelementptr inbounds i8, ptr %.1, i64 24
  store ptr null, ptr %52, align 8, !tbaa !10
  tail call void @set_chunk_needs_clearing(ptr noundef nonnull %.1)
  store ptr %.1, ptr %9, align 8, !tbaa !5
  %53 = tail call ptr @get_m(ptr noundef nonnull %.1)
  br label %54

54:                                               ; preds = %11, %27, %46
  %.055 = phi ptr [ %53, %46 ], [ %21, %27 ], [ %21, %11 ]
  %55 = shl i32 32, %2
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i8, ptr %1, i64 120
  %58 = load i64, ptr %57, align 8, !tbaa !15
  %59 = add i64 %58, %56
  store i64 %59, ptr %57, align 8, !tbaa !15
  ret ptr %.055
}

; Function Attrs: inlinehint nounwind uwtable
declare dso_local i32 @__pony_ctz(i32 noundef) local_unnamed_addr #2

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

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

declare noalias ptr @ponyint_pool_alloc(i64 noundef) local_unnamed_addr #0

declare void @ponyint_pagemap_set(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

attributes #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 = { 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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 24}
!11 = !{!"chunk_t", !6, i64 0, !7, i64 8, !6, i64 24}
!12 = !{!11, !6, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !17, i64 120}
!16 = !{!"heap_t", !7, i64 0, !7, i64 40, !6, i64 80, !7, i64 88, !17, i64 120, !17, i64 128}
!17 = !{!"long", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass