; LLVM IR from bldeng/AASolver :: AndersonOpt/external/OpenMesh/Core/IO/reader (OMReader)

; 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.OpenMesh::IO::_OMReader_" = type { %"class.OpenMesh::IO::BaseReader", i64, %"class.OpenMesh::IO::Options", %"struct.OpenMesh::IO::OMFormat::Header", %"struct.OpenMesh::IO::OMFormat::Chunk::Header", %"class.OpenMesh::IO::OMFormat::Chunk::PropertyName" }
%"class.OpenMesh::IO::BaseReader" = type { ptr }
%"class.OpenMesh::IO::Options" = type { i32 }
%"struct.OpenMesh::IO::OMFormat::Header" = type { [2 x i8], i8, i8, i32, i32, i32 }
%"struct.OpenMesh::IO::OMFormat::Chunk::Header" = type { i32 }
%"class.OpenMesh::IO::OMFormat::Chunk::PropertyName" = type { %"class.std::__cxx11::basic_string" }
%"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.4 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [44 x i8], align 1
@__PRETTY_FUNCTION__._ZNK8OpenMesh2IO10_OMReader_22read_binary_mesh_chunkERSiRNS0_12BaseImporterERNS0_7OptionsEb = external hidden unnamed_addr constant [109 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: 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 noundef zeroext i1 @_ZNK8OpenMesh2IO10_OMReader_22read_binary_mesh_chunkERSiRNS0_12BaseImporterERNS0_7OptionsEb(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, i1 noundef zeroext %4) #1 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %13 = zext i1 %4 to i8
  store i8 %13, ptr %10, align 1, !tbaa !9
  %14 = load ptr, ptr %6, align 8
  %15 = getelementptr inbounds %"class.OpenMesh::IO::_OMReader_", ptr %14, i32 0, i32 4
  %16 = load i32, ptr %15, align 4
  %17 = lshr i32 %16, 2
  %18 = and i32 %17, 7
  %19 = icmp eq i32 %18, 1
  br i1 %19, label %20, label %21

20:                                               ; preds = %5
  br label %23

21:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.4, i32 noundef 514, ptr noundef @__PRETTY_FUNCTION__._ZNK8OpenMesh2IO10_OMReader_22read_binary_mesh_chunkERSiRNS0_12BaseImporterERNS0_7OptionsEb) #5
  unreachable

22:                                               ; No predecessors!
  br label %23

23:                                               ; preds = %22, %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %24 = getelementptr inbounds %"class.OpenMesh::IO::_OMReader_", ptr %14, i32 0, i32 1
  %25 = load i64, ptr %24, align 8, !tbaa !11
  store i64 %25, ptr %11, align 8, !tbaa !22
  %26 = getelementptr inbounds %"class.OpenMesh::IO::_OMReader_", ptr %14, i32 0, i32 4
  %27 = load i32, ptr %26, align 4
  %28 = lshr i32 %27, 5
  %29 = and i32 %28, 15
  switch i32 %29, label %45 [
    i32 6, label %30
  ]

30:                                               ; preds = %23
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = load ptr, ptr %32, align 8, !tbaa !23
  %34 = getelementptr inbounds ptr, ptr %33, i64 28
  %35 = load ptr, ptr %34, align 8
  %36 = call noundef ptr %35(ptr noundef nonnull align 8 dereferenceable(8) %32)
  %37 = getelementptr inbounds %"class.OpenMesh::IO::_OMReader_", ptr %14, i32 0, i32 5
  %38 = call noundef ptr @_ZN8OpenMesh10BaseKernel10_get_mpropERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(168) %36, ptr noundef nonnull align 8 dereferenceable(32) %37)
  %39 = load i8, ptr %10, align 1, !tbaa !9, !range !25, !noundef !26
  %40 = trunc i8 %39 to i1
  %41 = call noundef i64 @_ZNK8OpenMesh2IO10_OMReader_26restore_binary_custom_dataERSiPNS_12BasePropertyEmb(ptr noundef nonnull align 8 dereferenceable(72) %14, ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef %38, i64 noundef 1, i1 noundef zeroext %40)
  %42 = getelementptr inbounds %"class.OpenMesh::IO::_OMReader_", ptr %14, i32 0, i32 1
  %43 = load i64, ptr %42, align 8, !tbaa !11
  %44 = add i64 %43, %41
  store i64 %44, ptr %42, align 8, !tbaa !11
  br label %56

45:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %46 = getelementptr inbounds %"class.OpenMesh::IO::_OMReader_", ptr %14, i32 0, i32 3
  %47 = getelementptr inbounds %"class.OpenMesh::IO::_OMReader_", ptr %14, i32 0, i32 4
  %48 = call noundef i64 @_ZN8OpenMesh2IO8OMFormat15chunk_data_sizeERNS1_6HeaderERNS1_5Chunk6HeaderE(ptr noundef nonnull align 4 dereferenceable(16) %46, ptr noundef nonnull align 4 dereferenceable(4) %47)
  store i64 %48, ptr %12, align 8, !tbaa !22
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = load i64, ptr %12, align 8, !tbaa !22
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi6ignoreEl(ptr noundef nonnull align 8 dereferenceable(16) %49, i64 noundef %50)
  %52 = load i64, ptr %12, align 8, !tbaa !22
  %53 = getelementptr inbounds %"class.OpenMesh::IO::_OMReader_", ptr %14, i32 0, i32 1
  %54 = load i64, ptr %53, align 8, !tbaa !11
  %55 = add i64 %54, %52
  store i64 %55, ptr %53, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %56

56:                                               ; preds = %45, %30
  %57 = load i64, ptr %11, align 8, !tbaa !22
  %58 = getelementptr inbounds %"class.OpenMesh::IO::_OMReader_", ptr %14, i32 0, i32 1
  %59 = load i64, ptr %58, align 8, !tbaa !11
  %60 = icmp ult i64 %57, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  ret i1 %60
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK8OpenMesh2IO10_OMReader_26restore_binary_custom_dataERSiPNS_12BasePropertyEmb(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef, i1 noundef zeroext) #1 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi6ignoreEl(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN8OpenMesh2IO8OMFormat15chunk_data_sizeERNS1_6HeaderERNS1_5Chunk6HeaderE(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN8OpenMesh10BaseKernel10_get_mpropERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(32)) #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 = { noreturn nounwind "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 = { "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 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 = { noreturn nounwind }
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 = !{!"bool", !7, i64 0}
!11 = !{!12, !14, i64 8}
!12 = !{!"_ZTSN8OpenMesh2IO10_OMReader_E", !13, i64 0, !14, i64 8, !15, i64 16, !17, i64 20, !18, i64 36, !19, i64 40}
!13 = !{!"_ZTSN8OpenMesh2IO10BaseReaderE"}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSN8OpenMesh2IO7OptionsE", !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTSN8OpenMesh2IO8OMFormat6HeaderE", !7, i64 0, !7, i64 2, !7, i64 3, !16, i64 4, !16, i64 8, !16, i64 12}
!18 = !{!"_ZTSN8OpenMesh2IO8OMFormat5Chunk6HeaderE", !16, i64 0, !16, i64 0, !16, i64 0, !16, i64 0, !16, i64 1, !16, i64 1, !16, i64 1, !16, i64 1, !16, i64 2}
!19 = !{!"_ZTSN8OpenMesh2IO8OMFormat5Chunk12PropertyNameE", !20, i64 0}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !21, i64 0, !14, i64 8, !7, i64 16}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!22 = !{!14, !14, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !8, i64 0}
!25 = !{i8 0, i8 2}
!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"

@.str.4 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [44 x i8], align 1
@__PRETTY_FUNCTION__._ZNK8OpenMesh2IO10_OMReader_22read_binary_mesh_chunkERSiRNS0_12BaseImporterERNS0_7OptionsEb = external hidden unnamed_addr constant [109 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK8OpenMesh2IO10_OMReader_22read_binary_mesh_chunkERSiRNS0_12BaseImporterERNS0_7OptionsEb(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr nocapture noundef nonnull readnone align 4 dereferenceable(4) %3, i1 noundef zeroext %4) local_unnamed_addr #0 align 2 {
  %6 = getelementptr inbounds i8, ptr %0, i64 36
  %7 = load i32, ptr %6, align 4
  %8 = and i32 %7, 28
  %9 = icmp eq i32 %8, 4
  br i1 %9, label %11, label %10

10:                                               ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.4, i32 noundef 514, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK8OpenMesh2IO10_OMReader_22read_binary_mesh_chunkERSiRNS0_12BaseImporterERNS0_7OptionsEb) #4
  unreachable

11:                                               ; preds = %5
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load i64, ptr %12, align 8, !tbaa !5
  %14 = and i32 %7, 480
  %cond = icmp eq i32 %14, 192
  br i1 %cond, label %15, label %23

15:                                               ; preds = %11
  %16 = load ptr, ptr %2, align 8, !tbaa !19
  %17 = getelementptr inbounds i8, ptr %16, i64 224
  %18 = load ptr, ptr %17, align 8
  %19 = tail call noundef ptr %18(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %20 = getelementptr inbounds i8, ptr %0, i64 40
  %21 = tail call noundef ptr @_ZN8OpenMesh10BaseKernel10_get_mpropERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(168) %19, ptr noundef nonnull align 8 dereferenceable(32) %20)
  %22 = tail call noundef i64 @_ZNK8OpenMesh2IO10_OMReader_26restore_binary_custom_dataERSiPNS_12BasePropertyEmb(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %21, i64 noundef 1, i1 noundef zeroext %4)
  br label %27

23:                                               ; preds = %11
  %24 = getelementptr inbounds i8, ptr %0, i64 20
  %25 = tail call noundef i64 @_ZN8OpenMesh2IO8OMFormat15chunk_data_sizeERNS1_6HeaderERNS1_5Chunk6HeaderE(ptr noundef nonnull align 4 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %26 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi6ignoreEl(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %25)
  br label %27

27:                                               ; preds = %23, %15
  %.sink7 = phi i64 [ %25, %23 ], [ %22, %15 ]
  %28 = load i64, ptr %12, align 8, !tbaa !5
  %29 = add i64 %28, %.sink7
  store i64 %29, ptr %12, align 8, !tbaa !5
  %30 = icmp ult i64 %13, %29
  ret i1 %30
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK8OpenMesh2IO10_OMReader_26restore_binary_custom_dataERSiPNS_12BasePropertyEmb(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef, i1 noundef zeroext) local_unnamed_addr #0 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi6ignoreEl(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN8OpenMesh2IO8OMFormat15chunk_data_sizeERNS1_6HeaderERNS1_5Chunk6HeaderE(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN8OpenMesh10BaseKernel10_get_mpropERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { noreturn 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, !8, i64 8}
!6 = !{!"_ZTSN8OpenMesh2IO10_OMReader_E", !7, i64 0, !8, i64 8, !11, i64 16, !13, i64 20, !14, i64 36, !15, i64 40}
!7 = !{!"_ZTSN8OpenMesh2IO10BaseReaderE"}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN8OpenMesh2IO7OptionsE", !12, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!"_ZTSN8OpenMesh2IO8OMFormat6HeaderE", !9, i64 0, !9, i64 2, !9, i64 3, !12, i64 4, !12, i64 8, !12, i64 12}
!14 = !{!"_ZTSN8OpenMesh2IO8OMFormat5Chunk6HeaderE", !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 2}
!15 = !{!"_ZTSN8OpenMesh2IO8OMFormat5Chunk12PropertyNameE", !16, i64 0}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !17, i64 0, !8, i64 8, !9, i64 16}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !18, i64 0}
!18 = !{!"any pointer", !9, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"vtable pointer", !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass