; LLVM IR from giacomo-ascari/dichotomic-compression :: src/dc/dc-decompressor/dc-decompressor.ll (ZN15dc_decompressor7_renderEb)

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

%struct._dc_corners = type { i64, i64, i64, i64 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%class.dc = type { i8, i64, i64, i64, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i64, %class.dc_pixel_matrix, %"class.std::map", %"class.std::vector" }
%"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.dc_pixel_matrix = type { ptr, i64, i64 }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, _dc_heavy_sector>, std::_Select1st<std::pair<const unsigned long, _dc_heavy_sector>>, std::less<unsigned long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, _dc_heavy_sector>, std::_Select1st<std::pair<const unsigned long, _dc_heavy_sector>>, std::less<unsigned long>>::_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<_dc_light_sector, std::allocator<_dc_light_sector>>::_Vector_impl" }
%"struct.std::_Vector_base<_dc_light_sector, std::allocator<_dc_light_sector>>::_Vector_impl" = type { %"struct.std::_Vector_base<_dc_light_sector, std::allocator<_dc_light_sector>>::_Vector_impl_data" }
%"struct.std::_Vector_base<_dc_light_sector, std::allocator<_dc_light_sector>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct._dc_light_sector = type { %class.dc_pixel, i8, i8 }
%class.dc_pixel = type { i8, i8, i8 }

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

; 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
define dso_local void @_ZN15dc_decompressor7_renderEb(ptr noundef nonnull align 8 dereferenceable(200) %0, i1 noundef zeroext %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %struct._dc_corners, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %21 = zext i1 %1 to i8
  store i8 %21, ptr %4, align 1, !tbaa !9
  %22 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %23 = getelementptr inbounds %class.dc, ptr %22, i32 0, i32 7
  %24 = call noundef i64 @_ZN15dc_pixel_matrix9get_widthEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  store i64 %24, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %25 = getelementptr inbounds %class.dc, ptr %22, i32 0, i32 7
  %26 = call noundef i64 @_ZN15dc_pixel_matrix10get_heightEv(ptr noundef nonnull align 8 dereferenceable(24) %25)
  store i64 %26, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %27 = load i64, ptr %5, align 8, !tbaa !11
  %28 = load i64, ptr %6, align 8, !tbaa !11
  %29 = mul i64 %27, %28
  %30 = call noalias noundef nonnull ptr @_Znam(i64 noundef %29) #7
  store ptr %30, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %31 = getelementptr inbounds %class.dc, ptr %22, i32 0, i32 9
  %32 = call ptr @_ZNSt6vectorI16_dc_light_sectorSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #6
  %33 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %32, ptr %33, align 8
  br label %34

34:                                               ; preds = %165, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %35 = getelementptr inbounds %class.dc, ptr %22, i32 0, i32 9
  %36 = call ptr @_ZNSt6vectorI16_dc_light_sectorSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #6
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %36, ptr %37, align 8
  %38 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br i1 %38, label %40, label %39

39:                                               ; preds = %34
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %168

40:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !11
  br label %41

41:                                               ; preds = %52, %40
  %42 = load i64, ptr %16, align 8, !tbaa !11
  %43 = load i64, ptr %5, align 8, !tbaa !11
  %44 = load i64, ptr %6, align 8, !tbaa !11
  %45 = mul i64 %43, %44
  %46 = icmp ult i64 %42, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %41
  store i32 4, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %55

48:                                               ; preds = %41
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = load i64, ptr %16, align 8, !tbaa !11
  %51 = getelementptr inbounds i8, ptr %49, i64 %50
  store i8 0, ptr %51, align 1, !tbaa !15
  br label %52

52:                                               ; preds = %48
  %53 = load i64, ptr %16, align 8, !tbaa !11
  %54 = add i64 %53, 1
  store i64 %54, ptr %16, align 8, !tbaa !11
  br label %41, !llvm.loop !16

55:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i64 0, ptr %17, align 8, !tbaa !11
  br label %56

56:                                               ; preds = %162, %55
  %57 = load i64, ptr %17, align 8, !tbaa !11
  %58 = load i64, ptr %6, align 8, !tbaa !11
  %59 = icmp ult i64 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 7, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %165

61:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 0, ptr %18, align 8, !tbaa !11
  br label %62

62:                                               ; preds = %158, %61
  %63 = load i64, ptr %18, align 8, !tbaa !11
  %64 = load i64, ptr %5, align 8, !tbaa !11
  %65 = icmp ult i64 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  store i32 10, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %161

67:                                               ; preds = %62
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = load i64, ptr %18, align 8, !tbaa !11
  %70 = load i64, ptr %17, align 8, !tbaa !11
  %71 = load i64, ptr %5, align 8, !tbaa !11
  %72 = call noundef i64 @_Z2ixmmm(i64 noundef %69, i64 noundef %70, i64 noundef %71)
  %73 = getelementptr inbounds i8, ptr %68, i64 %72
  %74 = load i8, ptr %73, align 1, !tbaa !15
  %75 = zext i8 %74 to i32
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %157

77:                                               ; preds = %67
  %78 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 0
  store i64 0, ptr %78, align 8, !tbaa !18
  %79 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 1
  store i64 0, ptr %79, align 8, !tbaa !20
  %80 = load i64, ptr %5, align 8, !tbaa !11
  %81 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 2
  store i64 %80, ptr %81, align 8, !tbaa !21
  %82 = load i64, ptr %6, align 8, !tbaa !11
  %83 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 3
  store i64 %82, ptr %83, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 0, ptr %19, align 8, !tbaa !11
  br label %84

84:                                               ; preds = %139, %77
  %85 = load i64, ptr %19, align 8, !tbaa !11
  %86 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  %87 = getelementptr inbounds %struct._dc_light_sector, ptr %86, i32 0, i32 2
  %88 = load i8, ptr %87, align 1, !tbaa !23
  %89 = zext i8 %88 to i64
  %90 = icmp ult i64 %85, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %84
  store i32 13, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %142

92:                                               ; preds = %84
  %93 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 2
  %94 = load i64, ptr %93, align 8, !tbaa !21
  %95 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 0
  %96 = load i64, ptr %95, align 8, !tbaa !18
  %97 = sub i64 %94, %96
  store i64 %97, ptr %9, align 8, !tbaa !11
  %98 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 3
  %99 = load i64, ptr %98, align 8, !tbaa !22
  %100 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 1
  %101 = load i64, ptr %100, align 8, !tbaa !20
  %102 = sub i64 %99, %101
  store i64 %102, ptr %10, align 8, !tbaa !11
  %103 = load i64, ptr %9, align 8, !tbaa !11
  %104 = load i64, ptr %10, align 8, !tbaa !11
  %105 = icmp ugt i64 %103, %104
  br i1 %105, label %106, label %122

106:                                              ; preds = %92
  %107 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 0
  %108 = load i64, ptr %107, align 8, !tbaa !18
  %109 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 2
  %110 = load i64, ptr %109, align 8, !tbaa !21
  %111 = call noundef i64 @_Z6middlemm(i64 noundef %108, i64 noundef %110)
  store i64 %111, ptr %11, align 8, !tbaa !11
  %112 = load i64, ptr %11, align 8, !tbaa !11
  %113 = load i64, ptr %18, align 8, !tbaa !11
  %114 = icmp ugt i64 %112, %113
  br i1 %114, label %115, label %118

115:                                              ; preds = %106
  %116 = load i64, ptr %11, align 8, !tbaa !11
  %117 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 2
  store i64 %116, ptr %117, align 8, !tbaa !21
  br label %121

118:                                              ; preds = %106
  %119 = load i64, ptr %11, align 8, !tbaa !11
  %120 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 0
  store i64 %119, ptr %120, align 8, !tbaa !18
  br label %121

121:                                              ; preds = %118, %115
  br label %138

122:                                              ; preds = %92
  %123 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 1
  %124 = load i64, ptr %123, align 8, !tbaa !20
  %125 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 3
  %126 = load i64, ptr %125, align 8, !tbaa !22
  %127 = call noundef i64 @_Z6middlemm(i64 noundef %124, i64 noundef %126)
  store i64 %127, ptr %11, align 8, !tbaa !11
  %128 = load i64, ptr %11, align 8, !tbaa !11
  %129 = load i64, ptr %17, align 8, !tbaa !11
  %130 = icmp ugt i64 %128, %129
  br i1 %130, label %131, label %134

131:                                              ; preds = %122
  %132 = load i64, ptr %11, align 8, !tbaa !11
  %133 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 3
  store i64 %132, ptr %133, align 8, !tbaa !22
  br label %137

134:                                              ; preds = %122
  %135 = load i64, ptr %11, align 8, !tbaa !11
  %136 = getelementptr inbounds %struct._dc_corners, ptr %8, i32 0, i32 1
  store i64 %135, ptr %136, align 8, !tbaa !20
  br label %137

137:                                              ; preds = %134, %131
  br label %138

138:                                              ; preds = %137, %121
  br label %139

139:                                              ; preds = %138
  %140 = load i64, ptr %19, align 8, !tbaa !11
  %141 = add i64 %140, 1
  store i64 %141, ptr %19, align 8, !tbaa !11
  br label %84, !llvm.loop !26

142:                                              ; preds = %91
  %143 = load i8, ptr %4, align 1, !tbaa !9, !range !27, !noundef !28
  %144 = trunc i8 %143 to i1
  br i1 %144, label %145, label %150

145:                                              ; preds = %142
  %146 = getelementptr inbounds %class.dc, ptr %22, i32 0, i32 7
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = call noundef nonnull align 1 dereferenceable(5) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  %149 = load i32, ptr %12, align 4, !tbaa !13
  call void @_ZN15dc_pixel_matrix13draw_n_occupyER11_dc_cornersPhR16_dc_light_sector11dc_channels(ptr noundef nonnull align 8 dereferenceable(24) %146, ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef %147, ptr noundef nonnull align 1 dereferenceable(5) %148, i32 noundef %149)
  br label %154

150:                                              ; preds = %142
  %151 = getelementptr inbounds %class.dc, ptr %22, i32 0, i32 7
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  %153 = call noundef nonnull align 1 dereferenceable(5) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  call void @_ZN15dc_pixel_matrix13draw_n_occupyER11_dc_cornersPhR16_dc_light_sector11dc_channels(ptr noundef nonnull align 8 dereferenceable(24) %151, ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef %152, ptr noundef nonnull align 1 dereferenceable(5) %153, i32 noundef 3)
  br label %154

154:                                              ; preds = %150, %145
  %155 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %13, i32 noundef 0) #6
  %156 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %155, ptr %156, align 8
  br label %157

157:                                              ; preds = %154, %67
  br label %158

158:                                              ; preds = %157
  %159 = load i64, ptr %18, align 8, !tbaa !11
  %160 = add i64 %159, 1
  store i64 %160, ptr %18, align 8, !tbaa !11
  br label %62, !llvm.loop !29

161:                                              ; preds = %66
  br label %162

162:                                              ; preds = %161
  %163 = load i64, ptr %17, align 8, !tbaa !11
  %164 = add i64 %163, 1
  store i64 %164, ptr %17, align 8, !tbaa !11
  br label %56, !llvm.loop !30

165:                                              ; preds = %60
  %166 = load i32, ptr %12, align 4, !tbaa !13
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %12, align 4, !tbaa !13
  br label %34, !llvm.loop !31

168:                                              ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void
}

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

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

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

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

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

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

declare noundef i64 @_Z2ixmmm(i64 noundef, i64 noundef, i64 noundef) #5

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

declare noundef i64 @_Z6middlemm(i64 noundef, i64 noundef) #5

declare void @_ZN15dc_pixel_matrix13draw_n_occupyER11_dc_cornersPhR16_dc_light_sector11dc_channels(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(5), i32 noundef) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2 align 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 = { 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 #3 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { "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 }
attributes #7 = { builtin allocsize(0) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTS11dc_channels", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !12, i64 0}
!19 = !{!"_ZTS11_dc_corners", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!20 = !{!19, !12, i64 8}
!21 = !{!19, !12, i64 16}
!22 = !{!19, !12, i64 24}
!23 = !{!24, !7, i64 4}
!24 = !{!"_ZTS16_dc_light_sector", !25, i64 0, !7, i64 3, !7, i64 4}
!25 = !{!"_ZTS8dc_pixel", !7, i64 0, !7, i64 1, !7, i64 2}
!26 = distinct !{!26, !17}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = distinct !{!29, !17}
!30 = distinct !{!30, !17}
!31 = distinct !{!31, !17}


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

%struct._dc_corners = type { i64, i64, i64, i64 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN15dc_decompressor7_renderEb(ptr noundef nonnull align 8 dereferenceable(200) %0, i1 noundef zeroext %1) local_unnamed_addr #1 align 2 {
  %3 = alloca %struct._dc_corners, align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 104
  %7 = tail call noundef i64 @_ZN15dc_pixel_matrix9get_widthEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  %8 = tail call noundef i64 @_ZN15dc_pixel_matrix10get_heightEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  %9 = mul i64 %8, %7
  %10 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %9) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %11 = getelementptr inbounds i8, ptr %0, i64 176
  %12 = tail call ptr @_ZNSt6vectorI16_dc_light_sectorSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #8
  store ptr %12, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %13 = tail call ptr @_ZNSt6vectorI16_dc_light_sectorSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #8
  store ptr %13, ptr %5, align 8
  %14 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br i1 %14, label %.preheader47.lr.ph, label %._crit_edge

.preheader47.lr.ph:                               ; preds = %2
  %.not = icmp eq i64 %9, 0
  %.not75 = icmp eq i64 %8, 0
  %15 = getelementptr inbounds i8, ptr %3, i64 8
  %16 = getelementptr inbounds i8, ptr %3, i64 16
  %17 = getelementptr inbounds i8, ptr %3, i64 24
  br i1 %.not75, label %.preheader47, label %.preheader47.lr.ph.split.us

.preheader47.lr.ph.split.us:                      ; preds = %.preheader47.lr.ph
  %.not76 = icmp eq i64 %7, 0
  br i1 %.not76, label %.preheader47.us, label %.preheader47.us.us

.preheader47.us.us:                               ; preds = %.preheader47.lr.ph.split.us, %._crit_edge56.split.us.us.us
  %.04057.us.us = phi i32 [ %56, %._crit_edge56.split.us.us.us ], [ 0, %.preheader47.lr.ph.split.us ]
  br i1 %.not, label %.preheader.us.us.us.preheader, label %.lr.ph.us.us.preheader

.lr.ph.us.us.preheader:                           ; preds = %.preheader47.us.us
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %10, i8 0, i64 %9, i1 false), !tbaa !5
  br label %.preheader.us.us.us.preheader

.preheader.us.us.us.preheader:                    ; preds = %.lr.ph.us.us.preheader, %.preheader47.us.us
  %.04057.us.us. = select i1 %1, i32 %.04057.us.us, i32 3
  br label %.preheader.us.us.us

.preheader.us.us.us:                              ; preds = %.preheader.us.us.us.preheader, %._crit_edge54.us.us.us
  %.03855.us.us.us = phi i64 [ %55, %._crit_edge54.us.us.us ], [ 0, %.preheader.us.us.us.preheader ]
  br label %18

18:                                               ; preds = %29, %.preheader.us.us.us
  %.03751.us.us.us = phi i64 [ 0, %.preheader.us.us.us ], [ %30, %29 ]
  %19 = call noundef i64 @_Z2ixmmm(i64 noundef %.03751.us.us.us, i64 noundef %.03855.us.us.us, i64 noundef %7)
  %20 = getelementptr inbounds i8, ptr %10, i64 %19
  %21 = load i8, ptr %20, align 1, !tbaa !5
  %22 = icmp eq i8 %21, 0
  br i1 %22, label %23, label %29

23:                                               ; preds = %18
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %3, i8 0, i64 16, i1 false)
  store i64 %7, ptr %16, align 8, !tbaa !8
  store i64 %8, ptr %17, align 8, !tbaa !11
  %24 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  %25 = getelementptr inbounds i8, ptr %24, i64 4
  %26 = load i8, ptr %25, align 1, !tbaa !12
  %.not77 = icmp eq i8 %26, 0
  br i1 %.not77, label %._crit_edge.us.us.us, label %.lr.ph50.us.us.us

._crit_edge.us.us.us:                             ; preds = %48, %23
  %27 = call noundef nonnull align 1 dereferenceable(5) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  call void @_ZN15dc_pixel_matrix13draw_n_occupyER11_dc_cornersPhR16_dc_light_sector11dc_channels(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull %10, ptr noundef nonnull align 1 dereferenceable(5) %27, i32 noundef %.04057.us.us.)
  %28 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef 0) #8
  br label %29

29:                                               ; preds = %._crit_edge.us.us.us, %18
  %30 = add nuw i64 %.03751.us.us.us, 1
  %exitcond.not = icmp eq i64 %30, %7
  br i1 %exitcond.not, label %._crit_edge54.us.us.us, label %18, !llvm.loop !15

.lr.ph50.us.us.us:                                ; preds = %23, %48
  %.049.us.us.us = phi i64 [ %49, %48 ], [ 0, %23 ]
  %31 = load i64, ptr %16, align 8, !tbaa !8
  %32 = load i64, ptr %3, align 8, !tbaa !17
  %33 = sub i64 %31, %32
  %34 = load i64, ptr %17, align 8, !tbaa !11
  %35 = load i64, ptr %15, align 8, !tbaa !18
  %36 = sub i64 %34, %35
  %37 = icmp ugt i64 %33, %36
  br i1 %37, label %43, label %38

38:                                               ; preds = %.lr.ph50.us.us.us
  %39 = call noundef i64 @_Z6middlemm(i64 noundef %35, i64 noundef %34)
  %40 = icmp ugt i64 %39, %.03855.us.us.us
  br i1 %40, label %42, label %41

41:                                               ; preds = %38
  store i64 %39, ptr %15, align 8, !tbaa !18
  br label %48

42:                                               ; preds = %38
  store i64 %39, ptr %17, align 8, !tbaa !11
  br label %48

43:                                               ; preds = %.lr.ph50.us.us.us
  %44 = call noundef i64 @_Z6middlemm(i64 noundef %32, i64 noundef %31)
  %45 = icmp ugt i64 %44, %.03751.us.us.us
  br i1 %45, label %47, label %46

46:                                               ; preds = %43
  store i64 %44, ptr %3, align 8, !tbaa !17
  br label %48

47:                                               ; preds = %43
  store i64 %44, ptr %16, align 8, !tbaa !8
  br label %48

48:                                               ; preds = %47, %46, %42, %41
  %49 = add nuw nsw i64 %.049.us.us.us, 1
  %50 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  %51 = getelementptr inbounds i8, ptr %50, i64 4
  %52 = load i8, ptr %51, align 1, !tbaa !12
  %53 = zext i8 %52 to i64
  %54 = icmp ult i64 %49, %53
  br i1 %54, label %.lr.ph50.us.us.us, label %._crit_edge.us.us.us, !llvm.loop !19

._crit_edge54.us.us.us:                           ; preds = %29
  %55 = add nuw i64 %.03855.us.us.us, 1
  %exitcond82.not = icmp eq i64 %55, %8
  br i1 %exitcond82.not, label %._crit_edge56.split.us.us.us, label %.preheader.us.us.us, !llvm.loop !20

._crit_edge56.split.us.us.us:                     ; preds = %._crit_edge54.us.us.us
  %56 = add nuw nsw i32 %.04057.us.us, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %57 = call ptr @_ZNSt6vectorI16_dc_light_sectorSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #8
  store ptr %57, ptr %5, align 8
  %58 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br i1 %58, label %.preheader47.us.us, label %._crit_edge, !llvm.loop !21

.preheader47.us:                                  ; preds = %.preheader47.lr.ph.split.us, %.preheader47.us
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %59 = call ptr @_ZNSt6vectorI16_dc_light_sectorSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #8
  store ptr %59, ptr %5, align 8
  %60 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br i1 %60, label %.preheader47.us, label %._crit_edge, !llvm.loop !21

.preheader47:                                     ; preds = %.preheader47.lr.ph, %.preheader47
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %61 = call ptr @_ZNSt6vectorI16_dc_light_sectorSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #8
  store ptr %61, ptr %5, align 8
  %62 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br i1 %62, label %.preheader47, label %._crit_edge, !llvm.loop !21

._crit_edge:                                      ; preds = %._crit_edge56.split.us.us.us, %.preheader47.us, %.preheader47, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #8
  ret void
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIP16_dc_light_sectorSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(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 ptr @_ZNSt6vectorI16_dc_light_sectorSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

declare noundef i64 @_Z2ixmmm(i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #5

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

declare noundef i64 @_Z6middlemm(i64 noundef, i64 noundef) local_unnamed_addr #5

declare void @_ZN15dc_pixel_matrix13draw_n_occupyER11_dc_cornersPhR16_dc_light_sector11dc_channels(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(5), i32 noundef) local_unnamed_addr #5

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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 = { 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 #3 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { 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, !10, i64 16}
!9 = !{!"_ZTS11_dc_corners", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!10 = !{!"long", !6, i64 0}
!11 = !{!9, !10, i64 24}
!12 = !{!13, !6, i64 4}
!13 = !{!"_ZTS16_dc_light_sector", !14, i64 0, !6, i64 3, !6, i64 4}
!14 = !{!"_ZTS8dc_pixel", !6, i64 0, !6, i64 1, !6, i64 2}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!9, !10, i64 0}
!18 = !{!9, !10, i64 8}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass