; LLVM IR from pranjalwalia/Competitive-programming :: Hackerrank/language/C (Post Transition)

; 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.package = type { ptr, i32 }
%struct.town = type { ptr, ptr, i32 }
%struct.post_office = type { i32, i32, ptr, i32 }

; 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
define dso_local void @send_all_acceptable_packages(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.package, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %221, %4
  %17 = load i32, ptr %14, align 4, !tbaa !9
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.town, ptr %18, i32 0, i32 1
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds %struct.post_office, ptr %20, i64 %22
  %24 = getelementptr inbounds %struct.post_office, ptr %23, i32 0, i32 3
  %25 = load i32, ptr %24, align 8, !tbaa !13
  %26 = icmp slt i32 %17, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %224

28:                                               ; preds = %16
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.town, ptr %29, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = load i32, ptr %6, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds %struct.post_office, ptr %31, i64 %33
  %35 = getelementptr inbounds %struct.post_office, ptr %34, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !15
  %37 = load i32, ptr %14, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds %struct.package, ptr %36, i64 %38
  %40 = getelementptr inbounds %struct.package, ptr %39, i32 0, i32 1
  %41 = load i32, ptr %40, align 8, !tbaa !16
  store i32 %41, ptr %13, align 4, !tbaa !9
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.town, ptr %42, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %struct.post_office, ptr %44, i64 %46
  %48 = getelementptr inbounds %struct.post_office, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 8, !tbaa !18
  store i32 %49, ptr %12, align 4, !tbaa !9
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.town, ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds %struct.post_office, ptr %52, i64 %54
  %56 = getelementptr inbounds %struct.post_office, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !19
  store i32 %57, ptr %11, align 4, !tbaa !9
  %58 = load i32, ptr %12, align 4, !tbaa !9
  %59 = load i32, ptr %13, align 4, !tbaa !9
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %61, label %220

61:                                               ; preds = %28
  %62 = load i32, ptr %13, align 4, !tbaa !9
  %63 = load i32, ptr %11, align 4, !tbaa !9
  %64 = icmp sle i32 %62, %63
  br i1 %64, label %65, label %220

65:                                               ; preds = %61
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.town, ptr %66, i32 0, i32 1
  %68 = load ptr, ptr %67, align 8, !tbaa !11
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds %struct.post_office, ptr %68, i64 %70
  %72 = getelementptr inbounds %struct.post_office, ptr %71, i32 0, i32 3
  %73 = load i32, ptr %72, align 8, !tbaa !13
  store i32 %73, ptr %9, align 4, !tbaa !9
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.town, ptr %74, i32 0, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !11
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds %struct.post_office, ptr %76, i64 %78
  %80 = getelementptr inbounds %struct.post_office, ptr %79, i32 0, i32 2
  %81 = load ptr, ptr %80, align 8, !tbaa !15
  %82 = load i32, ptr %9, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = mul i64 16, %84
  %86 = call ptr @realloc(ptr noundef %81, i64 noundef %85) #5
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.town, ptr %87, i32 0, i32 1
  %89 = load ptr, ptr %88, align 8, !tbaa !11
  %90 = load i32, ptr %8, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds %struct.post_office, ptr %89, i64 %91
  %93 = getelementptr inbounds %struct.post_office, ptr %92, i32 0, i32 2
  store ptr %86, ptr %93, align 8, !tbaa !15
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.town, ptr %94, i32 0, i32 1
  %96 = load ptr, ptr %95, align 8, !tbaa !11
  %97 = load i32, ptr %8, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds %struct.post_office, ptr %96, i64 %98
  %100 = getelementptr inbounds %struct.post_office, ptr %99, i32 0, i32 2
  %101 = load ptr, ptr %100, align 8, !tbaa !15
  %102 = load i32, ptr %9, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds %struct.package, ptr %101, i64 %103
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.town, ptr %105, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !11
  %108 = load i32, ptr %6, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds %struct.post_office, ptr %107, i64 %109
  %111 = getelementptr inbounds %struct.post_office, ptr %110, i32 0, i32 2
  %112 = load ptr, ptr %111, align 8, !tbaa !15
  %113 = load i32, ptr %14, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds %struct.package, ptr %112, i64 %114
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %104, ptr align 8 %115, i64 16, i1 false), !tbaa.struct !20
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.town, ptr %116, i32 0, i32 1
  %118 = load ptr, ptr %117, align 8, !tbaa !11
  %119 = load i32, ptr %6, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds %struct.post_office, ptr %118, i64 %120
  %122 = getelementptr inbounds %struct.post_office, ptr %121, i32 0, i32 3
  %123 = load i32, ptr %122, align 8, !tbaa !13
  store i32 %123, ptr %9, align 4, !tbaa !9
  %124 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %124, ptr %10, align 4, !tbaa !9
  br label %125

125:                                              ; preds = %130, %65
  %126 = load i32, ptr %10, align 4, !tbaa !9
  %127 = load i32, ptr %9, align 4, !tbaa !9
  %128 = sub nsw i32 %127, 1
  %129 = icmp slt i32 %126, %128
  br i1 %129, label %130, label %179

130:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #4
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.town, ptr %131, i32 0, i32 1
  %133 = load ptr, ptr %132, align 8, !tbaa !11
  %134 = load i32, ptr %6, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds %struct.post_office, ptr %133, i64 %135
  %137 = getelementptr inbounds %struct.post_office, ptr %136, i32 0, i32 2
  %138 = load ptr, ptr %137, align 8, !tbaa !15
  %139 = load i32, ptr %10, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds %struct.package, ptr %138, i64 %140
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %141, i64 16, i1 false), !tbaa.struct !20
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.town, ptr %142, i32 0, i32 1
  %144 = load ptr, ptr %143, align 8, !tbaa !11
  %145 = load i32, ptr %6, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds %struct.post_office, ptr %144, i64 %146
  %148 = getelementptr inbounds %struct.post_office, ptr %147, i32 0, i32 2
  %149 = load ptr, ptr %148, align 8, !tbaa !15
  %150 = load i32, ptr %10, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds %struct.package, ptr %149, i64 %151
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.town, ptr %153, i32 0, i32 1
  %155 = load ptr, ptr %154, align 8, !tbaa !11
  %156 = load i32, ptr %6, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds %struct.post_office, ptr %155, i64 %157
  %159 = getelementptr inbounds %struct.post_office, ptr %158, i32 0, i32 2
  %160 = load ptr, ptr %159, align 8, !tbaa !15
  %161 = load i32, ptr %10, align 4, !tbaa !9
  %162 = add nsw i32 %161, 1
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds %struct.package, ptr %160, i64 %163
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %152, ptr align 8 %164, i64 16, i1 false), !tbaa.struct !20
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.town, ptr %165, i32 0, i32 1
  %167 = load ptr, ptr %166, align 8, !tbaa !11
  %168 = load i32, ptr %6, align 4, !tbaa !9
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds %struct.post_office, ptr %167, i64 %169
  %171 = getelementptr inbounds %struct.post_office, ptr %170, i32 0, i32 2
  %172 = load ptr, ptr %171, align 8, !tbaa !15
  %173 = load i32, ptr %10, align 4, !tbaa !9
  %174 = add nsw i32 %173, 1
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds %struct.package, ptr %172, i64 %175
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %176, ptr align 8 %15, i64 16, i1 false), !tbaa.struct !20
  %177 = load i32, ptr %10, align 4, !tbaa !9
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  br label %125, !llvm.loop !21

179:                                              ; preds = %125
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.town, ptr %180, i32 0, i32 1
  %182 = load ptr, ptr %181, align 8, !tbaa !11
  %183 = load i32, ptr %6, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds %struct.post_office, ptr %182, i64 %184
  %186 = getelementptr inbounds %struct.post_office, ptr %185, i32 0, i32 2
  %187 = load ptr, ptr %186, align 8, !tbaa !15
  %188 = load i32, ptr %9, align 4, !tbaa !9
  %189 = sub nsw i32 %188, 1
  %190 = sext i32 %189 to i64
  %191 = mul i64 16, %190
  %192 = call ptr @realloc(ptr noundef %187, i64 noundef %191) #5
  %193 = load ptr, ptr %5, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.town, ptr %193, i32 0, i32 1
  %195 = load ptr, ptr %194, align 8, !tbaa !11
  %196 = load i32, ptr %6, align 4, !tbaa !9
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds %struct.post_office, ptr %195, i64 %197
  %199 = getelementptr inbounds %struct.post_office, ptr %198, i32 0, i32 2
  store ptr %192, ptr %199, align 8, !tbaa !15
  %200 = load ptr, ptr %7, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.town, ptr %200, i32 0, i32 1
  %202 = load ptr, ptr %201, align 8, !tbaa !11
  %203 = load i32, ptr %8, align 4, !tbaa !9
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds %struct.post_office, ptr %202, i64 %204
  %206 = getelementptr inbounds %struct.post_office, ptr %205, i32 0, i32 3
  %207 = load i32, ptr %206, align 8, !tbaa !13
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %206, align 8, !tbaa !13
  %209 = load ptr, ptr %5, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.town, ptr %209, i32 0, i32 1
  %211 = load ptr, ptr %210, align 8, !tbaa !11
  %212 = load i32, ptr %6, align 4, !tbaa !9
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds %struct.post_office, ptr %211, i64 %213
  %215 = getelementptr inbounds %struct.post_office, ptr %214, i32 0, i32 3
  %216 = load i32, ptr %215, align 8, !tbaa !13
  %217 = add nsw i32 %216, -1
  store i32 %217, ptr %215, align 8, !tbaa !13
  %218 = load i32, ptr %14, align 4, !tbaa !9
  %219 = add nsw i32 %218, -1
  store i32 %219, ptr %14, align 4, !tbaa !9
  br label %220

220:                                              ; preds = %179, %61, %28
  br label %221

221:                                              ; preds = %220
  %222 = load i32, ptr %14, align 4, !tbaa !9
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %14, align 4, !tbaa !9
  br label %16, !llvm.loop !23

224:                                              ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret void
}

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #2

; 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) #3

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

!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 = !{!12, !6, i64 8}
!12 = !{!"town", !6, i64 0, !6, i64 8, !10, i64 16}
!13 = !{!14, !10, i64 16}
!14 = !{!"post_office", !10, i64 0, !10, i64 4, !6, i64 8, !10, i64 16}
!15 = !{!14, !6, i64 8}
!16 = !{!17, !10, i64 8}
!17 = !{!"package", !6, i64 0, !10, i64 8}
!18 = !{!14, !10, i64 0}
!19 = !{!14, !10, i64 4}
!20 = !{i64 0, i64 8, !5, i64 8, i64 4, !9}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


; 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.package = type { ptr, i32 }
%struct.post_office = type { i32, i32, ptr, i32 }

; 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
define dso_local void @send_all_acceptable_packages(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef readonly %2, i32 noundef %3) local_unnamed_addr #1 {
  %5 = alloca %struct.package, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = sext i32 %1 to i64
  %8 = load ptr, ptr %6, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.post_office, ptr %8, i64 %7, i32 3
  %10 = load i32, ptr %9, align 8, !tbaa !11
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph62, label %._crit_edge63

.lr.ph62:                                         ; preds = %4
  %12 = getelementptr inbounds i8, ptr %2, i64 8
  %13 = sext i32 %3 to i64
  %.pre = load ptr, ptr %12, align 8, !tbaa !5
  br label %14

._crit_edge63:                                    ; preds = %72, %4
  ret void

14:                                               ; preds = %.lr.ph62, %72
  %15 = phi ptr [ %8, %.lr.ph62 ], [ %73, %72 ]
  %16 = phi ptr [ %.pre, %.lr.ph62 ], [ %74, %72 ]
  %.060 = phi i32 [ 0, %.lr.ph62 ], [ %75, %72 ]
  %17 = getelementptr inbounds %struct.post_office, ptr %15, i64 %7, i32 2
  %18 = load ptr, ptr %17, align 8, !tbaa !13
  %19 = sext i32 %.060 to i64
  %20 = getelementptr inbounds %struct.package, ptr %18, i64 %19, i32 1
  %21 = load i32, ptr %20, align 8, !tbaa !14
  %22 = getelementptr inbounds %struct.post_office, ptr %16, i64 %13
  %23 = load i32, ptr %22, align 8, !tbaa !16
  %.not = icmp sgt i32 %23, %21
  br i1 %.not, label %72, label %24

24:                                               ; preds = %14
  %25 = getelementptr inbounds i8, ptr %22, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !17
  %.not58 = icmp sgt i32 %21, %26
  br i1 %.not58, label %72, label %27

27:                                               ; preds = %24
  %28 = getelementptr inbounds i8, ptr %22, i64 16
  %29 = load i32, ptr %28, align 8, !tbaa !11
  %30 = getelementptr inbounds i8, ptr %22, i64 8
  %31 = load ptr, ptr %30, align 8, !tbaa !13
  %32 = add nsw i32 %29, 1
  %33 = sext i32 %32 to i64
  %34 = shl nsw i64 %33, 4
  %35 = tail call ptr @realloc(ptr noundef %31, i64 noundef %34) #4
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.post_office, ptr %36, i64 %13, i32 2
  store ptr %35, ptr %37, align 8, !tbaa !13
  %38 = sext i32 %29 to i64
  %39 = getelementptr inbounds %struct.package, ptr %35, i64 %38
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.post_office, ptr %40, i64 %7, i32 2
  %42 = load ptr, ptr %41, align 8, !tbaa !13
  %43 = getelementptr inbounds %struct.package, ptr %42, i64 %19
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 8 dereferenceable(16) %43, i64 16, i1 false), !tbaa.struct !18
  %44 = getelementptr inbounds %struct.post_office, ptr %40, i64 %7, i32 3
  %45 = load i32, ptr %44, align 8, !tbaa !11
  %46 = add nsw i32 %45, -1
  %47 = icmp slt i32 %.060, %46
  %wide.trip.count = sext i32 %46 to i64
  br i1 %47, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %27, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %19, %27 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5)
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.post_office, ptr %48, i64 %7, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !13
  %51 = getelementptr inbounds %struct.package, ptr %50, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %51, i64 16, i1 false), !tbaa.struct !18
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %52 = getelementptr inbounds %struct.package, ptr %50, i64 %indvars.iv.next
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 8 dereferenceable(16) %52, i64 16, i1 false), !tbaa.struct !18
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.post_office, ptr %53, i64 %7, i32 2
  %55 = load ptr, ptr %54, align 8, !tbaa !13
  %56 = getelementptr inbounds %struct.package, ptr %55, i64 %indvars.iv.next
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %56, ptr noundef nonnull align 8 dereferenceable(16) %5, i64 16, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5)
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !21

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre65 = load ptr, ptr %6, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %27, %._crit_edge.loopexit
  %57 = phi ptr [ %.pre65, %._crit_edge.loopexit ], [ %40, %27 ]
  %58 = getelementptr inbounds %struct.post_office, ptr %57, i64 %7, i32 2
  %59 = load ptr, ptr %58, align 8, !tbaa !13
  %60 = shl nsw i64 %wide.trip.count, 4
  %61 = tail call ptr @realloc(ptr noundef %59, i64 noundef %60) #4
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.post_office, ptr %62, i64 %7, i32 2
  store ptr %61, ptr %63, align 8, !tbaa !13
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.post_office, ptr %64, i64 %13, i32 3
  %66 = load i32, ptr %65, align 8, !tbaa !11
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %65, align 8, !tbaa !11
  %68 = getelementptr inbounds %struct.post_office, ptr %62, i64 %7, i32 3
  %69 = load i32, ptr %68, align 8, !tbaa !11
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr %68, align 8, !tbaa !11
  %71 = add nsw i32 %.060, -1
  br label %72

72:                                               ; preds = %14, %24, %._crit_edge
  %73 = phi ptr [ %62, %._crit_edge ], [ %15, %24 ], [ %15, %14 ]
  %74 = phi ptr [ %64, %._crit_edge ], [ %16, %24 ], [ %16, %14 ]
  %.1 = phi i32 [ %71, %._crit_edge ], [ %.060, %24 ], [ %.060, %14 ]
  %75 = add nsw i32 %.1, 1
  %76 = getelementptr inbounds %struct.post_office, ptr %73, i64 %7, i32 3
  %77 = load i32, ptr %76, align 8, !tbaa !11
  %78 = icmp slt i32 %75, %77
  br i1 %78, label %14, label %._crit_edge63, !llvm.loop !23
}

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #2

; 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) #3

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 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind allocsize(1) }

!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 8}
!6 = !{!"town", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"post_office", !10, i64 0, !10, i64 4, !7, i64 8, !10, i64 16}
!13 = !{!12, !7, i64 8}
!14 = !{!15, !10, i64 8}
!15 = !{!"package", !7, i64 0, !10, i64 8}
!16 = !{!12, !10, i64 0}
!17 = !{!12, !10, i64 4}
!18 = !{i64 0, i64 8, !19, i64 8, i64 4, !20}
!19 = !{!7, !7, i64 0}
!20 = !{!10, !10, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


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