; LLVM IR from nickmqb/muon :: bootstrap/mu.ll_AstPrinter (printFunctionDef__)

; 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_____FunctionDef__ = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.Node__, ptr, ptr, ptr, ptr, i32, ptr, %struct.string__, %struct.string__, %struct.tag_____Tag__, i32, ptr, ptr, ptr, ptr, %struct.string__ }
%struct.tag_____Tag__ = type { ptr, ptr }
%struct.tag_____TypeParams__ = type { ptr, ptr, ptr, ptr }
%struct.tag_____List__Ptr__Param______ = type { ptr, i32, i32 }

@mu_____string13 = external dso_local global %struct.string__, align 8
@mu_____string20 = external dso_local global %struct.string__, align 8
@mu_____string19 = external dso_local global %struct.string__, align 8
@mu_____string21 = external dso_local global %struct.string__, align 8
@mu_____string18 = 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 @AstPrinter__printAttributes__(ptr noundef, ptr noundef) #1

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @AstPrinter__printFunctionDef__(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca %struct.Node__, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %10, i32 0, i32 1
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = load ptr, ptr @mu_____string18, align 8
  %14 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string18, i32 0, i32 1), align 8
  call void @AstPrinter__printDescToken__(ptr noundef %9, ptr %13, i32 %14, ptr noundef %12)
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  call void @AstPrinter__indent__(ptr noundef %15)
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %16, i32 0, i32 2
  %18 = load ptr, ptr %17, align 8, !tbaa !15
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %29

20:                                               ; preds = %2
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %22, i32 0, i32 2
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %25 = getelementptr inbounds %struct.tag_____TypeParams__, ptr %24, i32 0, i32 1
  %26 = load ptr, ptr %25, align 8, !tbaa !16
  %27 = load ptr, ptr @mu_____string13, align 8
  %28 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string13, i32 0, i32 1), align 8
  call void @AstPrinter__printDescTokenList__(ptr noundef %21, ptr %27, i32 %28, ptr noundef %26)
  br label %29

29:                                               ; preds = %20, %2
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = load ptr, ptr @mu_____string19, align 8
  %32 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string19, i32 0, i32 1), align 8
  call void @AstPrinter__printLine__(ptr noundef %30, ptr %31, i32 %32)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %33, i32 0, i32 4
  %35 = load ptr, ptr %34, align 8, !tbaa !18
  store ptr %35, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  store i32 0, ptr %6, align 4, !tbaa !19
  br label %36

36:                                               ; preds = %42, %29
  %37 = load i32, ptr %6, align 4, !tbaa !19
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.tag_____List__Ptr__Param______, ptr %38, i32 0, i32 1
  %40 = load i32, ptr %39, align 8, !tbaa !20
  %41 = icmp slt i32 %37, %40
  br i1 %41, label %42, label %54

42:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.tag_____List__Ptr__Param______, ptr %43, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !22
  %46 = load i32, ptr %6, align 4, !tbaa !19
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds ptr, ptr %45, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  store ptr %49, ptr %7, align 8, !tbaa !5
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  call void @AstPrinter__printParam__(ptr noundef %50, ptr noundef %51)
  %52 = load i32, ptr %6, align 4, !tbaa !19
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %6, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  br label %36, !llvm.loop !23

54:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %56, i32 0, i32 7
  %58 = load ptr, ptr @mu_____string20, align 8
  %59 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string20, i32 0, i32 1), align 8
  %60 = getelementptr inbounds { i32, ptr }, ptr %57, i32 0, i32 0
  %61 = load i32, ptr %60, align 8
  %62 = getelementptr inbounds { i32, ptr }, ptr %57, i32 0, i32 1
  %63 = load ptr, ptr %62, align 8
  call void @AstPrinter__printDescAny__(ptr noundef %55, ptr %58, i32 %59, i32 %61, ptr %63)
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %65, i32 0, i32 8
  %67 = load ptr, ptr %66, align 8, !tbaa !25
  call void @AstPrinter__printAttributes__(ptr noundef %64, ptr noundef %67)
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #2
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %68, i32 0, i32 10
  %70 = load ptr, ptr %69, align 8, !tbaa !26
  %71 = getelementptr inbounds %struct.Node__, ptr %8, i32 0, i32 1
  store ptr %70, ptr %71, align 8, !tbaa !27
  %72 = getelementptr inbounds %struct.Node__, ptr %8, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !27
  %74 = icmp ne ptr %73, null
  %75 = zext i1 %74 to i64
  %76 = select i1 %74, i32 5, i32 0
  %77 = getelementptr inbounds %struct.Node__, ptr %8, i32 0, i32 0
  store i32 %76, ptr %77, align 8, !tbaa !28
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = load ptr, ptr @mu_____string21, align 8
  %80 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string21, i32 0, i32 1), align 8
  %81 = getelementptr inbounds { i32, ptr }, ptr %8, i32 0, i32 0
  %82 = load i32, ptr %81, align 8
  %83 = getelementptr inbounds { i32, ptr }, ptr %8, i32 0, i32 1
  %84 = load ptr, ptr %83, align 8
  call void @AstPrinter__printDescAny__(ptr noundef %78, ptr %79, i32 %80, i32 %82, ptr %84)
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  call void @AstPrinter__unIndent__(ptr noundef %85)
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #2
  ret void
}

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

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 8}
!10 = !{!"tag_____FunctionDef__", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !11, i64 56, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !12, i64 104, !6, i64 112, !13, i64 120, !13, i64 136, !14, i64 152, !12, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !13, i64 208}
!11 = !{!"", !12, i64 0, !6, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"", !6, i64 0, !12, i64 8}
!14 = !{!"tag_____Tag__", !6, i64 0, !6, i64 8}
!15 = !{!10, !6, i64 16}
!16 = !{!17, !6, i64 8}
!17 = !{!"tag_____TypeParams__", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!10, !6, i64 32}
!19 = !{!12, !12, i64 0}
!20 = !{!21, !12, i64 8}
!21 = !{!"tag_____List__Ptr__Param______", !6, i64 0, !12, i64 8, !12, i64 12}
!22 = !{!21, !6, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!10, !6, i64 72}
!26 = !{!10, !6, i64 88}
!27 = !{!11, !6, i64 8}
!28 = !{!11, !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_____string13 = external dso_local local_unnamed_addr global %struct.string__, align 8
@mu_____string20 = external dso_local local_unnamed_addr global %struct.string__, align 8
@mu_____string19 = external dso_local local_unnamed_addr global %struct.string__, align 8
@mu_____string21 = external dso_local local_unnamed_addr global %struct.string__, align 8
@mu_____string18 = external dso_local local_unnamed_addr global %struct.string__, align 8

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @AstPrinter__printFunctionDef__(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = load ptr, ptr @mu_____string18, align 8
  %6 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string18, i64 8), align 8
  tail call void @AstPrinter__printDescToken__(ptr noundef %0, ptr %5, i32 %6, ptr noundef %4)
  tail call void @AstPrinter__indent__(ptr noundef %0)
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !14
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %14, label %9

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %8, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !15
  %12 = load ptr, ptr @mu_____string13, align 8
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string13, i64 8), align 8
  tail call void @AstPrinter__printDescTokenList__(ptr noundef %0, ptr %12, i32 %13, ptr noundef %11)
  br label %14

14:                                               ; preds = %9, %2
  %15 = load ptr, ptr @mu_____string19, align 8
  %16 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string19, i64 8), align 8
  tail call void @AstPrinter__printLine__(ptr noundef %0, ptr %15, i32 %16)
  %17 = getelementptr inbounds i8, ptr %1, i64 32
  %18 = load ptr, ptr %17, align 8, !tbaa !17
  %19 = getelementptr inbounds i8, ptr %18, i64 8
  %20 = load i32, ptr %19, align 8, !tbaa !18
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %14, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %14 ]
  %22 = load ptr, ptr %18, align 8, !tbaa !20
  %23 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv
  %24 = load ptr, ptr %23, align 8, !tbaa !21
  tail call void @AstPrinter__printParam__(ptr noundef %0, ptr noundef %24)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = load i32, ptr %19, align 8, !tbaa !18
  %26 = sext i32 %25 to i64
  %27 = icmp slt i64 %indvars.iv.next, %26
  br i1 %27, label %.lr.ph, label %._crit_edge, !llvm.loop !22

._crit_edge:                                      ; preds = %.lr.ph, %14
  %28 = getelementptr inbounds i8, ptr %1, i64 56
  %29 = load ptr, ptr @mu_____string20, align 8
  %30 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string20, i64 8), align 8
  %31 = load i32, ptr %28, align 8
  %32 = getelementptr inbounds i8, ptr %1, i64 64
  %33 = load ptr, ptr %32, align 8
  tail call void @AstPrinter__printDescAny__(ptr noundef %0, ptr %29, i32 %30, i32 %31, ptr %33)
  %34 = getelementptr inbounds i8, ptr %1, i64 72
  %35 = load ptr, ptr %34, align 8, !tbaa !24
  tail call void @AstPrinter__printAttributes__(ptr noundef %0, ptr noundef %35)
  %36 = getelementptr inbounds i8, ptr %1, i64 88
  %37 = load ptr, ptr %36, align 8, !tbaa !25
  %.not24 = icmp eq ptr %37, null
  %38 = select i1 %.not24, i32 0, i32 5
  %39 = load ptr, ptr @mu_____string21, align 8
  %40 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string21, i64 8), align 8
  tail call void @AstPrinter__printDescAny__(ptr noundef %0, ptr %39, i32 %40, i32 %38, ptr %37)
  tail call void @AstPrinter__unIndent__(ptr noundef %0)
  ret void
}

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

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, !7, i64 8}
!6 = !{!"tag_____FunctionDef__", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !11, i64 104, !7, i64 112, !12, i64 120, !12, i64 136, !13, i64 152, !11, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !12, i64 208}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !7, i64 8}
!11 = !{!"int", !8, i64 0}
!12 = !{!"", !7, i64 0, !11, i64 8}
!13 = !{!"tag_____Tag__", !7, i64 0, !7, i64 8}
!14 = !{!6, !7, i64 16}
!15 = !{!16, !7, i64 8}
!16 = !{!"tag_____TypeParams__", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!17 = !{!6, !7, i64 32}
!18 = !{!19, !11, i64 8}
!19 = !{!"tag_____List__Ptr__Param______", !7, i64 0, !11, i64 8, !11, i64 12}
!20 = !{!19, !7, i64 0}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!6, !7, i64 72}
!25 = !{!6, !7, i64 88}


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