; LLVM IR from QiaoLiuHit/LSOTB-TIR :: vlfeat-0.9.19/vl (svmdataset)

; 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.VlSvmDataset_ = type { i32, ptr, i64, i64, ptr, ptr, i64 }

@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.vl_svmdataset_set_homogeneous_kernel_map = external hidden unnamed_addr constant [88 x i8], align 1

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

declare ptr @vl_calloc(i64 noundef, i64 noundef) #1

declare void @vl_free(ptr noundef) #1

declare i64 @vl_homogeneouskernelmap_get_dimension(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @vl_svmdataset_set_homogeneous_kernel_map(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8, !tbaa !5
  %6 = icmp ne ptr %5, null
  br i1 %6, label %7, label %8

7:                                                ; preds = %2
  br label %9

8:                                                ; preds = %2
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 241, ptr noundef @__PRETTY_FUNCTION__.vl_svmdataset_set_homogeneous_kernel_map) #4
  unreachable

9:                                                ; preds = %7
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.VlSvmDataset_, ptr %11, i32 0, i32 4
  store ptr %10, ptr %12, align 8, !tbaa !9
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.VlSvmDataset_, ptr %13, i32 0, i32 6
  store i64 0, ptr %14, align 8, !tbaa !13
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.VlSvmDataset_, ptr %15, i32 0, i32 5
  %17 = load ptr, ptr %16, align 8, !tbaa !14
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %25

19:                                               ; preds = %9
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.VlSvmDataset_, ptr %20, i32 0, i32 5
  %22 = load ptr, ptr %21, align 8, !tbaa !14
  call void @vl_free(ptr noundef %22)
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.VlSvmDataset_, ptr %23, i32 0, i32 5
  store ptr null, ptr %24, align 8, !tbaa !14
  br label %25

25:                                               ; preds = %19, %9
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.VlSvmDataset_, ptr %26, i32 0, i32 4
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %47

30:                                               ; preds = %25
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.VlSvmDataset_, ptr %31, i32 0, i32 4
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = call i64 @vl_homogeneouskernelmap_get_dimension(ptr noundef %33)
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.VlSvmDataset_, ptr %35, i32 0, i32 6
  store i64 %34, ptr %36, align 8, !tbaa !13
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.VlSvmDataset_, ptr %37, i32 0, i32 6
  %39 = load i64, ptr %38, align 8, !tbaa !13
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.VlSvmDataset_, ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !15
  %43 = call i64 @vl_get_type_size(i32 noundef %42)
  %44 = call ptr @vl_calloc(i64 noundef %39, i64 noundef %43)
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.VlSvmDataset_, ptr %45, i32 0, i32 5
  store ptr %44, ptr %46, align 8, !tbaa !14
  br label %47

47:                                               ; preds = %30, %25
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @vl_get_type_size(i32 noundef) #3

attributes #0 = { 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 #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 = { 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 = { 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 = { 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 = !{!10, !6, i64 32}
!10 = !{!"VlSvmDataset_", !11, i64 0, !6, i64 8, !12, i64 16, !12, i64 24, !6, i64 32, !6, i64 40, !12, i64 48}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!10, !12, i64 48}
!14 = !{!10, !6, i64 40}
!15 = !{!10, !11, 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.1 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.vl_svmdataset_set_homogeneous_kernel_map = external hidden unnamed_addr constant [88 x i8], align 1

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

declare ptr @vl_calloc(i64 noundef, i64 noundef) local_unnamed_addr #1

declare void @vl_free(ptr noundef) local_unnamed_addr #1

declare i64 @vl_homogeneouskernelmap_get_dimension(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @vl_svmdataset_set_homogeneous_kernel_map(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %3, label %4

3:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 241, ptr noundef nonnull @__PRETTY_FUNCTION__.vl_svmdataset_set_homogeneous_kernel_map) #4
  unreachable

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %1, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 48
  store i64 0, ptr %6, align 8, !tbaa !12
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = load ptr, ptr %7, align 8, !tbaa !13
  %.not15 = icmp eq ptr %8, null
  br i1 %.not15, label %10, label %9

9:                                                ; preds = %4
  tail call void @vl_free(ptr noundef nonnull %8) #5
  store ptr null, ptr %7, align 8, !tbaa !13
  %.pre = load ptr, ptr %5, align 8, !tbaa !5
  br label %10

10:                                               ; preds = %9, %4
  %11 = phi ptr [ %.pre, %9 ], [ %1, %4 ]
  %.not16 = icmp eq ptr %11, null
  br i1 %.not16, label %17, label %12

12:                                               ; preds = %10
  %13 = tail call i64 @vl_homogeneouskernelmap_get_dimension(ptr noundef nonnull %11) #5
  store i64 %13, ptr %6, align 8, !tbaa !12
  %14 = load i32, ptr %0, align 8, !tbaa !14
  %15 = tail call i64 @vl_get_type_size(i32 noundef %14)
  %16 = tail call ptr @vl_calloc(i64 noundef %13, i64 noundef %15) #5
  store ptr %16, ptr %7, align 8, !tbaa !13
  br label %17

17:                                               ; preds = %12, %10
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @vl_get_type_size(i32 noundef) local_unnamed_addr #3

attributes #0 = { 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 #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 = { 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 = { 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 = { noreturn nounwind }
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, !10, i64 32}
!6 = !{!"VlSvmDataset_", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 24, !10, i64 32, !10, i64 40, !11, i64 48}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"long long", !8, i64 0}
!12 = !{!6, !11, i64 48}
!13 = !{!6, !10, i64 40}
!14 = !{!6, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass