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

; 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.tag_____StructInitializerExpression__ = type { %struct.Node__, ptr, ptr, ptr, ptr }
%struct.Node__ = type { i32, ptr }
%struct.tag_____List__Ptr__FieldInitializerExpression______ = type { ptr, i32, i32 }

@mu_____string30 = external dso_local global %struct.string__, align 8
@mu_____string63 = external dso_local global %struct.string__, align 8
@mu_____string31 = 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__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__printFieldInitializerExpression__(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @AstPrinter__printStructInitializerExpression__(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
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = load ptr, ptr @mu_____string63, align 8
  %10 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string63, i32 0, i32 1), align 8
  call void @AstPrinter__printLine__(ptr noundef %8, ptr %9, i32 %10)
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  call void @AstPrinter__indent__(ptr noundef %11)
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.tag_____StructInitializerExpression__, ptr %13, i32 0, i32 0
  %15 = load ptr, ptr @mu_____string30, align 8
  %16 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string30, i32 0, i32 1), align 8
  %17 = getelementptr inbounds { i32, ptr }, ptr %14, i32 0, i32 0
  %18 = load i32, ptr %17, align 8
  %19 = getelementptr inbounds { i32, ptr }, ptr %14, i32 0, i32 1
  %20 = load ptr, ptr %19, align 8
  call void @AstPrinter__printDescAny__(ptr noundef %12, ptr %15, i32 %16, i32 %18, ptr %20)
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = load ptr, ptr @mu_____string31, align 8
  %23 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string31, i32 0, i32 1), align 8
  call void @AstPrinter__printLine__(ptr noundef %21, ptr %22, i32 %23)
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  call void @AstPrinter__indent__(ptr noundef %24)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.tag_____StructInitializerExpression__, ptr %25, i32 0, i32 2
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  store ptr %27, 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 !13
  br label %28

28:                                               ; preds = %34, %2
  %29 = load i32, ptr %6, align 4, !tbaa !13
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.tag_____List__Ptr__FieldInitializerExpression______, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 8, !tbaa !14
  %33 = icmp slt i32 %29, %32
  br i1 %33, label %34, label %46

34:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.tag_____List__Ptr__FieldInitializerExpression______, ptr %35, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  %38 = load i32, ptr %6, align 4, !tbaa !13
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds ptr, ptr %37, i64 %39
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  store ptr %41, ptr %7, align 8, !tbaa !5
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  call void @AstPrinter__printFieldInitializerExpression__(ptr noundef %42, ptr noundef %43)
  %44 = load i32, ptr %6, align 4, !tbaa !13
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %6, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  br label %28, !llvm.loop !17

46:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  call void @AstPrinter__unIndent__(ptr noundef %47)
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  call void @AstPrinter__unIndent__(ptr noundef %48)
  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 24}
!10 = !{!"tag_____StructInitializerExpression__", !11, i64 0, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!11 = !{!"", !12, i64 0, !6, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!15, !12, i64 8}
!15 = !{!"tag_____List__Ptr__FieldInitializerExpression______", !6, i64 0, !12, i64 8, !12, i64 12}
!16 = !{!15, !6, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"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.string__ = type { ptr, i32 }

@mu_____string30 = external dso_local local_unnamed_addr global %struct.string__, align 8
@mu_____string63 = external dso_local local_unnamed_addr global %struct.string__, align 8
@mu_____string31 = external dso_local local_unnamed_addr global %struct.string__, align 8

; 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__printFieldInitializerExpression__(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @AstPrinter__printStructInitializerExpression__(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = load ptr, ptr @mu_____string63, align 8
  %4 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string63, i64 8), align 8
  tail call void @AstPrinter__printLine__(ptr noundef %0, ptr %3, i32 %4)
  tail call void @AstPrinter__indent__(ptr noundef %0)
  %5 = load ptr, ptr @mu_____string30, align 8
  %6 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string30, i64 8), align 8
  %7 = load i32, ptr %1, align 8
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load ptr, ptr %8, align 8
  tail call void @AstPrinter__printDescAny__(ptr noundef %0, ptr %5, i32 %6, i32 %7, ptr %9)
  %10 = load ptr, ptr @mu_____string31, align 8
  %11 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string31, i64 8), align 8
  tail call void @AstPrinter__printLine__(ptr noundef %0, ptr %10, i32 %11)
  tail call void @AstPrinter__indent__(ptr noundef %0)
  %12 = getelementptr inbounds i8, ptr %1, i64 24
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = load i32, ptr %14, align 8, !tbaa !12
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

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

._crit_edge:                                      ; preds = %.lr.ph, %2
  tail call void @AstPrinter__unIndent__(ptr noundef %0)
  tail call void @AstPrinter__unIndent__(ptr noundef %0)
  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, !11, i64 24}
!6 = !{!"tag_____StructInitializerExpression__", !7, i64 0, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40}
!7 = !{!"", !8, i64 0, !11, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!13, !8, i64 8}
!13 = !{!"tag_____List__Ptr__FieldInitializerExpression______", !11, i64 0, !8, i64 8, !8, i64 12}
!14 = !{!13, !11, i64 0}
!15 = !{!11, !11, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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