; LLVM IR from nickmqb/muon :: bootstrap/mu.ll_CGenerator (genUnreachable__)

; 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_____IAllocator__ = type { ptr, ptr, ptr, ptr }
%struct.tag_____StringBuilder__ = type { ptr, i32, i32 }
%struct.tag_____Tag__ = type { ptr, ptr }
%struct.tag_____GenerateContext__ = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, ptr, %struct.string__, i32, %struct.string__, i32, ptr, ptr, i8 }
%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.Node__ = type { i32, ptr }
%struct.tag_____CommonTags__ = type { %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@mu_____string324 = external dso_local global %struct.string__, align 8
@mu_____string531 = external dso_local global %struct.string__, align 8
@top_____currentAllocator__ = external dso_local thread_local global %struct.tag_____IAllocator__, 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 speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local { ptr, i32 } @StringBuilder__toString__(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local { ptr, ptr } @TypeChecker__closeTag__(ptr, ptr, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @CGenerator__genUnreachable__(ptr noundef %0) #4 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.tag_____StringBuilder__, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.tag_____Tag__, align 8
  %7 = alloca %struct.string__, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.tag_____GenerateContext__, ptr %8, i32 0, i32 9
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %11 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %10, i32 0, i32 16
  %12 = getelementptr inbounds %struct.tag_____Tag__, ptr %11, i32 0, i32 0
  %13 = load ptr, ptr %12, align 8, !tbaa !13
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.tag_____GenerateContext__, ptr %14, i32 0, i32 4
  %16 = load ptr, ptr %15, align 8, !tbaa !17
  %17 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %16, i32 0, i32 0
  %18 = getelementptr inbounds %struct.tag_____Tag__, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !18
  %20 = icmp ne ptr %13, %19
  br i1 %20, label %21, label %77

21:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %22 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %23 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %22, i32 0, i32 1
  %24 = load ptr, ptr %23, align 8, !tbaa !20
  %25 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %26 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %25, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !22
  %28 = call ptr %24(ptr noundef %27, i64 noundef 16)
  store ptr %28, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #5
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 16, i1 false)
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %4, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %30, ptr %5, align 8, !tbaa !5
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = load ptr, ptr @mu_____string531, align 8
  %33 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string531, i32 0, i32 1), align 8
  call void @StringBuilder__write__(ptr noundef %31, ptr %32, i32 %33)
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.tag_____GenerateContext__, ptr %35, i32 0, i32 9
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %37, i32 0, i32 16
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.tag_____GenerateContext__, ptr %39, i32 0, i32 9
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %41, i32 0, i32 13
  %43 = load ptr, ptr %42, align 8, !tbaa !25
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.tag_____GenerateContext__, ptr %44, i32 0, i32 8
  %46 = load ptr, ptr %45, align 8, !tbaa !26
  %47 = getelementptr inbounds { ptr, ptr }, ptr %38, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8
  %49 = getelementptr inbounds { ptr, ptr }, ptr %38, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8
  %51 = call { ptr, ptr } @TypeChecker__closeTag__(ptr %48, ptr %50, ptr noundef %43, ptr noundef %46)
  %52 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 0
  %53 = extractvalue { ptr, ptr } %51, 0
  store ptr %53, ptr %52, align 8
  %54 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 1
  %55 = extractvalue { ptr, ptr } %51, 1
  store ptr %55, ptr %54, align 8
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8
  %59 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8
  call void @CGenerator__genTagDefaultValue__(ptr noundef %34, ptr %58, ptr %60, ptr noundef %56)
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = load ptr, ptr @mu_____string324, align 8
  %63 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string324, i32 0, i32 1), align 8
  call void @StringBuilder__write__(ptr noundef %61, ptr %62, i32 %63)
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.tag_____GenerateContext__, ptr %64, i32 0, i32 5
  %66 = load ptr, ptr %65, align 8, !tbaa !27
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = call { ptr, i32 } @StringBuilder__toString__(ptr noundef %67)
  %69 = getelementptr inbounds { ptr, i32 }, ptr %7, i32 0, i32 0
  %70 = extractvalue { ptr, i32 } %68, 0
  store ptr %70, ptr %69, align 8
  %71 = getelementptr inbounds { ptr, i32 }, ptr %7, i32 0, i32 1
  %72 = extractvalue { ptr, i32 } %68, 1
  store i32 %72, ptr %71, align 8
  %73 = getelementptr inbounds { ptr, i32 }, ptr %7, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8
  %75 = getelementptr inbounds { ptr, i32 }, ptr %7, i32 0, i32 1
  %76 = load i32, ptr %75, align 8
  call void @CodeBuilder__writeLine__(ptr noundef %66, ptr %74, i32 %76)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %77

77:                                               ; preds = %21, %1
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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/C++ TBAA"}
!9 = !{!10, !6, i64 64}
!10 = !{!"tag_____GenerateContext__", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !11, i64 48, !11, i64 52, !6, i64 56, !6, i64 64, !6, i64 72, !12, i64 80, !11, i64 96, !12, i64 104, !11, i64 120, !6, i64 128, !6, i64 136, !7, i64 144}
!11 = !{!"int", !7, i64 0}
!12 = !{!"", !6, i64 0, !11, i64 8}
!13 = !{!14, !6, i64 152}
!14 = !{!"tag_____FunctionDef__", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !15, i64 56, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !11, i64 104, !6, i64 112, !12, i64 120, !12, i64 136, !16, i64 152, !11, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !12, i64 208}
!15 = !{!"", !11, i64 0, !6, i64 8}
!16 = !{!"tag_____Tag__", !6, i64 0, !6, i64 8}
!17 = !{!10, !6, i64 32}
!18 = !{!19, !6, i64 0}
!19 = !{!"tag_____CommonTags__", !16, i64 0, !16, i64 16, !16, i64 32, !16, i64 48, !16, i64 64, !16, i64 80, !16, i64 96, !16, i64 112, !16, i64 128, !16, i64 144, !16, i64 160, !16, i64 176, !16, i64 192, !16, i64 208, !16, i64 224, !16, i64 240, !16, i64 256, !16, i64 272, !16, i64 288, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376}
!20 = !{!21, !6, i64 8}
!21 = !{!"tag_____IAllocator__", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!21, !6, i64 0}
!23 = !{i64 0, i64 8, !5, i64 8, i64 4, !24, i64 12, i64 4, !24}
!24 = !{!11, !11, i64 0}
!25 = !{!14, !6, i64 112}
!26 = !{!10, !6, i64 56}
!27 = !{!10, !6, i64 40}


; 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 }
%struct.tag_____IAllocator__ = type { ptr, ptr, ptr, ptr }

@mu_____string324 = external dso_local local_unnamed_addr global %struct.string__, align 8
@mu_____string531 = external dso_local local_unnamed_addr global %struct.string__, align 8
@top_____currentAllocator__ = external dso_local thread_local local_unnamed_addr global %struct.tag_____IAllocator__, align 8

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local { ptr, i32 } @StringBuilder__toString__(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local { ptr, ptr } @TypeChecker__closeTag__(ptr, ptr, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @CGenerator__genUnreachable__(ptr noundef %0) local_unnamed_addr #2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 64
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 152
  %5 = load ptr, ptr %4, align 8, !tbaa !12
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load ptr, ptr %6, align 8, !tbaa !16
  %8 = load ptr, ptr %7, align 8, !tbaa !17
  %.not = icmp eq ptr %5, %8
  br i1 %.not, label %36, label %9

9:                                                ; preds = %1
  %10 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !19
  %13 = load ptr, ptr %10, align 8, !tbaa !21
  %14 = tail call ptr %12(ptr noundef %13, i64 noundef 16) #3
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %14, i8 0, i64 16, i1 false)
  %15 = load ptr, ptr @mu_____string531, align 8
  %16 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string531, i64 8), align 8
  tail call void @StringBuilder__write__(ptr noundef %14, ptr %15, i32 %16)
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 152
  %19 = getelementptr inbounds i8, ptr %17, i64 112
  %20 = load ptr, ptr %19, align 8, !tbaa !22
  %21 = getelementptr inbounds i8, ptr %0, i64 56
  %22 = load ptr, ptr %21, align 8, !tbaa !23
  %23 = load ptr, ptr %18, align 8
  %24 = getelementptr inbounds i8, ptr %17, i64 160
  %25 = load ptr, ptr %24, align 8
  %26 = tail call { ptr, ptr } @TypeChecker__closeTag__(ptr %23, ptr %25, ptr noundef %20, ptr noundef %22)
  %27 = extractvalue { ptr, ptr } %26, 0
  %28 = extractvalue { ptr, ptr } %26, 1
  tail call void @CGenerator__genTagDefaultValue__(ptr noundef nonnull %0, ptr %27, ptr %28, ptr noundef %14)
  %29 = load ptr, ptr @mu_____string324, align 8
  %30 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string324, i64 8), align 8
  tail call void @StringBuilder__write__(ptr noundef %14, ptr %29, i32 %30)
  %31 = getelementptr inbounds i8, ptr %0, i64 40
  %32 = load ptr, ptr %31, align 8, !tbaa !24
  %33 = tail call { ptr, i32 } @StringBuilder__toString__(ptr noundef %14)
  %34 = extractvalue { ptr, i32 } %33, 0
  %35 = extractvalue { ptr, i32 } %33, 1
  tail call void @CodeBuilder__writeLine__(ptr noundef %32, ptr %34, i32 %35)
  br label %36

36:                                               ; preds = %9, %1
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { 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 = { 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, !7, i64 64}
!6 = !{!"tag_____GenerateContext__", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !10, i64 48, !10, i64 52, !7, i64 56, !7, i64 64, !7, i64 72, !11, i64 80, !10, i64 96, !11, i64 104, !10, i64 120, !7, i64 128, !7, i64 136, !8, i64 144}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"", !7, i64 0, !10, i64 8}
!12 = !{!13, !7, i64 152}
!13 = !{!"tag_____FunctionDef__", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !14, i64 56, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !10, i64 104, !7, i64 112, !11, i64 120, !11, i64 136, !15, i64 152, !10, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !11, i64 208}
!14 = !{!"", !10, i64 0, !7, i64 8}
!15 = !{!"tag_____Tag__", !7, i64 0, !7, i64 8}
!16 = !{!6, !7, i64 32}
!17 = !{!18, !7, i64 0}
!18 = !{!"tag_____CommonTags__", !15, i64 0, !15, i64 16, !15, i64 32, !15, i64 48, !15, i64 64, !15, i64 80, !15, i64 96, !15, i64 112, !15, i64 128, !15, i64 144, !15, i64 160, !15, i64 176, !15, i64 192, !15, i64 208, !15, i64 224, !15, i64 240, !15, i64 256, !15, i64 272, !15, i64 288, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360, !7, i64 368, !7, i64 376}
!19 = !{!20, !7, i64 8}
!20 = !{!"tag_____IAllocator__", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!21 = !{!20, !7, i64 0}
!22 = !{!13, !7, i64 112}
!23 = !{!6, !7, i64 56}
!24 = !{!6, !7, i64 40}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SROAPass,TailCallElimPass