; LLVM IR from Optiroc/SuperFamiconv :: src/Tiles.ll (ZNK3sfc4Tile4cropEjjjj)

; 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" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.sfc::Tile" = type { i32, i32, i32, i32, %"class.std::vector", %"class.std::vector.0", %"class.std::vector.5" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<unsigned char>, std::allocator<std::vector<unsigned char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<unsigned char>, std::allocator<std::vector<unsigned char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<unsigned char>, std::allocator<std::vector<unsigned char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<unsigned char>, std::allocator<std::vector<unsigned char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

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

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

; 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 void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i1 noundef zeroext, i1 noundef zeroext) #3

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3sfc4Tile4cropEjjjj(ptr dead_on_unwind noalias writable sret(%"struct.sfc::Tile") align 8 %0, ptr noundef nonnull align 8 dereferenceable(88) %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i1, align 1
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::vector", align 8
  %20 = alloca %"class.std::vector", align 8
  %21 = alloca %"class.std::vector", align 8
  store ptr %0, ptr %7, align 8
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  %22 = load ptr, ptr %8, align 8
  store i1 false, ptr %13, align 1
  call void @_ZN3sfc4TileC2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %23 = getelementptr inbounds %"struct.sfc::Tile", ptr %22, i32 0, i32 0
  %24 = load i32, ptr %23, align 8, !tbaa !11
  %25 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 0
  store i32 %24, ptr %25, align 8, !tbaa !11
  %26 = getelementptr inbounds %"struct.sfc::Tile", ptr %22, i32 0, i32 1
  %27 = load i32, ptr %26, align 4, !tbaa !26
  %28 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 1
  store i32 %27, ptr %28, align 4, !tbaa !26
  %29 = load i32, ptr %11, align 4, !tbaa !9
  %30 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 2
  store i32 %29, ptr %30, align 8, !tbaa !27
  %31 = load i32, ptr %12, align 4, !tbaa !9
  %32 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 3
  store i32 %31, ptr %32, align 4, !tbaa !28
  %33 = getelementptr inbounds %"struct.sfc::Tile", ptr %22, i32 0, i32 6
  %34 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 6
  %35 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIjSaIjEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(24) %33)
          to label %36 unwind label %88

36:                                               ; preds = %6
  %37 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 4
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = load i32, ptr %12, align 4, !tbaa !9
  %40 = mul i32 %38, %39
  %41 = zext i32 %40 to i64
  invoke void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %37, i64 noundef %41)
          to label %42 unwind label %88

42:                                               ; preds = %36
  %43 = load i32, ptr %9, align 4, !tbaa !9
  %44 = getelementptr inbounds %"struct.sfc::Tile", ptr %22, i32 0, i32 2
  %45 = load i32, ptr %44, align 8, !tbaa !27
  %46 = icmp ugt i32 %43, %45
  br i1 %46, label %117, label %47

47:                                               ; preds = %42
  %48 = load i32, ptr %10, align 4, !tbaa !9
  %49 = getelementptr inbounds %"struct.sfc::Tile", ptr %22, i32 0, i32 3
  %50 = load i32, ptr %49, align 4, !tbaa !28
  %51 = icmp ugt i32 %48, %50
  br i1 %51, label %117, label %52

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %53 = load i32, ptr %9, align 4, !tbaa !9
  %54 = load i32, ptr %11, align 4, !tbaa !9
  %55 = add i32 %53, %54
  %56 = getelementptr inbounds %"struct.sfc::Tile", ptr %22, i32 0, i32 2
  %57 = load i32, ptr %56, align 8, !tbaa !27
  %58 = icmp ugt i32 %55, %57
  br i1 %58, label %59, label %64

59:                                               ; preds = %52
  %60 = getelementptr inbounds %"struct.sfc::Tile", ptr %22, i32 0, i32 2
  %61 = load i32, ptr %60, align 8, !tbaa !27
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = sub i32 %61, %62
  br label %66

64:                                               ; preds = %52
  %65 = load i32, ptr %11, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %64, %59
  %67 = phi i32 [ %63, %59 ], [ %65, %64 ]
  store i32 %67, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = load i32, ptr %12, align 4, !tbaa !9
  %70 = add i32 %68, %69
  %71 = getelementptr inbounds %"struct.sfc::Tile", ptr %22, i32 0, i32 3
  %72 = load i32, ptr %71, align 4, !tbaa !28
  %73 = icmp ugt i32 %70, %72
  br i1 %73, label %74, label %79

74:                                               ; preds = %66
  %75 = getelementptr inbounds %"struct.sfc::Tile", ptr %22, i32 0, i32 3
  %76 = load i32, ptr %75, align 4, !tbaa !28
  %77 = load i32, ptr %10, align 4, !tbaa !9
  %78 = sub i32 %76, %77
  br label %81

79:                                               ; preds = %66
  %80 = load i32, ptr %12, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %79, %74
  %82 = phi i32 [ %78, %74 ], [ %80, %79 ]
  store i32 %82, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %83

83:                                               ; preds = %113, %81
  %84 = load i32, ptr %18, align 4, !tbaa !9
  %85 = load i32, ptr %17, align 4, !tbaa !9
  %86 = icmp ult i32 %84, %85
  br i1 %86, label %92, label %87

87:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %116

88:                                               ; preds = %36, %6
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %14, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %15, align 4
  br label %171

92:                                               ; preds = %83
  %93 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 4
  %94 = load i32, ptr %18, align 4, !tbaa !9
  %95 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 2
  %96 = load i32, ptr %95, align 8, !tbaa !27
  %97 = mul i32 %94, %96
  %98 = zext i32 %97 to i64
  %99 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %93, i64 noundef %98) #6
  %100 = getelementptr inbounds %"struct.sfc::Tile", ptr %22, i32 0, i32 4
  %101 = load i32, ptr %9, align 4, !tbaa !9
  %102 = load i32, ptr %18, align 4, !tbaa !9
  %103 = load i32, ptr %10, align 4, !tbaa !9
  %104 = add i32 %102, %103
  %105 = getelementptr inbounds %"struct.sfc::Tile", ptr %22, i32 0, i32 2
  %106 = load i32, ptr %105, align 8, !tbaa !27
  %107 = mul i32 %104, %106
  %108 = add i32 %101, %107
  %109 = zext i32 %108 to i64
  %110 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %100, i64 noundef %109) #6
  %111 = load i32, ptr %16, align 4, !tbaa !9
  %112 = zext i32 %111 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %99, ptr align 1 %110, i64 %112, i1 false)
  br label %113

113:                                              ; preds = %92
  %114 = load i32, ptr %18, align 4, !tbaa !9
  %115 = add i32 %114, 1
  store i32 %115, ptr %18, align 4, !tbaa !9
  br label %83, !llvm.loop !29

116:                                              ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %117

117:                                              ; preds = %116, %47, %42
  %118 = getelementptr inbounds %"struct.sfc::Tile", ptr %22, i32 0, i32 5
  %119 = call noundef i64 @_ZNKSt6vectorIS_IhSaIhEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %118) #6
  %120 = icmp ne i64 %119, 0
  br i1 %120, label %121, label %167

121:                                              ; preds = %117
  %122 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #6
  %123 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 4
  %124 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 2
  %125 = load i32, ptr %124, align 8, !tbaa !27
  invoke void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %19, ptr noundef nonnull align 8 dereferenceable(24) %123, i32 noundef %125, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %126 unwind label %140

126:                                              ; preds = %121
  invoke void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %122, ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %127 unwind label %144

127:                                              ; preds = %126
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  %128 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #6
  %129 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 4
  %130 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 2
  %131 = load i32, ptr %130, align 8, !tbaa !27
  invoke void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %20, ptr noundef nonnull align 8 dereferenceable(24) %129, i32 noundef %131, i1 noundef zeroext false, i1 noundef zeroext true)
          to label %132 unwind label %149

132:                                              ; preds = %127
  invoke void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %128, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %133 unwind label %153

133:                                              ; preds = %132
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  %134 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #6
  %135 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 4
  %136 = getelementptr inbounds %"struct.sfc::Tile", ptr %0, i32 0, i32 2
  %137 = load i32, ptr %136, align 8, !tbaa !27
  invoke void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %21, ptr noundef nonnull align 8 dereferenceable(24) %135, i32 noundef %137, i1 noundef zeroext true, i1 noundef zeroext true)
          to label %138 unwind label %158

138:                                              ; preds = %133
  invoke void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %134, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %139 unwind label %162

139:                                              ; preds = %138
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #6
  br label %167

140:                                              ; preds = %121
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %14, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %15, align 4
  br label %148

144:                                              ; preds = %126
  %145 = landingpad { ptr, i32 }
          cleanup
  %146 = extractvalue { ptr, i32 } %145, 0
  store ptr %146, ptr %14, align 8
  %147 = extractvalue { ptr, i32 } %145, 1
  store i32 %147, ptr %15, align 4
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #6
  br label %148

148:                                              ; preds = %144, %140
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  br label %171

149:                                              ; preds = %127
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %14, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %15, align 4
  br label %157

153:                                              ; preds = %132
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %14, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %15, align 4
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  br label %157

157:                                              ; preds = %153, %149
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  br label %171

158:                                              ; preds = %133
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %14, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %15, align 4
  br label %166

162:                                              ; preds = %138
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %14, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %15, align 4
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #6
  br label %166

166:                                              ; preds = %162, %158
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #6
  br label %171

167:                                              ; preds = %139, %117
  store i1 true, ptr %13, align 1
  %168 = load i1, ptr %13, align 1
  br i1 %168, label %170, label %169

169:                                              ; preds = %167
  call void @_ZN3sfc4TileD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0) #6
  br label %170

170:                                              ; preds = %169, %167
  ret void

171:                                              ; preds = %166, %157, %148, %88
  call void @_ZN3sfc4TileD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0) #6
  br label %172

172:                                              ; preds = %171
  %173 = load ptr, ptr %14, align 8
  %174 = load i32, ptr %15, align 4
  %175 = insertvalue { ptr, i32 } poison, ptr %173, 0
  %176 = insertvalue { ptr, i32 } %175, i32 %174, 1
  resume { ptr, i32 } %176
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3sfc4TileD2Ev(ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #5 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN3sfc4TileE", !13, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !14, i64 16, !18, i64 40, !22, i64 64}
!13 = !{!"_ZTSN3sfc4ModeE", !7, i64 0}
!14 = !{!"_ZTSSt6vectorIhSaIhEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"_ZTSSt6vectorIS_IhSaIhEESaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseISt6vectorIhSaIhEESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseISt6vectorIhSaIhEESaIS2_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseISt6vectorIhSaIhEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTSSt6vectorIjSaIjEE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!12, !10, i64 4}
!27 = !{!12, !10, i64 8}
!28 = !{!12, !10, i64 12}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


; 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" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.sfc::Tile" = type { i32, i32, i32, i32, %"class.std::vector", %"class.std::vector.0", %"class.std::vector.5" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<unsigned char>, std::allocator<std::vector<unsigned char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<unsigned char>, std::allocator<std::vector<unsigned char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<unsigned char>, std::allocator<std::vector<unsigned char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<unsigned char>, std::allocator<std::vector<unsigned char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

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

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

; 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 void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #3

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3sfc4Tile4cropEjjjj(ptr dead_on_unwind noalias nonnull writable sret(%"struct.sfc::Tile") align 8 %0, ptr noundef nonnull align 8 dereferenceable(88) %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.std::vector", align 8
  tail call void @_ZN3sfc4TileC2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %10 = load <2 x i32>, ptr %1, align 8, !tbaa !5
  store <2 x i32> %10, ptr %0, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %4, ptr %11, align 8, !tbaa !8
  %12 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %5, ptr %12, align 4, !tbaa !25
  %13 = getelementptr inbounds i8, ptr %1, i64 64
  %14 = getelementptr inbounds i8, ptr %0, i64 64
  %15 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIjSaIjEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %16 unwind label %39

16:                                               ; preds = %6
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  %18 = mul i32 %5, %4
  %19 = zext i32 %18 to i64
  invoke void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %19)
          to label %20 unwind label %39

20:                                               ; preds = %16
  %21 = getelementptr inbounds i8, ptr %1, i64 8
  %22 = load i32, ptr %21, align 8, !tbaa !8
  %23 = icmp ult i32 %22, %2
  br i1 %23, label %.loopexit, label %24

24:                                               ; preds = %20
  %25 = getelementptr inbounds i8, ptr %1, i64 12
  %26 = load i32, ptr %25, align 4, !tbaa !25
  %27 = icmp ult i32 %26, %3
  br i1 %27, label %.loopexit, label %28

28:                                               ; preds = %24
  %29 = add i32 %5, %3
  %30 = icmp ugt i32 %29, %26
  %31 = sub i32 %26, %3
  %32 = select i1 %30, i32 %31, i32 %5
  %.not41 = icmp eq i32 %32, 0
  br i1 %.not41, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %28
  %33 = add i32 %4, %2
  %34 = icmp ugt i32 %33, %22
  %35 = sub i32 %22, %2
  %36 = select i1 %34, i32 %35, i32 %4
  %37 = getelementptr inbounds i8, ptr %1, i64 16
  %38 = zext i32 %36 to i64
  br label %41

39:                                               ; preds = %16, %6
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %83

41:                                               ; preds = %.lr.ph, %41
  %.040 = phi i32 [ 0, %.lr.ph ], [ %52, %41 ]
  %42 = load i32, ptr %11, align 8, !tbaa !8
  %43 = mul i32 %42, %.040
  %44 = zext i32 %43 to i64
  %45 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %44) #6
  %46 = add i32 %.040, %3
  %47 = load i32, ptr %21, align 8, !tbaa !8
  %48 = mul i32 %47, %46
  %49 = add i32 %48, %2
  %50 = zext i32 %49 to i64
  %51 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %37, i64 noundef %50) #6
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %45, ptr nonnull align 1 %51, i64 %38, i1 false)
  %52 = add nuw i32 %.040, 1
  %53 = icmp ult i32 %52, %32
  br i1 %53, label %41, label %.loopexit, !llvm.loop !26

.loopexit:                                        ; preds = %41, %28, %24, %20
  %54 = getelementptr inbounds i8, ptr %1, i64 40
  %55 = tail call noundef i64 @_ZNKSt6vectorIS_IhSaIhEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #6
  %.not = icmp eq i64 %55, 0
  br i1 %.not, label %82, label %56

56:                                               ; preds = %.loopexit
  %57 = getelementptr inbounds i8, ptr %0, i64 40
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  %58 = load i32, ptr %11, align 8, !tbaa !8
  invoke void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %7, ptr noundef nonnull align 8 dereferenceable(24) %17, i32 noundef %58, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %59 unwind label %67

59:                                               ; preds = %56
  invoke void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %60 unwind label %69

60:                                               ; preds = %59
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  %61 = load i32, ptr %11, align 8, !tbaa !8
  invoke void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %17, i32 noundef %61, i1 noundef zeroext false, i1 noundef zeroext true)
          to label %62 unwind label %72

62:                                               ; preds = %60
  invoke void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %63 unwind label %74

63:                                               ; preds = %62
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  %64 = load i32, ptr %11, align 8, !tbaa !8
  invoke void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %17, i32 noundef %64, i1 noundef zeroext true, i1 noundef zeroext true)
          to label %65 unwind label %77

65:                                               ; preds = %63
  invoke void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %66 unwind label %79

66:                                               ; preds = %65
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  br label %82

67:                                               ; preds = %56
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %71

69:                                               ; preds = %59
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  br label %71

71:                                               ; preds = %69, %67
  %.pn = phi { ptr, i32 } [ %70, %69 ], [ %68, %67 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  br label %83

72:                                               ; preds = %60
  %73 = landingpad { ptr, i32 }
          cleanup
  br label %76

74:                                               ; preds = %62
  %75 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  br label %76

76:                                               ; preds = %74, %72
  %.pn35 = phi { ptr, i32 } [ %75, %74 ], [ %73, %72 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  br label %83

77:                                               ; preds = %63
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %81

79:                                               ; preds = %65
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  br label %81

81:                                               ; preds = %79, %77
  %.pn37 = phi { ptr, i32 } [ %80, %79 ], [ %78, %77 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  br label %83

82:                                               ; preds = %.loopexit, %66
  ret void

83:                                               ; preds = %81, %76, %71, %39
  %.pn37.pn = phi { ptr, i32 } [ %.pn37, %81 ], [ %.pn35, %76 ], [ %.pn, %71 ], [ %40, %39 ]
  call void @_ZN3sfc4TileD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0) #6
  resume { ptr, i32 } %.pn37.pn
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3sfc4TileD2Ev(ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #5 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !11, i64 8}
!9 = !{!"_ZTSN3sfc4TileE", !10, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !12, i64 16, !17, i64 40, !21, i64 64}
!10 = !{!"_ZTSN3sfc4ModeE", !6, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = !{!"_ZTSSt6vectorIhSaIhEE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!16 = !{!"any pointer", !6, i64 0}
!17 = !{!"_ZTSSt6vectorIS_IhSaIhEESaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseISt6vectorIhSaIhEESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseISt6vectorIhSaIhEESaIS2_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseISt6vectorIhSaIhEESaIS2_EE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!21 = !{!"_ZTSSt6vectorIjSaIjEE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!25 = !{!9, !11, i64 12}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass