; LLVM IR from upupming/algorithm :: AdvancedLevel_C++/1159. Structure of a Binary Tree (30) (main)

; 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::basic_istream" = type { ptr, i64, %"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_ostream" = type { ptr, %"class.std::basic_ios" }
%"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] }
%struct.TreeNode = type { i32, i32, ptr, ptr, ptr }

@is_full = external dso_local global i8, align 1
@nodes = external dso_local global %"class.std::unordered_map", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [32 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9TraversalP8TreeNode(ptr noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #9
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %17, i64 4)
  %19 = extractvalue { i64, i1 } %18, 1
  %20 = extractvalue { i64, i1 } %18, 0
  %21 = select i1 %19, i64 -1, i64 %20
  %22 = call noalias noundef nonnull ptr @_Znam(i64 noundef %21) #10
  store ptr %22, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %24, i64 4)
  %26 = extractvalue { i64, i1 } %25, 1
  %27 = extractvalue { i64, i1 } %25, 0
  %28 = select i1 %26, i64 -1, i64 %27
  %29 = call noalias noundef nonnull ptr @_Znam(i64 noundef %28) #10
  store ptr %29, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %41, %0
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %44

35:                                               ; preds = %30
  %36 = load ptr, ptr %4, align 8, !tbaa !9
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr %36, i64 %38
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %39)
  br label %41

41:                                               ; preds = %35
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %6, align 4, !tbaa !5
  br label %30, !llvm.loop !11

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

45:                                               ; preds = %56, %44
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %59

50:                                               ; preds = %45
  %51 = load ptr, ptr %5, align 8, !tbaa !9
  %52 = load i32, ptr %7, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr %51, i64 %53
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %54)
  br label %56

56:                                               ; preds = %50
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %7, align 4, !tbaa !5
  br label %45, !llvm.loop !13

59:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %60 = load ptr, ptr %4, align 8, !tbaa !9
  %61 = load ptr, ptr %5, align 8, !tbaa !9
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = call noundef ptr @_Z5BuildPiS_i(ptr noundef %60, ptr noundef %61, i32 noundef %62)
  store ptr %63, ptr %8, align 8, !tbaa !9
  %64 = load ptr, ptr %8, align 8, !tbaa !9
  %65 = getelementptr inbounds %struct.TreeNode, ptr %64, i32 0, i32 1
  store i32 1, ptr %65, align 4, !tbaa !14
  %66 = load ptr, ptr %8, align 8, !tbaa !9
  call void @_Z9TraversalP8TreeNode(ptr noundef %66)
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %68 = call i32 @getchar()
  br label %69

69:                                               ; preds = %192, %59
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = add nsw i32 %70, -1
  store i32 %71, ptr %3, align 4, !tbaa !5
  %72 = icmp ne i32 %70, 0
  br i1 %72, label %73, label %193

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  %74 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %75 unwind label %87

75:                                               ; preds = %73
  %76 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str, i64 noundef 0) #9
  %77 = icmp ne i64 %76, -1
  br i1 %77, label %78, label %91

78:                                               ; preds = %75
  %79 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  %80 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %79, ptr noundef @.str.2, ptr noundef %10) #9
  %81 = load i32, ptr %10, align 4, !tbaa !5
  %82 = load ptr, ptr %8, align 8, !tbaa !9
  %83 = getelementptr inbounds %struct.TreeNode, ptr %82, i32 0, i32 0
  %84 = load i32, ptr %83, align 8, !tbaa !16
  %85 = icmp eq i32 %81, %84
  %86 = zext i1 %85 to i8
  store i8 %86, ptr %9, align 1, !tbaa !17
  br label %184

87:                                               ; preds = %190, %184, %164, %160, %148, %144, %132, %128, %116, %112, %98, %94, %73
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %13, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %14, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %194

91:                                               ; preds = %75
  %92 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.3, i64 noundef 0) #9
  %93 = icmp ne i64 %92, -1
  br i1 %93, label %94, label %109

94:                                               ; preds = %91
  %95 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  %96 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %95, ptr noundef @.str.4, ptr noundef %10, ptr noundef %11) #9
  %97 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %98 unwind label %87

98:                                               ; preds = %94
  %99 = load ptr, ptr %97, align 8, !tbaa !9
  %100 = getelementptr inbounds %struct.TreeNode, ptr %99, i32 0, i32 2
  %101 = load ptr, ptr %100, align 8, !tbaa !19
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %103 unwind label %87

103:                                              ; preds = %98
  %104 = load ptr, ptr %102, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.TreeNode, ptr %104, i32 0, i32 2
  %106 = load ptr, ptr %105, align 8, !tbaa !19
  %107 = icmp eq ptr %101, %106
  %108 = zext i1 %107 to i8
  store i8 %108, ptr %9, align 1, !tbaa !17
  br label %183

109:                                              ; preds = %91
  %110 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.5, i64 noundef 0) #9
  %111 = icmp ne i64 %110, -1
  br i1 %111, label %112, label %125

112:                                              ; preds = %109
  %113 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  %114 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %113, ptr noundef @.str.6, ptr noundef %10, ptr noundef %11) #9
  %115 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %116 unwind label %87

116:                                              ; preds = %112
  %117 = load ptr, ptr %115, align 8, !tbaa !9
  %118 = getelementptr inbounds %struct.TreeNode, ptr %117, i32 0, i32 2
  %119 = load ptr, ptr %118, align 8, !tbaa !19
  %120 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %121 unwind label %87

121:                                              ; preds = %116
  %122 = load ptr, ptr %120, align 8, !tbaa !9
  %123 = icmp eq ptr %119, %122
  %124 = zext i1 %123 to i8
  store i8 %124, ptr %9, align 1, !tbaa !17
  br label %182

125:                                              ; preds = %109
  %126 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.7, i64 noundef 0) #9
  %127 = icmp ne i64 %126, -1
  br i1 %127, label %128, label %141

128:                                              ; preds = %125
  %129 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  %130 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %129, ptr noundef @.str.8, ptr noundef %10, ptr noundef %11) #9
  %131 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %132 unwind label %87

132:                                              ; preds = %128
  %133 = load ptr, ptr %131, align 8, !tbaa !9
  %134 = getelementptr inbounds %struct.TreeNode, ptr %133, i32 0, i32 3
  %135 = load ptr, ptr %134, align 8, !tbaa !20
  %136 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %137 unwind label %87

137:                                              ; preds = %132
  %138 = load ptr, ptr %136, align 8, !tbaa !9
  %139 = icmp eq ptr %135, %138
  %140 = zext i1 %139 to i8
  store i8 %140, ptr %9, align 1, !tbaa !17
  br label %181

141:                                              ; preds = %125
  %142 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.9, i64 noundef 0) #9
  %143 = icmp ne i64 %142, -1
  br i1 %143, label %144, label %157

144:                                              ; preds = %141
  %145 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  %146 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %145, ptr noundef @.str.10, ptr noundef %10, ptr noundef %11) #9
  %147 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %148 unwind label %87

148:                                              ; preds = %144
  %149 = load ptr, ptr %147, align 8, !tbaa !9
  %150 = getelementptr inbounds %struct.TreeNode, ptr %149, i32 0, i32 4
  %151 = load ptr, ptr %150, align 8, !tbaa !21
  %152 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %153 unwind label %87

153:                                              ; preds = %148
  %154 = load ptr, ptr %152, align 8, !tbaa !9
  %155 = icmp eq ptr %151, %154
  %156 = zext i1 %155 to i8
  store i8 %156, ptr %9, align 1, !tbaa !17
  br label %180

157:                                              ; preds = %141
  %158 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.11, i64 noundef 0) #9
  %159 = icmp ne i64 %158, -1
  br i1 %159, label %160, label %175

160:                                              ; preds = %157
  %161 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  %162 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %161, ptr noundef @.str.12, ptr noundef %10, ptr noundef %11) #9
  %163 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %164 unwind label %87

164:                                              ; preds = %160
  %165 = load ptr, ptr %163, align 8, !tbaa !9
  %166 = getelementptr inbounds %struct.TreeNode, ptr %165, i32 0, i32 1
  %167 = load i32, ptr %166, align 4, !tbaa !14
  %168 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %169 unwind label %87

169:                                              ; preds = %164
  %170 = load ptr, ptr %168, align 8, !tbaa !9
  %171 = getelementptr inbounds %struct.TreeNode, ptr %170, i32 0, i32 1
  %172 = load i32, ptr %171, align 4, !tbaa !14
  %173 = icmp eq i32 %167, %172
  %174 = zext i1 %173 to i8
  store i8 %174, ptr %9, align 1, !tbaa !17
  br label %179

175:                                              ; preds = %157
  %176 = load i8, ptr @is_full, align 1, !tbaa !17, !range !22, !noundef !23
  %177 = trunc i8 %176 to i1
  %178 = zext i1 %177 to i8
  store i8 %178, ptr %9, align 1, !tbaa !17
  br label %179

179:                                              ; preds = %175, %169
  br label %180

180:                                              ; preds = %179, %153
  br label %181

181:                                              ; preds = %180, %137
  br label %182

182:                                              ; preds = %181, %121
  br label %183

183:                                              ; preds = %182, %103
  br label %184

184:                                              ; preds = %183, %78
  %185 = load i8, ptr %9, align 1, !tbaa !17, !range !22, !noundef !23
  %186 = trunc i8 %185 to i1
  %187 = zext i1 %186 to i64
  %188 = select i1 %186, ptr @.str.13, ptr @.str.14
  %189 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %188)
          to label %190 unwind label %87

190:                                              ; preds = %184
  %191 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %189, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %192 unwind label %87

192:                                              ; preds = %190
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #9
  br label %69, !llvm.loop !24

193:                                              ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  ret i32 0

194:                                              ; preds = %87
  %195 = load ptr, ptr %13, align 8
  %196 = load i32, ptr %14, align 4
  %197 = insertvalue { ptr, i32 } poison, ptr %195, 0
  %198 = insertvalue { ptr, i32 } %197, i32 %196, 1
  resume { ptr, i32 } %198
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @getchar() #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #6

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i64 noundef) #7 align 2

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #8

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

; 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) #6

; 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)) #6

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #7 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 = { 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 #3 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nobuiltin allocsize(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 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 = { 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !6, i64 4}
!15 = !{!"_ZTS8TreeNode", !6, i64 0, !6, i64 4, !10, i64 8, !10, i64 16, !10, i64 24}
!16 = !{!15, !6, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!15, !10, i64 8}
!20 = !{!15, !10, i64 16}
!21 = !{!15, !10, i64 24}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !12}


; 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::basic_istream" = type { ptr, i64, %"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_ostream" = type { ptr, %"class.std::basic_ios" }
%"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] }

@is_full = external dso_local local_unnamed_addr global i8, align 1
@nodes = external dso_local global %"class.std::unordered_map", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [32 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z5BuildPiS_i(ptr noundef, ptr noundef, i32 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(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: mustprogress uwtable
declare dso_local void @_Z9TraversalP8TreeNode(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 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::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = icmp slt i32 %7, 0
  %10 = shl nsw i64 %8, 2
  %11 = select i1 %9, i64 -1, i64 %10
  %12 = call noalias noundef nonnull ptr @_Znam(i64 noundef %11) #10
  %13 = call noalias noundef nonnull ptr @_Znam(i64 noundef %11) #10
  %14 = icmp sgt i32 %7, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %.lr.ph
  %15 = icmp sgt i32 %18, 0
  br i1 %15, label %.lr.ph26, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %16 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph26, %0, %.preheader
  %.lcssa = phi i32 [ %18, %.preheader ], [ %7, %0 ], [ %29, %.lr.ph26 ]
  %21 = call noundef ptr @_Z5BuildPiS_i(ptr noundef nonnull %12, ptr noundef nonnull %13, i32 noundef %.lcssa)
  %22 = getelementptr inbounds i8, ptr %21, i64 4
  store i32 1, ptr %22, align 4, !tbaa !11
  call void @_Z9TraversalP8TreeNode(ptr noundef %21)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %24 = call i32 @getchar()
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr %2, align 4, !tbaa !5
  %.not27 = icmp eq i32 %25, 0
  br i1 %.not27, label %._crit_edge30, label %.lr.ph29

.lr.ph26:                                         ; preds = %.preheader, %.lr.ph26
  %indvars.iv33 = phi i64 [ %indvars.iv.next34, %.lr.ph26 ], [ 0, %.preheader ]
  %27 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv33
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next34, %30
  br i1 %31, label %.lr.ph26, label %._crit_edge, !llvm.loop !14

.lr.ph29:                                         ; preds = %._crit_edge, %131
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  %32 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %33 unwind label %42

33:                                               ; preds = %.lr.ph29
  %34 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str, i64 noundef 0) #9
  %.not18 = icmp eq i64 %34, -1
  br i1 %.not18, label %44, label %35

35:                                               ; preds = %33
  %36 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  %37 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %36, ptr noundef nonnull @.str.2, ptr noundef nonnull %3) #9
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = load i32, ptr %21, align 8, !tbaa !15
  %40 = icmp eq i32 %38, %39
  %41 = zext i1 %40 to i8
  br label %125

42:                                               ; preds = %129, %125, %112, %108, %97, %93, %82, %78, %67, %63, %50, %46, %.lr.ph29
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  resume { ptr, i32 } %43

44:                                               ; preds = %33
  %45 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.3, i64 noundef 0) #9
  %.not19 = icmp eq i64 %45, -1
  br i1 %.not19, label %61, label %46

46:                                               ; preds = %44
  %47 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  %48 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %47, ptr noundef nonnull @.str.4, ptr noundef nonnull %3, ptr noundef nonnull %4) #9
  %49 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %50 unwind label %42

50:                                               ; preds = %46
  %51 = load ptr, ptr %49, align 8, !tbaa !16
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load ptr, ptr %52, align 8, !tbaa !17
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %55 unwind label %42

55:                                               ; preds = %50
  %56 = load ptr, ptr %54, align 8, !tbaa !16
  %57 = getelementptr inbounds i8, ptr %56, i64 8
  %58 = load ptr, ptr %57, align 8, !tbaa !17
  %59 = icmp eq ptr %53, %58
  %60 = zext i1 %59 to i8
  br label %125

61:                                               ; preds = %44
  %62 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.5, i64 noundef 0) #9
  %.not20 = icmp eq i64 %62, -1
  br i1 %.not20, label %76, label %63

63:                                               ; preds = %61
  %64 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  %65 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %64, ptr noundef nonnull @.str.6, ptr noundef nonnull %3, ptr noundef nonnull %4) #9
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %67 unwind label %42

67:                                               ; preds = %63
  %68 = load ptr, ptr %66, align 8, !tbaa !16
  %69 = getelementptr inbounds i8, ptr %68, i64 8
  %70 = load ptr, ptr %69, align 8, !tbaa !17
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %72 unwind label %42

72:                                               ; preds = %67
  %73 = load ptr, ptr %71, align 8, !tbaa !16
  %74 = icmp eq ptr %70, %73
  %75 = zext i1 %74 to i8
  br label %125

76:                                               ; preds = %61
  %77 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.7, i64 noundef 0) #9
  %.not21 = icmp eq i64 %77, -1
  br i1 %.not21, label %91, label %78

78:                                               ; preds = %76
  %79 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  %80 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %79, ptr noundef nonnull @.str.8, ptr noundef nonnull %3, ptr noundef nonnull %4) #9
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %82 unwind label %42

82:                                               ; preds = %78
  %83 = load ptr, ptr %81, align 8, !tbaa !16
  %84 = getelementptr inbounds i8, ptr %83, i64 16
  %85 = load ptr, ptr %84, align 8, !tbaa !18
  %86 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %87 unwind label %42

87:                                               ; preds = %82
  %88 = load ptr, ptr %86, align 8, !tbaa !16
  %89 = icmp eq ptr %85, %88
  %90 = zext i1 %89 to i8
  br label %125

91:                                               ; preds = %76
  %92 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.9, i64 noundef 0) #9
  %.not22 = icmp eq i64 %92, -1
  br i1 %.not22, label %106, label %93

93:                                               ; preds = %91
  %94 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  %95 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %94, ptr noundef nonnull @.str.10, ptr noundef nonnull %3, ptr noundef nonnull %4) #9
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %97 unwind label %42

97:                                               ; preds = %93
  %98 = load ptr, ptr %96, align 8, !tbaa !16
  %99 = getelementptr inbounds i8, ptr %98, i64 24
  %100 = load ptr, ptr %99, align 8, !tbaa !19
  %101 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %102 unwind label %42

102:                                              ; preds = %97
  %103 = load ptr, ptr %101, align 8, !tbaa !16
  %104 = icmp eq ptr %100, %103
  %105 = zext i1 %104 to i8
  br label %125

106:                                              ; preds = %91
  %107 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.11, i64 noundef 0) #9
  %.not23 = icmp eq i64 %107, -1
  br i1 %.not23, label %123, label %108

108:                                              ; preds = %106
  %109 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  %110 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %109, ptr noundef nonnull @.str.12, ptr noundef nonnull %3, ptr noundef nonnull %4) #9
  %111 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %112 unwind label %42

112:                                              ; preds = %108
  %113 = load ptr, ptr %111, align 8, !tbaa !16
  %114 = getelementptr inbounds i8, ptr %113, i64 4
  %115 = load i32, ptr %114, align 4, !tbaa !11
  %116 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt13unordered_mapIiP8TreeNodeSt4hashIiESt8equal_toIiESaISt4pairIKiS1_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(56) @nodes, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %117 unwind label %42

117:                                              ; preds = %112
  %118 = load ptr, ptr %116, align 8, !tbaa !16
  %119 = getelementptr inbounds i8, ptr %118, i64 4
  %120 = load i32, ptr %119, align 4, !tbaa !11
  %121 = icmp eq i32 %115, %120
  %122 = zext i1 %121 to i8
  br label %125

123:                                              ; preds = %106
  %124 = load i8, ptr @is_full, align 1, !tbaa !20, !range !22, !noundef !23
  br label %125

125:                                              ; preds = %55, %87, %117, %123, %102, %72, %35
  %.016 = phi i8 [ %41, %35 ], [ %60, %55 ], [ %75, %72 ], [ %90, %87 ], [ %105, %102 ], [ %122, %117 ], [ %124, %123 ]
  %126 = trunc nuw i8 %.016 to i1
  %127 = select i1 %126, ptr @.str.13, ptr @.str.14
  %128 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %127)
          to label %129 unwind label %42

129:                                              ; preds = %125
  %130 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %128, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %131 unwind label %42

131:                                              ; preds = %129
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  %132 = load i32, ptr %2, align 4, !tbaa !5
  %133 = add nsw i32 %132, -1
  store i32 %133, ptr %2, align 4, !tbaa !5
  %.not = icmp eq i32 %132, 0
  br i1 %.not, label %._crit_edge30, label %.lr.ph29, !llvm.loop !24

._crit_edge30:                                    ; preds = %131, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @getchar() local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #7

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcm(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i64 noundef) local_unnamed_addr #6 align 2

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

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

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

; 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)) #7

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #6 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 = { 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 #3 = { "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 = { nobuiltin allocsize(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 = { inlinehint mustprogress nofree 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 #6 = { 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 #7 = { 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 4}
!12 = !{!"_ZTS8TreeNode", !6, i64 0, !6, i64 4, !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = !{!12, !6, i64 0}
!16 = !{!13, !13, i64 0}
!17 = !{!12, !13, i64 8}
!18 = !{!12, !13, i64 16}
!19 = !{!12, !13, i64 24}
!20 = !{!21, !21, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !10}


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