; LLVM IR from MikeMirzayanov/testlib :: checkers (rcmp4)

; 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.InStream = type { ptr, i32, %"class.std::__cxx11::basic_string", i32, i8, i8, i8, i32, %"class.std::__cxx11::basic_string", i32, i64, i64, i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@ouf = external dso_local global %struct.InStream, align 8
@ans = external dso_local global %struct.InStream, align 8
@.str.441 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.442 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.443 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.444 = external hidden unnamed_addr constant [11 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8InStream7seekEofEv(ptr noundef nonnull align 8 dereferenceable(128)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN8InStream10readDoubleEv(ptr noundef nonnull align 8 dereferenceable(128)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(none) uwtable
declare dso_local noundef double @_Z11doubleDeltadd(double noundef, double noundef) #3

; Function Attrs: mustprogress noreturn uwtable
declare dso_local void @_Z5quitf7TResultPKcz(i32 noundef, ptr noundef, ...) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z18registerTestlibCmdiPPc(i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7setNamePKcz(ptr noundef, ...) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #5 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void (ptr, ...) @_Z7setNamePKcz(ptr noundef @.str.441, double noundef 1.000000e-04)
  %12 = load i32, ptr %4, align 4, !tbaa !5
  %13 = load ptr, ptr %5, align 8, !tbaa !9
  call void @_Z18registerTestlibCmdiPPc(i32 noundef %12, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store double 0.000000e+00, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store double 0.000000e+00, ptr %8, align 8, !tbaa !11
  br label %14

14:                                               ; preds = %39, %2
  %15 = call noundef zeroext i1 @_ZN8InStream7seekEofEv(ptr noundef nonnull align 8 dereferenceable(128) @ans)
  %16 = xor i1 %15, true
  br i1 %16, label %17, label %40

17:                                               ; preds = %14
  %18 = load i32, ptr %6, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %6, align 4, !tbaa !5
  %20 = call noundef double @_ZN8InStream10readDoubleEv(ptr noundef nonnull align 8 dereferenceable(128) @ans)
  store double %20, ptr %7, align 8, !tbaa !11
  %21 = call noundef double @_ZN8InStream10readDoubleEv(ptr noundef nonnull align 8 dereferenceable(128) @ouf)
  store double %21, ptr %8, align 8, !tbaa !11
  %22 = load double, ptr %7, align 8, !tbaa !11
  %23 = load double, ptr %8, align 8, !tbaa !11
  %24 = call noundef zeroext i1 @_Z13doubleCompareddd(double noundef %22, double noundef %23, double noundef 1.000000e-04) #8
  br i1 %24, label %39, label %25

25:                                               ; preds = %17
  %26 = load i32, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #7
  %27 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z13englishEndingB5cxx11i(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %9, i32 noundef %27) #9
  %28 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  %29 = load double, ptr %7, align 8, !tbaa !11
  %30 = load double, ptr %8, align 8, !tbaa !11
  %31 = load double, ptr %7, align 8, !tbaa !11
  %32 = load double, ptr %8, align 8, !tbaa !11
  %33 = call noundef double @_Z11doubleDeltadd(double noundef %31, double noundef %32) #8
  invoke void (i32, ptr, ...) @_Z5quitf7TResultPKcz(i32 noundef 1, ptr noundef @.str.442, i32 noundef %26, ptr noundef %28, double noundef %29, double noundef %30, double noundef %33) #10
          to label %34 unwind label %35

34:                                               ; preds = %25
  unreachable

35:                                               ; preds = %25
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %10, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %51

39:                                               ; preds = %17
  br label %14, !llvm.loop !13

40:                                               ; preds = %14
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = icmp eq i32 %41, 1
  br i1 %42, label %43, label %49

43:                                               ; preds = %40
  %44 = load double, ptr %8, align 8, !tbaa !11
  %45 = load double, ptr %7, align 8, !tbaa !11
  %46 = load double, ptr %7, align 8, !tbaa !11
  %47 = load double, ptr %8, align 8, !tbaa !11
  %48 = call noundef double @_Z11doubleDeltadd(double noundef %46, double noundef %47) #8
  call void (i32, ptr, ...) @_Z5quitf7TResultPKcz(i32 noundef 0, ptr noundef @.str.443, double noundef %44, double noundef %45, double noundef %48) #10
  unreachable

49:                                               ; preds = %40
  %50 = load i32, ptr %6, align 4, !tbaa !5
  call void (i32, ptr, ...) @_Z5quitf7TResultPKcz(i32 noundef 0, ptr noundef @.str.444, i32 noundef %50) #10
  unreachable

51:                                               ; preds = %35
  %52 = load ptr, ptr %10, align 8
  %53 = load i32, ptr %11, align 4
  %54 = insertvalue { ptr, i32 } poison, ptr %52, 0
  %55 = insertvalue { ptr, i32 } %54, i32 %53, 1
  resume { ptr, i32 } %55
}

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(none) uwtable
declare dso_local noundef zeroext i1 @_Z13doubleCompareddd(double noundef, double noundef, double noundef) #3

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(argmem: readwrite) uwtable
declare dso_local void @_Z13englishEndingB5cxx11i(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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" }
attributes #3 = { inlinehint mustprogress nounwind willreturn memory(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" }
attributes #4 = { mustprogress noreturn 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 #5 = { mustprogress norecurse 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 #6 = { inlinehint mustprogress 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" }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(none) }
attributes #9 = { nounwind willreturn memory(argmem: readwrite) }
attributes #10 = { noreturn }

!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 = !{!"int", !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 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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.InStream = type { ptr, i32, %"class.std::__cxx11::basic_string", i32, i8, i8, i8, i32, %"class.std::__cxx11::basic_string", i32, i64, i64, i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@ouf = external dso_local global %struct.InStream, align 8
@ans = external dso_local global %struct.InStream, align 8
@.str.441 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.442 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.443 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.444 = external hidden unnamed_addr constant [11 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8InStream7seekEofEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN8InStream10readDoubleEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nofree nosync nounwind willreturn memory(none) uwtable
declare dso_local noundef double @_Z11doubleDeltadd(double noundef, double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress noreturn uwtable
declare dso_local void @_Z5quitf7TResultPKcz(i32 noundef, ptr noundef, ...) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z18registerTestlibCmdiPPc(i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7setNamePKcz(ptr noundef, ...) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse noreturn uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  tail call void (ptr, ...) @_Z7setNamePKcz(ptr noundef nonnull @.str.441, double noundef 1.000000e-04)
  tail call void @_Z18registerTestlibCmdiPPc(i32 noundef %0, ptr noundef %1)
  %4 = tail call noundef zeroext i1 @_ZN8InStream7seekEofEv(ptr noundef nonnull align 8 dereferenceable(128) @ans)
  br i1 %4, label %._crit_edge.thread, label %.lr.ph

5:                                                ; preds = %.lr.ph
  %6 = tail call noundef zeroext i1 @_ZN8InStream7seekEofEv(ptr noundef nonnull align 8 dereferenceable(128) @ans)
  br i1 %6, label %._crit_edge, label %.lr.ph, !llvm.loop !5

.lr.ph:                                           ; preds = %2, %5
  %.025 = phi i32 [ %7, %5 ], [ 0, %2 ]
  %7 = add nuw nsw i32 %.025, 1
  %8 = tail call noundef double @_ZN8InStream10readDoubleEv(ptr noundef nonnull align 8 dereferenceable(128) @ans)
  %9 = tail call noundef double @_ZN8InStream10readDoubleEv(ptr noundef nonnull align 8 dereferenceable(128) @ouf)
  %10 = tail call noundef zeroext i1 @_Z13doubleCompareddd(double noundef %8, double noundef %9, double noundef 1.000000e-04) #7
  br i1 %10, label %5, label %11, !llvm.loop !5

11:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #8
  call void @_Z13englishEndingB5cxx11i(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %3, i32 noundef %7) #9
  %12 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #8
  %13 = call noundef double @_Z11doubleDeltadd(double noundef %8, double noundef %9) #7
  invoke void (i32, ptr, ...) @_Z5quitf7TResultPKcz(i32 noundef 1, ptr noundef nonnull @.str.442, i32 noundef %7, ptr noundef %12, double noundef %8, double noundef %9, double noundef %13) #10
          to label %14 unwind label %15

14:                                               ; preds = %11
  unreachable

15:                                               ; preds = %11
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #8
  resume { ptr, i32 } %16

._crit_edge:                                      ; preds = %5
  %17 = icmp eq i32 %.025, 0
  br i1 %17, label %18, label %._crit_edge.thread

18:                                               ; preds = %._crit_edge
  %19 = tail call noundef double @_Z11doubleDeltadd(double noundef %8, double noundef %9) #7
  tail call void (i32, ptr, ...) @_Z5quitf7TResultPKcz(i32 noundef 0, ptr noundef nonnull @.str.443, double noundef %9, double noundef %8, double noundef %19) #10
  unreachable

._crit_edge.thread:                               ; preds = %2, %._crit_edge
  %.0.lcssa36 = phi i32 [ %7, %._crit_edge ], [ 0, %2 ]
  tail call void (i32, ptr, ...) @_Z5quitf7TResultPKcz(i32 noundef 0, ptr noundef nonnull @.str.444, i32 noundef %.0.lcssa36) #10
  unreachable
}

; Function Attrs: inlinehint mustprogress nofree nosync nounwind willreturn memory(none) uwtable
declare dso_local noundef zeroext i1 @_Z13doubleCompareddd(double noundef, double noundef, double noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(argmem: readwrite) uwtable
declare dso_local void @_Z13englishEndingB5cxx11i(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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" }
attributes #3 = { inlinehint mustprogress nofree nosync nounwind willreturn memory(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" }
attributes #4 = { mustprogress noreturn 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 #5 = { mustprogress norecurse noreturn 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 #6 = { inlinehint mustprogress 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" }
attributes #7 = { nounwind willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(argmem: readwrite) }
attributes #10 = { noreturn }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass