; LLVM IR from drohmer/cgp :: library/cgp/07_image (image)

; 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.cgp::numarray_stack.9" = type { float, float, float }
%"struct.cgp::image_structure" = type { i32, i32, i32, %"struct.cgp::numarray" }
%"struct.cgp::numarray" = type { %"class.std::vector" }
%"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.cgp::grid_2D" = type { %"struct.cgp::numarray_stack", %"struct.cgp::numarray.3" }
%"struct.cgp::numarray_stack" = type { i32, i32 }
%"struct.cgp::numarray.3" = type { %"class.std::vector.4" }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<cgp::numarray_stack<float, 3>, std::allocator<cgp::numarray_stack<float, 3>>>::_Vector_impl" }
%"struct.std::_Vector_base<cgp::numarray_stack<float, 3>, std::allocator<cgp::numarray_stack<float, 3>>>::_Vector_impl" = type { %"struct.std::_Vector_base<cgp::numarray_stack<float, 3>, std::allocator<cgp::numarray_stack<float, 3>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cgp::numarray_stack<float, 3>, std::allocator<cgp::numarray_stack<float, 3>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3cgp7convertERKNS_15image_structureERNS_7grid_2DINS_14numarray_stackIfLi3EEEEE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"struct.cgp::numarray_stack.9", align 4
  %8 = alloca %"struct.cgp::numarray_stack.9", align 4
  %9 = alloca { <2 x float>, float }, align 8
  %10 = alloca i64, align 8
  %11 = alloca %"struct.cgp::numarray_stack.9", align 4
  %12 = alloca %"struct.cgp::numarray_stack.9", align 4
  %13 = alloca { <2 x float>, float }, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %"struct.cgp::image_structure", ptr %14, i32 0, i32 0
  %16 = load i32, ptr %15, align 8, !tbaa !9
  %17 = sext i32 %16 to i64
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %"struct.cgp::image_structure", ptr %18, i32 0, i32 1
  %20 = load i32, ptr %19, align 4, !tbaa !18
  %21 = sext i32 %20 to i64
  %22 = mul i64 %17, %21
  store i64 %22, ptr %5, align 8, !tbaa !19
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.cgp::image_structure", ptr %24, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !9
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.cgp::image_structure", ptr %27, i32 0, i32 1
  %29 = load i32, ptr %28, align 4, !tbaa !18
  call void @_ZN3cgp7grid_2DINS_14numarray_stackIfLi3EEEE6resizeEii(ptr noundef nonnull align 8 dereferenceable(32) %23, i32 noundef %26, i32 noundef %29)
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.cgp::image_structure", ptr %30, i32 0, i32 2
  %32 = load i32, ptr %31, align 8, !tbaa !21
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %72

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

35:                                               ; preds = %68, %34
  %36 = load i64, ptr %6, align 8, !tbaa !19
  %37 = load i64, ptr %5, align 8, !tbaa !19
  %38 = icmp ult i64 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %71

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #6
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.cgp::image_structure", ptr %41, i32 0, i32 3
  %43 = load i64, ptr %6, align 8, !tbaa !19
  %44 = mul i64 3, %43
  %45 = add i64 %44, 0
  %46 = trunc i64 %45 to i32
  %47 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24) %42, i32 noundef %46)
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.cgp::image_structure", ptr %48, i32 0, i32 3
  %50 = load i64, ptr %6, align 8, !tbaa !19
  %51 = mul i64 3, %50
  %52 = add i64 %51, 1
  %53 = trunc i64 %52 to i32
  %54 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24) %49, i32 noundef %53)
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.cgp::image_structure", ptr %55, i32 0, i32 3
  %57 = load i64, ptr %6, align 8, !tbaa !19
  %58 = mul i64 3, %57
  %59 = add i64 %58, 2
  %60 = trunc i64 %59 to i32
  %61 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24) %56, i32 noundef %60)
  call void @_ZN3cgp14numarray_stackIfLi3EEC2IhhhEERKT_RKT0_RKT1_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 1 dereferenceable(1) %47, ptr noundef nonnull align 1 dereferenceable(1) %54, ptr noundef nonnull align 1 dereferenceable(1) %61)
  %62 = call { <2 x float>, float } @_ZN3cgpdvERKNS_14numarray_stackIfLi3EEEf(ptr noundef nonnull align 4 dereferenceable(12) %8, float noundef 2.550000e+02)
  store { <2 x float>, float } %62, ptr %9, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 8 %9, i64 12, i1 false)
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.cgp::grid_2D", ptr %63, i32 0, i32 1
  %65 = load i64, ptr %6, align 8, !tbaa !19
  %66 = trunc i64 %65 to i32
  %67 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3cgp8numarrayINS_14numarray_stackIfLi3EEEEixEi(ptr noundef nonnull align 8 dereferenceable(24) %64, i32 noundef %66)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %67, ptr align 4 %7, i64 12, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #6
  br label %68

68:                                               ; preds = %40
  %69 = load i64, ptr %6, align 8, !tbaa !19
  %70 = add i64 %69, 1
  store i64 %70, ptr %6, align 8, !tbaa !19
  br label %35, !llvm.loop !25

71:                                               ; preds = %39
  br label %116

72:                                               ; preds = %2
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.cgp::image_structure", ptr %73, i32 0, i32 2
  %75 = load i32, ptr %74, align 8, !tbaa !21
  %76 = icmp eq i32 %75, 1
  br i1 %76, label %77, label %115

77:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !19
  br label %78

78:                                               ; preds = %111, %77
  %79 = load i64, ptr %10, align 8, !tbaa !19
  %80 = load i64, ptr %5, align 8, !tbaa !19
  %81 = icmp ult i64 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %114

83:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #6
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.cgp::image_structure", ptr %84, i32 0, i32 3
  %86 = load i64, ptr %10, align 8, !tbaa !19
  %87 = mul i64 4, %86
  %88 = add i64 %87, 0
  %89 = trunc i64 %88 to i32
  %90 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24) %85, i32 noundef %89)
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %"struct.cgp::image_structure", ptr %91, i32 0, i32 3
  %93 = load i64, ptr %10, align 8, !tbaa !19
  %94 = mul i64 4, %93
  %95 = add i64 %94, 1
  %96 = trunc i64 %95 to i32
  %97 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24) %92, i32 noundef %96)
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %"struct.cgp::image_structure", ptr %98, i32 0, i32 3
  %100 = load i64, ptr %10, align 8, !tbaa !19
  %101 = mul i64 4, %100
  %102 = add i64 %101, 2
  %103 = trunc i64 %102 to i32
  %104 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24) %99, i32 noundef %103)
  call void @_ZN3cgp14numarray_stackIfLi3EEC2IhhhEERKT_RKT0_RKT1_(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 1 dereferenceable(1) %90, ptr noundef nonnull align 1 dereferenceable(1) %97, ptr noundef nonnull align 1 dereferenceable(1) %104)
  %105 = call { <2 x float>, float } @_ZN3cgpdvERKNS_14numarray_stackIfLi3EEEf(ptr noundef nonnull align 4 dereferenceable(12) %12, float noundef 2.550000e+02)
  store { <2 x float>, float } %105, ptr %13, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 8 %13, i64 12, i1 false)
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %"struct.cgp::grid_2D", ptr %106, i32 0, i32 1
  %108 = load i64, ptr %10, align 8, !tbaa !19
  %109 = trunc i64 %108 to i32
  %110 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3cgp8numarrayINS_14numarray_stackIfLi3EEEEixEi(ptr noundef nonnull align 8 dereferenceable(24) %107, i32 noundef %109)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %110, ptr align 4 %11, i64 12, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #6
  br label %111

111:                                              ; preds = %83
  %112 = load i64, ptr %10, align 8, !tbaa !19
  %113 = add i64 %112, 1
  store i64 %113, ptr %10, align 8, !tbaa !19
  br label %78, !llvm.loop !27

114:                                              ; preds = %82
  br label %115

115:                                              ; preds = %114, %72
  br label %116

116:                                              ; preds = %115, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN3cgpdvERKNS_14numarray_stackIfLi3EEEf(ptr noundef nonnull align 4 dereferenceable(12), float noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3cgp14numarray_stackIfLi3EEC2IhhhEERKT_RKT0_RKT1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 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) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN3cgp8numarrayINS_14numarray_stackIfLi3EEEEixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #1 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 uwtable "min-legal-vector-width"="64" "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 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !11, i64 0}
!10 = !{!"_ZTSN3cgp15image_structureE", !11, i64 0, !11, i64 4, !12, i64 8, !13, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN3cgp16image_color_typeE", !7, i64 0}
!13 = !{!"_ZTSN3cgp8numarrayIhEE", !14, 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 = !{!10, !11, i64 4}
!19 = !{!20, !20, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!10, !12, i64 8}
!22 = !{i64 0, i64 4, !23, i64 4, i64 4, !23, i64 8, i64 4, !23}
!23 = !{!24, !24, i64 0}
!24 = !{!"float", !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


; 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.cgp::numarray_stack.9" = type { float, float, float }

; 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
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3cgp7convertERKNS_15image_structureERNS_7grid_2DINS_14numarray_stackIfLi3EEEEE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #2 {
  %3 = alloca %"struct.cgp::numarray_stack.9", align 4
  %4 = alloca %"struct.cgp::numarray_stack.9", align 4
  %5 = load i32, ptr %0, align 8, !tbaa !5
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !17
  %9 = sext i32 %8 to i64
  %10 = mul nsw i64 %9, %6
  tail call void @_ZN3cgp7grid_2DINS_14numarray_stackIfLi3EEEE6resizeEii(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %5, i32 noundef %8)
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load i32, ptr %11, align 8, !tbaa !18
  switch i32 %12, label %.loopexit [
    i32 0, label %.preheader
    i32 1, label %.preheader37
  ]

.preheader37:                                     ; preds = %2
  %.not = icmp eq i64 %10, 0
  br i1 %.not, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader37
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  br label %28

.preheader:                                       ; preds = %2
  %.not42 = icmp eq i64 %10, 0
  br i1 %.not42, label %.loopexit, label %.lr.ph41

.lr.ph41:                                         ; preds = %.preheader
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = getelementptr inbounds i8, ptr %1, i64 8
  br label %17

17:                                               ; preds = %.lr.ph41, %17
  %.040 = phi i64 [ 0, %.lr.ph41 ], [ %27, %17 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #5
  %18 = trunc i64 %.040 to i32
  %19 = mul i32 %18, 3
  %20 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %19)
  %21 = add i32 %19, 1
  %22 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %21)
  %23 = add i32 %19, 2
  %24 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %23)
  call void @_ZN3cgp14numarray_stackIfLi3EEC2IhhhEERKT_RKT0_RKT1_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 1 dereferenceable(1) %20, ptr noundef nonnull align 1 dereferenceable(1) %22, ptr noundef nonnull align 1 dereferenceable(1) %24)
  %25 = call { <2 x float>, float } @_ZN3cgpdvERKNS_14numarray_stackIfLi3EEEf(ptr noundef nonnull align 4 dereferenceable(12) %3, float noundef 2.550000e+02)
  %.fca.0.extract7 = extractvalue { <2 x float>, float } %25, 0
  %.fca.1.extract8 = extractvalue { <2 x float>, float } %25, 1
  %26 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3cgp8numarrayINS_14numarray_stackIfLi3EEEEixEi(ptr noundef nonnull align 8 dereferenceable(24) %16, i32 noundef %18)
  store <2 x float> %.fca.0.extract7, ptr %26, align 4
  %.sroa.412.0..sroa_idx = getelementptr inbounds i8, ptr %26, i64 8
  store float %.fca.1.extract8, ptr %.sroa.412.0..sroa_idx, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #5
  %27 = add nuw i64 %.040, 1
  %exitcond44.not = icmp eq i64 %27, %10
  br i1 %exitcond44.not, label %.loopexit, label %17, !llvm.loop !21

28:                                               ; preds = %.lr.ph, %28
  %.03539 = phi i64 [ 0, %.lr.ph ], [ %37, %28 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #5
  %.035.tr = trunc i64 %.03539 to i32
  %29 = shl i32 %.035.tr, 2
  %30 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %29)
  %31 = or disjoint i32 %29, 1
  %32 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %31)
  %33 = or disjoint i32 %29, 2
  %34 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK3cgp8numarrayIhEixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %33)
  call void @_ZN3cgp14numarray_stackIfLi3EEC2IhhhEERKT_RKT0_RKT1_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 1 dereferenceable(1) %30, ptr noundef nonnull align 1 dereferenceable(1) %32, ptr noundef nonnull align 1 dereferenceable(1) %34)
  %35 = call { <2 x float>, float } @_ZN3cgpdvERKNS_14numarray_stackIfLi3EEEf(ptr noundef nonnull align 4 dereferenceable(12) %4, float noundef 2.550000e+02)
  %.fca.0.extract = extractvalue { <2 x float>, float } %35, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %35, 1
  %36 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3cgp8numarrayINS_14numarray_stackIfLi3EEEEixEi(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef %.035.tr)
  store <2 x float> %.fca.0.extract, ptr %36, align 4
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %36, i64 8
  store float %.fca.1.extract, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #5
  %37 = add nuw i64 %.03539, 1
  %exitcond.not = icmp eq i64 %37, %10
  br i1 %exitcond.not, label %.loopexit, label %28, !llvm.loop !23

.loopexit:                                        ; preds = %28, %17, %.preheader37, %.preheader, %2
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN3cgpdvERKNS_14numarray_stackIfLi3EEEf(ptr noundef nonnull align 4 dereferenceable(12), float noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN3cgp8numarrayINS_14numarray_stackIfLi3EEEEixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #1 align 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 = { mustprogress uwtable "min-legal-vector-width"="64" "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN3cgp15image_structureE", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN3cgp16image_color_typeE", !8, i64 0}
!11 = !{!"_ZTSN3cgp8numarrayIhEE", !12, 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", !8, i64 0}
!17 = !{!6, !7, i64 4}
!18 = !{!6, !10, i64 8}
!19 = !{!20, !20, i64 0}
!20 = !{!"float", !8, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


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