; LLVM IR from eyangch/competitive-programming :: USACOcontests/silver/2012.12/crazy.ll (Z4isctSt4pairIS_IxxES0_ES1_)

; 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.std::pair.0" = type { %"struct.std::pair", %"struct.std::pair" }
%"struct.std::pair" = type { i64, i64 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3CCWSt4pairIxxES0_S0_(i64, i64, i64, i64, i64, i64) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z4isctSt4pairIS_IxxES0_ES1_(ptr noundef byval(%"struct.std::pair.0") align 8 %0, ptr noundef byval(%"struct.std::pair.0") align 8 %1) #0 {
  %3 = alloca i64, align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i64, align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca i64, align 8
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i64, align 8
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca %"struct.std::pair", align 8
  %18 = alloca %"struct.std::pair", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %19 = getelementptr inbounds %"struct.std::pair.0", ptr %0, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %19, i64 16, i1 false)
  %20 = getelementptr inbounds %"struct.std::pair.0", ptr %0, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 %20, i64 16, i1 false)
  %21 = getelementptr inbounds %"struct.std::pair.0", ptr %1, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %21, i64 16, i1 false)
  %22 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 0
  %23 = load i64, ptr %22, align 8
  %24 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 1
  %25 = load i64, ptr %24, align 8
  %26 = getelementptr inbounds { i64, i64 }, ptr %5, i32 0, i32 0
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds { i64, i64 }, ptr %5, i32 0, i32 1
  %29 = load i64, ptr %28, align 8
  %30 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 0
  %31 = load i64, ptr %30, align 8
  %32 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 1
  %33 = load i64, ptr %32, align 8
  %34 = call noundef i64 @_Z3CCWSt4pairIxxES0_S0_(i64 %23, i64 %25, i64 %27, i64 %29, i64 %31, i64 %33)
  store i64 %34, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %35 = getelementptr inbounds %"struct.std::pair.0", ptr %0, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %35, i64 16, i1 false)
  %36 = getelementptr inbounds %"struct.std::pair.0", ptr %0, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %36, i64 16, i1 false)
  %37 = getelementptr inbounds %"struct.std::pair.0", ptr %1, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %37, i64 16, i1 false)
  %38 = getelementptr inbounds { i64, i64 }, ptr %8, i32 0, i32 0
  %39 = load i64, ptr %38, align 8
  %40 = getelementptr inbounds { i64, i64 }, ptr %8, i32 0, i32 1
  %41 = load i64, ptr %40, align 8
  %42 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 0
  %43 = load i64, ptr %42, align 8
  %44 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 1
  %45 = load i64, ptr %44, align 8
  %46 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %47 = load i64, ptr %46, align 8
  %48 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %49 = load i64, ptr %48, align 8
  %50 = call noundef i64 @_Z3CCWSt4pairIxxES0_S0_(i64 %39, i64 %41, i64 %43, i64 %45, i64 %47, i64 %49)
  store i64 %50, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %51 = getelementptr inbounds %"struct.std::pair.0", ptr %1, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %51, i64 16, i1 false)
  %52 = getelementptr inbounds %"struct.std::pair.0", ptr %1, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %52, i64 16, i1 false)
  %53 = getelementptr inbounds %"struct.std::pair.0", ptr %0, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %53, i64 16, i1 false)
  %54 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 0
  %55 = load i64, ptr %54, align 8
  %56 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 1
  %57 = load i64, ptr %56, align 8
  %58 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %59 = load i64, ptr %58, align 8
  %60 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %61 = load i64, ptr %60, align 8
  %62 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %63 = load i64, ptr %62, align 8
  %64 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %65 = load i64, ptr %64, align 8
  %66 = call noundef i64 @_Z3CCWSt4pairIxxES0_S0_(i64 %55, i64 %57, i64 %59, i64 %61, i64 %63, i64 %65)
  store i64 %66, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %67 = getelementptr inbounds %"struct.std::pair.0", ptr %1, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %67, i64 16, i1 false)
  %68 = getelementptr inbounds %"struct.std::pair.0", ptr %1, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %68, i64 16, i1 false)
  %69 = getelementptr inbounds %"struct.std::pair.0", ptr %0, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %69, i64 16, i1 false)
  %70 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 0
  %71 = load i64, ptr %70, align 8
  %72 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 1
  %73 = load i64, ptr %72, align 8
  %74 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 0
  %75 = load i64, ptr %74, align 8
  %76 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 1
  %77 = load i64, ptr %76, align 8
  %78 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %79 = load i64, ptr %78, align 8
  %80 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %81 = load i64, ptr %80, align 8
  %82 = call noundef i64 @_Z3CCWSt4pairIxxES0_S0_(i64 %71, i64 %73, i64 %75, i64 %77, i64 %79, i64 %81)
  store i64 %82, ptr %15, align 8, !tbaa !5
  %83 = load i64, ptr %3, align 8, !tbaa !5
  %84 = load i64, ptr %7, align 8, !tbaa !5
  %85 = icmp ne i64 %83, %84
  br i1 %85, label %86, label %90

86:                                               ; preds = %2
  %87 = load i64, ptr %11, align 8, !tbaa !5
  %88 = load i64, ptr %15, align 8, !tbaa !5
  %89 = icmp ne i64 %87, %88
  br label %90

90:                                               ; preds = %86, %2
  %91 = phi i1 [ false, %2 ], [ %89, %86 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret i1 %91
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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

%"struct.std::pair.0" = type { %"struct.std::pair", %"struct.std::pair" }
%"struct.std::pair" = type { i64, i64 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3CCWSt4pairIxxES0_S0_(i64, i64, i64, i64, i64, i64) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z4isctSt4pairIS_IxxES0_ES1_(ptr nocapture noundef readonly byval(%"struct.std::pair.0") align 8 %0, ptr nocapture noundef readonly byval(%"struct.std::pair.0") align 8 %1) local_unnamed_addr #0 {
  %.sroa.023.0.copyload = load i64, ptr %0, align 8
  %.sroa.224.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 8
  %.sroa.224.0.copyload = load i64, ptr %.sroa.224.0..sroa_idx, align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  %.sroa.021.0.copyload = load i64, ptr %3, align 8
  %.sroa.222.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 24
  %.sroa.222.0.copyload = load i64, ptr %.sroa.222.0..sroa_idx, align 8
  %.sroa.019.0.copyload = load i64, ptr %1, align 8
  %.sroa.220.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 8
  %.sroa.220.0.copyload = load i64, ptr %.sroa.220.0..sroa_idx, align 8
  %4 = tail call noundef i64 @_Z3CCWSt4pairIxxES0_S0_(i64 %.sroa.023.0.copyload, i64 %.sroa.224.0.copyload, i64 %.sroa.021.0.copyload, i64 %.sroa.222.0.copyload, i64 %.sroa.019.0.copyload, i64 %.sroa.220.0.copyload)
  %5 = getelementptr inbounds i8, ptr %1, i64 16
  %.sroa.012.0.copyload = load i64, ptr %5, align 8
  %.sroa.213.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 24
  %.sroa.213.0.copyload = load i64, ptr %.sroa.213.0..sroa_idx, align 8
  %6 = tail call noundef i64 @_Z3CCWSt4pairIxxES0_S0_(i64 %.sroa.023.0.copyload, i64 %.sroa.224.0.copyload, i64 %.sroa.021.0.copyload, i64 %.sroa.222.0.copyload, i64 %.sroa.012.0.copyload, i64 %.sroa.213.0.copyload)
  %7 = tail call noundef i64 @_Z3CCWSt4pairIxxES0_S0_(i64 %.sroa.019.0.copyload, i64 %.sroa.220.0.copyload, i64 %.sroa.012.0.copyload, i64 %.sroa.213.0.copyload, i64 %.sroa.023.0.copyload, i64 %.sroa.224.0.copyload)
  %8 = tail call noundef i64 @_Z3CCWSt4pairIxxES0_S0_(i64 %.sroa.019.0.copyload, i64 %.sroa.220.0.copyload, i64 %.sroa.012.0.copyload, i64 %.sroa.213.0.copyload, i64 %.sroa.021.0.copyload, i64 %.sroa.222.0.copyload)
  %9 = icmp ne i64 %4, %6
  %10 = icmp ne i64 %7, %8
  %11 = and i1 %9, %10
  ret i1 %11
}

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)"}


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