; LLVM IR from steevo87/thermalvis :: src/core/ros_substitution.ll (ZN11sensor_msgs10CameraInfoC2Ev)

; 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::allocator" = type { i8 }
%"struct.sensor_msgs::CameraInfo" = type { %"struct.std_msgs::Header", [9 x double], [9 x double], [12 x double], %"class.std::vector", i32, i32, i32, i32, %"class.std::__cxx11::basic_string" }
%"struct.std_msgs::Header" = type { i64, %"class.std::__cxx11::basic_string", %"struct.ros::Time" }
%"struct.ros::Time" = type { i64, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11sensor_msgs10CameraInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(368) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  %8 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 0
  call void @_ZN8std_msgs6HeaderC1Ev(ptr noundef nonnull align 8 dereferenceable(56) %8)
  %9 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 4
  call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  %10 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 5
  store i32 384, ptr %10, align 8, !tbaa !9
  %11 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 6
  store i32 288, ptr %11, align 4, !tbaa !21
  %12 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 7
  store i32 0, ptr %12, align 8, !tbaa !22
  %13 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 8
  store i32 0, ptr %13, align 4, !tbaa !23
  %14 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 9
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %15 unwind label %38

15:                                               ; preds = %1
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #4
  %16 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 1
  %17 = getelementptr inbounds [9 x double], ptr %16, i64 0, i64 0
  store double 5.000000e+02, ptr %17, align 8, !tbaa !24
  %18 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 1
  %19 = getelementptr inbounds [9 x double], ptr %18, i64 0, i64 1
  store double 0.000000e+00, ptr %19, align 8, !tbaa !24
  %20 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 1
  %21 = getelementptr inbounds [9 x double], ptr %20, i64 0, i64 2
  store double 1.915000e+02, ptr %21, align 8, !tbaa !24
  %22 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 1
  %23 = getelementptr inbounds [9 x double], ptr %22, i64 0, i64 3
  store double 0.000000e+00, ptr %23, align 8, !tbaa !24
  %24 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 1
  %25 = getelementptr inbounds [9 x double], ptr %24, i64 0, i64 4
  store double 5.000000e+02, ptr %25, align 8, !tbaa !24
  %26 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 1
  %27 = getelementptr inbounds [9 x double], ptr %26, i64 0, i64 5
  store double 1.435000e+02, ptr %27, align 8, !tbaa !24
  %28 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 1
  %29 = getelementptr inbounds [9 x double], ptr %28, i64 0, i64 6
  store double 0.000000e+00, ptr %29, align 8, !tbaa !24
  %30 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 1
  %31 = getelementptr inbounds [9 x double], ptr %30, i64 0, i64 7
  store double 0.000000e+00, ptr %31, align 8, !tbaa !24
  %32 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 1
  %33 = getelementptr inbounds [9 x double], ptr %32, i64 0, i64 8
  store double 1.000000e+00, ptr %33, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !26
  br label %34

34:                                               ; preds = %55, %15
  %35 = load i32, ptr %6, align 4, !tbaa !26
  %36 = icmp slt i32 %35, 12
  br i1 %36, label %42, label %37

37:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %58

38:                                               ; preds = %1
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %4, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %5, align 4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  call void @_ZN8std_msgs6HeaderD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #4
  br label %59

42:                                               ; preds = %34
  %43 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 3
  %44 = load i32, ptr %6, align 4, !tbaa !26
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [12 x double], ptr %43, i64 0, i64 %45
  store double 0.000000e+00, ptr %46, align 8, !tbaa !24
  %47 = load i32, ptr %6, align 4, !tbaa !26
  %48 = icmp slt i32 %47, 9
  br i1 %48, label %49, label %54

49:                                               ; preds = %42
  %50 = getelementptr inbounds %"struct.sensor_msgs::CameraInfo", ptr %7, i32 0, i32 2
  %51 = load i32, ptr %6, align 4, !tbaa !26
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [9 x double], ptr %50, i64 0, i64 %52
  store double 0.000000e+00, ptr %53, align 8, !tbaa !24
  br label %54

54:                                               ; preds = %49, %42
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %6, align 4, !tbaa !26
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %6, align 4, !tbaa !26
  br label %34, !llvm.loop !27

58:                                               ; preds = %37
  ret void

59:                                               ; preds = %38
  %60 = load ptr, ptr %4, align 8
  %61 = load i32, ptr %5, align 4
  %62 = insertvalue { ptr, i32 } poison, ptr %60, 0
  %63 = insertvalue { ptr, i32 } %62, i32 %61, 1
  resume { ptr, i32 } %63
}

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

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

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

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

declare void @_ZN8std_msgs6HeaderC1Ev(ptr)

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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !20, i64 320}
!10 = !{!"_ZTSN11sensor_msgs10CameraInfoE", !11, i64 0, !7, i64 56, !7, i64 128, !7, i64 200, !16, i64 296, !20, i64 320, !20, i64 324, !20, i64 328, !20, i64 332, !13, i64 336}
!11 = !{!"_ZTSN8std_msgs6HeaderE", !12, i64 0, !13, i64 8, !15, i64 40}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !12, i64 8, !7, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!15 = !{!"_ZTSN3ros4TimeE", !12, i64 0, !12, i64 8}
!16 = !{!"_ZTSSt6vectorIdSaIdEE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"int", !7, i64 0}
!21 = !{!10, !20, i64 324}
!22 = !{!10, !20, i64 328}
!23 = !{!10, !20, i64 332}
!24 = !{!25, !25, i64 0}
!25 = !{!"double", !7, i64 0}
!26 = !{!20, !20, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"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::allocator" = type { i8 }

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11sensor_msgs10CameraInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(368) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::allocator", align 1
  tail call void @_ZN8std_msgs6HeaderC1Ev(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %3 = getelementptr inbounds i8, ptr %0, i64 296
  tail call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %4 = getelementptr inbounds i8, ptr %0, i64 320
  store <4 x i32> <i32 384, i32 288, i32 0, i32 0>, ptr %4, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 336
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %8 unwind label %6

6:                                                ; preds = %1
  %7 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @_ZN8std_msgs6HeaderD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #5
  resume { ptr, i32 } %7

8:                                                ; preds = %1
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  %9 = getelementptr inbounds i8, ptr %0, i64 56
  store <2 x double> <double 5.000000e+02, double 0.000000e+00>, ptr %9, align 8, !tbaa !9
  %10 = getelementptr inbounds i8, ptr %0, i64 72
  store <2 x double> <double 1.915000e+02, double 0.000000e+00>, ptr %10, align 8, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %0, i64 88
  store <2 x double> <double 5.000000e+02, double 1.435000e+02>, ptr %11, align 8, !tbaa !9
  %12 = getelementptr inbounds i8, ptr %0, i64 104
  %13 = getelementptr inbounds i8, ptr %0, i64 120
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %12, i8 0, i64 16, i1 false)
  store double 1.000000e+00, ptr %13, align 8, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %0, i64 128
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(168) %14, i8 0, i64 168, i1 false)
  ret void
}

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

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

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

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

declare void @_ZN8std_msgs6HeaderC1Ev(ptr) local_unnamed_addr

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

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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,MemCpyOptPass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass