; LLVM IR from facebook/redex :: libredex/DexPosition.ll (ZNK11DexPositioneqERKS_)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK11DexPositioneqERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #0 align 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
  %6 = getelementptr inbounds %struct.DexPosition, ptr %5, i32 0, i32 0
  %7 = load ptr, ptr %6, align 8, !tbaa !9
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.DexPosition, ptr %8, i32 0, i32 0
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %11 = icmp eq ptr %7, %10
  br i1 %11, label %12, label %53

12:                                               ; preds = %2
  %13 = getelementptr inbounds %struct.DexPosition, ptr %5, i32 0, i32 1
  %14 = load ptr, ptr %13, align 8, !tbaa !12
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.DexPosition, ptr %15, i32 0, i32 1
  %17 = load ptr, ptr %16, align 8, !tbaa !12
  %18 = icmp eq ptr %14, %17
  br i1 %18, label %19, label %53

19:                                               ; preds = %12
  %20 = getelementptr inbounds %struct.DexPosition, ptr %5, i32 0, i32 2
  %21 = load i32, ptr %20, align 8, !tbaa !13
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.DexPosition, ptr %22, i32 0, i32 2
  %24 = load i32, ptr %23, align 8, !tbaa !13
  %25 = icmp eq i32 %21, %24
  br i1 %25, label %26, label %53

26:                                               ; preds = %19
  %27 = getelementptr inbounds %struct.DexPosition, ptr %5, i32 0, i32 3
  %28 = load ptr, ptr %27, align 8, !tbaa !14
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.DexPosition, ptr %29, i32 0, i32 3
  %31 = load ptr, ptr %30, align 8, !tbaa !14
  %32 = icmp eq ptr %28, %31
  br i1 %32, label %51, label %33

33:                                               ; preds = %26
  %34 = getelementptr inbounds %struct.DexPosition, ptr %5, i32 0, i32 3
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %49

37:                                               ; preds = %33
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.DexPosition, ptr %38, i32 0, i32 3
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %49

42:                                               ; preds = %37
  %43 = getelementptr inbounds %struct.DexPosition, ptr %5, i32 0, i32 3
  %44 = load ptr, ptr %43, align 8, !tbaa !14
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.DexPosition, ptr %45, i32 0, i32 3
  %47 = load ptr, ptr %46, align 8, !tbaa !14
  %48 = call noundef zeroext i1 @_ZNK11DexPositioneqERKS_(ptr noundef nonnull align 8 dereferenceable(32) %44, ptr noundef nonnull align 8 dereferenceable(32) %47)
  br label %49

49:                                               ; preds = %42, %37, %33
  %50 = phi i1 [ false, %37 ], [ false, %33 ], [ %48, %42 ]
  br label %51

51:                                               ; preds = %49, %26
  %52 = phi i1 [ true, %26 ], [ %50, %49 ]
  br label %53

53:                                               ; preds = %51, %19, %12, %2
  %54 = phi i1 [ false, %19 ], [ false, %12 ], [ false, %2 ], [ %52, %51 ]
  ret i1 %54
}

attributes #0 = { mustprogress 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, !6, i64 0}
!10 = !{!"_ZTS11DexPosition", !6, i64 0, !6, i64 8, !11, i64 16, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!10, !11, i64 16}
!14 = !{!10, !6, i64 24}


; 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(read, inaccessiblemem: none) uwtable
define dso_local noundef zeroext i1 @_ZNK11DexPositioneqERKS_(ptr nocapture noundef nonnull readonly align 8 dereferenceable(32) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(32) %1) local_unnamed_addr #0 align 2 {
  br label %tailrecurse

tailrecurse:                                      ; preds = %24, %2
  %.tr = phi ptr [ %0, %2 ], [ %20, %24 ]
  %.tr9 = phi ptr [ %1, %2 ], [ %22, %24 ]
  %3 = load ptr, ptr %.tr, align 8, !tbaa !5
  %4 = load ptr, ptr %.tr9, align 8, !tbaa !5
  %5 = icmp eq ptr %3, %4
  br i1 %5, label %6, label %25

6:                                                ; preds = %tailrecurse
  %7 = getelementptr inbounds i8, ptr %.tr, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %.tr9, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  %11 = icmp eq ptr %8, %10
  br i1 %11, label %12, label %25

12:                                               ; preds = %6
  %13 = getelementptr inbounds i8, ptr %.tr, i64 16
  %14 = load i32, ptr %13, align 8, !tbaa !12
  %15 = getelementptr inbounds i8, ptr %.tr9, i64 16
  %16 = load i32, ptr %15, align 8, !tbaa !12
  %17 = icmp eq i32 %14, %16
  br i1 %17, label %18, label %25

18:                                               ; preds = %12
  %19 = getelementptr inbounds i8, ptr %.tr, i64 24
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = getelementptr inbounds i8, ptr %.tr9, i64 24
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = icmp eq ptr %20, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %18
  %.not = icmp eq ptr %20, null
  %.not8 = icmp eq ptr %22, null
  %or.cond = or i1 %.not, %.not8
  br i1 %or.cond, label %25, label %tailrecurse

25:                                               ; preds = %18, %24, %12, %6, %tailrecurse
  %26 = phi i1 [ false, %12 ], [ false, %6 ], [ false, %tailrecurse ], [ true, %18 ], [ false, %24 ]
  ret i1 %26
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) 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, !7, i64 0}
!6 = !{!"_ZTS11DexPosition", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = !{!6, !10, i64 16}
!13 = !{!6, !7, i64 24}


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