; LLVM IR from ox-vgg/vise :: src/search_engine/relja_retrival/external/KMCode_relja/descriptor (Corner)

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

%class.Corner = type { i32, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, i32, i32, float, i32, i32 }

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN6Corner4isOKEiii(ptr noundef nonnull align 4 dereferenceable(88) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #0 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  %10 = load ptr, ptr %6, align 8
  %11 = getelementptr inbounds %class.Corner, ptr %10, i32 0, i32 1
  %12 = load float, ptr %11, align 4, !tbaa !11
  %13 = fptosi float %12 to i32
  %14 = load i32, ptr %8, align 4, !tbaa !9
  %15 = icmp sgt i32 %13, %14
  br i1 %15, label %34, label %16

16:                                               ; preds = %4
  %17 = getelementptr inbounds %class.Corner, ptr %10, i32 0, i32 1
  %18 = load float, ptr %17, align 4, !tbaa !11
  %19 = fptosi float %18 to i32
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %34, label %22

22:                                               ; preds = %16
  %23 = getelementptr inbounds %class.Corner, ptr %10, i32 0, i32 2
  %24 = load float, ptr %23, align 4, !tbaa !14
  %25 = fptosi float %24 to i32
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = icmp sgt i32 %25, %26
  br i1 %27, label %34, label %28

28:                                               ; preds = %22
  %29 = getelementptr inbounds %class.Corner, ptr %10, i32 0, i32 2
  %30 = load float, ptr %29, align 4, !tbaa !14
  %31 = fptosi float %30 to i32
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %34, label %38

34:                                               ; preds = %28, %22, %16, %4
  %35 = getelementptr inbounds %class.Corner, ptr %10, i32 0, i32 20
  store i32 0, ptr %35, align 4, !tbaa !15
  %36 = getelementptr inbounds %class.Corner, ptr %10, i32 0, i32 20
  %37 = load i32, ptr %36, align 4, !tbaa !15
  store i32 %37, ptr %5, align 4
  br label %42

38:                                               ; preds = %28
  %39 = getelementptr inbounds %class.Corner, ptr %10, i32 0, i32 20
  store i32 1, ptr %39, align 4, !tbaa !15
  %40 = getelementptr inbounds %class.Corner, ptr %10, i32 0, i32 20
  %41 = load i32, ptr %40, align 4, !tbaa !15
  store i32 %41, ptr %5, align 4
  br label %42

42:                                               ; preds = %38, %34
  %43 = load i32, ptr %5, align 4
  ret i32 %43
}

attributes #0 = { mustprogress 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" }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 4}
!12 = !{!"_ZTS6Corner", !10, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !10, i64 68, !10, i64 72, !13, i64 76, !10, i64 80, !10, i64 84}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!12, !10, i64 80}


; 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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN6Corner4isOKEiii(ptr nocapture noundef nonnull align 4 dereferenceable(88) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 align 2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 4
  %6 = load float, ptr %5, align 4, !tbaa !5
  %7 = fptosi float %6 to i32
  %8 = icmp sgt i32 %7, %2
  %9 = icmp slt i32 %7, %1
  %or.cond = or i1 %8, %9
  br i1 %or.cond, label %16, label %10

10:                                               ; preds = %4
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load float, ptr %11, align 4, !tbaa !11
  %13 = fptosi float %12 to i32
  %14 = icmp sle i32 %13, %3
  %15 = icmp sge i32 %13, %1
  %or.cond8.not = and i1 %14, %15
  %spec.select = zext i1 %or.cond8.not to i32
  br label %16

16:                                               ; preds = %10, %4
  %.sink = phi i32 [ 0, %4 ], [ %spec.select, %10 ]
  %17 = getelementptr inbounds i8, ptr %0, i64 80
  store i32 %.sink, ptr %17, align 4, !tbaa !12
  ret i32 %.sink
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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" }

!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 4}
!6 = !{!"_ZTS6Corner", !7, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !7, i64 68, !7, i64 72, !10, i64 76, !7, i64 80, !7, i64 84}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!6, !7, i64 80}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass