; LLVM IR from bytecodealliance/sightglass :: benchmarks/shootout/src (memmove)

; 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"

@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@black_box = external hidden global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i8, align 1
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 10000, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %7 = load i64, ptr %2, align 8, !tbaa !5
  %8 = call noalias ptr @calloc(i64 noundef %7, i64 noundef 1) #8
  store ptr %8, ptr %3, align 8, !tbaa !9
  %9 = load ptr, ptr %3, align 8, !tbaa !9
  %10 = icmp ne ptr %9, null
  br i1 %10, label %11, label %12

11:                                               ; preds = %0
  br label %13

12:                                               ; preds = %0
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 13, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

13:                                               ; preds = %11
  call void (...) @bench_start()
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i32 0, ptr %4, align 4, !tbaa !11
  br label %14

14:                                               ; preds = %53, %13
  %15 = load i32, ptr %4, align 4, !tbaa !11
  %16 = icmp slt i32 %15, 10
  br i1 %16, label %17, label %56

17:                                               ; preds = %14
  %18 = load volatile ptr, ptr @black_box, align 8, !tbaa !9
  call void %18(ptr noundef %3)
  store i64 0, ptr %5, align 8, !tbaa !5
  br label %19

19:                                               ; preds = %32, %17
  %20 = load i64, ptr %5, align 8, !tbaa !5
  %21 = load i64, ptr %2, align 8, !tbaa !5
  %22 = sub i64 %21, 1
  %23 = icmp ult i64 %20, %22
  br i1 %23, label %24, label %35

24:                                               ; preds = %19
  %25 = load ptr, ptr %3, align 8, !tbaa !9
  %26 = load i64, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %25, i64 %26
  %28 = load ptr, ptr %3, align 8, !tbaa !9
  %29 = load i64, ptr %2, align 8, !tbaa !5
  %30 = load i64, ptr %5, align 8, !tbaa !5
  %31 = sub i64 %29, %30
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %27, ptr align 1 %28, i64 %31, i1 false)
  br label %32

32:                                               ; preds = %24
  %33 = load i64, ptr %5, align 8, !tbaa !5
  %34 = add i64 %33, 1
  store i64 %34, ptr %5, align 8, !tbaa !5
  br label %19, !llvm.loop !13

35:                                               ; preds = %19
  store i64 0, ptr %5, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %49, %35
  %37 = load i64, ptr %5, align 8, !tbaa !5
  %38 = load i64, ptr %2, align 8, !tbaa !5
  %39 = sub i64 %38, 1
  %40 = icmp ult i64 %37, %39
  br i1 %40, label %41, label %52

41:                                               ; preds = %36
  %42 = load ptr, ptr %3, align 8, !tbaa !9
  %43 = load ptr, ptr %3, align 8, !tbaa !9
  %44 = load i64, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %43, i64 %44
  %46 = load i64, ptr %2, align 8, !tbaa !5
  %47 = load i64, ptr %5, align 8, !tbaa !5
  %48 = sub i64 %46, %47
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %42, ptr align 1 %45, i64 %48, i1 false)
  br label %49

49:                                               ; preds = %41
  %50 = load i64, ptr %5, align 8, !tbaa !5
  %51 = add i64 %50, 1
  store i64 %51, ptr %5, align 8, !tbaa !5
  br label %36, !llvm.loop !15

52:                                               ; preds = %36
  br label %53

53:                                               ; preds = %52
  %54 = load i32, ptr %4, align 4, !tbaa !11
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %4, align 4, !tbaa !11
  br label %14, !llvm.loop !16

56:                                               ; preds = %14
  call void (...) @bench_end()
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #7
  %57 = load ptr, ptr %3, align 8, !tbaa !9
  %58 = getelementptr inbounds i8, ptr %57, i64 0
  %59 = load i8, ptr %58, align 1, !tbaa !17
  store i8 %59, ptr %6, align 1, !tbaa !17
  %60 = load volatile ptr, ptr @black_box, align 8, !tbaa !9
  call void %60(ptr noundef %3)
  %61 = load ptr, ptr %3, align 8, !tbaa !9
  call void @free(ptr noundef %61) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %62 = load i32, ptr %1, align 4
  ret i32 %62
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

declare void @bench_start(...) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #5

declare void @bench_end(...) #4

; Function Attrs: nounwind
declare void @free(ptr noundef) #6

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind allocsize(0,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 = { 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }
attributes #9 = { 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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = !{!7, !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@black_box = external hidden global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %2 = tail call noalias dereferenceable_or_null(10000) ptr @calloc(i64 noundef 10000, i64 noundef 1) #8
  store ptr %2, ptr %1, align 8, !tbaa !5
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %3, label %4

3:                                                ; preds = %0
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 13, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

4:                                                ; preds = %0
  tail call void (...) @bench_start() #7
  %5 = load volatile ptr, ptr @black_box, align 8, !tbaa !5
  call void %5(ptr noundef nonnull %1) #7
  br label %6

6:                                                ; preds = %6, %4
  %.01617 = phi i64 [ 0, %4 ], [ %18, %6 ]
  %7 = load ptr, ptr %1, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 %.01617
  %9 = sub nuw nsw i64 10000, %.01617
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %8, ptr align 1 %7, i64 %9, i1 false)
  %10 = load ptr, ptr %1, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %10, i64 %.01617
  %12 = getelementptr inbounds i8, ptr %11, i64 1
  %13 = sub nuw nsw i64 9999, %.01617
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %12, ptr align 1 %10, i64 %13, i1 false)
  %14 = load ptr, ptr %1, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %14, i64 %.01617
  %16 = getelementptr inbounds i8, ptr %15, i64 2
  %17 = sub nuw nsw i64 9998, %.01617
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %16, ptr align 1 %14, i64 %17, i1 false)
  %18 = add nuw nsw i64 %.01617, 3
  %exitcond.not.2 = icmp eq i64 %18, 9999
  br i1 %exitcond.not.2, label %.preheader, label %6, !llvm.loop !9

.preheader:                                       ; preds = %6, %.preheader
  %.118 = phi i64 [ %30, %.preheader ], [ 0, %6 ]
  %19 = load ptr, ptr %1, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 %.118
  %21 = sub nuw nsw i64 10000, %.118
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %19, ptr align 1 %20, i64 %21, i1 false)
  %22 = load ptr, ptr %1, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 %.118
  %24 = getelementptr inbounds i8, ptr %23, i64 1
  %25 = sub nuw nsw i64 9999, %.118
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %22, ptr nonnull align 1 %24, i64 %25, i1 false)
  %26 = load ptr, ptr %1, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 %.118
  %28 = getelementptr inbounds i8, ptr %27, i64 2
  %29 = sub nuw nsw i64 9998, %.118
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %26, ptr nonnull align 1 %28, i64 %29, i1 false)
  %30 = add nuw nsw i64 %.118, 3
  %exitcond20.not.2 = icmp eq i64 %30, 9999
  br i1 %exitcond20.not.2, label %31, label %.preheader, !llvm.loop !11

31:                                               ; preds = %.preheader
  %32 = load volatile ptr, ptr @black_box, align 8, !tbaa !5
  call void %32(ptr noundef nonnull %1) #7
  br label %33

33:                                               ; preds = %33, %31
  %.01617.1 = phi i64 [ 0, %31 ], [ %45, %33 ]
  %34 = load ptr, ptr %1, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 %.01617.1
  %36 = sub nuw nsw i64 10000, %.01617.1
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %35, ptr align 1 %34, i64 %36, i1 false)
  %37 = load ptr, ptr %1, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i64 %.01617.1
  %39 = getelementptr inbounds i8, ptr %38, i64 1
  %40 = sub nuw nsw i64 9999, %.01617.1
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %39, ptr align 1 %37, i64 %40, i1 false)
  %41 = load ptr, ptr %1, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i64 %.01617.1
  %43 = getelementptr inbounds i8, ptr %42, i64 2
  %44 = sub nuw nsw i64 9998, %.01617.1
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %43, ptr align 1 %41, i64 %44, i1 false)
  %45 = add nuw nsw i64 %.01617.1, 3
  %exitcond.1.not.2 = icmp eq i64 %45, 9999
  br i1 %exitcond.1.not.2, label %.preheader.1, label %33, !llvm.loop !9

.preheader.1:                                     ; preds = %33, %.preheader.1
  %.118.1 = phi i64 [ %57, %.preheader.1 ], [ 0, %33 ]
  %46 = load ptr, ptr %1, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i64 %.118.1
  %48 = sub nuw nsw i64 10000, %.118.1
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %46, ptr align 1 %47, i64 %48, i1 false)
  %49 = load ptr, ptr %1, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 %.118.1
  %51 = getelementptr inbounds i8, ptr %50, i64 1
  %52 = sub nuw nsw i64 9999, %.118.1
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %49, ptr nonnull align 1 %51, i64 %52, i1 false)
  %53 = load ptr, ptr %1, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 %.118.1
  %55 = getelementptr inbounds i8, ptr %54, i64 2
  %56 = sub nuw nsw i64 9998, %.118.1
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %53, ptr nonnull align 1 %55, i64 %56, i1 false)
  %57 = add nuw nsw i64 %.118.1, 3
  %exitcond20.1.not.2 = icmp eq i64 %57, 9999
  br i1 %exitcond20.1.not.2, label %58, label %.preheader.1, !llvm.loop !11

58:                                               ; preds = %.preheader.1
  %59 = load volatile ptr, ptr @black_box, align 8, !tbaa !5
  call void %59(ptr noundef nonnull %1) #7
  br label %60

60:                                               ; preds = %60, %58
  %.01617.2 = phi i64 [ 0, %58 ], [ %72, %60 ]
  %61 = load ptr, ptr %1, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 %.01617.2
  %63 = sub nuw nsw i64 10000, %.01617.2
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %62, ptr align 1 %61, i64 %63, i1 false)
  %64 = load ptr, ptr %1, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 %.01617.2
  %66 = getelementptr inbounds i8, ptr %65, i64 1
  %67 = sub nuw nsw i64 9999, %.01617.2
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %66, ptr align 1 %64, i64 %67, i1 false)
  %68 = load ptr, ptr %1, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %68, i64 %.01617.2
  %70 = getelementptr inbounds i8, ptr %69, i64 2
  %71 = sub nuw nsw i64 9998, %.01617.2
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %70, ptr align 1 %68, i64 %71, i1 false)
  %72 = add nuw nsw i64 %.01617.2, 3
  %exitcond.2.not.2 = icmp eq i64 %72, 9999
  br i1 %exitcond.2.not.2, label %.preheader.2, label %60, !llvm.loop !9

.preheader.2:                                     ; preds = %60, %.preheader.2
  %.118.2 = phi i64 [ %84, %.preheader.2 ], [ 0, %60 ]
  %73 = load ptr, ptr %1, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i64 %.118.2
  %75 = sub nuw nsw i64 10000, %.118.2
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %73, ptr align 1 %74, i64 %75, i1 false)
  %76 = load ptr, ptr %1, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i64 %.118.2
  %78 = getelementptr inbounds i8, ptr %77, i64 1
  %79 = sub nuw nsw i64 9999, %.118.2
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %76, ptr nonnull align 1 %78, i64 %79, i1 false)
  %80 = load ptr, ptr %1, align 8, !tbaa !5
  %81 = getelementptr inbounds i8, ptr %80, i64 %.118.2
  %82 = getelementptr inbounds i8, ptr %81, i64 2
  %83 = sub nuw nsw i64 9998, %.118.2
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %80, ptr nonnull align 1 %82, i64 %83, i1 false)
  %84 = add nuw nsw i64 %.118.2, 3
  %exitcond20.2.not.2 = icmp eq i64 %84, 9999
  br i1 %exitcond20.2.not.2, label %85, label %.preheader.2, !llvm.loop !11

85:                                               ; preds = %.preheader.2
  %86 = load volatile ptr, ptr @black_box, align 8, !tbaa !5
  call void %86(ptr noundef nonnull %1) #7
  br label %87

87:                                               ; preds = %87, %85
  %.01617.3 = phi i64 [ 0, %85 ], [ %99, %87 ]
  %88 = load ptr, ptr %1, align 8, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %88, i64 %.01617.3
  %90 = sub nuw nsw i64 10000, %.01617.3
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %89, ptr align 1 %88, i64 %90, i1 false)
  %91 = load ptr, ptr %1, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %91, i64 %.01617.3
  %93 = getelementptr inbounds i8, ptr %92, i64 1
  %94 = sub nuw nsw i64 9999, %.01617.3
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %93, ptr align 1 %91, i64 %94, i1 false)
  %95 = load ptr, ptr %1, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i64 %.01617.3
  %97 = getelementptr inbounds i8, ptr %96, i64 2
  %98 = sub nuw nsw i64 9998, %.01617.3
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %97, ptr align 1 %95, i64 %98, i1 false)
  %99 = add nuw nsw i64 %.01617.3, 3
  %exitcond.3.not.2 = icmp eq i64 %99, 9999
  br i1 %exitcond.3.not.2, label %.preheader.3, label %87, !llvm.loop !9

.preheader.3:                                     ; preds = %87, %.preheader.3
  %.118.3 = phi i64 [ %111, %.preheader.3 ], [ 0, %87 ]
  %100 = load ptr, ptr %1, align 8, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i64 %.118.3
  %102 = sub nuw nsw i64 10000, %.118.3
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %100, ptr align 1 %101, i64 %102, i1 false)
  %103 = load ptr, ptr %1, align 8, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %103, i64 %.118.3
  %105 = getelementptr inbounds i8, ptr %104, i64 1
  %106 = sub nuw nsw i64 9999, %.118.3
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %103, ptr nonnull align 1 %105, i64 %106, i1 false)
  %107 = load ptr, ptr %1, align 8, !tbaa !5
  %108 = getelementptr inbounds i8, ptr %107, i64 %.118.3
  %109 = getelementptr inbounds i8, ptr %108, i64 2
  %110 = sub nuw nsw i64 9998, %.118.3
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %107, ptr nonnull align 1 %109, i64 %110, i1 false)
  %111 = add nuw nsw i64 %.118.3, 3
  %exitcond20.3.not.2 = icmp eq i64 %111, 9999
  br i1 %exitcond20.3.not.2, label %112, label %.preheader.3, !llvm.loop !11

112:                                              ; preds = %.preheader.3
  %113 = load volatile ptr, ptr @black_box, align 8, !tbaa !5
  call void %113(ptr noundef nonnull %1) #7
  br label %114

114:                                              ; preds = %114, %112
  %.01617.4 = phi i64 [ 0, %112 ], [ %126, %114 ]
  %115 = load ptr, ptr %1, align 8, !tbaa !5
  %116 = getelementptr inbounds i8, ptr %115, i64 %.01617.4
  %117 = sub nuw nsw i64 10000, %.01617.4
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %116, ptr align 1 %115, i64 %117, i1 false)
  %118 = load ptr, ptr %1, align 8, !tbaa !5
  %119 = getelementptr inbounds i8, ptr %118, i64 %.01617.4
  %120 = getelementptr inbounds i8, ptr %119, i64 1
  %121 = sub nuw nsw i64 9999, %.01617.4
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %120, ptr align 1 %118, i64 %121, i1 false)
  %122 = load ptr, ptr %1, align 8, !tbaa !5
  %123 = getelementptr inbounds i8, ptr %122, i64 %.01617.4
  %124 = getelementptr inbounds i8, ptr %123, i64 2
  %125 = sub nuw nsw i64 9998, %.01617.4
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %124, ptr align 1 %122, i64 %125, i1 false)
  %126 = add nuw nsw i64 %.01617.4, 3
  %exitcond.4.not.2 = icmp eq i64 %126, 9999
  br i1 %exitcond.4.not.2, label %.preheader.4, label %114, !llvm.loop !9

.preheader.4:                                     ; preds = %114, %.preheader.4
  %.118.4 = phi i64 [ %138, %.preheader.4 ], [ 0, %114 ]
  %127 = load ptr, ptr %1, align 8, !tbaa !5
  %128 = getelementptr inbounds i8, ptr %127, i64 %.118.4
  %129 = sub nuw nsw i64 10000, %.118.4
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %127, ptr align 1 %128, i64 %129, i1 false)
  %130 = load ptr, ptr %1, align 8, !tbaa !5
  %131 = getelementptr inbounds i8, ptr %130, i64 %.118.4
  %132 = getelementptr inbounds i8, ptr %131, i64 1
  %133 = sub nuw nsw i64 9999, %.118.4
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %130, ptr nonnull align 1 %132, i64 %133, i1 false)
  %134 = load ptr, ptr %1, align 8, !tbaa !5
  %135 = getelementptr inbounds i8, ptr %134, i64 %.118.4
  %136 = getelementptr inbounds i8, ptr %135, i64 2
  %137 = sub nuw nsw i64 9998, %.118.4
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %134, ptr nonnull align 1 %136, i64 %137, i1 false)
  %138 = add nuw nsw i64 %.118.4, 3
  %exitcond20.4.not.2 = icmp eq i64 %138, 9999
  br i1 %exitcond20.4.not.2, label %139, label %.preheader.4, !llvm.loop !11

139:                                              ; preds = %.preheader.4
  %140 = load volatile ptr, ptr @black_box, align 8, !tbaa !5
  call void %140(ptr noundef nonnull %1) #7
  br label %141

141:                                              ; preds = %141, %139
  %.01617.5 = phi i64 [ 0, %139 ], [ %153, %141 ]
  %142 = load ptr, ptr %1, align 8, !tbaa !5
  %143 = getelementptr inbounds i8, ptr %142, i64 %.01617.5
  %144 = sub nuw nsw i64 10000, %.01617.5
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %143, ptr align 1 %142, i64 %144, i1 false)
  %145 = load ptr, ptr %1, align 8, !tbaa !5
  %146 = getelementptr inbounds i8, ptr %145, i64 %.01617.5
  %147 = getelementptr inbounds i8, ptr %146, i64 1
  %148 = sub nuw nsw i64 9999, %.01617.5
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %147, ptr align 1 %145, i64 %148, i1 false)
  %149 = load ptr, ptr %1, align 8, !tbaa !5
  %150 = getelementptr inbounds i8, ptr %149, i64 %.01617.5
  %151 = getelementptr inbounds i8, ptr %150, i64 2
  %152 = sub nuw nsw i64 9998, %.01617.5
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %151, ptr align 1 %149, i64 %152, i1 false)
  %153 = add nuw nsw i64 %.01617.5, 3
  %exitcond.5.not.2 = icmp eq i64 %153, 9999
  br i1 %exitcond.5.not.2, label %.preheader.5, label %141, !llvm.loop !9

.preheader.5:                                     ; preds = %141, %.preheader.5
  %.118.5 = phi i64 [ %165, %.preheader.5 ], [ 0, %141 ]
  %154 = load ptr, ptr %1, align 8, !tbaa !5
  %155 = getelementptr inbounds i8, ptr %154, i64 %.118.5
  %156 = sub nuw nsw i64 10000, %.118.5
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %154, ptr align 1 %155, i64 %156, i1 false)
  %157 = load ptr, ptr %1, align 8, !tbaa !5
  %158 = getelementptr inbounds i8, ptr %157, i64 %.118.5
  %159 = getelementptr inbounds i8, ptr %158, i64 1
  %160 = sub nuw nsw i64 9999, %.118.5
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %157, ptr nonnull align 1 %159, i64 %160, i1 false)
  %161 = load ptr, ptr %1, align 8, !tbaa !5
  %162 = getelementptr inbounds i8, ptr %161, i64 %.118.5
  %163 = getelementptr inbounds i8, ptr %162, i64 2
  %164 = sub nuw nsw i64 9998, %.118.5
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %161, ptr nonnull align 1 %163, i64 %164, i1 false)
  %165 = add nuw nsw i64 %.118.5, 3
  %exitcond20.5.not.2 = icmp eq i64 %165, 9999
  br i1 %exitcond20.5.not.2, label %166, label %.preheader.5, !llvm.loop !11

166:                                              ; preds = %.preheader.5
  %167 = load volatile ptr, ptr @black_box, align 8, !tbaa !5
  call void %167(ptr noundef nonnull %1) #7
  br label %168

168:                                              ; preds = %168, %166
  %.01617.6 = phi i64 [ 0, %166 ], [ %180, %168 ]
  %169 = load ptr, ptr %1, align 8, !tbaa !5
  %170 = getelementptr inbounds i8, ptr %169, i64 %.01617.6
  %171 = sub nuw nsw i64 10000, %.01617.6
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %170, ptr align 1 %169, i64 %171, i1 false)
  %172 = load ptr, ptr %1, align 8, !tbaa !5
  %173 = getelementptr inbounds i8, ptr %172, i64 %.01617.6
  %174 = getelementptr inbounds i8, ptr %173, i64 1
  %175 = sub nuw nsw i64 9999, %.01617.6
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %174, ptr align 1 %172, i64 %175, i1 false)
  %176 = load ptr, ptr %1, align 8, !tbaa !5
  %177 = getelementptr inbounds i8, ptr %176, i64 %.01617.6
  %178 = getelementptr inbounds i8, ptr %177, i64 2
  %179 = sub nuw nsw i64 9998, %.01617.6
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %178, ptr align 1 %176, i64 %179, i1 false)
  %180 = add nuw nsw i64 %.01617.6, 3
  %exitcond.6.not.2 = icmp eq i64 %180, 9999
  br i1 %exitcond.6.not.2, label %.preheader.6, label %168, !llvm.loop !9

.preheader.6:                                     ; preds = %168, %.preheader.6
  %.118.6 = phi i64 [ %192, %.preheader.6 ], [ 0, %168 ]
  %181 = load ptr, ptr %1, align 8, !tbaa !5
  %182 = getelementptr inbounds i8, ptr %181, i64 %.118.6
  %183 = sub nuw nsw i64 10000, %.118.6
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %181, ptr align 1 %182, i64 %183, i1 false)
  %184 = load ptr, ptr %1, align 8, !tbaa !5
  %185 = getelementptr inbounds i8, ptr %184, i64 %.118.6
  %186 = getelementptr inbounds i8, ptr %185, i64 1
  %187 = sub nuw nsw i64 9999, %.118.6
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %184, ptr nonnull align 1 %186, i64 %187, i1 false)
  %188 = load ptr, ptr %1, align 8, !tbaa !5
  %189 = getelementptr inbounds i8, ptr %188, i64 %.118.6
  %190 = getelementptr inbounds i8, ptr %189, i64 2
  %191 = sub nuw nsw i64 9998, %.118.6
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %188, ptr nonnull align 1 %190, i64 %191, i1 false)
  %192 = add nuw nsw i64 %.118.6, 3
  %exitcond20.6.not.2 = icmp eq i64 %192, 9999
  br i1 %exitcond20.6.not.2, label %193, label %.preheader.6, !llvm.loop !11

193:                                              ; preds = %.preheader.6
  %194 = load volatile ptr, ptr @black_box, align 8, !tbaa !5
  call void %194(ptr noundef nonnull %1) #7
  br label %195

195:                                              ; preds = %195, %193
  %.01617.7 = phi i64 [ 0, %193 ], [ %207, %195 ]
  %196 = load ptr, ptr %1, align 8, !tbaa !5
  %197 = getelementptr inbounds i8, ptr %196, i64 %.01617.7
  %198 = sub nuw nsw i64 10000, %.01617.7
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %197, ptr align 1 %196, i64 %198, i1 false)
  %199 = load ptr, ptr %1, align 8, !tbaa !5
  %200 = getelementptr inbounds i8, ptr %199, i64 %.01617.7
  %201 = getelementptr inbounds i8, ptr %200, i64 1
  %202 = sub nuw nsw i64 9999, %.01617.7
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %201, ptr align 1 %199, i64 %202, i1 false)
  %203 = load ptr, ptr %1, align 8, !tbaa !5
  %204 = getelementptr inbounds i8, ptr %203, i64 %.01617.7
  %205 = getelementptr inbounds i8, ptr %204, i64 2
  %206 = sub nuw nsw i64 9998, %.01617.7
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %205, ptr align 1 %203, i64 %206, i1 false)
  %207 = add nuw nsw i64 %.01617.7, 3
  %exitcond.7.not.2 = icmp eq i64 %207, 9999
  br i1 %exitcond.7.not.2, label %.preheader.7, label %195, !llvm.loop !9

.preheader.7:                                     ; preds = %195, %.preheader.7
  %.118.7 = phi i64 [ %219, %.preheader.7 ], [ 0, %195 ]
  %208 = load ptr, ptr %1, align 8, !tbaa !5
  %209 = getelementptr inbounds i8, ptr %208, i64 %.118.7
  %210 = sub nuw nsw i64 10000, %.118.7
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %208, ptr align 1 %209, i64 %210, i1 false)
  %211 = load ptr, ptr %1, align 8, !tbaa !5
  %212 = getelementptr inbounds i8, ptr %211, i64 %.118.7
  %213 = getelementptr inbounds i8, ptr %212, i64 1
  %214 = sub nuw nsw i64 9999, %.118.7
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %211, ptr nonnull align 1 %213, i64 %214, i1 false)
  %215 = load ptr, ptr %1, align 8, !tbaa !5
  %216 = getelementptr inbounds i8, ptr %215, i64 %.118.7
  %217 = getelementptr inbounds i8, ptr %216, i64 2
  %218 = sub nuw nsw i64 9998, %.118.7
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %215, ptr nonnull align 1 %217, i64 %218, i1 false)
  %219 = add nuw nsw i64 %.118.7, 3
  %exitcond20.7.not.2 = icmp eq i64 %219, 9999
  br i1 %exitcond20.7.not.2, label %220, label %.preheader.7, !llvm.loop !11

220:                                              ; preds = %.preheader.7
  %221 = load volatile ptr, ptr @black_box, align 8, !tbaa !5
  call void %221(ptr noundef nonnull %1) #7
  br label %222

222:                                              ; preds = %222, %220
  %.01617.8 = phi i64 [ 0, %220 ], [ %234, %222 ]
  %223 = load ptr, ptr %1, align 8, !tbaa !5
  %224 = getelementptr inbounds i8, ptr %223, i64 %.01617.8
  %225 = sub nuw nsw i64 10000, %.01617.8
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %224, ptr align 1 %223, i64 %225, i1 false)
  %226 = load ptr, ptr %1, align 8, !tbaa !5
  %227 = getelementptr inbounds i8, ptr %226, i64 %.01617.8
  %228 = getelementptr inbounds i8, ptr %227, i64 1
  %229 = sub nuw nsw i64 9999, %.01617.8
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %228, ptr align 1 %226, i64 %229, i1 false)
  %230 = load ptr, ptr %1, align 8, !tbaa !5
  %231 = getelementptr inbounds i8, ptr %230, i64 %.01617.8
  %232 = getelementptr inbounds i8, ptr %231, i64 2
  %233 = sub nuw nsw i64 9998, %.01617.8
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %232, ptr align 1 %230, i64 %233, i1 false)
  %234 = add nuw nsw i64 %.01617.8, 3
  %exitcond.8.not.2 = icmp eq i64 %234, 9999
  br i1 %exitcond.8.not.2, label %.preheader.8, label %222, !llvm.loop !9

.preheader.8:                                     ; preds = %222, %.preheader.8
  %.118.8 = phi i64 [ %246, %.preheader.8 ], [ 0, %222 ]
  %235 = load ptr, ptr %1, align 8, !tbaa !5
  %236 = getelementptr inbounds i8, ptr %235, i64 %.118.8
  %237 = sub nuw nsw i64 10000, %.118.8
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %235, ptr align 1 %236, i64 %237, i1 false)
  %238 = load ptr, ptr %1, align 8, !tbaa !5
  %239 = getelementptr inbounds i8, ptr %238, i64 %.118.8
  %240 = getelementptr inbounds i8, ptr %239, i64 1
  %241 = sub nuw nsw i64 9999, %.118.8
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %238, ptr nonnull align 1 %240, i64 %241, i1 false)
  %242 = load ptr, ptr %1, align 8, !tbaa !5
  %243 = getelementptr inbounds i8, ptr %242, i64 %.118.8
  %244 = getelementptr inbounds i8, ptr %243, i64 2
  %245 = sub nuw nsw i64 9998, %.118.8
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %242, ptr nonnull align 1 %244, i64 %245, i1 false)
  %246 = add nuw nsw i64 %.118.8, 3
  %exitcond20.8.not.2 = icmp eq i64 %246, 9999
  br i1 %exitcond20.8.not.2, label %247, label %.preheader.8, !llvm.loop !11

247:                                              ; preds = %.preheader.8
  %248 = load volatile ptr, ptr @black_box, align 8, !tbaa !5
  call void %248(ptr noundef nonnull %1) #7
  br label %249

249:                                              ; preds = %249, %247
  %.01617.9 = phi i64 [ 0, %247 ], [ %261, %249 ]
  %250 = load ptr, ptr %1, align 8, !tbaa !5
  %251 = getelementptr inbounds i8, ptr %250, i64 %.01617.9
  %252 = sub nuw nsw i64 10000, %.01617.9
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %251, ptr align 1 %250, i64 %252, i1 false)
  %253 = load ptr, ptr %1, align 8, !tbaa !5
  %254 = getelementptr inbounds i8, ptr %253, i64 %.01617.9
  %255 = getelementptr inbounds i8, ptr %254, i64 1
  %256 = sub nuw nsw i64 9999, %.01617.9
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %255, ptr align 1 %253, i64 %256, i1 false)
  %257 = load ptr, ptr %1, align 8, !tbaa !5
  %258 = getelementptr inbounds i8, ptr %257, i64 %.01617.9
  %259 = getelementptr inbounds i8, ptr %258, i64 2
  %260 = sub nuw nsw i64 9998, %.01617.9
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %259, ptr align 1 %257, i64 %260, i1 false)
  %261 = add nuw nsw i64 %.01617.9, 3
  %exitcond.9.not.2 = icmp eq i64 %261, 9999
  br i1 %exitcond.9.not.2, label %.preheader.9, label %249, !llvm.loop !9

.preheader.9:                                     ; preds = %249, %.preheader.9
  %.118.9 = phi i64 [ %273, %.preheader.9 ], [ 0, %249 ]
  %262 = load ptr, ptr %1, align 8, !tbaa !5
  %263 = getelementptr inbounds i8, ptr %262, i64 %.118.9
  %264 = sub nuw nsw i64 10000, %.118.9
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %262, ptr align 1 %263, i64 %264, i1 false)
  %265 = load ptr, ptr %1, align 8, !tbaa !5
  %266 = getelementptr inbounds i8, ptr %265, i64 %.118.9
  %267 = getelementptr inbounds i8, ptr %266, i64 1
  %268 = sub nuw nsw i64 9999, %.118.9
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %265, ptr nonnull align 1 %267, i64 %268, i1 false)
  %269 = load ptr, ptr %1, align 8, !tbaa !5
  %270 = getelementptr inbounds i8, ptr %269, i64 %.118.9
  %271 = getelementptr inbounds i8, ptr %270, i64 2
  %272 = sub nuw nsw i64 9998, %.118.9
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %269, ptr nonnull align 1 %271, i64 %272, i1 false)
  %273 = add nuw nsw i64 %.118.9, 3
  %exitcond20.9.not.2 = icmp eq i64 %273, 9999
  br i1 %exitcond20.9.not.2, label %274, label %.preheader.9, !llvm.loop !11

274:                                              ; preds = %.preheader.9
  call void (...) @bench_end() #7
  %275 = load volatile ptr, ptr @black_box, align 8, !tbaa !5
  call void %275(ptr noundef nonnull %1) #7
  %276 = load ptr, ptr %1, align 8, !tbaa !5
  call void @free(ptr noundef %276) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare void @bench_start(...) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #5

declare void @bench_end(...) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(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 = { 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 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { mustprogress nounwind willreturn allockind("free") 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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }
attributes #9 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


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