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

; 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::map.21" = type { %"class.std::_Rb_tree.22" }
%"class.std::_Rb_tree.22" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, sim::Color>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, sim::Color>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, sim::Color>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, sim::Color>>, std::less<std::__cxx11::basic_string<char>>>::_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 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl_data" = type { ptr, ptr, 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.sim::Polygon" = type { %"class.std::vector.206", %"class.std::vector.211" }
%"class.std::vector.206" = type { %"struct.std::_Vector_base.207" }
%"struct.std::_Vector_base.207" = type { %"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.211" = type { %"struct.std::_Vector_base.212" }
%"struct.std::_Vector_base.212" = type { %"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair.237" = type { i32, float }
%"class.std::vector.221" = type { %"struct.std::_Vector_base.222" }
%"struct.std::_Vector_base.222" = type { %"struct.std::_Vector_base<sim::Polygon, std::allocator<sim::Polygon>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Polygon, std::allocator<sim::Polygon>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Polygon, std::allocator<sim::Polygon>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Polygon, std::allocator<sim::Polygon>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.239" = type { ptr }
%"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" }
%"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 }

@_ZN3simL15STRING_TO_COLORB5cxx11E = external hidden global %"class.std::map.21", align 8
@_ZN3simL10DIRECTIONSE = external hidden global %"class.std::vector", align 8

; 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 uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3sim5ColorESt4lessIS5_ESaISt4pairIKS5_S7_EEE2atERSB_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

declare noundef ptr @_ZN3sim1PEv() #2

declare void @_ZN3sim5Param13tileBaseColorB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(1056)) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3sim11TileGraphic10updateTextEv(ptr noundef nonnull align 8 dereferenceable(104)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3sim11TileGraphic4drawEv(ptr noundef nonnull align 8 dereferenceable(104) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.sim::Polygon", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca i1, align 1
  %8 = alloca i1, align 1
  %9 = alloca ptr, align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair.237", align 4
  %14 = alloca %"class.sim::Polygon", align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"class.std::vector.221", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator.239", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator.239", align 8
  %19 = alloca %"class.sim::Polygon", align 8
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca %"class.sim::Polygon", align 8
  %22 = alloca %"class.std::__cxx11::basic_string", align 8
  %23 = alloca %"struct.std::pair.193", align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %27 = load ptr, ptr %2, align 8
  %28 = getelementptr inbounds %"class.sim::TileGraphic", ptr %27, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 48, ptr %3) #5
  %30 = getelementptr inbounds %"class.sim::TileGraphic", ptr %27, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !26
  call void @_ZNK3sim4Tile14getFullPolygonEv(ptr dead_on_unwind writable sret(%"class.sim::Polygon") align 8 %3, ptr noundef nonnull align 8 dereferenceable(232) %31)
  store i1 false, ptr %7, align 1
  store i1 false, ptr %8, align 1
  %32 = invoke noundef ptr @_ZN3sim1SEv()
          to label %33 unwind label %62

33:                                               ; preds = %1
  %34 = invoke noundef zeroext i1 @_ZN3sim5State17tileColorsVisibleEv(ptr noundef nonnull align 8 dereferenceable(168) %32)
          to label %35 unwind label %62

35:                                               ; preds = %33
  br i1 %34, label %36, label %39

36:                                               ; preds = %35
  %37 = getelementptr inbounds %"class.sim::TileGraphic", ptr %27, i32 0, i32 2
  %38 = load i32, ptr %37, align 8, !tbaa !27
  br label %46

39:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #5
  store i1 true, ptr %7, align 1
  %40 = invoke noundef ptr @_ZN3sim1PEv()
          to label %41 unwind label %66

41:                                               ; preds = %39
  invoke void @_ZN3sim5Param13tileBaseColorB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %6, ptr noundef nonnull align 8 dereferenceable(1056) %40)
          to label %42 unwind label %66

42:                                               ; preds = %41
  store i1 true, ptr %8, align 1
  %43 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3sim5ColorESt4lessIS5_ESaISt4pairIKS5_S7_EEE2atERSB_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN3simL15STRING_TO_COLORB5cxx11E, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %44 unwind label %70

44:                                               ; preds = %42
  %45 = load i32, ptr %43, align 4, !tbaa !28
  br label %46

46:                                               ; preds = %44, %36
  %47 = phi i32 [ %38, %36 ], [ %45, %44 ]
  invoke void @_ZN3sim15BufferInterface26insertIntoGraphicCpuBufferERKNS_7PolygonENS_5ColorEd(ptr noundef nonnull align 8 dereferenceable(160) %29, ptr noundef nonnull align 8 dereferenceable(48) %3, i32 noundef %47, double noundef 1.000000e+00)
          to label %48 unwind label %70

48:                                               ; preds = %46
  %49 = load i1, ptr %8, align 1
  br i1 %49, label %50, label %51

50:                                               ; preds = %48
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br label %51

51:                                               ; preds = %50, %48
  %52 = load i1, ptr %7, align 1
  br i1 %52, label %53, label %54

53:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #5
  br label %54

54:                                               ; preds = %53, %51
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr @_ZN3simL10DIRECTIONSE, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %55 = call ptr @_ZNKSt6vectorIN3sim9DirectionESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN3simL10DIRECTIONSE) #5
  %56 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %55, ptr %56, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %57 = call ptr @_ZNKSt6vectorIN3sim9DirectionESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN3simL10DIRECTIONSE) #5
  %58 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %57, ptr %58, align 8
  br label %59

59:                                               ; preds = %98, %54
  %60 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br i1 %60, label %82, label %61

61:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %104

62:                                               ; preds = %33, %1
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %4, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %5, align 4
  br label %81

66:                                               ; preds = %41, %39
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %4, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %5, align 4
  br label %77

70:                                               ; preds = %46, %42
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %4, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %5, align 4
  %74 = load i1, ptr %8, align 1
  br i1 %74, label %75, label %76

75:                                               ; preds = %70
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br label %76

76:                                               ; preds = %75, %70
  br label %77

77:                                               ; preds = %76, %66
  %78 = load i1, ptr %7, align 1
  br i1 %78, label %79, label %80

79:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #5
  br label %80

80:                                               ; preds = %79, %77
  br label %81

81:                                               ; preds = %80, %62
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #5
  br label %208

82:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %84 = load i32, ptr %83, align 4, !tbaa !29
  store i32 %84, ptr %12, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %85 = load i32, ptr %12, align 4, !tbaa !29
  %86 = call i64 @_ZNK3sim11TileGraphic23deduceWallColorAndAlphaENS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(104) %27, i32 noundef %85)
  store i64 %86, ptr %13, align 4
  %87 = getelementptr inbounds %"class.sim::TileGraphic", ptr %27, i32 0, i32 1
  %88 = load ptr, ptr %87, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 48, ptr %14) #5
  %89 = getelementptr inbounds %"class.sim::TileGraphic", ptr %27, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !26
  %91 = load i32, ptr %12, align 4, !tbaa !29
  call void @_ZNK3sim4Tile14getWallPolygonENS_9DirectionE(ptr dead_on_unwind writable sret(%"class.sim::Polygon") align 8 %14, ptr noundef nonnull align 8 dereferenceable(232) %90, i32 noundef %91)
  %92 = getelementptr inbounds %"struct.std::pair.237", ptr %13, i32 0, i32 0
  %93 = load i32, ptr %92, align 4, !tbaa !31
  %94 = getelementptr inbounds %"struct.std::pair.237", ptr %13, i32 0, i32 1
  %95 = load float, ptr %94, align 4, !tbaa !34
  %96 = fpext float %95 to double
  invoke void @_ZN3sim15BufferInterface26insertIntoGraphicCpuBufferERKNS_7PolygonENS_5ColorEd(ptr noundef nonnull align 8 dereferenceable(160) %88, ptr noundef nonnull align 8 dereferenceable(48) %14, i32 noundef %93, double noundef %96)
          to label %97 unwind label %100

97:                                               ; preds = %82
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %14) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %98

98:                                               ; preds = %97
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  br label %59

100:                                              ; preds = %82
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %4, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %5, align 4
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %14) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %208

104:                                              ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  %105 = getelementptr inbounds %"class.sim::TileGraphic", ptr %27, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !26
  call void @_ZNK3sim4Tile17getCornerPolygonsEv(ptr dead_on_unwind writable sret(%"class.std::vector.221") align 8 %16, ptr noundef nonnull align 8 dereferenceable(232) %106)
  store ptr %16, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %107 = load ptr, ptr %15, align 8, !tbaa !5
  %108 = call ptr @_ZNSt6vectorIN3sim7PolygonESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %107) #5
  %109 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.239", ptr %17, i32 0, i32 0
  store ptr %108, ptr %109, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %110 = load ptr, ptr %15, align 8, !tbaa !5
  %111 = call ptr @_ZNSt6vectorIN3sim7PolygonESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %110) #5
  %112 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.239", ptr %18, i32 0, i32 0
  store ptr %111, ptr %112, align 8
  br label %113

113:                                              ; preds = %128, %104
  %114 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN3sim7PolygonESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  br i1 %114, label %116, label %115

115:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @_ZNSt6vectorIN3sim7PolygonESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %144

116:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 48, ptr %19) #5
  %117 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3sim7PolygonESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  invoke void @_ZN3sim7PolygonC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %19, ptr noundef nonnull align 8 dereferenceable(48) %117)
          to label %118 unwind label %130

118:                                              ; preds = %116
  %119 = getelementptr inbounds %"class.sim::TileGraphic", ptr %27, i32 0, i32 1
  %120 = load ptr, ptr %119, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #5
  %121 = invoke noundef ptr @_ZN3sim1PEv()
          to label %122 unwind label %134

122:                                              ; preds = %118
  invoke void @_ZN3sim5Param15tileCornerColorB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %20, ptr noundef nonnull align 8 dereferenceable(1056) %121)
          to label %123 unwind label %134

123:                                              ; preds = %122
  %124 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3sim5ColorESt4lessIS5_ESaISt4pairIKS5_S7_EEE2atERSB_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN3simL15STRING_TO_COLORB5cxx11E, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %125 unwind label %138

125:                                              ; preds = %123
  %126 = load i32, ptr %124, align 4, !tbaa !28
  invoke void @_ZN3sim15BufferInterface26insertIntoGraphicCpuBufferERKNS_7PolygonENS_5ColorEd(ptr noundef nonnull align 8 dereferenceable(160) %120, ptr noundef nonnull align 8 dereferenceable(48) %19, i32 noundef %126, double noundef 1.000000e+00)
          to label %127 unwind label %138

127:                                              ; preds = %125
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %19) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %19) #5
  br label %128

128:                                              ; preds = %127
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN3sim7PolygonESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  br label %113

130:                                              ; preds = %116
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %4, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %5, align 4
  br label %143

134:                                              ; preds = %122, %118
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %4, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %5, align 4
  br label %142

138:                                              ; preds = %125, %123
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %4, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  br label %142

142:                                              ; preds = %138, %134
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %19) #5
  br label %143

143:                                              ; preds = %142, %130
  call void @llvm.lifetime.end.p0(i64 48, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @_ZNSt6vectorIN3sim7PolygonESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %208

144:                                              ; preds = %115
  %145 = getelementptr inbounds %"class.sim::TileGraphic", ptr %27, i32 0, i32 1
  %146 = load ptr, ptr %145, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 48, ptr %21) #5
  %147 = getelementptr inbounds %"class.sim::TileGraphic", ptr %27, i32 0, i32 0
  %148 = load ptr, ptr %147, align 8, !tbaa !26
  call void @_ZNK3sim4Tile14getFullPolygonEv(ptr dead_on_unwind writable sret(%"class.sim::Polygon") align 8 %21, ptr noundef nonnull align 8 dereferenceable(232) %148)
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #5
  %149 = invoke noundef ptr @_ZN3sim1PEv()
          to label %150 unwind label %181

150:                                              ; preds = %144
  invoke void @_ZN3sim5Param12tileFogColorB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %22, ptr noundef nonnull align 8 dereferenceable(1056) %149)
          to label %151 unwind label %181

151:                                              ; preds = %150
  %152 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3sim5ColorESt4lessIS5_ESaISt4pairIKS5_S7_EEE2atERSB_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN3simL15STRING_TO_COLORB5cxx11E, ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %153 unwind label %185

153:                                              ; preds = %151
  %154 = load i32, ptr %152, align 4, !tbaa !28
  %155 = getelementptr inbounds %"class.sim::TileGraphic", ptr %27, i32 0, i32 4
  %156 = load i8, ptr %155, align 8, !tbaa !35, !range !36, !noundef !37
  %157 = trunc i8 %156 to i1
  br i1 %157, label %158, label %168

158:                                              ; preds = %153
  %159 = invoke noundef ptr @_ZN3sim1SEv()
          to label %160 unwind label %185

160:                                              ; preds = %158
  %161 = invoke noundef zeroext i1 @_ZN3sim5State14tileFogVisibleEv(ptr noundef nonnull align 8 dereferenceable(168) %159)
          to label %162 unwind label %185

162:                                              ; preds = %160
  br i1 %161, label %163, label %168

163:                                              ; preds = %162
  %164 = invoke noundef ptr @_ZN3sim1PEv()
          to label %165 unwind label %185

165:                                              ; preds = %163
  %166 = invoke noundef double @_ZN3sim5Param12tileFogAlphaEv(ptr noundef nonnull align 8 dereferenceable(1056) %164)
          to label %167 unwind label %185

167:                                              ; preds = %165
  br label %169

168:                                              ; preds = %162, %153
  br label %169

169:                                              ; preds = %168, %167
  %170 = phi double [ %166, %167 ], [ 0.000000e+00, %168 ]
  invoke void @_ZN3sim15BufferInterface26insertIntoGraphicCpuBufferERKNS_7PolygonENS_5ColorEd(ptr noundef nonnull align 8 dereferenceable(160) %146, ptr noundef nonnull align 8 dereferenceable(48) %21, i32 noundef %154, double noundef %170)
          to label %171 unwind label %185

171:                                              ; preds = %169
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #5
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %21) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %172 = getelementptr inbounds %"class.sim::TileGraphic", ptr %27, i32 0, i32 1
  %173 = load ptr, ptr %172, align 8, !tbaa !9
  %174 = call i64 @_ZN3sim15BufferInterface25getTileGraphicTextMaxSizeEv(ptr noundef nonnull align 8 dereferenceable(160) %173)
  store i64 %174, ptr %23, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !38
  br label %175

175:                                              ; preds = %204, %171
  %176 = load i32, ptr %24, align 4, !tbaa !38
  %177 = getelementptr inbounds %"struct.std::pair.193", ptr %23, i32 0, i32 0
  %178 = load i32, ptr %177, align 4, !tbaa !40
  %179 = icmp slt i32 %176, %178
  br i1 %179, label %190, label %180

180:                                              ; preds = %175
  store i32 6, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %207

181:                                              ; preds = %150, %144
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %4, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %5, align 4
  br label %189

185:                                              ; preds = %169, %165, %163, %160, %158, %151
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %4, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #5
  br label %189

189:                                              ; preds = %185, %181
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #5
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %21) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %21) #5
  br label %208

190:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 0, ptr %26, align 4, !tbaa !38
  br label %191

191:                                              ; preds = %200, %190
  %192 = load i32, ptr %26, align 4, !tbaa !38
  %193 = getelementptr inbounds %"struct.std::pair.193", ptr %23, i32 0, i32 1
  %194 = load i32, ptr %193, align 4, !tbaa !42
  %195 = icmp slt i32 %192, %194
  br i1 %195, label %197, label %196

196:                                              ; preds = %191
  store i32 9, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %203

197:                                              ; preds = %191
  %198 = getelementptr inbounds %"class.sim::TileGraphic", ptr %27, i32 0, i32 1
  %199 = load ptr, ptr %198, align 8, !tbaa !9
  call void @_ZN3sim15BufferInterface26insertIntoTextureCpuBufferEv(ptr noundef nonnull align 8 dereferenceable(160) %199)
  br label %200

200:                                              ; preds = %197
  %201 = load i32, ptr %26, align 4, !tbaa !38
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %26, align 4, !tbaa !38
  br label %191, !llvm.loop !43

203:                                              ; preds = %196
  br label %204

204:                                              ; preds = %203
  %205 = load i32, ptr %24, align 4, !tbaa !38
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %24, align 4, !tbaa !38
  br label %175, !llvm.loop !45

207:                                              ; preds = %180
  call void @_ZNK3sim11TileGraphic10updateTextEv(ptr noundef nonnull align 8 dereferenceable(104) %27)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  ret void

208:                                              ; preds = %189, %143, %100, %81
  %209 = load ptr, ptr %4, align 8
  %210 = load i32, ptr %5, align 4
  %211 = insertvalue { ptr, i32 } poison, ptr %209, 0
  %212 = insertvalue { ptr, i32 } %211, i32 %210, 1
  resume { ptr, i32 } %212
}

declare void @_ZN3sim15BufferInterface26insertIntoGraphicCpuBufferERKNS_7PolygonENS_5ColorEd(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, double noundef) #2

declare void @_ZNK3sim4Tile14getFullPolygonEv(ptr dead_on_unwind writable sret(%"class.sim::Polygon") align 8, ptr noundef nonnull align 8 dereferenceable(232)) #2

declare noundef ptr @_ZN3sim1SEv() #2

declare noundef zeroext i1 @_ZN3sim5State17tileColorsVisibleEv(ptr noundef nonnull align 8 dereferenceable(168)) #2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNK3sim11TileGraphic23deduceWallColorAndAlphaENS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef) #1 align 2

declare void @_ZNK3sim4Tile14getWallPolygonENS_9DirectionE(ptr dead_on_unwind writable sret(%"class.sim::Polygon") align 8, ptr noundef nonnull align 8 dereferenceable(232), i32 noundef) #2

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

declare void @_ZNK3sim4Tile17getCornerPolygonsEv(ptr dead_on_unwind writable sret(%"class.std::vector.221") align 8, ptr noundef nonnull align 8 dereferenceable(232)) #2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3sim7PolygonESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

declare void @_ZN3sim7PolygonC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2

declare void @_ZN3sim5Param15tileCornerColorB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(1056)) #2

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

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

declare void @_ZN3sim5Param12tileFogColorB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(1056)) #2

declare noundef zeroext i1 @_ZN3sim5State14tileFogVisibleEv(ptr noundef nonnull align 8 dereferenceable(168)) #2

declare noundef double @_ZN3sim5Param12tileFogAlphaEv(ptr noundef nonnull align 8 dereferenceable(1056)) #2

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

declare void @_ZN3sim15BufferInterface26insertIntoTextureCpuBufferEv(ptr noundef nonnull align 8 dereferenceable(160)) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #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 8}
!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 0}
!27 = !{!10, !11, i64 16}
!28 = !{!11, !11, i64 0}
!29 = !{!30, !30, i64 0}
!30 = !{!"_ZTSN3sim9DirectionE", !7, i64 0}
!31 = !{!32, !11, i64 0}
!32 = !{!"_ZTSSt4pairIN3sim5ColorEfE", !11, i64 0, !33, i64 4}
!33 = !{!"float", !7, i64 0}
!34 = !{!32, !33, i64 4}
!35 = !{!10, !21, i64 72}
!36 = !{i8 0, i8 2}
!37 = !{}
!38 = !{!39, !39, i64 0}
!39 = !{!"int", !7, i64 0}
!40 = !{!41, !39, i64 0}
!41 = !{!"_ZTSSt4pairIiiE", !39, i64 0, !39, i64 4}
!42 = !{!41, !39, i64 4}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}
!45 = distinct !{!45, !44}


; 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::map.21" = type { %"class.std::_Rb_tree.22" }
%"class.std::_Rb_tree.22" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, sim::Color>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, sim::Color>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, sim::Color>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, sim::Color>>, std::less<std::__cxx11::basic_string<char>>>::_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 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl_data" = type { ptr, ptr, 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.sim::Polygon" = type { %"class.std::vector.206", %"class.std::vector.211" }
%"class.std::vector.206" = type { %"struct.std::_Vector_base.207" }
%"struct.std::_Vector_base.207" = type { %"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Cartesian, std::allocator<sim::Cartesian>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.211" = type { %"struct.std::_Vector_base.212" }
%"struct.std::_Vector_base.212" = type { %"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Triangle, std::allocator<sim::Triangle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::vector.221" = type { %"struct.std::_Vector_base.222" }
%"struct.std::_Vector_base.222" = type { %"struct.std::_Vector_base<sim::Polygon, std::allocator<sim::Polygon>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Polygon, std::allocator<sim::Polygon>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Polygon, std::allocator<sim::Polygon>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Polygon, std::allocator<sim::Polygon>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.239" = type { ptr }

@_ZN3simL15STRING_TO_COLORB5cxx11E = external hidden global %"class.std::map.21", align 8
@_ZN3simL10DIRECTIONSE = external hidden global %"class.std::vector", align 8

; 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 uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3sim5ColorESt4lessIS5_ESaISt4pairIKS5_S7_EEE2atERSB_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

declare noundef ptr @_ZN3sim1PEv() local_unnamed_addr #2

declare void @_ZN3sim5Param13tileBaseColorB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(1056)) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3sim11TileGraphic10updateTextEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3sim11TileGraphic4drawEv(ptr noundef nonnull align 8 dereferenceable(104) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.sim::Polygon", align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.sim::Polygon", align 8
  %7 = alloca %"class.std::vector.221", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.239", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.239", align 8
  %10 = alloca %"class.sim::Polygon", align 8
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.sim::Polygon", align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #5
  %16 = load ptr, ptr %0, align 8, !tbaa !25
  call void @_ZNK3sim4Tile14getFullPolygonEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Polygon") align 8 %2, ptr noundef nonnull align 8 dereferenceable(232) %16)
  %17 = invoke noundef ptr @_ZN3sim1SEv()
          to label %18 unwind label %40

18:                                               ; preds = %1
  %19 = invoke noundef zeroext i1 @_ZN3sim5State17tileColorsVisibleEv(ptr noundef nonnull align 8 dereferenceable(168) %17)
          to label %20 unwind label %40

20:                                               ; preds = %18
  br i1 %19, label %21, label %23

21:                                               ; preds = %20
  %22 = getelementptr inbounds i8, ptr %0, i64 16
  br label %29

23:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  %24 = invoke noundef ptr @_ZN3sim1PEv()
          to label %25 unwind label %42

25:                                               ; preds = %23
  invoke void @_ZN3sim5Param13tileBaseColorB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %3, ptr noundef nonnull align 8 dereferenceable(1056) %24)
          to label %26 unwind label %42

26:                                               ; preds = %25
  %27 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3sim5ColorESt4lessIS5_ESaISt4pairIKS5_S7_EEE2atERSB_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN3simL15STRING_TO_COLORB5cxx11E, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %29 unwind label %.thread

.thread:                                          ; preds = %26
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %46

29:                                               ; preds = %26, %21
  %.in = phi ptr [ %22, %21 ], [ %27, %26 ]
  %30 = load i32, ptr %.in, align 4, !tbaa !26
  invoke void @_ZN3sim15BufferInterface26insertIntoGraphicCpuBufferERKNS_7PolygonENS_5ColorEd(ptr noundef nonnull align 8 dereferenceable(160) %15, ptr noundef nonnull align 8 dereferenceable(48) %2, i32 noundef %30, double noundef 1.000000e+00)
          to label %31 unwind label %44

31:                                               ; preds = %29
  br i1 %19, label %.critedge, label %32

32:                                               ; preds = %31
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  br label %.critedge

.critedge:                                        ; preds = %31, %32
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %33 = call ptr @_ZNKSt6vectorIN3sim9DirectionESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN3simL10DIRECTIONSE) #5
  store ptr %33, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %34 = call ptr @_ZNKSt6vectorIN3sim9DirectionESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN3simL10DIRECTIONSE) #5
  store ptr %34, ptr %5, align 8
  %35 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %35, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %57, %.critedge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %36 = load ptr, ptr %0, align 8, !tbaa !25
  call void @_ZNK3sim4Tile17getCornerPolygonsEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.221") align 8 %7, ptr noundef nonnull align 8 dereferenceable(232) %36)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %37 = call ptr @_ZNSt6vectorIN3sim7PolygonESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %37, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %38 = call ptr @_ZNSt6vectorIN3sim7PolygonESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %38, ptr %9, align 8
  %39 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN3sim7PolygonESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br i1 %39, label %.lr.ph44, label %._crit_edge45

40:                                               ; preds = %18, %1
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %49

42:                                               ; preds = %25, %23
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %48

44:                                               ; preds = %29
  %45 = landingpad { ptr, i32 }
          cleanup
  br i1 %19, label %49, label %46

46:                                               ; preds = %.thread, %44
  %47 = phi { ptr, i32 } [ %28, %.thread ], [ %45, %44 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  br label %48

48:                                               ; preds = %46, %42
  %.pn.ph = phi { ptr, i32 } [ %43, %42 ], [ %47, %46 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  br label %49

49:                                               ; preds = %44, %48, %40
  %.pn.pn = phi { ptr, i32 } [ %.pn.ph, %48 ], [ %41, %40 ], [ %45, %44 ]
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #5
  br label %118

.lr.ph:                                           ; preds = %.critedge, %57
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %51 = load i32, ptr %50, align 4, !tbaa !27
  %52 = call i64 @_ZNK3sim11TileGraphic23deduceWallColorAndAlphaENS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef %51)
  %.sroa.05.0.extract.trunc = trunc i64 %52 to i32
  %.sroa.5.0.extract.shift = lshr i64 %52, 32
  %.sroa.5.0.extract.trunc = trunc nuw i64 %.sroa.5.0.extract.shift to i32
  %53 = bitcast i32 %.sroa.5.0.extract.trunc to float
  %54 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #5
  %55 = load ptr, ptr %0, align 8, !tbaa !25
  call void @_ZNK3sim4Tile14getWallPolygonENS_9DirectionE(ptr dead_on_unwind nonnull writable sret(%"class.sim::Polygon") align 8 %6, ptr noundef nonnull align 8 dereferenceable(232) %55, i32 noundef %51)
  %56 = fpext float %53 to double
  invoke void @_ZN3sim15BufferInterface26insertIntoGraphicCpuBufferERKNS_7PolygonENS_5ColorEd(ptr noundef nonnull align 8 dereferenceable(160) %54, ptr noundef nonnull align 8 dereferenceable(48) %6, i32 noundef %.sroa.05.0.extract.trunc, double noundef %56)
          to label %57 unwind label %60

57:                                               ; preds = %.lr.ph
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #5
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %59 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %59, label %.lr.ph, label %._crit_edge

60:                                               ; preds = %.lr.ph
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %118

._crit_edge45:                                    ; preds = %74, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @_ZNSt6vectorIN3sim7PolygonESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  %62 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %12) #5
  %63 = load ptr, ptr %0, align 8, !tbaa !25
  call void @_ZNK3sim4Tile14getFullPolygonEv(ptr dead_on_unwind nonnull writable sret(%"class.sim::Polygon") align 8 %12, ptr noundef nonnull align 8 dereferenceable(232) %63)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #5
  %64 = invoke noundef ptr @_ZN3sim1PEv()
          to label %85 unwind label %113

.lr.ph44:                                         ; preds = %._crit_edge, %74
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %10) #5
  %65 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3sim7PolygonESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  invoke void @_ZN3sim7PolygonC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 8 dereferenceable(48) %65)
          to label %66 unwind label %77

66:                                               ; preds = %.lr.ph44
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #5
  %68 = invoke noundef ptr @_ZN3sim1PEv()
          to label %69 unwind label %79

69:                                               ; preds = %66
  invoke void @_ZN3sim5Param15tileCornerColorB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %11, ptr noundef nonnull align 8 dereferenceable(1056) %68)
          to label %70 unwind label %79

70:                                               ; preds = %69
  %71 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3sim5ColorESt4lessIS5_ESaISt4pairIKS5_S7_EEE2atERSB_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN3simL15STRING_TO_COLORB5cxx11E, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %72 unwind label %81

72:                                               ; preds = %70
  %73 = load i32, ptr %71, align 4, !tbaa !26
  invoke void @_ZN3sim15BufferInterface26insertIntoGraphicCpuBufferERKNS_7PolygonENS_5ColorEd(ptr noundef nonnull align 8 dereferenceable(160) %67, ptr noundef nonnull align 8 dereferenceable(48) %10, i32 noundef %73, double noundef 1.000000e+00)
          to label %74 unwind label %81

74:                                               ; preds = %72
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %10) #5
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN3sim7PolygonESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %76 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN3sim7PolygonESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br i1 %76, label %.lr.ph44, label %._crit_edge45

77:                                               ; preds = %.lr.ph44
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %84

79:                                               ; preds = %69, %66
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %83

81:                                               ; preds = %72, %70
  %82 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  br label %83

83:                                               ; preds = %81, %79
  %.pn32 = phi { ptr, i32 } [ %82, %81 ], [ %80, %79 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #5
  br label %84

84:                                               ; preds = %83, %77
  %.pn32.pn = phi { ptr, i32 } [ %.pn32, %83 ], [ %78, %77 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @_ZNSt6vectorIN3sim7PolygonESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %118

85:                                               ; preds = %._crit_edge45
  invoke void @_ZN3sim5Param12tileFogColorB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %13, ptr noundef nonnull align 8 dereferenceable(1056) %64)
          to label %86 unwind label %113

86:                                               ; preds = %85
  %87 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3sim5ColorESt4lessIS5_ESaISt4pairIKS5_S7_EEE2atERSB_(ptr noundef nonnull align 8 dereferenceable(48) @_ZN3simL15STRING_TO_COLORB5cxx11E, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %88 unwind label %115

88:                                               ; preds = %86
  %89 = load i32, ptr %87, align 4, !tbaa !26
  %90 = getelementptr inbounds i8, ptr %0, i64 72
  %91 = load i8, ptr %90, align 8, !tbaa !29, !range !30, !noundef !31
  %92 = trunc nuw i8 %91 to i1
  br i1 %92, label %93, label %102

93:                                               ; preds = %88
  %94 = invoke noundef ptr @_ZN3sim1SEv()
          to label %95 unwind label %115

95:                                               ; preds = %93
  %96 = invoke noundef zeroext i1 @_ZN3sim5State14tileFogVisibleEv(ptr noundef nonnull align 8 dereferenceable(168) %94)
          to label %97 unwind label %115

97:                                               ; preds = %95
  br i1 %96, label %98, label %102

98:                                               ; preds = %97
  %99 = invoke noundef ptr @_ZN3sim1PEv()
          to label %100 unwind label %115

100:                                              ; preds = %98
  %101 = invoke noundef double @_ZN3sim5Param12tileFogAlphaEv(ptr noundef nonnull align 8 dereferenceable(1056) %99)
          to label %102 unwind label %115

102:                                              ; preds = %88, %97, %100
  %103 = phi double [ %101, %100 ], [ 0.000000e+00, %97 ], [ 0.000000e+00, %88 ]
  invoke void @_ZN3sim15BufferInterface26insertIntoGraphicCpuBufferERKNS_7PolygonENS_5ColorEd(ptr noundef nonnull align 8 dereferenceable(160) %62, ptr noundef nonnull align 8 dereferenceable(48) %12, i32 noundef %89, double noundef %103)
          to label %104 unwind label %115

104:                                              ; preds = %102
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #5
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %12) #5
  %105 = load ptr, ptr %14, align 8, !tbaa !5
  %106 = call i64 @_ZN3sim15BufferInterface25getTileGraphicTextMaxSizeEv(ptr noundef nonnull align 8 dereferenceable(160) %105)
  %.sroa.0.0.extract.trunc = trunc i64 %106 to i32
  %.sroa.4.0.extract.shift = lshr i64 %106, 32
  %.sroa.4.0.extract.trunc = trunc nuw i64 %.sroa.4.0.extract.shift to i32
  %107 = icmp sgt i32 %.sroa.0.0.extract.trunc, 0
  %108 = icmp sgt i32 %.sroa.4.0.extract.trunc, 0
  %or.cond = select i1 %107, i1 %108, i1 false
  br i1 %or.cond, label %.preheader.us, label %._crit_edge50

.preheader.us:                                    ; preds = %104, %._crit_edge48.us
  %.01549.us = phi i32 [ %112, %._crit_edge48.us ], [ 0, %104 ]
  br label %109

109:                                              ; preds = %.preheader.us, %109
  %.046.us = phi i32 [ 0, %.preheader.us ], [ %111, %109 ]
  %110 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN3sim15BufferInterface26insertIntoTextureCpuBufferEv(ptr noundef nonnull align 8 dereferenceable(160) %110)
  %111 = add nuw nsw i32 %.046.us, 1
  %exitcond.not = icmp eq i32 %111, %.sroa.4.0.extract.trunc
  br i1 %exitcond.not, label %._crit_edge48.us, label %109, !llvm.loop !32

._crit_edge48.us:                                 ; preds = %109
  %112 = add nuw nsw i32 %.01549.us, 1
  %exitcond52.not = icmp eq i32 %112, %.sroa.0.0.extract.trunc
  br i1 %exitcond52.not, label %._crit_edge50, label %.preheader.us, !llvm.loop !34

._crit_edge50:                                    ; preds = %._crit_edge48.us, %104
  call void @_ZNK3sim11TileGraphic10updateTextEv(ptr noundef nonnull align 8 dereferenceable(104) %0)
  ret void

113:                                              ; preds = %85, %._crit_edge45
  %114 = landingpad { ptr, i32 }
          cleanup
  br label %117

115:                                              ; preds = %102, %100, %98, %95, %93, %86
  %116 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  br label %117

117:                                              ; preds = %115, %113
  %.pn30 = phi { ptr, i32 } [ %116, %115 ], [ %114, %113 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #5
  call void @_ZN3sim7PolygonD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %12) #5
  br label %118

118:                                              ; preds = %117, %84, %60, %49
  %.pn35 = phi { ptr, i32 } [ %61, %60 ], [ %.pn32.pn, %84 ], [ %.pn30, %117 ], [ %.pn.pn, %49 ]
  resume { ptr, i32 } %.pn35
}

declare void @_ZN3sim15BufferInterface26insertIntoGraphicCpuBufferERKNS_7PolygonENS_5ColorEd(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, double noundef) local_unnamed_addr #2

declare void @_ZNK3sim4Tile14getFullPolygonEv(ptr dead_on_unwind writable sret(%"class.sim::Polygon") align 8, ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #2

declare noundef ptr @_ZN3sim1SEv() local_unnamed_addr #2

declare noundef zeroext i1 @_ZN3sim5State17tileColorsVisibleEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNK3sim11TileGraphic23deduceWallColorAndAlphaENS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef) local_unnamed_addr #1 align 2

declare void @_ZNK3sim4Tile14getWallPolygonENS_9DirectionE(ptr dead_on_unwind writable sret(%"class.sim::Polygon") align 8, ptr noundef nonnull align 8 dereferenceable(232), i32 noundef) local_unnamed_addr #2

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

declare void @_ZNK3sim4Tile17getCornerPolygonsEv(ptr dead_on_unwind writable sret(%"class.std::vector.221") align 8, ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN3sim7PolygonESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

declare void @_ZN3sim7PolygonC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2

declare void @_ZN3sim5Param15tileCornerColorB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(1056)) local_unnamed_addr #2

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

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

declare void @_ZN3sim5Param12tileFogColorB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(1056)) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN3sim5State14tileFogVisibleEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #2

declare noundef double @_ZN3sim5Param12tileFogAlphaEv(ptr noundef nonnull align 8 dereferenceable(1056)) local_unnamed_addr #2

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

declare void @_ZN3sim15BufferInterface26insertIntoTextureCpuBufferEv(ptr noundef nonnull align 8 dereferenceable(160)) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #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 8}
!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 0}
!26 = !{!10, !10, i64 0}
!27 = !{!28, !28, i64 0}
!28 = !{!"_ZTSN3sim9DirectionE", !8, i64 0}
!29 = !{!6, !20, i64 72}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}


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