; LLVM IR from QiaoLiuHit/LSOTB-TIR :: vlfeat-0.9.19/src (test_vec_comp)

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

; Function Attrs: nounwind uwtable
define dso_local void @init_data(i64 noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store i64 %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %13 = call ptr @vl_get_rand()
  store ptr %13, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %14 = load i64, ptr %5, align 8, !tbaa !5
  %15 = mul i64 4, %14
  %16 = load i64, ptr %6, align 8, !tbaa !5
  %17 = mul i64 %15, %16
  %18 = call ptr @vl_malloc(i64 noundef %17)
  %19 = load ptr, ptr %7, align 8, !tbaa !9
  store ptr %18, ptr %19, align 8, !tbaa !9
  store ptr %18, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %20 = load i64, ptr %5, align 8, !tbaa !5
  %21 = mul i64 4, %20
  %22 = load i64, ptr %6, align 8, !tbaa !5
  %23 = mul i64 %21, %22
  %24 = call ptr @vl_malloc(i64 noundef %23)
  %25 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %24, ptr %25, align 8, !tbaa !9
  store ptr %24, ptr %12, align 8, !tbaa !9
  store i64 0, ptr %10, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %43, %4
  %27 = load i64, ptr %10, align 8, !tbaa !5
  %28 = load i64, ptr %5, align 8, !tbaa !5
  %29 = load i64, ptr %6, align 8, !tbaa !5
  %30 = mul i64 %28, %29
  %31 = icmp ult i64 %27, %30
  br i1 %31, label %32, label %46

32:                                               ; preds = %26
  %33 = load ptr, ptr %9, align 8, !tbaa !9
  %34 = call double @vl_rand_real1(ptr noundef %33)
  %35 = fptrunc double %34 to float
  %36 = load ptr, ptr %11, align 8, !tbaa !9
  %37 = getelementptr inbounds float, ptr %36, i32 1
  store ptr %37, ptr %11, align 8, !tbaa !9
  store float %35, ptr %36, align 4, !tbaa !11
  %38 = load ptr, ptr %9, align 8, !tbaa !9
  %39 = call double @vl_rand_real1(ptr noundef %38)
  %40 = fptrunc double %39 to float
  %41 = load ptr, ptr %12, align 8, !tbaa !9
  %42 = getelementptr inbounds float, ptr %41, i32 1
  store ptr %42, ptr %12, align 8, !tbaa !9
  store float %40, ptr %41, align 4, !tbaa !11
  br label %43

43:                                               ; preds = %32
  %44 = load i64, ptr %10, align 8, !tbaa !5
  %45 = add i64 %44, 1
  store i64 %45, ptr %10, align 8, !tbaa !5
  br label %26, !llvm.loop !13

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

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

declare ptr @vl_get_rand() #2

declare ptr @vl_malloc(i64 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden double @vl_rand_real1(ptr noundef) #3

; 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 = { "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 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 = { 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 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 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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"

; Function Attrs: nounwind uwtable
define dso_local void @init_data(i64 noundef %0, i64 noundef %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 {
  %5 = tail call ptr @vl_get_rand() #3
  %6 = shl i64 %0, 2
  %7 = mul i64 %6, %1
  %8 = tail call ptr @vl_malloc(i64 noundef %7) #3
  store ptr %8, ptr %2, align 8, !tbaa !5
  %9 = tail call ptr @vl_malloc(i64 noundef %7) #3
  store ptr %9, ptr %3, align 8, !tbaa !5
  %10 = mul i64 %1, %0
  %.not = icmp eq i64 %10, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %4, %.lr.ph
  %.017 = phi ptr [ %16, %.lr.ph ], [ %9, %4 ]
  %.01316 = phi ptr [ %13, %.lr.ph ], [ %8, %4 ]
  %.01415 = phi i64 [ %17, %.lr.ph ], [ 0, %4 ]
  %11 = tail call double @vl_rand_real1(ptr noundef %5)
  %12 = fptrunc double %11 to float
  %13 = getelementptr inbounds i8, ptr %.01316, i64 4
  store float %12, ptr %.01316, align 4, !tbaa !9
  %14 = tail call double @vl_rand_real1(ptr noundef %5)
  %15 = fptrunc double %14 to float
  %16 = getelementptr inbounds i8, ptr %.017, i64 4
  store float %15, ptr %.017, align 4, !tbaa !9
  %17 = add nuw i64 %.01415, 1
  %exitcond.not = icmp eq i64 %17, %10
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %4
  ret void
}

declare ptr @vl_get_rand() local_unnamed_addr #1

declare ptr @vl_malloc(i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden double @vl_rand_real1(ptr noundef) local_unnamed_addr #2

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 = { "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 = { 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 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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