; LLVM IR from nickmqb/muon :: bootstrap/mu.ll_Parser (endLine__)

; 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.string__ = type { ptr, i32 }
%struct.Node__ = type { i32, ptr }
%struct.tag_____ParserState__ = type { %struct.string__, i32, ptr, ptr, i32, i32, i32, i32, i32, ptr, %struct.tag_____IntRange__, i32, i32, ptr, i32, ptr, ptr, ptr }
%struct.tag_____IntRange__ = type { i32, i32 }
%struct.tag_____Token__ = type { i32, %struct.string__, %struct.tag_____IntRange__, %struct.tag_____IntRange__, i32 }

@mu_____string313 = external dso_local global %struct.string__, align 8

; 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: nounwind uwtable
declare dso_local void @List__add__Node____(ptr noundef, i32, ptr) #1

; Function Attrs: nounwind uwtable
declare dso_local void @Parser__badToken__(ptr noundef, ptr, i32) #1

; Function Attrs: nounwind uwtable
define dso_local void @Parser__endLine__(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.Node__, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  br label %6

6:                                                ; preds = %14, %2
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.tag_____ParserState__, ptr %7, i32 0, i32 3
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = getelementptr inbounds %struct.tag_____Token__, ptr %9, i32 0, i32 4
  %11 = load i32, ptr %10, align 8, !tbaa !14
  %12 = icmp eq i32 %11, 2147483647
  br i1 %12, label %14, label %13

13:                                               ; preds = %6
  br label %33

14:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #2
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.tag_____ParserState__, ptr %15, i32 0, i32 3
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = getelementptr inbounds %struct.Node__, ptr %5, i32 0, i32 1
  store ptr %17, ptr %18, align 8, !tbaa !16
  %19 = getelementptr inbounds %struct.Node__, ptr %5, i32 0, i32 1
  %20 = load ptr, ptr %19, align 8, !tbaa !16
  %21 = icmp ne ptr %20, null
  %22 = zext i1 %21 to i64
  %23 = select i1 %21, i32 21, i32 0
  %24 = getelementptr inbounds %struct.Node__, ptr %5, i32 0, i32 0
  store i32 %23, ptr %24, align 8, !tbaa !18
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds { i32, ptr }, ptr %5, i32 0, i32 0
  %27 = load i32, ptr %26, align 8
  %28 = getelementptr inbounds { i32, ptr }, ptr %5, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8
  call void @List__add__Node____(ptr noundef %25, i32 %27, ptr %29)
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = load ptr, ptr @mu_____string313, align 8
  %32 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string313, i32 0, i32 1), align 8
  call void @Parser__badToken__(ptr noundef %30, ptr %31, i32 %32)
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #2
  br label %6

33:                                               ; preds = %13
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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/C++ TBAA"}
!9 = !{!10, !6, i64 32}
!10 = !{!"tag_____ParserState__", !11, i64 0, !12, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !6, i64 64, !13, i64 72, !12, i64 80, !12, i64 84, !6, i64 88, !12, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!11 = !{!"", !6, i64 0, !12, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"tag_____IntRange__", !12, i64 0, !12, i64 4}
!14 = !{!15, !12, i64 40}
!15 = !{!"tag_____Token__", !12, i64 0, !11, i64 8, !13, i64 24, !13, i64 32, !12, i64 40}
!16 = !{!17, !6, i64 8}
!17 = !{!"", !12, i64 0, !6, i64 8}
!18 = !{!17, !12, 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.string__ = type { ptr, i32 }

@mu_____string313 = external dso_local local_unnamed_addr global %struct.string__, align 8

; Function Attrs: nounwind uwtable
declare dso_local void @List__add__Node____(ptr noundef, i32, ptr) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @Parser__badToken__(ptr noundef, ptr, i32) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @Parser__endLine__(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 40
  %6 = load i32, ptr %5, align 8, !tbaa !13
  %7 = icmp eq i32 %6, 2147483647
  br i1 %7, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %.lr.ph
  %8 = phi ptr [ %11, %.lr.ph ], [ %4, %2 ]
  tail call void @List__add__Node____(ptr noundef %1, i32 21, ptr nonnull %8)
  %9 = load ptr, ptr @mu_____string313, align 8
  %10 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string313, i64 8), align 8
  tail call void @Parser__badToken__(ptr noundef nonnull %0, ptr %9, i32 %10)
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 40
  %13 = load i32, ptr %12, align 8, !tbaa !13
  %14 = icmp eq i32 %13, 2147483647
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %2
  ret void
}

attributes #0 = { 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, !8, i64 32}
!6 = !{!"tag_____ParserState__", !7, i64 0, !11, i64 16, !8, i64 24, !8, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !8, i64 64, !12, i64 72, !11, i64 80, !11, i64 84, !8, i64 88, !11, i64 96, !8, i64 104, !8, i64 112, !8, i64 120}
!7 = !{!"", !8, i64 0, !11, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"tag_____IntRange__", !11, i64 0, !11, i64 4}
!13 = !{!14, !11, i64 40}
!14 = !{!"tag_____Token__", !11, i64 0, !7, i64 8, !12, i64 24, !12, i64 32, !11, i64 40}


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