; LLVM IR from ponylang/ponyc :: src/libponyrt/gc (serialise)

; 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.serialise_t = type { i64, i64, ptr, i32, i8 }
%struct._pony_type_t = type { i32, i32, i64, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i8, ptr, ptr, ptr }
%struct.pony_ctx_t = type { ptr, ptr, ptr, ptr, ptr, %struct.actormap_t, ptr, i64, %struct.ponyint_serialise_t, ptr, ptr, ptr }
%struct.actormap_t = type { %struct.hashmap_t }
%struct.hashmap_t = type { i64, i64, ptr, ptr }
%struct.ponyint_serialise_t = type { %struct.hashmap_t }

@desc_table_size = external hidden global i64, align 8

; 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 @ponyint_serialise_get(ptr noundef, ptr noundef, ptr noundef) #1

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

declare noalias ptr @ponyint_pool_alloc(i64 noundef) #2

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

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

; Function Attrs: noreturn nounwind
declare void @abort() #3

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

16:                                               ; preds = %3
  store ptr null, ptr %4, align 8
  br label %158

17:                                               ; preds = %3
  %18 = load i64, ptr %7, align 8, !tbaa !9
  %19 = and i64 %18, -9223372036854775808
  %20 = icmp ne i64 %19, 0
  br i1 %20, label %21, label %34

21:                                               ; preds = %17
  %22 = load i64, ptr %7, align 8, !tbaa !9
  %23 = and i64 %22, 9223372036854775807
  store i64 %23, ptr %7, align 8, !tbaa !9
  %24 = load i64, ptr %7, align 8, !tbaa !9
  %25 = load i64, ptr @desc_table_size, align 8, !tbaa !9
  %26 = icmp ugt i64 %24, %25
  br i1 %26, label %27, label %28

27:                                               ; preds = %21
  store ptr null, ptr %4, align 8
  br label %158

28:                                               ; preds = %21
  %29 = load i64, ptr %7, align 8, !tbaa !9
  %30 = call ptr @get_descriptor(i64 noundef %29)
  store ptr %30, ptr %6, align 8, !tbaa !5
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct._pony_type_t, ptr %31, i32 0, i32 5
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  store ptr %33, ptr %4, align 8
  br label %158

34:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #5
  %35 = load i64, ptr %7, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.serialise_t, ptr %8, i32 0, i32 0
  store i64 %35, ptr %36, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 -1, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.pony_ctx_t, ptr %37, i32 0, i32 8
  %39 = call ptr @ponyint_serialise_get(ptr noundef %38, ptr noundef %8, ptr noundef %9)
  store ptr %39, ptr %10, align 8, !tbaa !5
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %47

42:                                               ; preds = %34
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.serialise_t, ptr %43, i32 0, i32 1
  %45 = load i64, ptr %44, align 8, !tbaa !17
  %46 = inttoptr i64 %45 to ptr
  store ptr %46, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %157

47:                                               ; preds = %34
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = icmp eq ptr %48, null
  br i1 %49, label %50, label %73

50:                                               ; preds = %47
  %51 = load i64, ptr %7, align 8, !tbaa !9
  %52 = add i64 %51, 8
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.pony_ctx_t, ptr %53, i32 0, i32 7
  %55 = load i64, ptr %54, align 8, !tbaa !18
  %56 = icmp ugt i64 %52, %55
  br i1 %56, label %57, label %62

57:                                               ; preds = %50
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  call void @serialise_cleanup(ptr noundef %58)
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.pony_ctx_t, ptr %59, i32 0, i32 11
  %61 = load ptr, ptr %60, align 8, !tbaa !23
  call void (...) %61()
  call void @abort() #6
  unreachable

62:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.pony_ctx_t, ptr %63, i32 0, i32 6
  %65 = load ptr, ptr %64, align 8, !tbaa !24
  %66 = ptrtoint ptr %65 to i64
  %67 = load i64, ptr %7, align 8, !tbaa !9
  %68 = add i64 %66, %67
  %69 = inttoptr i64 %68 to ptr
  %70 = load i64, ptr %69, align 8, !tbaa !9
  store i64 %70, ptr %12, align 8, !tbaa !9
  %71 = load i64, ptr %12, align 8, !tbaa !9
  %72 = call ptr @get_descriptor(i64 noundef %71)
  store ptr %72, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %73

73:                                               ; preds = %62, %47
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._pony_type_t, ptr %74, i32 0, i32 5
  %76 = load ptr, ptr %75, align 8, !tbaa !11
  %77 = icmp ne ptr %76, null
  br i1 %77, label %78, label %82

78:                                               ; preds = %73
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._pony_type_t, ptr %79, i32 0, i32 5
  %81 = load ptr, ptr %80, align 8, !tbaa !11
  store ptr %81, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %157

82:                                               ; preds = %73
  %83 = load i64, ptr %7, align 8, !tbaa !9
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._pony_type_t, ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !25
  %87 = zext i32 %86 to i64
  %88 = add i64 %83, %87
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.pony_ctx_t, ptr %89, i32 0, i32 7
  %91 = load i64, ptr %90, align 8, !tbaa !18
  %92 = icmp ugt i64 %88, %91
  br i1 %92, label %93, label %98

93:                                               ; preds = %82
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  call void @serialise_cleanup(ptr noundef %94)
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.pony_ctx_t, ptr %95, i32 0, i32 11
  %97 = load ptr, ptr %96, align 8, !tbaa !23
  call void (...) %97()
  call void @abort() #6
  unreachable

98:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct._pony_type_t, ptr %99, i32 0, i32 13
  %101 = load ptr, ptr %100, align 8, !tbaa !26
  %102 = icmp eq ptr %101, null
  br i1 %102, label %103, label %113

103:                                              ; preds = %98
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.pony_ctx_t, ptr %104, i32 0, i32 9
  %106 = load ptr, ptr %105, align 8, !tbaa !27
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._pony_type_t, ptr %108, i32 0, i32 1
  %110 = load i32, ptr %109, align 4, !tbaa !25
  %111 = zext i32 %110 to i64
  %112 = call ptr %106(ptr noundef %107, i64 noundef %111)
  store ptr %112, ptr %13, align 8, !tbaa !5
  br label %123

113:                                              ; preds = %98
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.pony_ctx_t, ptr %114, i32 0, i32 10
  %116 = load ptr, ptr %115, align 8, !tbaa !28
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._pony_type_t, ptr %118, i32 0, i32 1
  %120 = load i32, ptr %119, align 4, !tbaa !25
  %121 = zext i32 %120 to i64
  %122 = call ptr %116(ptr noundef %117, i64 noundef %121)
  store ptr %122, ptr %13, align 8, !tbaa !5
  br label %123

123:                                              ; preds = %113, %103
  %124 = load ptr, ptr %13, align 8, !tbaa !5
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.pony_ctx_t, ptr %125, i32 0, i32 6
  %127 = load ptr, ptr %126, align 8, !tbaa !24
  %128 = ptrtoint ptr %127 to i64
  %129 = load i64, ptr %7, align 8, !tbaa !9
  %130 = add i64 %128, %129
  %131 = inttoptr i64 %130 to ptr
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._pony_type_t, ptr %132, i32 0, i32 1
  %134 = load i32, ptr %133, align 4, !tbaa !25
  %135 = zext i32 %134 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %124, ptr align 1 %131, i64 %135, i1 false)
  %136 = call noalias ptr @ponyint_pool_alloc(i64 noundef 0)
  store ptr %136, ptr %10, align 8, !tbaa !5
  %137 = load i64, ptr %7, align 8, !tbaa !9
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.serialise_t, ptr %138, i32 0, i32 0
  store i64 %137, ptr %139, align 8, !tbaa !15
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = ptrtoint ptr %140 to i64
  %142 = load ptr, ptr %10, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.serialise_t, ptr %142, i32 0, i32 1
  store i64 %141, ptr %143, align 8, !tbaa !17
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = load ptr, ptr %10, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.serialise_t, ptr %145, i32 0, i32 2
  store ptr %144, ptr %146, align 8, !tbaa !29
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.pony_ctx_t, ptr %147, i32 0, i32 8
  %149 = load ptr, ptr %10, align 8, !tbaa !5
  %150 = load i64, ptr %9, align 8, !tbaa !9
  call void @ponyint_serialise_putindex(ptr noundef %148, ptr noundef %149, i64 noundef %150)
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = load ptr, ptr %13, align 8, !tbaa !5
  %153 = load ptr, ptr %6, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct._pony_type_t, ptr %153, i32 0, i32 9
  %155 = load ptr, ptr %154, align 8, !tbaa !30
  call void @recurse(ptr noundef %151, ptr noundef %152, ptr noundef %155)
  %156 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %156, ptr %4, align 8
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %157

157:                                              ; preds = %123, %78, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  br label %158

158:                                              ; preds = %157, %28, %27, %16
  %159 = load ptr, ptr %4, align 8
  ret ptr %159
}

; Function Attrs: nounwind uwtable
declare hidden ptr @get_descriptor(i64 noundef) #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) #4

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 = { noreturn 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"_pony_type_t", !13, i64 0, !13, i64 4, !10, i64 8, !13, i64 16, !13, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !13, i64 96, !14, i64 100, !6, i64 104, !6, i64 112, !6, i64 120}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"serialise_t", !10, i64 0, !10, i64 8, !6, i64 16, !13, i64 24, !14, i64 28}
!17 = !{!16, !10, i64 8}
!18 = !{!19, !10, i64 80}
!19 = !{!"pony_ctx_t", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !20, i64 40, !6, i64 72, !10, i64 80, !22, i64 88, !6, i64 120, !6, i64 128, !6, i64 136}
!20 = !{!"actormap_t", !21, i64 0}
!21 = !{!"hashmap_t", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!"ponyint_serialise_t", !21, i64 0}
!23 = !{!19, !6, i64 136}
!24 = !{!19, !6, i64 72}
!25 = !{!12, !13, i64 4}
!26 = !{!12, !6, i64 88}
!27 = !{!19, !6, i64 120}
!28 = !{!19, !6, i64 128}
!29 = !{!16, !6, i64 16}
!30 = !{!12, !6, i64 56}


; 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.serialise_t = type { i64, i64, ptr, i32, i8 }

@desc_table_size = external hidden local_unnamed_addr global i64, align 8

; 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 @ponyint_serialise_get(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local ptr @pony_deserialise_offset(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #1 {
  %4 = alloca %struct.serialise_t, align 8
  %5 = alloca i64, align 8
  %6 = icmp eq i64 %2, -1
  br i1 %6, label %77, label %7

7:                                                ; preds = %3
  %.not = icmp sgt i64 %2, -1
  br i1 %.not, label %16, label %8

8:                                                ; preds = %7
  %9 = and i64 %2, 9223372036854775807
  %10 = load i64, ptr @desc_table_size, align 8, !tbaa !5
  %11 = icmp ugt i64 %9, %10
  br i1 %11, label %77, label %12

12:                                               ; preds = %8
  %13 = tail call ptr @get_descriptor(i64 noundef %9)
  %14 = getelementptr inbounds i8, ptr %13, i64 24
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  br label %77

16:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  store i64 %2, ptr %4, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store i64 -1, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 88
  %18 = call ptr @ponyint_serialise_get(ptr noundef nonnull %17, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %.not55 = icmp eq ptr %18, null
  br i1 %.not55, label %23, label %19

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %18, i64 8
  %21 = load i64, ptr %20, align 8, !tbaa !16
  %22 = inttoptr i64 %21 to ptr
  br label %76

23:                                               ; preds = %16
  %24 = icmp eq ptr %1, null
  br i1 %24, label %25, label %41

25:                                               ; preds = %23
  %26 = add nuw i64 %2, 8
  %27 = getelementptr inbounds i8, ptr %0, i64 80
  %28 = load i64, ptr %27, align 8, !tbaa !17
  %29 = icmp ugt i64 %26, %28
  br i1 %29, label %30, label %33

30:                                               ; preds = %25
  call void @serialise_cleanup(ptr noundef nonnull %0)
  %31 = getelementptr inbounds i8, ptr %0, i64 136
  %32 = load ptr, ptr %31, align 8, !tbaa !22
  call void (...) %32() #5
  call void @abort() #6
  unreachable

33:                                               ; preds = %25
  %34 = getelementptr inbounds i8, ptr %0, i64 72
  %35 = load ptr, ptr %34, align 8, !tbaa !23
  %36 = ptrtoint ptr %35 to i64
  %37 = add i64 %36, %2
  %38 = inttoptr i64 %37 to ptr
  %39 = load i64, ptr %38, align 8, !tbaa !5
  %40 = call ptr @get_descriptor(i64 noundef %39)
  br label %41

41:                                               ; preds = %33, %23
  %.049 = phi ptr [ %40, %33 ], [ %1, %23 ]
  %42 = getelementptr inbounds i8, ptr %.049, i64 24
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  %.not56 = icmp eq ptr %43, null
  br i1 %.not56, label %44, label %76

44:                                               ; preds = %41
  %45 = getelementptr inbounds i8, ptr %.049, i64 4
  %46 = load i32, ptr %45, align 4, !tbaa !24
  %47 = zext i32 %46 to i64
  %48 = add nuw i64 %47, %2
  %49 = getelementptr inbounds i8, ptr %0, i64 80
  %50 = load i64, ptr %49, align 8, !tbaa !17
  %51 = icmp ugt i64 %48, %50
  br i1 %51, label %52, label %55

52:                                               ; preds = %44
  call void @serialise_cleanup(ptr noundef nonnull %0)
  %53 = getelementptr inbounds i8, ptr %0, i64 136
  %54 = load ptr, ptr %53, align 8, !tbaa !22
  call void (...) %54() #5
  call void @abort() #6
  unreachable

55:                                               ; preds = %44
  %56 = getelementptr inbounds i8, ptr %.049, i64 88
  %57 = load ptr, ptr %56, align 8, !tbaa !25
  %58 = icmp eq ptr %57, null
  %. = select i1 %58, i64 120, i64 128
  %59 = getelementptr inbounds i8, ptr %0, i64 %.
  %60 = load ptr, ptr %59, align 8, !tbaa !26
  %61 = call ptr %60(ptr noundef nonnull %0, i64 noundef %47) #5
  %62 = getelementptr inbounds i8, ptr %0, i64 72
  %63 = load ptr, ptr %62, align 8, !tbaa !23
  %64 = ptrtoint ptr %63 to i64
  %65 = add i64 %64, %2
  %66 = inttoptr i64 %65 to ptr
  %67 = load i32, ptr %45, align 4, !tbaa !24
  %68 = zext i32 %67 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %61, ptr align 1 %66, i64 %68, i1 false)
  %69 = call noalias ptr @ponyint_pool_alloc(i64 noundef 0) #5
  store i64 %2, ptr %69, align 8, !tbaa !14
  %70 = ptrtoint ptr %61 to i64
  %71 = getelementptr inbounds i8, ptr %69, i64 8
  store i64 %70, ptr %71, align 8, !tbaa !16
  %72 = getelementptr inbounds i8, ptr %69, i64 16
  store ptr %.049, ptr %72, align 8, !tbaa !27
  %73 = load i64, ptr %5, align 8, !tbaa !5
  call void @ponyint_serialise_putindex(ptr noundef nonnull %17, ptr noundef nonnull %69, i64 noundef %73)
  %74 = getelementptr inbounds i8, ptr %.049, i64 56
  %75 = load ptr, ptr %74, align 8, !tbaa !28
  call void @recurse(ptr noundef nonnull %0, ptr noundef %61, ptr noundef %75)
  br label %76

76:                                               ; preds = %41, %55, %19
  %.048 = phi ptr [ %22, %19 ], [ %61, %55 ], [ %43, %41 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  br label %77

77:                                               ; preds = %8, %3, %76, %12
  %.1 = phi ptr [ %15, %12 ], [ %.048, %76 ], [ null, %3 ], [ null, %8 ]
  ret ptr %.1
}

; Function Attrs: nounwind uwtable
declare hidden ptr @get_descriptor(i64 noundef) local_unnamed_addr #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) #4

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 = { noreturn 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !12, i64 24}
!10 = !{!"_pony_type_t", !11, i64 0, !11, i64 4, !6, i64 8, !11, i64 16, !11, i64 20, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !11, i64 96, !13, i64 100, !12, i64 104, !12, i64 112, !12, i64 120}
!11 = !{!"int", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"serialise_t", !6, i64 0, !6, i64 8, !12, i64 16, !11, i64 24, !13, i64 28}
!16 = !{!15, !6, i64 8}
!17 = !{!18, !6, i64 80}
!18 = !{!"pony_ctx_t", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !19, i64 40, !12, i64 72, !6, i64 80, !21, i64 88, !12, i64 120, !12, i64 128, !12, i64 136}
!19 = !{!"actormap_t", !20, i64 0}
!20 = !{!"hashmap_t", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 24}
!21 = !{!"ponyint_serialise_t", !20, i64 0}
!22 = !{!18, !12, i64 136}
!23 = !{!18, !12, i64 72}
!24 = !{!10, !11, i64 4}
!25 = !{!10, !12, i64 88}
!26 = !{!12, !12, i64 0}
!27 = !{!15, !12, i64 16}
!28 = !{!10, !12, i64 56}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass