; LLVM IR from jzimmerman/langcc :: gen/meta (gen)

; 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.langcc::rc_ptr.21" = type { ptr, ptr }
%"struct.lang::meta::Node::LexerDecl::Mode::ws_sig_::spec::_T" = type { %"struct.lang::meta::Node::_T", %"struct.langcc::Option::_T.305", %"struct.langcc::rc_ptr.450" }
%"struct.lang::meta::Node::_T" = type { ptr, %"struct.langcc::hash_obj", %"struct.langcc::enable_rc_from_this_poly", i32, i64, %"struct.langcc::TokenBounds", i8, i64, %"struct.langcc::ParserAttrMask", %"struct.langcc::ParserLookahead" }
%"struct.langcc::hash_obj" = type { %"struct.langcc::Option::_T" }
%"struct.langcc::Option::_T" = type { i32, [32 x i8] }
%"struct.langcc::enable_rc_from_this_poly" = type { ptr, ptr }
%"struct.langcc::TokenBounds" = type { i32, i32 }
%"struct.langcc::ParserAttrMask" = type { [16 x i8] }
%"struct.langcc::ParserLookahead" = type { [8 x i16] }
%"struct.langcc::Option::_T.305" = type { i32, [32 x i8] }
%"struct.langcc::rc_ptr.450" = type { ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; 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: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6langcc6rc_ptrIN4lang4meta4Node9LexerDecl4Mode7ws_sig_4spec2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK6langcc3VecINS_8StrSliceEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(64)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z20visit_lang_meta_NodeN6langcc6rc_ptrIN4lang4meta4Node9LexerDecl4Mode7ws_sig_4spec2_TEEESt8functionIFvNS0_INS3_2_TEEEEE(ptr noundef %0, ptr noundef %1) #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca %"struct.langcc::rc_ptr.21", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = call noundef ptr @_ZN6langcc6rc_ptrIN4lang4meta4Node9LexerDecl4Mode7ws_sig_4spec2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %10 = getelementptr inbounds %"struct.lang::meta::Node::LexerDecl::Mode::ws_sig_::spec::_T", ptr %9, i32 0, i32 1
  %11 = call noundef zeroext i1 @_ZNK6langcc6Option2_TINS_8StrSliceEE7is_someEv(ptr noundef nonnull align 4 dereferenceable(36) %10)
  br i1 %11, label %12, label %13

12:                                               ; preds = %2
  br label %13

13:                                               ; preds = %12, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !9
  store i64 0, ptr %5, align 8, !tbaa !9
  br label %14

14:                                               ; preds = %22, %13
  %15 = load i64, ptr %5, align 8, !tbaa !9
  %16 = call noundef ptr @_ZN6langcc6rc_ptrIN4lang4meta4Node9LexerDecl4Mode7ws_sig_4spec2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %17 = getelementptr inbounds %"struct.lang::meta::Node::LexerDecl::Mode::ws_sig_::spec::_T", ptr %16, i32 0, i32 2
  %18 = call noundef ptr @_ZN6langcc6rc_ptrINS_3VecINS_8StrSliceEEEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %17)
  %19 = call noundef i64 @_ZNK6langcc3VecINS_8StrSliceEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(64) %18)
  %20 = icmp slt i64 %15, %19
  br i1 %20, label %21, label %25

21:                                               ; preds = %14
  br label %22

22:                                               ; preds = %21
  %23 = load i64, ptr %5, align 8, !tbaa !9
  %24 = add nsw i64 %23, 1
  store i64 %24, ptr %5, align 8, !tbaa !9
  br label %14, !llvm.loop !11

25:                                               ; preds = %14
  call void @_ZN6langcc6rc_ptrIN4lang4meta4Node2_TEEC2INS3_9LexerDecl4Mode7ws_sig_4spec2_TETnPNSt9enable_ifIXsr3std10is_base_ofIS4_T_EE5valueEvE4typeELPv0EEERKNS0_ISD_EE(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %0)
  invoke void @_ZNKSt8functionIFvN6langcc6rc_ptrIN4lang4meta4Node2_TEEEEEclES6_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %6)
          to label %26 unwind label %27

26:                                               ; preds = %25
  call void @_ZN6langcc6rc_ptrIN4lang4meta4Node2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void

27:                                               ; preds = %25
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %7, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %8, align 4
  call void @_ZN6langcc6rc_ptrIN4lang4meta4Node2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %31

31:                                               ; preds = %27
  %32 = load ptr, ptr %7, align 8
  %33 = load i32, ptr %8, align 4
  %34 = insertvalue { ptr, i32 } poison, ptr %32, 0
  %35 = insertvalue { ptr, i32 } %34, i32 %33, 1
  resume { ptr, i32 } %35
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6langcc6Option2_TINS_8StrSliceEE7is_someEv(ptr noundef nonnull align 4 dereferenceable(36)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6langcc6rc_ptrIN4lang4meta4Node2_TEEC2INS3_9LexerDecl4Mode7ws_sig_4spec2_TETnPNSt9enable_ifIXsr3std10is_base_ofIS4_T_EE5valueEvE4typeELPv0EEERKNS0_ISD_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline 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 = { 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, !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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"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"

%"struct.langcc::rc_ptr.21" = type { ptr, ptr }

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN6langcc6rc_ptrIN4lang4meta4Node2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z20visit_lang_meta_NodeN6langcc6rc_ptrIN4lang4meta4Node9LexerDecl4Mode7ws_sig_4spec2_TEEESt8functionIFvNS0_INS3_2_TEEEEE(ptr noundef nonnull %0, ptr noundef %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.langcc::rc_ptr.21", align 8
  %4 = tail call noundef ptr @_ZN6langcc6rc_ptrIN4lang4meta4Node9LexerDecl4Mode7ws_sig_4spec2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %5 = getelementptr inbounds i8, ptr %4, i64 136
  %6 = tail call noundef zeroext i1 @_ZNK6langcc6Option2_TINS_8StrSliceEE7is_someEv(ptr noundef nonnull align 4 dereferenceable(36) %5)
  br label %7

7:                                                ; preds = %7, %2
  %.0 = phi i64 [ 0, %2 ], [ %13, %7 ]
  %8 = tail call noundef ptr @_ZN6langcc6rc_ptrIN4lang4meta4Node9LexerDecl4Mode7ws_sig_4spec2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %9 = getelementptr inbounds i8, ptr %8, i64 176
  %10 = tail call noundef ptr @_ZN6langcc6rc_ptrINS_3VecINS_8StrSliceEEEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %11 = tail call noundef i64 @_ZNK6langcc3VecINS_8StrSliceEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(64) %10)
  %12 = icmp slt i64 %.0, %11
  %13 = add nuw nsw i64 %.0, 1
  br i1 %12, label %7, label %14, !llvm.loop !5

14:                                               ; preds = %7
  call void @_ZN6langcc6rc_ptrIN4lang4meta4Node2_TEEC2INS3_9LexerDecl4Mode7ws_sig_4spec2_TETnPNSt9enable_ifIXsr3std10is_base_ofIS4_T_EE5valueEvE4typeELPv0EEERKNS0_ISD_EE(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %0)
  invoke void @_ZNKSt8functionIFvN6langcc6rc_ptrIN4lang4meta4Node2_TEEEEEclES6_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull %3)
          to label %15 unwind label %16

15:                                               ; preds = %14
  call void @_ZN6langcc6rc_ptrIN4lang4meta4Node2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  ret void

16:                                               ; preds = %14
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6langcc6rc_ptrIN4lang4meta4Node2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  resume { ptr, i32 } %17
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6langcc6Option2_TINS_8StrSliceEE7is_someEv(ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6langcc6rc_ptrIN4lang4meta4Node2_TEEC2INS3_9LexerDecl4Mode7ws_sig_4spec2_TETnPNSt9enable_ifIXsr3std10is_base_ofIS4_T_EE5valueEvE4typeELPv0EEERKNS0_ISD_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

attributes #0 = { alwaysinline 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 #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 = { 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 #3 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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