; LLVM IR from Yinxiaoli/iros2015_folding :: src/folding_planner_cmake/lib/blackbill/loader (rawlfsloader)

; 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._BlackBill::_Loader::CRawLFSLoader" = type <{ ptr, ptr, ptr, i32, i32, i8, i8, i8, i8, i32, %"struct._BlackBill::_Loader::SLFSToken", i8, i8, i8, i8, i32, %"class.std::vector", %"class.std::vector.3", %"struct._BlackBill::_Loader::SLFSProgramSpec", %"class.std::map", i8, [7 x i8] }>
%"struct._BlackBill::_Loader::SLFSToken" = type { i32, %"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] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<_BlackBill::_Loader::SLFSToken, std::allocator<_BlackBill::_Loader::SLFSToken>>::_Vector_impl" }
%"struct.std::_Vector_base<_BlackBill::_Loader::SLFSToken, std::allocator<_BlackBill::_Loader::SLFSToken>>::_Vector_impl" = type { %"struct.std::_Vector_base<_BlackBill::_Loader::SLFSToken, std::allocator<_BlackBill::_Loader::SLFSToken>>::_Vector_impl_data" }
%"struct.std::_Vector_base<_BlackBill::_Loader::SLFSToken, std::allocator<_BlackBill::_Loader::SLFSToken>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<_BlackBill::_Loader::SLFSStatement, std::allocator<_BlackBill::_Loader::SLFSStatement>>::_Vector_impl" }
%"struct.std::_Vector_base<_BlackBill::_Loader::SLFSStatement, std::allocator<_BlackBill::_Loader::SLFSStatement>>::_Vector_impl" = type { %"struct.std::_Vector_base<_BlackBill::_Loader::SLFSStatement, std::allocator<_BlackBill::_Loader::SLFSStatement>>::_Vector_impl_data" }
%"struct.std::_Vector_base<_BlackBill::_Loader::SLFSStatement, std::allocator<_BlackBill::_Loader::SLFSStatement>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct._BlackBill::_Loader::SLFSProgramSpec" = type { ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, _BlackBill::_Loader::SLFSDataField>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, _BlackBill::_Loader::SLFSDataField>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, _BlackBill::_Loader::SLFSDataField>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, _BlackBill::_Loader::SLFSDataField>>, std::less<std::__cxx11::basic_string<char>>>::_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 }

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_ZN10_BlackBill7_Loader13CRawLFSLoader11getNextCharEv(ptr noundef nonnull align 8 dereferenceable(201)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10_BlackBill7_Loader13CRawLFSLoader9skipSpaceEv(ptr noundef nonnull align 8 dereferenceable(201) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i8, align 1
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  br label %6

6:                                                ; preds = %41, %1
  %7 = getelementptr inbounds %"class._BlackBill::_Loader::CRawLFSLoader", ptr %5, i32 0, i32 7
  %8 = load i8, ptr %7, align 2, !tbaa !9, !range !35, !noundef !36
  %9 = trunc i8 %8 to i1
  %10 = xor i1 %9, true
  br i1 %10, label %11, label %42

11:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #3
  %12 = call noundef signext i8 @_ZN10_BlackBill7_Loader13CRawLFSLoader11getNextCharEv(ptr noundef nonnull align 8 dereferenceable(201) %5)
  store i8 %12, ptr %3, align 1, !tbaa !37
  %13 = load i8, ptr %3, align 1, !tbaa !37
  %14 = sext i8 %13 to i32
  %15 = icmp ne i32 %14, 32
  br i1 %15, label %16, label %30

16:                                               ; preds = %11
  %17 = load i8, ptr %3, align 1, !tbaa !37
  %18 = sext i8 %17 to i32
  %19 = icmp ne i32 %18, 9
  br i1 %19, label %20, label %30

20:                                               ; preds = %16
  %21 = load i8, ptr %3, align 1, !tbaa !37
  %22 = sext i8 %21 to i32
  %23 = icmp ne i32 %22, 13
  br i1 %23, label %24, label %30

24:                                               ; preds = %20
  %25 = load i8, ptr %3, align 1, !tbaa !37
  %26 = sext i8 %25 to i32
  %27 = icmp ne i32 %26, 10
  br i1 %27, label %28, label %30

28:                                               ; preds = %24
  %29 = load i8, ptr %3, align 1, !tbaa !37
  call void @_ZN10_BlackBill7_Loader13CRawLFSLoader13ungetNextCharEc(ptr noundef nonnull align 8 dereferenceable(201) %5, i8 noundef signext %29)
  store i32 3, ptr %4, align 4
  br label %39

30:                                               ; preds = %24, %20, %16, %11
  %31 = load i8, ptr %3, align 1, !tbaa !37
  %32 = sext i8 %31 to i32
  %33 = icmp eq i32 %32, 10
  br i1 %33, label %34, label %38

34:                                               ; preds = %30
  %35 = getelementptr inbounds %"class._BlackBill::_Loader::CRawLFSLoader", ptr %5, i32 0, i32 15
  %36 = load i32, ptr %35, align 4, !tbaa !38
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %35, align 4, !tbaa !38
  br label %38

38:                                               ; preds = %34, %30
  store i32 0, ptr %4, align 4
  br label %39

39:                                               ; preds = %38, %28
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #3
  %40 = load i32, ptr %4, align 4
  switch i32 %40, label %43 [
    i32 0, label %41
    i32 3, label %42
  ]

41:                                               ; preds = %39
  br label %6, !llvm.loop !39

42:                                               ; preds = %39, %6
  ret void

43:                                               ; preds = %39
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10_BlackBill7_Loader13CRawLFSLoader13ungetNextCharEc(ptr noundef nonnull align 8 dereferenceable(201), i8 noundef signext) #2 align 2

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

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 = { 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, !12, i64 34}
!10 = !{!"_ZTSN10_BlackBill7_Loader13CRawLFSLoaderE", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !11, i64 28, !7, i64 32, !12, i64 33, !12, i64 34, !11, i64 36, !13, i64 40, !12, i64 80, !12, i64 81, !12, i64 82, !11, i64 84, !18, i64 88, !22, i64 112, !26, i64 136, !27, i64 152, !12, i64 200}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTSN10_BlackBill7_Loader9SLFSTokenE", !14, i64 0, !15, i64 8}
!14 = !{!"_ZTSN10_BlackBill7_Loader10ETokenTypeE", !7, i64 0}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !17, i64 8, !7, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSSt6vectorIN10_BlackBill7_Loader9SLFSTokenESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIN10_BlackBill7_Loader9SLFSTokenESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN10_BlackBill7_Loader9SLFSTokenESaIS2_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN10_BlackBill7_Loader9SLFSTokenESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTSSt6vectorIN10_BlackBill7_Loader13SLFSStatementESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIN10_BlackBill7_Loader13SLFSStatementESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN10_BlackBill7_Loader13SLFSStatementESaIS2_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN10_BlackBill7_Loader13SLFSStatementESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!"_ZTSN10_BlackBill7_Loader15SLFSProgramSpecE", !6, i64 0, !6, i64 8}
!27 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10_BlackBill7_Loader13SLFSDataFieldESt4lessIS5_ESaISt4pairIKS5_S8_EEE", !28, i64 0}
!28 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N10_BlackBill7_Loader13SLFSDataFieldEESt10_Select1stISB_ESt4lessIS5_ESaISB_EE", !29, i64 0}
!29 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N10_BlackBill7_Loader13SLFSDataFieldEESt10_Select1stISB_ESt4lessIS5_ESaISB_EE13_Rb_tree_implISF_Lb1EEE", !30, i64 0, !32, i64 8}
!30 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !31, i64 0}
!31 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!32 = !{!"_ZTSSt15_Rb_tree_header", !33, i64 0, !17, i64 32}
!33 = !{!"_ZTSSt18_Rb_tree_node_base", !34, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!34 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!35 = !{i8 0, i8 2}
!36 = !{}
!37 = !{!7, !7, i64 0}
!38 = !{!10, !11, i64 84}
!39 = distinct !{!39, !40}
!40 = !{!"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"

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_ZN10_BlackBill7_Loader13CRawLFSLoader11getNextCharEv(ptr noundef nonnull align 8 dereferenceable(201)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10_BlackBill7_Loader13CRawLFSLoader9skipSpaceEv(ptr noundef nonnull align 8 dereferenceable(201) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 34
  %3 = load i8, ptr %2, align 2, !tbaa !5, !range !34, !noundef !35
  %4 = trunc nuw i8 %3 to i1
  br i1 %4, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 84
  br label %6

6:                                                ; preds = %.lr.ph, %11
  %7 = tail call noundef signext i8 @_ZN10_BlackBill7_Loader13CRawLFSLoader11getNextCharEv(ptr noundef nonnull align 8 dereferenceable(201) %0)
  switch i8 %7, label %.thread [
    i8 10, label %8
    i8 9, label %11
    i8 13, label %11
    i8 32, label %11
  ]

.thread:                                          ; preds = %6
  tail call void @_ZN10_BlackBill7_Loader13CRawLFSLoader13ungetNextCharEc(ptr noundef nonnull align 8 dereferenceable(201) %0, i8 noundef signext %7)
  br label %.loopexit

8:                                                ; preds = %6
  %9 = load i32, ptr %5, align 4, !tbaa !36
  %10 = add nsw i32 %9, 1
  store i32 %10, ptr %5, align 4, !tbaa !36
  br label %11

11:                                               ; preds = %8, %6, %6, %6
  %12 = load i8, ptr %2, align 2, !tbaa !5, !range !34, !noundef !35
  %13 = trunc nuw i8 %12 to i1
  br i1 %13, label %.loopexit, label %6

.loopexit:                                        ; preds = %11, %1, %.thread
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10_BlackBill7_Loader13CRawLFSLoader13ungetNextCharEc(ptr noundef nonnull align 8 dereferenceable(201), i8 noundef signext) local_unnamed_addr #1 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 = { 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" }

!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, !11, i64 34}
!6 = !{!"_ZTSN10_BlackBill7_Loader13CRawLFSLoaderE", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 28, !8, i64 32, !11, i64 33, !11, i64 34, !10, i64 36, !12, i64 40, !11, i64 80, !11, i64 81, !11, i64 82, !10, i64 84, !17, i64 88, !21, i64 112, !25, i64 136, !26, i64 152, !11, i64 200}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTSN10_BlackBill7_Loader9SLFSTokenE", !13, i64 0, !14, i64 8}
!13 = !{!"_ZTSN10_BlackBill7_Loader10ETokenTypeE", !8, i64 0}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !15, i64 0, !16, i64 8, !8, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = !{!"_ZTSSt6vectorIN10_BlackBill7_Loader9SLFSTokenESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIN10_BlackBill7_Loader9SLFSTokenESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN10_BlackBill7_Loader9SLFSTokenESaIS2_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN10_BlackBill7_Loader9SLFSTokenESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!21 = !{!"_ZTSSt6vectorIN10_BlackBill7_Loader13SLFSStatementESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIN10_BlackBill7_Loader13SLFSStatementESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN10_BlackBill7_Loader13SLFSStatementESaIS2_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN10_BlackBill7_Loader13SLFSStatementESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!25 = !{!"_ZTSN10_BlackBill7_Loader15SLFSProgramSpecE", !7, i64 0, !7, i64 8}
!26 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10_BlackBill7_Loader13SLFSDataFieldESt4lessIS5_ESaISt4pairIKS5_S8_EEE", !27, i64 0}
!27 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N10_BlackBill7_Loader13SLFSDataFieldEESt10_Select1stISB_ESt4lessIS5_ESaISB_EE", !28, i64 0}
!28 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N10_BlackBill7_Loader13SLFSDataFieldEESt10_Select1stISB_ESt4lessIS5_ESaISB_EE13_Rb_tree_implISF_Lb1EEE", !29, i64 0, !31, i64 8}
!29 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !30, i64 0}
!30 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!31 = !{!"_ZTSSt15_Rb_tree_header", !32, i64 0, !16, i64 32}
!32 = !{!"_ZTSSt18_Rb_tree_node_base", !33, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!33 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = !{!6, !10, i64 84}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass