; LLVM IR from jzimmerman/langcc :: gen/cc (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.204" = type { ptr, ptr }
%"struct.langcc::ParserAttrMask" = type { [16 x i8] }
%"struct.langcc::ParserLookahead" = type { [8 x i16] }
%"struct.langcc::TokenBounds" = type { i32, i32 }
%"struct.lang::cc::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 }

declare i32 @__gxx_personality_v0(...)

; 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) #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4lang2cc4Node10FunDeclDef3Del4makeElN6langcc11TokenBoundsEblNS4_14ParserAttrMaskENS4_15ParserLookaheadE(ptr dead_on_unwind noalias writable sret(%"struct.langcc::rc_ptr.204") align 8 %0, i64 noundef %1, i64 %2, i1 noundef zeroext %3, i64 noundef %4, ptr noundef byval(%"struct.langcc::ParserAttrMask") align 8 %5, ptr noundef byval(%"struct.langcc::ParserLookahead") align 8 %6) #2 personality ptr @__gxx_personality_v0 {
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.langcc::TokenBounds", align 4
  %10 = alloca i64, align 8
  %11 = alloca i8, align 1
  %12 = alloca i64, align 8
  %13 = alloca i1, align 1
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %8, align 8
  store i64 %2, ptr %9, align 4
  store i64 %1, ptr %10, align 8, !tbaa !5
  %16 = zext i1 %3 to i8
  store i8 %16, ptr %11, align 1, !tbaa !9
  store i64 %4, ptr %12, align 8, !tbaa !5
  store i1 false, ptr %13, align 1
  call void @_ZN6langcc7make_rcIN4lang2cc4Node10FunDeclDef3Del2_TEJEEENS_6rc_ptrIT_EEDpT0_(ptr dead_on_unwind writable sret(%"struct.langcc::rc_ptr.204") align 8 %0)
  %17 = load i64, ptr %10, align 8, !tbaa !5
  %18 = invoke noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
          to label %19 unwind label %41

19:                                               ; preds = %7
  %20 = getelementptr inbounds %"struct.lang::cc::Node::_T", ptr %18, i32 0, i32 4
  store i64 %17, ptr %20, align 8, !tbaa !11
  %21 = invoke noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
          to label %22 unwind label %41

22:                                               ; preds = %19
  %23 = getelementptr inbounds %"struct.lang::cc::Node::_T", ptr %21, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !23
  %24 = load i8, ptr %11, align 1, !tbaa !9, !range !25, !noundef !26
  %25 = trunc i8 %24 to i1
  %26 = invoke noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
          to label %27 unwind label %41

27:                                               ; preds = %22
  %28 = getelementptr inbounds %"struct.lang::cc::Node::_T", ptr %26, i32 0, i32 6
  %29 = zext i1 %25 to i8
  store i8 %29, ptr %28, align 8, !tbaa !27
  %30 = load i64, ptr %12, align 8, !tbaa !5
  %31 = invoke noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
          to label %32 unwind label %41

32:                                               ; preds = %27
  %33 = getelementptr inbounds %"struct.lang::cc::Node::_T", ptr %31, i32 0, i32 7
  store i64 %30, ptr %33, align 8, !tbaa !28
  %34 = invoke noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
          to label %35 unwind label %41

35:                                               ; preds = %32
  %36 = getelementptr inbounds %"struct.lang::cc::Node::_T", ptr %34, i32 0, i32 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %36, ptr align 8 %5, i64 16, i1 false), !tbaa.struct !29
  %37 = invoke noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
          to label %38 unwind label %41

38:                                               ; preds = %35
  %39 = getelementptr inbounds %"struct.lang::cc::Node::_T", ptr %37, i32 0, i32 9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %39, ptr align 8 %6, i64 16, i1 false), !tbaa.struct !29
  store i1 true, ptr %13, align 1
  %40 = load i1, ptr %13, align 1
  br i1 %40, label %46, label %45

41:                                               ; preds = %35, %32, %27, %22, %19, %7
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %14, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %15, align 4
  call void @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #3
  br label %47

45:                                               ; preds = %38
  call void @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #3
  br label %46

46:                                               ; preds = %45, %38
  ret void

47:                                               ; preds = %41
  %48 = load ptr, ptr %14, align 8
  %49 = load i32, ptr %15, align 4
  %50 = insertvalue { ptr, i32 } poison, ptr %48, 0
  %51 = insertvalue { ptr, i32 } %50, i32 %49, 1
  resume { ptr, i32 } %51
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6langcc7make_rcIN4lang2cc4Node10FunDeclDef3Del2_TEJEEENS_6rc_ptrIT_EEDpT0_(ptr dead_on_unwind noalias writable sret(%"struct.langcc::rc_ptr.204") align 8) #2

attributes #0 = { nocallback nofree 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 = { 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 = !{!"long", !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, !6, i64 72}
!12 = !{!"_ZTSN4lang2cc4Node2_TE", !13, i64 8, !16, i64 48, !18, i64 64, !6, i64 72, !19, i64 80, !10, i64 88, !6, i64 96, !21, i64 104, !22, i64 120}
!13 = !{!"_ZTSN6langcc8hash_objE", !14, i64 0}
!14 = !{!"_ZTSN6langcc6Option2_TINS_7HashValEEE", !15, i64 0, !7, i64 4}
!15 = !{!"_ZTSN6langcc6Option2_WE", !7, i64 0}
!16 = !{!"_ZTSN6langcc24enable_rc_from_this_polyE", !17, i64 0, !17, i64 8}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!"_ZTSN4lang2cc4Node2_WE", !7, i64 0}
!19 = !{!"_ZTSN6langcc11TokenBoundsE", !20, i64 0, !20, i64 4}
!20 = !{!"int", !7, i64 0}
!21 = !{!"_ZTSN6langcc14ParserAttrMaskE", !7, i64 0}
!22 = !{!"_ZTSN6langcc15ParserLookaheadE", !7, i64 0}
!23 = !{i64 0, i64 4, !24, i64 4, i64 4, !24}
!24 = !{!20, !20, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!12, !10, i64 88}
!28 = !{!12, !6, i64 96}
!29 = !{i64 0, i64 16, !30}
!30 = !{!7, !7, i64 0}


; 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.204" = type { ptr, ptr }
%"struct.langcc::ParserAttrMask" = type { [16 x i8] }
%"struct.langcc::ParserLookahead" = type { [8 x i16] }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress 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) #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4lang2cc4Node10FunDeclDef3Del4makeElN6langcc11TokenBoundsEblNS4_14ParserAttrMaskENS4_15ParserLookaheadE(ptr dead_on_unwind noalias writable sret(%"struct.langcc::rc_ptr.204") align 8 %0, i64 noundef %1, i64 %2, i1 noundef zeroext %3, i64 noundef %4, ptr nocapture noundef readonly byval(%"struct.langcc::ParserAttrMask") align 8 %5, ptr nocapture noundef readonly byval(%"struct.langcc::ParserLookahead") align 8 %6) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %8 = zext i1 %3 to i8
  tail call void @_ZN6langcc7make_rcIN4lang2cc4Node10FunDeclDef3Del2_TEJEEENS_6rc_ptrIT_EEDpT0_(ptr dead_on_unwind writable sret(%"struct.langcc::rc_ptr.204") align 8 %0)
  %9 = tail call noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %10 = getelementptr inbounds i8, ptr %9, i64 72
  store i64 %1, ptr %10, align 8, !tbaa !5
  %11 = tail call noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %12 = getelementptr inbounds i8, ptr %11, i64 80
  store i64 %2, ptr %12, align 8
  %13 = tail call noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %14 = getelementptr inbounds i8, ptr %13, i64 88
  store i8 %8, ptr %14, align 8, !tbaa !21
  %15 = tail call noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %16 = getelementptr inbounds i8, ptr %15, i64 96
  store i64 %4, ptr %16, align 8, !tbaa !22
  %17 = tail call noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %18 = getelementptr inbounds i8, ptr %17, i64 104
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %5, i64 16, i1 false), !tbaa.struct !23
  %19 = tail call noundef ptr @_ZN6langcc6rc_ptrIN4lang2cc4Node10FunDeclDef3Del2_TEEptEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %20 = getelementptr inbounds i8, ptr %19, i64 120
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %6, i64 16, i1 false), !tbaa.struct !23
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6langcc7make_rcIN4lang2cc4Node10FunDeclDef3Del2_TEJEEENS_6rc_ptrIT_EEDpT0_(ptr dead_on_unwind noalias writable sret(%"struct.langcc::rc_ptr.204") align 8) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree 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" }

!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, !15, i64 72}
!6 = !{!"_ZTSN4lang2cc4Node2_TE", !7, i64 8, !12, i64 48, !14, i64 64, !15, i64 72, !16, i64 80, !18, i64 88, !15, i64 96, !19, i64 104, !20, i64 120}
!7 = !{!"_ZTSN6langcc8hash_objE", !8, i64 0}
!8 = !{!"_ZTSN6langcc6Option2_TINS_7HashValEEE", !9, i64 0, !10, i64 4}
!9 = !{!"_ZTSN6langcc6Option2_WE", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN6langcc24enable_rc_from_this_polyE", !13, i64 0, !13, i64 8}
!13 = !{!"any pointer", !10, i64 0}
!14 = !{!"_ZTSN4lang2cc4Node2_WE", !10, i64 0}
!15 = !{!"long", !10, i64 0}
!16 = !{!"_ZTSN6langcc11TokenBoundsE", !17, i64 0, !17, i64 4}
!17 = !{!"int", !10, i64 0}
!18 = !{!"bool", !10, i64 0}
!19 = !{!"_ZTSN6langcc14ParserAttrMaskE", !10, i64 0}
!20 = !{!"_ZTSN6langcc15ParserLookaheadE", !10, i64 0}
!21 = !{!6, !18, i64 88}
!22 = !{!6, !15, i64 96}
!23 = !{i64 0, i64 16, !24}
!24 = !{!10, !10, i64 0}


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