; LLVM IR from taichi-dev/taichi :: taichi/runtime/llvm/runtime_module (runtime)

; 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.Element = type { ptr, [2 x i32], %struct.PhysicalCoordinates }
%struct.PhysicalCoordinates = type { [12 x i32] }
%struct.LLVMRuntime = type { %struct.PreallocatedMemoryChunk, %struct.PreallocatedMemoryChunk, ptr, ptr, ptr, ptr, ptr, [512 x ptr], [512 x i64], ptr, ptr, [1024 x ptr], [1024 x ptr], [1024 x ptr], ptr, ptr, ptr, ptr, ptr, [2048 x i8], [32 x i64], i32, i64, ptr, i32, i32, i64 }
%struct.PreallocatedMemoryChunk = type { ptr, ptr, i64 }
%struct.StructMeta = type { i32, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr }

@_ZL31taichi_listgen_max_element_size = external hidden constant i32, align 4

; 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: 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) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11ListManager6appendEPv(ptr noundef nonnull align 8 dereferenceable(1048616), ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(64) ptr @_ZN11ListManager3getI7ElementEERT_i(ptr noundef nonnull align 8 dereferenceable(1048616), i32 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @element_listgen_nonroot(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %struct.Element, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %struct.PhysicalCoordinates, align 4
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca %struct.Element, align 8
  %31 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.LLVMRuntime, ptr %32, i32 0, i32 11
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.StructMeta, ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 8, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [1024 x ptr], ptr %33, i64 0, i64 %37
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  store ptr %39, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = call noundef i32 @_ZN11ListManager4sizeEv(ptr noundef nonnull align 8 dereferenceable(1048616) %40)
  store i32 %41, ptr %8, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.LLVMRuntime, ptr %42, i32 0, i32 11
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.StructMeta, ptr %44, i32 0, i32 0
  %46 = load i32, ptr %45, align 8, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [1024 x ptr], ptr %43, i64 0, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  store ptr %49, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.StructMeta, ptr %50, i32 0, i32 7
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  store ptr %52, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.StructMeta, ptr %53, i32 0, i32 5
  %55 = load ptr, ptr %54, align 8, !tbaa !15
  store ptr %55, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.StructMeta, ptr %56, i32 0, i32 3
  %58 = load ptr, ptr %57, align 8, !tbaa !16
  store ptr %58, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.StructMeta, ptr %59, i32 0, i32 6
  %61 = load ptr, ptr %60, align 8, !tbaa !17
  store ptr %61, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.StructMeta, ptr %62, i32 0, i32 4
  %64 = load ptr, ptr %63, align 8, !tbaa !18
  store ptr %64, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 1, ptr %16, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 1, ptr %18, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %65 = load i32, ptr %15, align 4, !tbaa !13
  store i32 %65, ptr %19, align 4, !tbaa !13
  br label %66

66:                                               ; preds = %146, %3
  %67 = load i32, ptr %19, align 4, !tbaa !13
  %68 = load i32, ptr %8, align 4, !tbaa !13
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 2, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %150

71:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 64, ptr %21) #5
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = load i32, ptr %19, align 4, !tbaa !13
  %74 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZN11ListManager3getI7ElementEERT_i(ptr noundef nonnull align 8 dereferenceable(1048616) %72, i32 noundef %73)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %74, i64 64, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %75 = getelementptr inbounds %struct.Element, ptr %21, i32 0, i32 1
  %76 = getelementptr inbounds [2 x i32], ptr %75, i64 0, i64 0
  %77 = load i32, ptr %76, align 8, !tbaa !13
  %78 = load i32, ptr %17, align 4, !tbaa !13
  %79 = add nsw i32 %77, %78
  store i32 %79, ptr %22, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %80 = getelementptr inbounds %struct.Element, ptr %21, i32 0, i32 1
  %81 = getelementptr inbounds [2 x i32], ptr %80, i64 0, i64 1
  %82 = load i32, ptr %81, align 4, !tbaa !13
  store i32 %82, ptr %23, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %83 = load i32, ptr %22, align 4, !tbaa !13
  store i32 %83, ptr %24, align 4, !tbaa !13
  br label %84

84:                                               ; preds = %141, %71
  %85 = load i32, ptr %24, align 4, !tbaa !13
  %86 = load i32, ptr %23, align 4, !tbaa !13
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 5, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %145

89:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 48, ptr %25) #5
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.Element, ptr %21, i32 0, i32 2
  %92 = load i32, ptr %24, align 4, !tbaa !13
  call void %90(ptr noundef %91, ptr noundef %25, i32 noundef %92)
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.Element, ptr %21, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !21
  %97 = load i32, ptr %24, align 4, !tbaa !13
  %98 = call noundef zeroext i1 %93(ptr noundef %94, ptr noundef %96, i32 noundef %97)
  br i1 %98, label %99, label %140

99:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.Element, ptr %21, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !21
  %104 = load i32, ptr %24, align 4, !tbaa !13
  %105 = call noundef ptr %100(ptr noundef %101, ptr noundef %103, i32 noundef %104)
  store ptr %105, ptr %26, align 8, !tbaa !5
  %106 = load ptr, ptr %14, align 8, !tbaa !5
  %107 = load ptr, ptr %26, align 8, !tbaa !5
  %108 = call noundef ptr %106(ptr noundef %107)
  store ptr %108, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = load ptr, ptr %26, align 8, !tbaa !5
  %112 = call noundef i32 %109(ptr noundef %110, ptr noundef %111)
  store i32 %112, ptr %27, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  %113 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %27, ptr noundef nonnull align 4 dereferenceable(4) @_ZL31taichi_listgen_max_element_size)
  %114 = load i32, ptr %113, align 4, !tbaa !13
  store i32 %114, ptr %28, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  store i32 0, ptr %29, align 4, !tbaa !13
  br label %115

115:                                              ; preds = %135, %99
  %116 = load i32, ptr %29, align 4, !tbaa !13
  %117 = load i32, ptr %27, align 4, !tbaa !13
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 8, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  br label %139

120:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 64, ptr %30) #5
  %121 = load ptr, ptr %26, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.Element, ptr %30, i32 0, i32 0
  store ptr %121, ptr %122, align 8, !tbaa !21
  %123 = load i32, ptr %29, align 4, !tbaa !13
  %124 = getelementptr inbounds %struct.Element, ptr %30, i32 0, i32 1
  %125 = getelementptr inbounds [2 x i32], ptr %124, i64 0, i64 0
  store i32 %123, ptr %125, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %126 = load i32, ptr %29, align 4, !tbaa !13
  %127 = load i32, ptr %28, align 4, !tbaa !13
  %128 = add nsw i32 %126, %127
  store i32 %128, ptr %31, align 4, !tbaa !13
  %129 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %130 = load i32, ptr %129, align 4, !tbaa !13
  %131 = getelementptr inbounds %struct.Element, ptr %30, i32 0, i32 1
  %132 = getelementptr inbounds [2 x i32], ptr %131, i64 0, i64 1
  store i32 %130, ptr %132, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  %133 = getelementptr inbounds %struct.Element, ptr %30, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %133, ptr align 4 %25, i64 48, i1 false), !tbaa.struct !24
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN11ListManager6appendEPv(ptr noundef nonnull align 8 dereferenceable(1048616) %134, ptr noundef %30)
  call void @llvm.lifetime.end.p0(i64 64, ptr %30) #5
  br label %135

135:                                              ; preds = %120
  %136 = load i32, ptr %28, align 4, !tbaa !13
  %137 = load i32, ptr %29, align 4, !tbaa !13
  %138 = add nsw i32 %137, %136
  store i32 %138, ptr %29, align 4, !tbaa !13
  br label %115, !llvm.loop !25

139:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br label %140

140:                                              ; preds = %139, %89
  call void @llvm.lifetime.end.p0(i64 48, ptr %25) #5
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %18, align 4, !tbaa !13
  %143 = load i32, ptr %24, align 4, !tbaa !13
  %144 = add nsw i32 %143, %142
  store i32 %144, ptr %24, align 4, !tbaa !13
  br label %84, !llvm.loop !27

145:                                              ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %21) #5
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %16, align 4, !tbaa !13
  %148 = load i32, ptr %19, align 4, !tbaa !13
  %149 = add nsw i32 %148, %147
  store i32 %149, ptr %19, align 4, !tbaa !13
  br label %66, !llvm.loop !28

150:                                              ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  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 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11ListManager4sizeEv(ptr noundef nonnull align 8 dereferenceable(1048616)) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 mustprogress 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 = { mustprogress 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 #5 = { 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++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS10StructMeta", !11, i64 0, !12, i64 8, !12, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 56}
!15 = !{!10, !6, i64 40}
!16 = !{!10, !6, i64 24}
!17 = !{!10, !6, i64 48}
!18 = !{!10, !6, i64 32}
!19 = !{i64 0, i64 8, !5, i64 8, i64 8, !20, i64 16, i64 48, !20}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !6, i64 0}
!22 = !{!"_ZTS7Element", !6, i64 0, !7, i64 8, !23, i64 16}
!23 = !{!"_ZTS19PhysicalCoordinates", !7, i64 0}
!24 = !{i64 0, i64 48, !20}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}
!28 = distinct !{!28, !26}


; 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.Element = type { ptr, [2 x i32], %struct.PhysicalCoordinates }
%struct.PhysicalCoordinates = type { [12 x i32] }

@_ZL31taichi_listgen_max_element_size = external hidden constant i32, align 4

; 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: 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) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11ListManager6appendEPv(ptr noundef nonnull align 8 dereferenceable(1048616), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(64) ptr @_ZN11ListManager3getI7ElementEERT_i(ptr noundef nonnull align 8 dereferenceable(1048616), i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @element_listgen_nonroot(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca %struct.Element, align 8
  %5 = alloca %struct.PhysicalCoordinates, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.Element, align 8
  %8 = alloca i32, align 4
  %9 = getelementptr inbounds i8, ptr %0, i64 8296
  %10 = load i32, ptr %1, align 8, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds [1024 x ptr], ptr %9, i64 0, i64 %11
  %13 = load ptr, ptr %12, align 8, !tbaa !12
  %14 = tail call noundef i32 @_ZN11ListManager4sizeEv(ptr noundef nonnull align 8 dereferenceable(1048616) %13)
  %15 = load i32, ptr %2, align 8, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [1024 x ptr], ptr %9, i64 0, i64 %16
  %18 = load ptr, ptr %17, align 8, !tbaa !12
  %19 = getelementptr inbounds i8, ptr %1, i64 56
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = getelementptr inbounds i8, ptr %1, i64 40
  %22 = load ptr, ptr %21, align 8, !tbaa !14
  %23 = getelementptr inbounds i8, ptr %1, i64 24
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %25 = getelementptr inbounds i8, ptr %2, i64 48
  %26 = load ptr, ptr %25, align 8, !tbaa !16
  %27 = getelementptr inbounds i8, ptr %2, i64 32
  %28 = load ptr, ptr %27, align 8, !tbaa !17
  %29 = icmp sgt i32 %14, 0
  br i1 %29, label %.lr.ph52, label %._crit_edge53

.lr.ph52:                                         ; preds = %3
  %30 = getelementptr inbounds i8, ptr %4, i64 8
  %31 = getelementptr inbounds i8, ptr %4, i64 12
  %32 = getelementptr inbounds i8, ptr %4, i64 16
  %33 = getelementptr inbounds i8, ptr %7, i64 8
  %34 = getelementptr inbounds i8, ptr %7, i64 12
  %35 = getelementptr inbounds i8, ptr %7, i64 16
  br label %36

._crit_edge53:                                    ; preds = %._crit_edge49, %3
  ret void

36:                                               ; preds = %.lr.ph52, %._crit_edge49
  %.04350 = phi i32 [ 0, %.lr.ph52 ], [ %41, %._crit_edge49 ]
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #5
  %37 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZN11ListManager3getI7ElementEERT_i(ptr noundef nonnull align 8 dereferenceable(1048616) %13, i32 noundef %.04350)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %4, ptr noundef nonnull align 8 dereferenceable(64) %37, i64 64, i1 false), !tbaa.struct !18
  %38 = load i32, ptr %30, align 8, !tbaa !20
  %39 = load i32, ptr %31, align 4, !tbaa !20
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %.lr.ph48, label %._crit_edge49

._crit_edge49:                                    ; preds = %58, %36
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #5
  %41 = add nuw nsw i32 %.04350, 1
  %exitcond54.not = icmp eq i32 %41, %14
  br i1 %exitcond54.not, label %._crit_edge53, label %36, !llvm.loop !21

.lr.ph48:                                         ; preds = %36, %58
  %.04446 = phi i32 [ %59, %58 ], [ %38, %36 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #5
  call void %20(ptr noundef nonnull %32, ptr noundef nonnull %5, i32 noundef %.04446)
  %42 = load ptr, ptr %4, align 8, !tbaa !23
  %43 = call noundef zeroext i1 %22(ptr noundef nonnull %1, ptr noundef %42, i32 noundef %.04446)
  br i1 %43, label %44, label %58

44:                                               ; preds = %.lr.ph48
  %45 = load ptr, ptr %4, align 8, !tbaa !23
  %46 = call noundef ptr %24(ptr noundef nonnull %1, ptr noundef %45, i32 noundef %.04446)
  %47 = call noundef ptr %28(ptr noundef %46)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %48 = call noundef i32 %26(ptr noundef nonnull %2, ptr noundef %47)
  store i32 %48, ptr %6, align 4, !tbaa !20
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) @_ZL31taichi_listgen_max_element_size)
  %50 = load i32, ptr %49, align 4, !tbaa !20
  %51 = load i32, ptr %6, align 4, !tbaa !20
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  br label %58

.lr.ph:                                           ; preds = %44, %.lr.ph
  %.045 = phi i32 [ %53, %.lr.ph ], [ 0, %44 ]
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #5
  store ptr %47, ptr %7, align 8, !tbaa !23
  store i32 %.045, ptr %33, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %53 = add nsw i32 %.045, %50
  store i32 %53, ptr %8, align 4, !tbaa !20
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %55 = load i32, ptr %54, align 4, !tbaa !20
  store i32 %55, ptr %34, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %35, ptr noundef nonnull align 4 dereferenceable(48) %5, i64 48, i1 false), !tbaa.struct !26
  call void @_ZN11ListManager6appendEPv(ptr noundef nonnull align 8 dereferenceable(1048616) %18, ptr noundef nonnull %7)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #5
  %56 = load i32, ptr %6, align 4, !tbaa !20
  %57 = icmp slt i32 %53, %56
  br i1 %57, label %.lr.ph, label %._crit_edge, !llvm.loop !27

58:                                               ; preds = %._crit_edge, %.lr.ph48
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #5
  %59 = add i32 %.04446, 1
  %exitcond.not = icmp eq i32 %59, %39
  br i1 %exitcond.not, label %._crit_edge49, label %.lr.ph48, !llvm.loop !28
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11ListManager4sizeEv(ptr noundef nonnull align 8 dereferenceable(1048616)) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 mustprogress 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 = { mustprogress 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 #5 = { 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, !7, i64 0}
!6 = !{!"_ZTS10StructMeta", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!6, !11, i64 56}
!14 = !{!6, !11, i64 40}
!15 = !{!6, !11, i64 24}
!16 = !{!6, !11, i64 48}
!17 = !{!6, !11, i64 32}
!18 = !{i64 0, i64 8, !12, i64 8, i64 8, !19, i64 16, i64 48, !19}
!19 = !{!8, !8, i64 0}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !11, i64 0}
!24 = !{!"_ZTS7Element", !11, i64 0, !8, i64 8, !25, i64 16}
!25 = !{!"_ZTS19PhysicalCoordinates", !8, i64 0}
!26 = !{i64 0, i64 48, !19}
!27 = distinct !{!27, !22}
!28 = distinct !{!28, !22}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass