; LLVM IR from Water-Melon/Melon :: src (mln_bignum)

; 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.mln_bignum_t = type { i32, i32, [257 x i64] }

; 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 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @__mln_bignum_div(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @__mln_bignum_compare(ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @mln_bignum_extend_eulid(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, ptr noundef %3) #4 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.mln_bignum_t, align 8
  %11 = alloca %struct.mln_bignum_t, align 8
  %12 = alloca %struct.mln_bignum_t, align 8
  %13 = alloca %struct.mln_bignum_t, align 8
  %14 = alloca %struct.mln_bignum_t, align 8
  %15 = alloca %struct.mln_bignum_t, align 8
  %16 = alloca %struct.mln_bignum_t, align 8
  %17 = alloca %struct.mln_bignum_t, align 8
  %18 = alloca %struct.mln_bignum_t, align 8
  %19 = alloca %struct.mln_bignum_t, align 8
  %20 = alloca %struct.mln_bignum_t, align 8
  %21 = alloca %struct.mln_bignum_t, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2064, ptr %10) #5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %23, i64 2064, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 2064, ptr %11) #5
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %24, i64 2064, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 2064, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 2064, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 2064, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 2064, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 2064, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 2064, ptr %17) #5
  call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 2064, i1 false)
  call void @llvm.lifetime.start.p0(i64 2064, ptr %18) #5
  call void @llvm.memset.p0.i64(ptr align 8 %18, i8 0, i64 2064, i1 false)
  %25 = getelementptr inbounds %struct.mln_bignum_t, ptr %18, i32 0, i32 1
  store i32 1, ptr %25, align 4
  %26 = getelementptr inbounds %struct.mln_bignum_t, ptr %18, i32 0, i32 2
  %27 = getelementptr inbounds [257 x i64], ptr %26, i64 0, i64 0
  store i64 1, ptr %27, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 2064, ptr %19) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %17, i64 2064, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 2064, ptr %20) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %17, i64 2064, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 2064, ptr %21) #5
  call void @llvm.memset.p0.i64(ptr align 8 %21, i8 0, i64 2064, i1 false)
  %28 = getelementptr inbounds %struct.mln_bignum_t, ptr %21, i32 0, i32 1
  store i32 1, ptr %28, align 4
  %29 = getelementptr inbounds %struct.mln_bignum_t, ptr %21, i32 0, i32 2
  %30 = getelementptr inbounds [257 x i64], ptr %29, i64 0, i64 0
  store i64 1, ptr %30, align 8, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %20, i64 2064, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %21, i64 2064, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %10, i64 2064, i1 false), !tbaa.struct !9
  %31 = call i32 @__mln_bignum_div(ptr noundef %12, ptr noundef %11, ptr noundef %13)
  %32 = icmp slt i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %4
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %54

34:                                               ; preds = %4
  br label %35

35:                                               ; preds = %42, %34
  %36 = call i32 @__mln_bignum_compare(ptr noundef %12, ptr noundef %17)
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %38, label %43

38:                                               ; preds = %35
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %13, i64 2064, i1 false), !tbaa.struct !9
  call void @__mln_bignum_mul(ptr noundef %14, ptr noundef %20)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %18, i64 2064, i1 false), !tbaa.struct !9
  call void @__mln_bignum_sub(ptr noundef %15, ptr noundef %14)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %13, i64 2064, i1 false), !tbaa.struct !9
  call void @__mln_bignum_mul(ptr noundef %14, ptr noundef %21)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %19, i64 2064, i1 false), !tbaa.struct !9
  call void @__mln_bignum_sub(ptr noundef %16, ptr noundef %14)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %20, i64 2064, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %21, i64 2064, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %15, i64 2064, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %16, i64 2064, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %11, i64 2064, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %12, i64 2064, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %10, i64 2064, i1 false), !tbaa.struct !9
  %39 = call i32 @__mln_bignum_div(ptr noundef %12, ptr noundef %11, ptr noundef %13)
  %40 = icmp slt i32 %39, 0
  br i1 %40, label %41, label %42

41:                                               ; preds = %38
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %54

42:                                               ; preds = %38
  br label %35, !llvm.loop !15

43:                                               ; preds = %35
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %48

46:                                               ; preds = %43
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %47, ptr align 8 %15, i64 2064, i1 false), !tbaa.struct !9
  br label %48

48:                                               ; preds = %46, %43
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %53

51:                                               ; preds = %48
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %52, ptr align 8 %16, i64 2064, i1 false), !tbaa.struct !9
  br label %53

53:                                               ; preds = %51, %48
  store i32 0, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %54

54:                                               ; preds = %53, %41, %33
  call void @llvm.lifetime.end.p0(i64 2064, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr %10) #5
  %55 = load i32, ptr %5, align 4
  ret i32 %55
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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/C++ TBAA"}
!9 = !{i64 0, i64 4, !10, i64 4, i64 4, !10, i64 8, i64 2056, !12}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; 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.mln_bignum_t = type { i32, i32, [257 x i64] }

; 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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @__mln_bignum_sub(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @__mln_bignum_mul(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @__mln_bignum_div(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @__mln_bignum_compare(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @mln_bignum_extend_eulid(ptr nocapture noundef nonnull readonly %0, ptr nocapture noundef nonnull readonly %1, ptr noundef writeonly %2, ptr noundef writeonly %3) local_unnamed_addr #4 {
  %5 = alloca %struct.mln_bignum_t, align 8
  %6 = alloca %struct.mln_bignum_t, align 8
  %7 = alloca %struct.mln_bignum_t, align 8
  %8 = alloca %struct.mln_bignum_t, align 8
  %9 = alloca %struct.mln_bignum_t, align 8
  %10 = alloca %struct.mln_bignum_t, align 8
  %11 = alloca %struct.mln_bignum_t, align 8
  %12 = alloca %struct.mln_bignum_t, align 8
  %.sroa.7 = alloca [256 x i64], align 8
  %13 = alloca %struct.mln_bignum_t, align 8
  %14 = alloca %struct.mln_bignum_t, align 8
  %15 = alloca %struct.mln_bignum_t, align 8
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %5)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %5, ptr noundef nonnull align 8 dereferenceable(2064) %0, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %6) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %6, ptr noundef nonnull align 8 dereferenceable(2064) %1, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %12) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %12, i8 0, i64 2064, i1 false)
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %.sroa.7)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(2048) %.sroa.7, i8 0, i64 2048, i1 false)
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %13)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %13, i8 0, i64 2064, i1 false)
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %14) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %14, i8 0, i64 2064, i1 false)
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %15) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %15, i8 0, i64 2064, i1 false)
  %16 = getelementptr inbounds i8, ptr %15, i64 4
  store i32 1, ptr %16, align 4
  %17 = getelementptr inbounds i8, ptr %15, i64 8
  store i64 1, ptr %17, align 8, !tbaa !11
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %10, i8 0, i64 2064, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %11, ptr noundef nonnull align 8 dereferenceable(2064) %15, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %7, ptr noundef nonnull align 8 dereferenceable(2064) %0, i64 2064, i1 false)
  %18 = call i32 @__mln_bignum_div(ptr noundef nonnull %7, ptr noundef nonnull %6, ptr noundef nonnull %8)
  %19 = icmp slt i32 %18, 0
  br i1 %19, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %4
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 16
  %.sroa.6.0..sroa_idx4 = getelementptr inbounds i8, ptr %14, i64 8
  %.sroa.7.0..sroa_idx6 = getelementptr inbounds i8, ptr %14, i64 16
  br label %20

20:                                               ; preds = %.preheader, %24
  %.sroa.6.0 = phi i64 [ %.sroa.6.0.copyload5, %24 ], [ 1, %.preheader ]
  %21 = phi <2 x i32> [ %25, %24 ], [ <i32 0, i32 1>, %.preheader ]
  %22 = call i32 @__mln_bignum_compare(ptr noundef nonnull %7, ptr noundef nonnull %12)
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %24, label %28

24:                                               ; preds = %20
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %9, ptr noundef nonnull align 8 dereferenceable(2064) %8, i64 2064, i1 false), !tbaa.struct !5
  call void @__mln_bignum_mul(ptr noundef nonnull %9, ptr noundef nonnull %14)
  store i64 %.sroa.6.0, ptr %.sroa.6.0..sroa_idx, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2048) %.sroa.7.0..sroa_idx, ptr noundef nonnull align 8 dereferenceable(2048) %.sroa.7, i64 2048, i1 false), !tbaa.struct !13
  store <2 x i32> %21, ptr %10, align 8, !tbaa !6
  call void @__mln_bignum_sub(ptr noundef nonnull %10, ptr noundef nonnull %9)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %9, ptr noundef nonnull align 8 dereferenceable(2064) %8, i64 2064, i1 false), !tbaa.struct !5
  call void @__mln_bignum_mul(ptr noundef nonnull %9, ptr noundef nonnull %15)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %11, ptr noundef nonnull align 8 dereferenceable(2064) %13, i64 2064, i1 false), !tbaa.struct !5
  call void @__mln_bignum_sub(ptr noundef nonnull %11, ptr noundef nonnull %9)
  %25 = load <2 x i32>, ptr %14, align 8, !tbaa !6
  %.sroa.6.0.copyload5 = load i64, ptr %.sroa.6.0..sroa_idx4, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2048) %.sroa.7, ptr noundef nonnull align 8 dereferenceable(2048) %.sroa.7.0..sroa_idx6, i64 2048, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %13, ptr noundef nonnull align 8 dereferenceable(2064) %15, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %14, ptr noundef nonnull align 8 dereferenceable(2064) %10, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %15, ptr noundef nonnull align 8 dereferenceable(2064) %11, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %5, ptr noundef nonnull align 8 dereferenceable(2064) %6, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %6, ptr noundef nonnull align 8 dereferenceable(2064) %7, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %7, ptr noundef nonnull align 8 dereferenceable(2064) %5, i64 2064, i1 false), !tbaa.struct !5
  %26 = call i32 @__mln_bignum_div(ptr noundef nonnull %7, ptr noundef nonnull %6, ptr noundef nonnull %8)
  %27 = icmp slt i32 %26, 0
  br i1 %27, label %.loopexit, label %20, !llvm.loop !14

28:                                               ; preds = %20
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %30, label %29

29:                                               ; preds = %28
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %2, ptr noundef nonnull align 8 dereferenceable(2064) %10, i64 2064, i1 false), !tbaa.struct !5
  br label %30

30:                                               ; preds = %29, %28
  %.not14 = icmp eq ptr %3, null
  br i1 %.not14, label %.loopexit, label %31

31:                                               ; preds = %30
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %3, ptr noundef nonnull align 8 dereferenceable(2064) %11, i64 2064, i1 false), !tbaa.struct !5
  br label %.loopexit

.loopexit:                                        ; preds = %24, %30, %31, %4
  %.0 = phi i32 [ -1, %4 ], [ 0, %31 ], [ 0, %30 ], [ -1, %24 ]
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %13)
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %.sroa.7)
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %5)
  ret i32 %.0
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 2056, !10}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!8, !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{i64 0, i64 2048, !10}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass