; LLVM IR from fritzsedlazeck/SURVIVOR :: src/merge_vcf/IntervallTree.ll (Z9same_typesPb)

; 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: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z9same_typesPb(i16 noundef signext %0, ptr noundef %1) #0 {
  %3 = alloca i1, align 1
  %4 = alloca i16, align 2
  %5 = alloca ptr, align 8
  store i16 %0, ptr %4, align 2, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  %7 = load i16, ptr %4, align 2, !tbaa !5
  %8 = sext i16 %7 to i64
  %9 = getelementptr inbounds i8, ptr %6, i64 %8
  %10 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %11 = trunc i8 %10 to i1
  %12 = zext i1 %11 to i32
  %13 = icmp eq i32 %12, 1
  br i1 %13, label %14, label %15

14:                                               ; preds = %2
  store i1 true, ptr %3, align 1
  br label %51

15:                                               ; preds = %2
  %16 = load i16, ptr %4, align 2, !tbaa !5
  %17 = sext i16 %16 to i32
  %18 = icmp eq i32 %17, 3
  br i1 %18, label %23, label %19

19:                                               ; preds = %15
  %20 = load i16, ptr %4, align 2, !tbaa !5
  %21 = sext i16 %20 to i32
  %22 = icmp eq i32 %21, 2
  br i1 %22, label %23, label %30

23:                                               ; preds = %19, %15
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = getelementptr inbounds i8, ptr %24, i64 5
  %26 = load i8, ptr %25, align 1, !tbaa !11, !range !13, !noundef !14
  %27 = trunc i8 %26 to i1
  %28 = zext i1 %27 to i32
  %29 = icmp eq i32 %28, 1
  br i1 %29, label %48, label %30

30:                                               ; preds = %23, %19
  %31 = load ptr, ptr %5, align 8, !tbaa !9
  %32 = getelementptr inbounds i8, ptr %31, i64 3
  %33 = load i8, ptr %32, align 1, !tbaa !11, !range !13, !noundef !14
  %34 = trunc i8 %33 to i1
  %35 = zext i1 %34 to i32
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %44, label %37

37:                                               ; preds = %30
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %38, i64 2
  %40 = load i8, ptr %39, align 1, !tbaa !11, !range !13, !noundef !14
  %41 = trunc i8 %40 to i1
  %42 = zext i1 %41 to i32
  %43 = icmp eq i32 %42, 1
  br i1 %43, label %44, label %49

44:                                               ; preds = %37, %30
  %45 = load i16, ptr %4, align 2, !tbaa !5
  %46 = sext i16 %45 to i32
  %47 = icmp eq i32 %46, 5
  br i1 %47, label %48, label %49

48:                                               ; preds = %44, %23
  store i1 true, ptr %3, align 1
  br label %51

49:                                               ; preds = %44, %37
  br label %50

50:                                               ; preds = %49
  store i1 false, ptr %3, align 1
  br label %51

51:                                               ; preds = %50, %48, %14
  %52 = load i1, ptr %3, align 1
  ret i1 %52
}

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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


; 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: read) uwtable
define dso_local noundef zeroext i1 @_Z9same_typesPb(i16 noundef signext %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = sext i16 %0 to i64
  %4 = getelementptr inbounds i8, ptr %1, i64 %3
  %5 = load i8, ptr %4, align 1, !tbaa !5, !range !9, !noundef !10
  %6 = trunc nuw i8 %5 to i1
  br i1 %6, label %24, label %7

7:                                                ; preds = %2
  %8 = and i16 %0, -2
  %or.cond = icmp eq i16 %8, 2
  br i1 %or.cond, label %9, label %13

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %1, i64 5
  %11 = load i8, ptr %10, align 1, !tbaa !5, !range !9, !noundef !10
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %24, label %13

13:                                               ; preds = %7, %9
  %14 = getelementptr inbounds i8, ptr %1, i64 3
  %15 = load i8, ptr %14, align 1, !tbaa !5, !range !9, !noundef !10
  %16 = trunc nuw i8 %15 to i1
  br i1 %16, label %22, label %17

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %1, i64 2
  %19 = load i8, ptr %18, align 1, !tbaa !5, !range !9, !noundef !10
  %20 = trunc nuw i8 %19 to i1
  %21 = icmp eq i16 %0, 5
  %or.cond5 = and i1 %21, %20
  br i1 %or.cond5, label %24, label %23

22:                                               ; preds = %13
  %.old4 = icmp eq i16 %0, 5
  br i1 %.old4, label %24, label %23

23:                                               ; preds = %17, %22
  br label %24

24:                                               ; preds = %9, %22, %17, %2, %23
  %.0 = phi i1 [ false, %23 ], [ true, %2 ], [ true, %17 ], [ true, %22 ], [ true, %9 ]
  ret i1 %.0
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}


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