; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/AIM Tech Round 3/Problem A (A)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@a00 = external dso_local global i64, align 8
@a01 = external dso_local global i64, align 8
@a10 = external dso_local global i64, align 8
@a11 = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3getx(i64 noundef) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5solvexxb(i64 noundef, i64 noundef, i1 noundef zeroext) #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %5 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %13
  %15 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @a00)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) @a01)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) @a10)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) @a11)
  %20 = load i64, ptr @a00, align 8, !tbaa !8
  %21 = load i64, ptr @a01, align 8, !tbaa !8
  %22 = add nsw i64 %20, %21
  %23 = load i64, ptr @a10, align 8, !tbaa !8
  %24 = add nsw i64 %22, %23
  %25 = load i64, ptr @a11, align 8, !tbaa !8
  %26 = add nsw i64 %24, %25
  %27 = icmp eq i64 %26, 0
  br i1 %27, label %28, label %31

28:                                               ; preds = %0
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  br label %151

31:                                               ; preds = %0
  %32 = load i64, ptr @a00, align 8, !tbaa !8
  %33 = load i64, ptr @a01, align 8, !tbaa !8
  %34 = add nsw i64 %32, %33
  %35 = load i64, ptr @a10, align 8, !tbaa !8
  %36 = add nsw i64 %34, %35
  %37 = load i64, ptr @a11, align 8, !tbaa !8
  %38 = add nsw i64 %36, %37
  %39 = icmp eq i64 %38, 1
  br i1 %39, label %40, label %65

40:                                               ; preds = %31
  %41 = load i64, ptr @a00, align 8, !tbaa !8
  %42 = icmp ne i64 %41, 0
  br i1 %42, label %43, label %46

43:                                               ; preds = %40
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %46

46:                                               ; preds = %43, %40
  %47 = load i64, ptr @a01, align 8, !tbaa !8
  %48 = icmp ne i64 %47, 0
  br i1 %48, label %49, label %52

49:                                               ; preds = %46
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %52

52:                                               ; preds = %49, %46
  %53 = load i64, ptr @a10, align 8, !tbaa !8
  %54 = icmp ne i64 %53, 0
  br i1 %54, label %55, label %58

55:                                               ; preds = %52
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %58

58:                                               ; preds = %55, %52
  %59 = load i64, ptr @a11, align 8, !tbaa !8
  %60 = icmp ne i64 %59, 0
  br i1 %60, label %61, label %64

61:                                               ; preds = %58
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %64

64:                                               ; preds = %61, %58
  store i32 0, ptr %1, align 4
  br label %151

65:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %66 = load i64, ptr @a00, align 8, !tbaa !8
  %67 = call noundef i64 @_Z3getx(i64 noundef %66)
  store i64 %67, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %68 = load i64, ptr @a11, align 8, !tbaa !8
  %69 = call noundef i64 @_Z3getx(i64 noundef %68)
  store i64 %69, ptr %3, align 8, !tbaa !8
  %70 = load i64, ptr @a00, align 8, !tbaa !8
  %71 = icmp eq i64 %70, 0
  br i1 %71, label %72, label %92

72:                                               ; preds = %65
  %73 = load i64, ptr @a11, align 8, !tbaa !8
  %74 = icmp sgt i64 %73, 0
  br i1 %74, label %75, label %92

75:                                               ; preds = %72
  %76 = load i64, ptr %3, align 8, !tbaa !8
  %77 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef 0, i64 noundef %76, i1 noundef zeroext false)
  br i1 %77, label %78, label %81

78:                                               ; preds = %75
  %79 = load i64, ptr %3, align 8, !tbaa !8
  %80 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef 0, i64 noundef %79, i1 noundef zeroext true)
  br label %91

81:                                               ; preds = %75
  %82 = load i64, ptr %3, align 8, !tbaa !8
  %83 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef 1, i64 noundef %82, i1 noundef zeroext false)
  br i1 %83, label %84, label %87

84:                                               ; preds = %81
  %85 = load i64, ptr %3, align 8, !tbaa !8
  %86 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef 1, i64 noundef %85, i1 noundef zeroext true)
  br label %90

87:                                               ; preds = %81
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %88, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %90

90:                                               ; preds = %87, %84
  br label %91

91:                                               ; preds = %90, %78
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %150

92:                                               ; preds = %72, %65
  %93 = load i64, ptr @a00, align 8, !tbaa !8
  %94 = icmp sgt i64 %93, 0
  br i1 %94, label %95, label %115

95:                                               ; preds = %92
  %96 = load i64, ptr @a11, align 8, !tbaa !8
  %97 = icmp eq i64 %96, 0
  br i1 %97, label %98, label %115

98:                                               ; preds = %95
  %99 = load i64, ptr %2, align 8, !tbaa !8
  %100 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef %99, i64 noundef 0, i1 noundef zeroext false)
  br i1 %100, label %101, label %104

101:                                              ; preds = %98
  %102 = load i64, ptr %2, align 8, !tbaa !8
  %103 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef %102, i64 noundef 0, i1 noundef zeroext true)
  br label %114

104:                                              ; preds = %98
  %105 = load i64, ptr %2, align 8, !tbaa !8
  %106 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef %105, i64 noundef 1, i1 noundef zeroext false)
  br i1 %106, label %107, label %110

107:                                              ; preds = %104
  %108 = load i64, ptr %2, align 8, !tbaa !8
  %109 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef %108, i64 noundef 1, i1 noundef zeroext true)
  br label %113

110:                                              ; preds = %104
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %113

113:                                              ; preds = %110, %107
  br label %114

114:                                              ; preds = %113, %101
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %150

115:                                              ; preds = %95, %92
  %116 = load i64, ptr @a00, align 8, !tbaa !8
  %117 = icmp eq i64 %116, 0
  br i1 %117, label %118, label %144

118:                                              ; preds = %115
  %119 = load i64, ptr @a11, align 8, !tbaa !8
  %120 = icmp eq i64 %119, 0
  br i1 %120, label %121, label %144

121:                                              ; preds = %118
  %122 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef 0, i64 noundef 0, i1 noundef zeroext false)
  br i1 %122, label %123, label %125

123:                                              ; preds = %121
  %124 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef 0, i64 noundef 0, i1 noundef zeroext true)
  br label %143

125:                                              ; preds = %121
  %126 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef 1, i64 noundef 1, i1 noundef zeroext false)
  br i1 %126, label %127, label %129

127:                                              ; preds = %125
  %128 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef 1, i64 noundef 1, i1 noundef zeroext true)
  br label %142

129:                                              ; preds = %125
  %130 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef 1, i64 noundef 0, i1 noundef zeroext false)
  br i1 %130, label %131, label %133

131:                                              ; preds = %129
  %132 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef 1, i64 noundef 0, i1 noundef zeroext true)
  br label %141

133:                                              ; preds = %129
  %134 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef 0, i64 noundef 1, i1 noundef zeroext false)
  br i1 %134, label %135, label %137

135:                                              ; preds = %133
  %136 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef 0, i64 noundef 1, i1 noundef zeroext true)
  br label %140

137:                                              ; preds = %133
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %138, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %140

140:                                              ; preds = %137, %135
  br label %141

141:                                              ; preds = %140, %131
  br label %142

142:                                              ; preds = %141, %127
  br label %143

143:                                              ; preds = %142, %123
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %150

144:                                              ; preds = %118, %115
  br label %145

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145
  %147 = load i64, ptr %2, align 8, !tbaa !8
  %148 = load i64, ptr %3, align 8, !tbaa !8
  %149 = call noundef zeroext i1 @_Z5solvexxb(i64 noundef %147, i64 noundef %148, i1 noundef zeroext true)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %150

150:                                              ; preds = %146, %143, %114, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %151

151:                                              ; preds = %150, %64, %28
  %152 = load i32, ptr %1, align 4
  ret i32 %152
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #5

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5

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


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@a00 = external dso_local global i64, align 8
@a01 = external dso_local global i64, align 8
@a10 = external dso_local global i64, align 8
@a11 = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3getx(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5solvexxb(i64 noundef, i64 noundef, i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @a00)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) @a01)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) @a10)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) @a11)
  %16 = load i64, ptr @a00, align 8, !tbaa !8
  %17 = load i64, ptr @a01, align 8, !tbaa !8
  %18 = add nsw i64 %17, %16
  %19 = load i64, ptr @a10, align 8, !tbaa !8
  %20 = add nsw i64 %18, %19
  %21 = load i64, ptr @a11, align 8, !tbaa !8
  %22 = add nsw i64 %20, %21
  switch i64 %22, label %45 [
    i64 0, label %23
    i64 1, label %26
  ]

23:                                               ; preds = %0
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %100

26:                                               ; preds = %0
  %.not = icmp eq i64 %16, 0
  br i1 %.not, label %30, label %27

27:                                               ; preds = %26
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %29 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %.pre = load i64, ptr @a01, align 8, !tbaa !8
  br label %30

30:                                               ; preds = %27, %26
  %31 = phi i64 [ %.pre, %27 ], [ %17, %26 ]
  %.not16 = icmp eq i64 %31, 0
  br i1 %.not16, label %35, label %32

32:                                               ; preds = %30
  %33 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
  %34 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %35

35:                                               ; preds = %32, %30
  %36 = load i64, ptr @a10, align 8, !tbaa !8
  %.not17 = icmp eq i64 %36, 0
  br i1 %.not17, label %40, label %37

37:                                               ; preds = %35
  %38 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  %39 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %40

40:                                               ; preds = %37, %35
  %41 = load i64, ptr @a11, align 8, !tbaa !8
  %.not18 = icmp eq i64 %41, 0
  br i1 %.not18, label %100, label %42

42:                                               ; preds = %40
  %43 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
  %44 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %100

45:                                               ; preds = %0
  %46 = tail call noundef i64 @_Z3getx(i64 noundef %16)
  %47 = load i64, ptr @a11, align 8, !tbaa !8
  %48 = tail call noundef i64 @_Z3getx(i64 noundef %47)
  %49 = load i64, ptr @a00, align 8, !tbaa !8
  %50 = icmp eq i64 %49, 0
  %51 = load i64, ptr @a11, align 8
  %52 = icmp sgt i64 %51, 0
  %or.cond = select i1 %50, i1 %52, i1 false
  br i1 %or.cond, label %53, label %64

53:                                               ; preds = %45
  %54 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef 0, i64 noundef %48, i1 noundef zeroext false)
  br i1 %54, label %55, label %57

55:                                               ; preds = %53
  %56 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef 0, i64 noundef %48, i1 noundef zeroext true)
  br label %100

57:                                               ; preds = %53
  %58 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef 1, i64 noundef %48, i1 noundef zeroext false)
  br i1 %58, label %59, label %61

59:                                               ; preds = %57
  %60 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef 1, i64 noundef %48, i1 noundef zeroext true)
  br label %100

61:                                               ; preds = %57
  %62 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %100

64:                                               ; preds = %45
  %65 = icmp sgt i64 %49, 0
  %66 = icmp eq i64 %51, 0
  %or.cond3 = select i1 %65, i1 %66, i1 false
  br i1 %or.cond3, label %67, label %78

67:                                               ; preds = %64
  %68 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef %46, i64 noundef 0, i1 noundef zeroext false)
  br i1 %68, label %69, label %71

69:                                               ; preds = %67
  %70 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef %46, i64 noundef 0, i1 noundef zeroext true)
  br label %100

71:                                               ; preds = %67
  %72 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef %46, i64 noundef 1, i1 noundef zeroext false)
  br i1 %72, label %73, label %75

73:                                               ; preds = %71
  %74 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef %46, i64 noundef 1, i1 noundef zeroext true)
  br label %100

75:                                               ; preds = %71
  %76 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %77 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %100

78:                                               ; preds = %64
  %or.cond5 = select i1 %50, i1 %66, i1 false
  br i1 %or.cond5, label %79, label %98

79:                                               ; preds = %78
  %80 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef 0, i64 noundef 0, i1 noundef zeroext false)
  br i1 %80, label %81, label %83

81:                                               ; preds = %79
  %82 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef 0, i64 noundef 0, i1 noundef zeroext true)
  br label %100

83:                                               ; preds = %79
  %84 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef 1, i64 noundef 1, i1 noundef zeroext false)
  br i1 %84, label %85, label %87

85:                                               ; preds = %83
  %86 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef 1, i64 noundef 1, i1 noundef zeroext true)
  br label %100

87:                                               ; preds = %83
  %88 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef 1, i64 noundef 0, i1 noundef zeroext false)
  br i1 %88, label %89, label %91

89:                                               ; preds = %87
  %90 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef 1, i64 noundef 0, i1 noundef zeroext true)
  br label %100

91:                                               ; preds = %87
  %92 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef 0, i64 noundef 1, i1 noundef zeroext false)
  br i1 %92, label %93, label %95

93:                                               ; preds = %91
  %94 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef 0, i64 noundef 1, i1 noundef zeroext true)
  br label %100

95:                                               ; preds = %91
  %96 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %97 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %100

98:                                               ; preds = %78
  %99 = tail call noundef zeroext i1 @_Z5solvexxb(i64 noundef %46, i64 noundef %48, i1 noundef zeroext true)
  br label %100

100:                                              ; preds = %98, %59, %61, %55, %73, %75, %69, %85, %93, %95, %89, %81, %40, %42, %23
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

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" }
attributes #1 = { inlinehint 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 #2 = { 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 #3 = { 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 #4 = { "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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}


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