; LLVM IR from mackorone/mms :: old/v2/src/sim/TileGraphic.ll (ZNK3sim11TileGraphic10updateTextEv)

; 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::vector.188" = type { %"struct.std::_Vector_base.189" }
%"struct.std::_Vector_base.189" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.241" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.240" = type { ptr }
%"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] }
%"class.std::allocator.15" = type { i8 }
%"struct.std::pair.193" = type { i32, i32 }
%"class.sim::TileGraphic" = type { ptr, ptr, i32, %"class.std::map.183", i8, %"class.std::vector.188" }
%"class.std::map.183" = type { %"class.std::_Rb_tree.184" }
%"class.std::_Rb_tree.184" = type { %"struct.std::_Rb_tree<sim::Direction, std::pair<const sim::Direction, bool>, std::_Select1st<std::pair<const sim::Direction, bool>>, std::less<sim::Direction>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<sim::Direction, std::pair<const sim::Direction, bool>, std::_Select1st<std::pair<const sim::Direction, bool>>, std::less<sim::Direction>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@.str.64 = external hidden unnamed_addr constant [4 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3sim11TileGraphic10updateTextEv(ptr noundef nonnull align 8 dereferenceable(104) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::vector.188", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.241", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.240", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::allocator.15", align 1
  %10 = alloca i1, align 1
  %11 = alloca i1, align 1
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.240", align 8
  %13 = alloca %"struct.std::pair.193", align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %19 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  %20 = getelementptr inbounds %"class.sim::TileGraphic", ptr %19, i32 0, i32 5
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC2ERKS7_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %20)
  %21 = invoke noundef ptr @_ZN3sim1SEv()
          to label %22 unwind label %52

22:                                               ; preds = %1
  %23 = invoke noundef zeroext i1 @_ZN3sim5State19tileDistanceVisibleEv(ptr noundef nonnull align 8 dereferenceable(168) %21)
          to label %24 unwind label %52

24:                                               ; preds = %22
  br i1 %23, label %25, label %76

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %26 = call ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.240", ptr %7, i32 0, i32 0
  store ptr %26, ptr %27, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorIS6_SaIS6_EEEC2IPS6_vEERKNS0_IT_SB_EE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #5
  %28 = getelementptr inbounds %"class.sim::TileGraphic", ptr %19, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  store i1 false, ptr %10, align 1
  store i1 false, ptr %11, align 1
  %30 = invoke noundef i32 @_ZNK3sim4Tile11getDistanceEv(ptr noundef nonnull align 8 dereferenceable(232) %29)
          to label %31 unwind label %56

31:                                               ; preds = %25
  %32 = icmp sle i32 0, %30
  br i1 %32, label %33, label %38

33:                                               ; preds = %31
  %34 = getelementptr inbounds %"class.sim::TileGraphic", ptr %19, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = invoke noundef i32 @_ZNK3sim4Tile11getDistanceEv(ptr noundef nonnull align 8 dereferenceable(232) %35)
          to label %37 unwind label %56

37:                                               ; preds = %33
  call void @_ZNSt7__cxx119to_stringEi(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %8, i32 noundef %36) #5
  br label %40

38:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  store i1 true, ptr %10, align 1
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  store i1 true, ptr %11, align 1
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef @.str.64, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %39 unwind label %60

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39, %37
  %41 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.241", ptr %6, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8
  %43 = invoke ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE6insertEN9__gnu_cxx17__normal_iteratorIPKS5_S7_EEOS5_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr %42, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %44 unwind label %64

44:                                               ; preds = %40
  %45 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.240", ptr %12, i32 0, i32 0
  store ptr %43, ptr %45, align 8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  %46 = load i1, ptr %11, align 1
  br i1 %46, label %47, label %48

47:                                               ; preds = %44
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  br label %48

48:                                               ; preds = %47, %44
  %49 = load i1, ptr %10, align 1
  br i1 %49, label %50, label %51

50:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %51

51:                                               ; preds = %50, %48
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %76

52:                                               ; preds = %22, %1
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %4, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %5, align 4
  br label %190

56:                                               ; preds = %33, %25
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %4, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %5, align 4
  br label %75

60:                                               ; preds = %38
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %4, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %5, align 4
  br label %68

64:                                               ; preds = %40
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %4, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  br label %68

68:                                               ; preds = %64, %60
  %69 = load i1, ptr %11, align 1
  br i1 %69, label %70, label %71

70:                                               ; preds = %68
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  br label %71

71:                                               ; preds = %70, %68
  %72 = load i1, ptr %10, align 1
  br i1 %72, label %73, label %74

73:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %74

74:                                               ; preds = %73, %71
  br label %75

75:                                               ; preds = %74, %56
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %190

76:                                               ; preds = %51, %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %77 = getelementptr inbounds %"class.sim::TileGraphic", ptr %19, i32 0, i32 1
  %78 = load ptr, ptr %77, align 8, !tbaa !26
  %79 = invoke i64 @_ZN3sim15BufferInterface25getTileGraphicTextMaxSizeEv(ptr noundef nonnull align 8 dereferenceable(160) %78)
          to label %80 unwind label %87

80:                                               ; preds = %76
  store i64 %79, ptr %13, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !27
  br label %81

81:                                               ; preds = %185, %80
  %82 = load i32, ptr %14, align 4, !tbaa !27
  %83 = getelementptr inbounds %"struct.std::pair.193", ptr %13, i32 0, i32 0
  %84 = load i32, ptr %83, align 4, !tbaa !29
  %85 = icmp slt i32 %82, %84
  br i1 %85, label %91, label %86

86:                                               ; preds = %81
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %188

87:                                               ; preds = %76
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %4, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %5, align 4
  br label %189

91:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !27
  br label %92

92:                                               ; preds = %167, %91
  %93 = load i32, ptr %16, align 4, !tbaa !27
  %94 = getelementptr inbounds %"struct.std::pair.193", ptr %13, i32 0, i32 1
  %95 = load i32, ptr %94, align 4, !tbaa !31
  %96 = icmp slt i32 %93, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %92
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %184

98:                                               ; preds = %92
  %99 = getelementptr inbounds %"class.sim::TileGraphic", ptr %19, i32 0, i32 1
  %100 = load ptr, ptr %99, align 8, !tbaa !26
  %101 = getelementptr inbounds %"class.sim::TileGraphic", ptr %19, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !9
  %103 = invoke noundef i32 @_ZNK3sim4Tile4getXEv(ptr noundef nonnull align 8 dereferenceable(232) %102)
          to label %104 unwind label %170

104:                                              ; preds = %98
  %105 = getelementptr inbounds %"class.sim::TileGraphic", ptr %19, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  %107 = invoke noundef i32 @_ZNK3sim4Tile4getYEv(ptr noundef nonnull align 8 dereferenceable(232) %106)
          to label %108 unwind label %170

108:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %109 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %110 = trunc i64 %109 to i32
  store i32 %110, ptr %17, align 4, !tbaa !27
  %111 = getelementptr inbounds %"struct.std::pair.193", ptr %13, i32 0, i32 0
  %112 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %111)
          to label %113 unwind label %174

113:                                              ; preds = %108
  %114 = load i32, ptr %112, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %115 = load i32, ptr %14, align 4, !tbaa !27
  %116 = sext i32 %115 to i64
  %117 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %118 = icmp ult i64 %116, %117
  br i1 %118, label %119, label %125

119:                                              ; preds = %113
  %120 = load i32, ptr %14, align 4, !tbaa !27
  %121 = sext i32 %120 to i64
  %122 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %121)
          to label %123 unwind label %178

123:                                              ; preds = %119
  %124 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %122) #5
  br label %126

125:                                              ; preds = %113
  br label %126

126:                                              ; preds = %125, %123
  %127 = phi i64 [ %124, %123 ], [ 0, %125 ]
  %128 = trunc i64 %127 to i32
  store i32 %128, ptr %18, align 4, !tbaa !27
  %129 = getelementptr inbounds %"struct.std::pair.193", ptr %13, i32 0, i32 1
  %130 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %129)
          to label %131 unwind label %178

131:                                              ; preds = %126
  %132 = load i32, ptr %130, align 4, !tbaa !27
  %133 = load i32, ptr %14, align 4, !tbaa !27
  %134 = load i32, ptr %16, align 4, !tbaa !27
  %135 = invoke noundef ptr @_ZN3sim1SEv()
          to label %136 unwind label %178

136:                                              ; preds = %131
  %137 = invoke noundef zeroext i1 @_ZN3sim5State15tileTextVisibleEv(ptr noundef nonnull align 8 dereferenceable(168) %135)
          to label %138 unwind label %178

138:                                              ; preds = %136
  br i1 %137, label %139, label %163

139:                                              ; preds = %138
  %140 = load i32, ptr %14, align 4, !tbaa !27
  %141 = sext i32 %140 to i64
  %142 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %143 = icmp ult i64 %141, %142
  br i1 %143, label %144, label %163

144:                                              ; preds = %139
  %145 = load i32, ptr %16, align 4, !tbaa !27
  %146 = sext i32 %145 to i64
  %147 = load i32, ptr %14, align 4, !tbaa !27
  %148 = sext i32 %147 to i64
  %149 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %148)
          to label %150 unwind label %178

150:                                              ; preds = %144
  %151 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %149) #5
  %152 = icmp ult i64 %146, %151
  br i1 %152, label %153, label %163

153:                                              ; preds = %150
  %154 = load i32, ptr %14, align 4, !tbaa !27
  %155 = sext i32 %154 to i64
  %156 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %155)
          to label %157 unwind label %178

157:                                              ; preds = %153
  %158 = load i32, ptr %16, align 4, !tbaa !27
  %159 = sext i32 %158 to i64
  %160 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE2atEm(ptr noundef nonnull align 8 dereferenceable(32) %156, i64 noundef %159)
          to label %161 unwind label %178

161:                                              ; preds = %157
  %162 = load i8, ptr %160, align 1, !tbaa !32
  br label %164

163:                                              ; preds = %150, %139, %138
  br label %164

164:                                              ; preds = %163, %161
  %165 = phi i8 [ %162, %161 ], [ 32, %163 ]
  invoke void @_ZN3sim15BufferInterface21updateTileGraphicTextEiiiiiic(ptr noundef nonnull align 8 dereferenceable(160) %100, i32 noundef %103, i32 noundef %107, i32 noundef %114, i32 noundef %132, i32 noundef %133, i32 noundef %134, i8 noundef signext %165)
          to label %166 unwind label %178

166:                                              ; preds = %164
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr %16, align 4, !tbaa !27
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %16, align 4, !tbaa !27
  br label %92, !llvm.loop !33

170:                                              ; preds = %104, %98
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %4, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %5, align 4
  br label %183

174:                                              ; preds = %108
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %4, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %5, align 4
  br label %182

178:                                              ; preds = %164, %157, %153, %144, %136, %131, %126, %119
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %4, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %182

182:                                              ; preds = %178, %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %183

183:                                              ; preds = %182, %170
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %189

184:                                              ; preds = %97
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %14, align 4, !tbaa !27
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %14, align 4, !tbaa !27
  br label %81, !llvm.loop !35

188:                                              ; preds = %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  ret void

189:                                              ; preds = %183, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %190

190:                                              ; preds = %189, %75, %52
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  br label %191

191:                                              ; preds = %190
  %192 = load ptr, ptr %4, align 8
  %193 = load i32, ptr %5, align 4
  %194 = insertvalue { ptr, i32 } poison, ptr %192, 0
  %195 = insertvalue { ptr, i32 } %194, i32 %193, 1
  resume { ptr, i32 } %195
}

declare noundef ptr @_ZN3sim1SEv() #3

declare i64 @_ZN3sim15BufferInterface25getTileGraphicTextMaxSizeEv(ptr noundef nonnull align 8 dereferenceable(160)) #3

declare noundef i32 @_ZNK3sim4Tile4getXEv(ptr noundef nonnull align 8 dereferenceable(232)) #3

declare noundef i32 @_ZNK3sim4Tile4getYEv(ptr noundef nonnull align 8 dereferenceable(232)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC2ERKS7_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

declare noundef zeroext i1 @_ZN3sim5State19tileDistanceVisibleEv(ptr noundef nonnull align 8 dereferenceable(168)) #3

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

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

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

declare noundef i32 @_ZNK3sim4Tile11getDistanceEv(ptr noundef nonnull align 8 dereferenceable(232)) #3

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

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

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

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

declare void @_ZN3sim15BufferInterface21updateTileGraphicTextEiiiiiic(ptr noundef nonnull align 8 dereferenceable(160), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i8 noundef signext) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

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

declare noundef zeroext i1 @_ZN3sim5State15tileTextVisibleEv(ptr noundef nonnull align 8 dereferenceable(168)) #3

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { inlinehint 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN3sim11TileGraphicE", !6, i64 0, !6, i64 8, !11, i64 16, !12, i64 24, !21, i64 72, !22, i64 80}
!11 = !{!"_ZTSN3sim5ColorE", !7, i64 0}
!12 = !{!"_ZTSSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE", !13, i64 0}
!13 = !{!"_ZTSSt8_Rb_treeIN3sim9DirectionESt4pairIKS1_bESt10_Select1stIS4_ESt4lessIS1_ESaIS4_EE", !14, i64 0}
!14 = !{!"_ZTSNSt8_Rb_treeIN3sim9DirectionESt4pairIKS1_bESt10_Select1stIS4_ESt4lessIS1_ESaIS4_EE13_Rb_tree_implIS8_Lb1EEE", !15, i64 0, !17, i64 8}
!15 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN3sim9DirectionEEE", !16, i64 0}
!16 = !{!"_ZTSSt4lessIN3sim9DirectionEE"}
!17 = !{!"_ZTSSt15_Rb_tree_header", !18, i64 0, !20, i64 32}
!18 = !{!"_ZTSSt18_Rb_tree_node_base", !19, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!19 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"_ZTSSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!10, !6, i64 8}
!27 = !{!28, !28, i64 0}
!28 = !{!"int", !7, i64 0}
!29 = !{!30, !28, i64 0}
!30 = !{!"_ZTSSt4pairIiiE", !28, i64 0, !28, i64 4}
!31 = !{!30, !28, i64 4}
!32 = !{!7, !7, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}


; 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::vector.188" = type { %"struct.std::_Vector_base.189" }
%"struct.std::_Vector_base.189" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.241" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.240" = type { ptr }
%"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] }
%"class.std::allocator.15" = type { i8 }
%"struct.std::pair.193" = type { i32, i32 }

@.str.64 = external hidden unnamed_addr constant [4 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3sim11TileGraphic10updateTextEv(ptr noundef nonnull align 8 dereferenceable(104) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::vector.188", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.241", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.240", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator.15", align 1
  %7 = alloca %"struct.std::pair.193", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  %10 = getelementptr inbounds i8, ptr %0, i64 80
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC2ERKS7_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %10)
  %11 = invoke noundef ptr @_ZN3sim1SEv()
          to label %12 unwind label %31

12:                                               ; preds = %1
  %13 = invoke noundef zeroext i1 @_ZN3sim5State19tileDistanceVisibleEv(ptr noundef nonnull align 8 dereferenceable(168) %11)
          to label %14 unwind label %31

14:                                               ; preds = %12
  br i1 %13, label %15, label %39

15:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %16 = call ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  store ptr %16, ptr %4, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorIS6_SaIS6_EEEC2IPS6_vEERKNS0_IT_SB_EE(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  %17 = load ptr, ptr %0, align 8, !tbaa !5
  %18 = invoke noundef i32 @_ZNK3sim4Tile11getDistanceEv(ptr noundef nonnull align 8 dereferenceable(232) %17)
          to label %19 unwind label %33

19:                                               ; preds = %15
  %20 = icmp slt i32 %18, 0
  br i1 %20, label %25, label %21

21:                                               ; preds = %19
  %22 = load ptr, ptr %0, align 8, !tbaa !5
  %23 = invoke noundef i32 @_ZNK3sim4Tile11getDistanceEv(ptr noundef nonnull align 8 dereferenceable(232) %22)
          to label %24 unwind label %33

24:                                               ; preds = %21
  call void @_ZNSt7__cxx119to_stringEi(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, i32 noundef %23) #5
  br label %26

25:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.64, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %26 unwind label %.thread

26:                                               ; preds = %25, %24
  %27 = load ptr, ptr %3, align 8
  %28 = invoke ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE6insertEN9__gnu_cxx17__normal_iteratorIPKS5_S7_EEOS5_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr %27, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %29 unwind label %36

29:                                               ; preds = %26
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  br i1 %20, label %30, label %.critedge

30:                                               ; preds = %29
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  br label %.critedge

.critedge:                                        ; preds = %29, %30
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %39

31:                                               ; preds = %12, %1
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %113

33:                                               ; preds = %21, %15
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %.critedge40

.thread:                                          ; preds = %25
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %38

36:                                               ; preds = %26
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  br i1 %20, label %38, label %.critedge40

38:                                               ; preds = %.thread, %36
  %.pn43 = phi { ptr, i32 } [ %35, %.thread ], [ %37, %36 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  br label %.critedge40

.critedge40:                                      ; preds = %36, %38, %33
  %.pn.pn = phi { ptr, i32 } [ %.pn43, %38 ], [ %34, %33 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %113

39:                                               ; preds = %.critedge, %14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %40 = getelementptr inbounds i8, ptr %0, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !25
  %42 = invoke i64 @_ZN3sim15BufferInterface25getTileGraphicTextMaxSizeEv(ptr noundef nonnull align 8 dereferenceable(160) %41)
          to label %43 unwind label %54

43:                                               ; preds = %39
  store i64 %42, ptr %7, align 8
  %44 = trunc i64 %42 to i32
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.preheader.lr.ph, label %._crit_edge46

.preheader.lr.ph:                                 ; preds = %43
  %46 = lshr i64 %42, 32
  %47 = trunc nuw i64 %46 to i32
  %48 = getelementptr inbounds i8, ptr %7, i64 4
  %49 = icmp sgt i32 %47, 0
  br i1 %49, label %.preheader, label %._crit_edge46

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %50 = phi i32 [ %56, %._crit_edge ], [ %44, %.preheader.lr.ph ]
  %51 = phi i32 [ %57, %._crit_edge ], [ %47, %.preheader.lr.ph ]
  %indvars.iv49 = phi i64 [ %indvars.iv.next50, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %53 = trunc nuw nsw i64 %indvars.iv49 to i32
  br label %60

._crit_edge46:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  ret void

54:                                               ; preds = %39
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %112

._crit_edge.loopexit:                             ; preds = %104
  %.pre = load i32, ptr %7, align 8, !tbaa !26
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %56 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %50, %.preheader ]
  %57 = phi i32 [ %105, %._crit_edge.loopexit ], [ %51, %.preheader ]
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %58 = sext i32 %56 to i64
  %59 = icmp slt i64 %indvars.iv.next50, %58
  br i1 %59, label %.preheader, label %._crit_edge46, !llvm.loop !29

60:                                               ; preds = %.lr.ph, %104
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %104 ]
  %61 = load ptr, ptr %40, align 8, !tbaa !25
  %62 = load ptr, ptr %0, align 8, !tbaa !5
  %63 = invoke noundef i32 @_ZNK3sim4Tile4getXEv(ptr noundef nonnull align 8 dereferenceable(232) %62)
          to label %64 unwind label %108

64:                                               ; preds = %60
  %65 = load ptr, ptr %0, align 8, !tbaa !5
  %66 = invoke noundef i32 @_ZNK3sim4Tile4getYEv(ptr noundef nonnull align 8 dereferenceable(232) %65)
          to label %67 unwind label %108

67:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %68 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %69 = trunc i64 %68 to i32
  store i32 %69, ptr %8, align 4, !tbaa !32
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %71 = load i32, ptr %70, align 4, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  %72 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %73 = icmp ugt i64 %72, %indvars.iv49
  br i1 %73, label %74, label %78

74:                                               ; preds = %67
  %75 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv49)
          to label %76 unwind label %110

76:                                               ; preds = %74
  %77 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %75) #5
  br label %78

78:                                               ; preds = %67, %76
  %79 = phi i64 [ %77, %76 ], [ 0, %67 ]
  %80 = trunc i64 %79 to i32
  store i32 %80, ptr %9, align 4, !tbaa !32
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %48)
  %82 = load i32, ptr %81, align 4, !tbaa !32
  %83 = invoke noundef ptr @_ZN3sim1SEv()
          to label %84 unwind label %110

84:                                               ; preds = %78
  %85 = invoke noundef zeroext i1 @_ZN3sim5State15tileTextVisibleEv(ptr noundef nonnull align 8 dereferenceable(168) %83)
          to label %86 unwind label %110

86:                                               ; preds = %84
  br i1 %85, label %87, label %101

87:                                               ; preds = %86
  %88 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %89 = icmp ugt i64 %88, %indvars.iv49
  br i1 %89, label %90, label %101

90:                                               ; preds = %87
  %91 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv49)
          to label %92 unwind label %110

92:                                               ; preds = %90
  %93 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %91) #5
  %94 = icmp ugt i64 %93, %indvars.iv
  br i1 %94, label %95, label %101

95:                                               ; preds = %92
  %96 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv49)
          to label %97 unwind label %110

97:                                               ; preds = %95
  %98 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE2atEm(ptr noundef nonnull align 8 dereferenceable(32) %96, i64 noundef %indvars.iv)
          to label %99 unwind label %110

99:                                               ; preds = %97
  %100 = load i8, ptr %98, align 1, !tbaa !33
  br label %101

101:                                              ; preds = %86, %87, %92, %99
  %102 = phi i8 [ %100, %99 ], [ 32, %92 ], [ 32, %87 ], [ 32, %86 ]
  %103 = trunc nuw nsw i64 %indvars.iv to i32
  invoke void @_ZN3sim15BufferInterface21updateTileGraphicTextEiiiiiic(ptr noundef nonnull align 8 dereferenceable(160) %61, i32 noundef %63, i32 noundef %66, i32 noundef %71, i32 noundef %82, i32 noundef %53, i32 noundef %103, i8 noundef signext %102)
          to label %104 unwind label %110

104:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %105 = load i32, ptr %48, align 4, !tbaa !34
  %106 = sext i32 %105 to i64
  %107 = icmp slt i64 %indvars.iv.next, %106
  br i1 %107, label %60, label %._crit_edge.loopexit, !llvm.loop !35

108:                                              ; preds = %64, %60
  %109 = landingpad { ptr, i32 }
          cleanup
  br label %112

110:                                              ; preds = %101, %97, %95, %90, %84, %78, %74
  %111 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  br label %112

112:                                              ; preds = %108, %110, %54
  %.pn35.pn = phi { ptr, i32 } [ %55, %54 ], [ %111, %110 ], [ %109, %108 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %113

113:                                              ; preds = %112, %.critedge40, %31
  %.pn35.pn.pn = phi { ptr, i32 } [ %.pn35.pn, %112 ], [ %.pn.pn, %.critedge40 ], [ %32, %31 ]
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  resume { ptr, i32 } %.pn35.pn.pn
}

declare noundef ptr @_ZN3sim1SEv() local_unnamed_addr #3

declare i64 @_ZN3sim15BufferInterface25getTileGraphicTextMaxSizeEv(ptr noundef nonnull align 8 dereferenceable(160)) local_unnamed_addr #3

declare noundef i32 @_ZNK3sim4Tile4getXEv(ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #3

declare noundef i32 @_ZNK3sim4Tile4getYEv(ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC2ERKS7_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

declare noundef zeroext i1 @_ZN3sim5State19tileDistanceVisibleEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #3

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

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

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

declare noundef i32 @_ZNK3sim4Tile11getDistanceEv(ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #3

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

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

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

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

declare void @_ZN3sim15BufferInterface21updateTileGraphicTextEiiiiiic(ptr noundef nonnull align 8 dereferenceable(160), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i8 noundef signext) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

declare noundef zeroext i1 @_ZN3sim5State15tileTextVisibleEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #3

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { inlinehint 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, !7, i64 0}
!6 = !{!"_ZTSN3sim11TileGraphicE", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !20, i64 72, !21, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN3sim5ColorE", !8, i64 0}
!11 = !{!"_ZTSSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE", !12, i64 0}
!12 = !{!"_ZTSSt8_Rb_treeIN3sim9DirectionESt4pairIKS1_bESt10_Select1stIS4_ESt4lessIS1_ESaIS4_EE", !13, i64 0}
!13 = !{!"_ZTSNSt8_Rb_treeIN3sim9DirectionESt4pairIKS1_bESt10_Select1stIS4_ESt4lessIS1_ESaIS4_EE13_Rb_tree_implIS8_Lb1EEE", !14, i64 0, !16, i64 8}
!14 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN3sim9DirectionEEE", !15, i64 0}
!15 = !{!"_ZTSSt4lessIN3sim9DirectionEE"}
!16 = !{!"_ZTSSt15_Rb_tree_header", !17, i64 0, !19, i64 32}
!17 = !{!"_ZTSSt18_Rb_tree_node_base", !18, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!18 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!19 = !{!"long", !8, i64 0}
!20 = !{!"bool", !8, i64 0}
!21 = !{!"_ZTSSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!25 = !{!6, !7, i64 8}
!26 = !{!27, !28, i64 0}
!27 = !{!"_ZTSSt4pairIiiE", !28, i64 0, !28, i64 4}
!28 = !{!"int", !8, i64 0}
!29 = distinct !{!29, !30, !31}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!"llvm.loop.unswitch.partial.disable"}
!32 = !{!28, !28, i64 0}
!33 = !{!8, !8, i64 0}
!34 = !{!27, !28, i64 4}
!35 = distinct !{!35, !30}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass