; LLVM IR from tangjz/acm-icpc :: codeforces/complete (1466I)

; 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::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@cur = external dso_local global { [4 x i64] }, align 8
@vis = external dso_local global %"class.std::unordered_map", align 8
@buf = external dso_local global [403 x i8], align 16
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3askiPc(i32 noundef, ptr noundef) #0

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

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

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

declare i32 @printf(ptr noundef, ...) #2

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt13unordered_mapISt6bitsetILm201EEbSt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_bEEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::deque", align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %39, %0
  %14 = load i32, ptr %4, align 4, !tbaa !5
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = add nsw i32 %15, %16
  %18 = icmp slt i32 %14, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %42

20:                                               ; preds = %13
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %22
  store i8 49, ptr %23, align 1, !tbaa !9
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %27, label %38

27:                                               ; preds = %20
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = sext i8 %31 to i32
  %33 = icmp eq i32 %32, 49
  br i1 %33, label %34, label %38

34:                                               ; preds = %27
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6bitsetILm201EE3setEmb(ptr noundef nonnull align 8 dereferenceable(32) @cur, i64 noundef %36, i1 noundef zeroext true)
  br label %38

38:                                               ; preds = %34, %27, %20
  br label %39

39:                                               ; preds = %38
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %4, align 4, !tbaa !5
  br label %13, !llvm.loop !10

42:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 80, ptr %5) #5
  call void @_ZNSt5dequeIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %54, %42
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %61

48:                                               ; preds = %43
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %49 unwind label %57

49:                                               ; preds = %48
  %50 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt13unordered_mapIiS_ISt6bitsetILm201EEbSt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_bEEES2_IiES4_IiESaIS6_IKiSA_EEEixERSD_(ptr noundef nonnull align 8 dereferenceable(56) @vis, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %51 unwind label %57

51:                                               ; preds = %49
  %52 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt13unordered_mapISt6bitsetILm201EEbSt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_bEEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) %50, ptr noundef nonnull align 8 dereferenceable(32) @cur)
          to label %53 unwind label %57

53:                                               ; preds = %51
  store i8 0, ptr %52, align 1, !tbaa !12
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %6, align 4, !tbaa !5
  br label %43, !llvm.loop !14

57:                                               ; preds = %51, %49, %48
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %7, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %149

61:                                               ; preds = %47
  store i8 48, ptr @buf, align 16, !tbaa !9
  %62 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6bitsetILm201EE5resetEm(ptr noundef nonnull align 8 dereferenceable(32) @cur, i64 noundef 0)
          to label %63 unwind label %73

63:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %141, %63
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  %67 = trunc i64 %66 to i32
  %68 = sub nsw i32 %65, %67
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = sub nsw i32 %69, 1
  %71 = icmp slt i32 %68, %70
  br i1 %71, label %77, label %72

72:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %142

73:                                               ; preds = %142, %61
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %7, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %8, align 4
  br label %149

77:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !9
  store i8 %81, ptr %10, align 1, !tbaa !9
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %83
  store i8 0, ptr %84, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5dequeIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = invoke noundef zeroext i1 @_Z3askiPc(i32 noundef %86, ptr noundef @buf)
          to label %88 unwind label %108

88:                                               ; preds = %77
  %89 = zext i1 %87 to i8
  store i8 %89, ptr %11, align 1, !tbaa !12
  %90 = load i8, ptr %10, align 1, !tbaa !9
  %91 = load i32, ptr %3, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %92
  store i8 %90, ptr %93, align 1, !tbaa !9
  %94 = load i8, ptr %11, align 1, !tbaa !12, !range !15, !noundef !16
  %95 = trunc i8 %94 to i1
  br i1 %95, label %96, label %125

96:                                               ; preds = %88
  br label %97

97:                                               ; preds = %105, %96
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %99
  %101 = load i8, ptr %100, align 1, !tbaa !9
  %102 = sext i8 %101 to i32
  %103 = icmp eq i32 %102, 49
  br i1 %103, label %104, label %112

104:                                              ; preds = %97
  call void @_ZNSt5dequeIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = add nsw i32 %106, -1
  store i32 %107, ptr %9, align 4, !tbaa !5
  br label %97, !llvm.loop !17

108:                                              ; preds = %138, %133, %119, %77
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %7, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %149

112:                                              ; preds = %97
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %114
  store i8 49, ptr %115, align 1, !tbaa !9
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = load i32, ptr %3, align 4, !tbaa !5
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %119, label %124

119:                                              ; preds = %112
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6bitsetILm201EE3setEmb(ptr noundef nonnull align 8 dereferenceable(32) @cur, i64 noundef %121, i1 noundef zeroext true)
          to label %123 unwind label %108

123:                                              ; preds = %119
  br label %124

124:                                              ; preds = %123, %112
  br label %141

125:                                              ; preds = %88
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %9, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %128
  store i8 48, ptr %129, align 1, !tbaa !9
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = load i32, ptr %3, align 4, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %133, label %138

133:                                              ; preds = %125
  %134 = load i32, ptr %9, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6bitsetILm201EE5resetEm(ptr noundef nonnull align 8 dereferenceable(32) @cur, i64 noundef %135)
          to label %137 unwind label %108

137:                                              ; preds = %133
  br label %138

138:                                              ; preds = %137, %125
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5dequeIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %139)
          to label %140 unwind label %108

140:                                              ; preds = %138
  call void @_ZNSt5dequeIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  br label %141

141:                                              ; preds = %140, %124
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  br label %64, !llvm.loop !18

142:                                              ; preds = %72
  %143 = load i32, ptr %3, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %144
  store i8 0, ptr %145, align 1, !tbaa !9
  %146 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef @buf)
          to label %147 unwind label %73

147:                                              ; preds = %142
  store i32 0, ptr %1, align 4
  call void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %148 = load i32, ptr %1, align 4
  ret i32 %148

149:                                              ; preds = %108, %73, %57
  call void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %150

150:                                              ; preds = %149
  %151 = load ptr, ptr %7, align 8
  %152 = load i32, ptr %8, align 4
  %153 = insertvalue { ptr, i32 } poison, ptr %151, 0
  %154 = insertvalue { ptr, i32 } %153, i32 %152, 1
  resume { ptr, i32 } %154
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6bitsetILm201EE3setEmb(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i1 noundef zeroext) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5dequeIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = distinct !{!14, !11}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}


; 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::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@cur = external dso_local global { [4 x i64] }, align 8
@vis = external dso_local global %"class.std::unordered_map", align 8
@buf = external dso_local global [403 x i8], align 16
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3askiPc(i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt13unordered_mapISt6bitsetILm201EEbSt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_bEEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::deque", align 8
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = add nsw i32 %7, %6
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %18, %0
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #5
  call void @_ZNSt5dequeIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %.not28 = icmp slt i32 %10, 1
  br i1 %.not28, label %._crit_edge31, label %.lr.ph30

.lr.ph:                                           ; preds = %0, %18
  %11 = phi i32 [ %19, %18 ], [ %7, %0 ]
  %12 = phi i32 [ %20, %18 ], [ %6, %0 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %18 ], [ 0, %0 ]
  %13 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %indvars.iv
  store i8 49, ptr %13, align 1, !tbaa !9
  %14 = sext i32 %11 to i64
  %15 = icmp slt i64 %indvars.iv, %14
  br i1 %15, label %16, label %18

16:                                               ; preds = %.lr.ph
  %17 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6bitsetILm201EE3setEmb(ptr noundef nonnull align 8 dereferenceable(32) @cur, i64 noundef %indvars.iv, i1 noundef zeroext true)
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  %.pre48 = load i32, ptr %2, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %.lr.ph, %16
  %19 = phi i32 [ %11, %.lr.ph ], [ %.pre48, %16 ]
  %20 = phi i32 [ %12, %.lr.ph ], [ %.pre, %16 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = add nsw i32 %19, %20
  %22 = sext i32 %21 to i64
  %23 = icmp slt i64 %indvars.iv.next, %22
  br i1 %23, label %.lr.ph, label %._crit_edge, !llvm.loop !10

._crit_edge31:                                    ; preds = %35, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  store i8 48, ptr @buf, align 16, !tbaa !9
  %24 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6bitsetILm201EE5resetEm(ptr noundef nonnull align 8 dereferenceable(32) @cur, i64 noundef 0)
          to label %.preheader23 unwind label %44

.preheader23:                                     ; preds = %._crit_edge31
  %25 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  %26 = trunc i64 %25 to i32
  %27 = sub nsw i32 0, %26
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = add nsw i32 %28, -1
  %30 = icmp sgt i32 %29, %27
  br i1 %30, label %.lr.ph39, label %._crit_edge40

.lr.ph30:                                         ; preds = %._crit_edge, %35
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %31 unwind label %39

31:                                               ; preds = %.lr.ph30
  %32 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt13unordered_mapIiS_ISt6bitsetILm201EEbSt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_bEEES2_IiES4_IiESaIS6_IKiSA_EEEixERSD_(ptr noundef nonnull align 8 dereferenceable(56) @vis, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %33 unwind label %39

33:                                               ; preds = %31
  %34 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt13unordered_mapISt6bitsetILm201EEbSt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_bEEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) %32, ptr noundef nonnull align 8 dereferenceable(32) @cur)
          to label %35 unwind label %39

35:                                               ; preds = %33
  store i8 0, ptr %34, align 1, !tbaa !12
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %4, align 4, !tbaa !5
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %36, %38
  br i1 %.not.not, label %.lr.ph30, label %._crit_edge31, !llvm.loop !14

39:                                               ; preds = %33, %31, %.lr.ph30
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  br label %89

._crit_edge40:                                    ; preds = %82, %.preheader23
  %.lcssa25 = phi i32 [ %28, %.preheader23 ], [ %86, %82 ]
  %41 = sext i32 %.lcssa25 to i64
  %42 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %41
  store i8 0, ptr %42, align 1, !tbaa !9
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @buf)
  call void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

44:                                               ; preds = %._crit_edge31
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %89

.lr.ph39:                                         ; preds = %.preheader23, %82
  %46 = phi i32 [ %86, %82 ], [ %28, %.preheader23 ]
  %.01938 = phi i32 [ %.2, %82 ], [ 0, %.preheader23 ]
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !9
  store i8 0, ptr %48, align 1, !tbaa !9
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5dequeIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = invoke noundef zeroext i1 @_Z3askiPc(i32 noundef %51, ptr noundef nonnull @buf)
          to label %53 unwind label %64

53:                                               ; preds = %.lr.ph39
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %55
  store i8 %49, ptr %56, align 1, !tbaa !9
  br i1 %52, label %.preheader, label %72

.preheader:                                       ; preds = %53
  %57 = sext i32 %.01938 to i64
  %58 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !9
  %60 = icmp eq i8 %59, 49
  br i1 %60, label %.lr.ph34, label %._crit_edge35

.lr.ph34:                                         ; preds = %.preheader, %.lr.ph34
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %.lr.ph34 ], [ %57, %.preheader ]
  call void @_ZNSt5dequeIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  %indvars.iv.next46 = add nsw i64 %indvars.iv45, -1
  %61 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %indvars.iv.next46
  %62 = load i8, ptr %61, align 1, !tbaa !9
  %63 = icmp eq i8 %62, 49
  br i1 %63, label %.lr.ph34, label %._crit_edge35.loopexit, !llvm.loop !15

64:                                               ; preds = %79, %77, %70, %.lr.ph39
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %89

._crit_edge35.loopexit:                           ; preds = %.lr.ph34
  %66 = trunc nsw i64 %indvars.iv.next46 to i32
  %.pre49 = load i32, ptr %2, align 4, !tbaa !5
  br label %._crit_edge35

._crit_edge35:                                    ; preds = %._crit_edge35.loopexit, %.preheader
  %67 = phi i32 [ %54, %.preheader ], [ %.pre49, %._crit_edge35.loopexit ]
  %.lcssa32 = phi i64 [ %57, %.preheader ], [ %indvars.iv.next46, %._crit_edge35.loopexit ]
  %.1.lcssa = phi i32 [ %.01938, %.preheader ], [ %66, %._crit_edge35.loopexit ]
  %68 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %.lcssa32
  store i8 49, ptr %68, align 1, !tbaa !9
  %69 = icmp slt i32 %.1.lcssa, %67
  br i1 %69, label %70, label %82

70:                                               ; preds = %._crit_edge35
  %71 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6bitsetILm201EE3setEmb(ptr noundef nonnull align 8 dereferenceable(32) @cur, i64 noundef %.lcssa32, i1 noundef zeroext true)
          to label %82 unwind label %64

72:                                               ; preds = %53
  %73 = add nsw i32 %.01938, 1
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [403 x i8], ptr @buf, i64 0, i64 %74
  store i8 48, ptr %75, align 1, !tbaa !9
  %76 = icmp slt i32 %73, %54
  br i1 %76, label %77, label %79

77:                                               ; preds = %72
  %78 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6bitsetILm201EE5resetEm(ptr noundef nonnull align 8 dereferenceable(32) @cur, i64 noundef %74)
          to label %79 unwind label %64

79:                                               ; preds = %77, %72
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5dequeIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  invoke void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %80)
          to label %81 unwind label %64

81:                                               ; preds = %79
  call void @_ZNSt5dequeIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  br label %82

82:                                               ; preds = %._crit_edge35, %70, %81
  %.2 = phi i32 [ %.1.lcssa, %70 ], [ %.1.lcssa, %._crit_edge35 ], [ %73, %81 ]
  %83 = call noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  %84 = trunc i64 %83 to i32
  %85 = sub nsw i32 %.2, %84
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = add nsw i32 %86, -1
  %88 = icmp slt i32 %85, %87
  br i1 %88, label %.lr.ph39, label %._crit_edge40, !llvm.loop !16

89:                                               ; preds = %64, %44, %39
  %.pn = phi { ptr, i32 } [ %40, %39 ], [ %65, %64 ], [ %45, %44 ]
  call void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6bitsetILm201EE3setEmb(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i1 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt5dequeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5dequeIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "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 = { 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 #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass