; LLVM IR from nickmqb/muon :: bootstrap/mu.ll_Interpreter (evalCallExpression__)

; 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.tag_____NodeInfo__ = type { %struct.tag_____Tag__, %struct.Node__ }
%struct.tag_____Tag__ = type { ptr, ptr }
%struct.Node__ = type { i32, ptr }
%struct.tag_____EvalResult__ = type { %struct.tag_____Tag__, i64, i32 }
%struct.tag_____CallExpression__ = type { %struct.Node__, ptr, ptr, ptr, ptr, ptr }
%struct.tag_____TypeArgsExpression__ = type { %struct.Node__, ptr, ptr, 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.string__ = type { ptr, i32 }
%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__ }

@top_____abandonFn__ = external dso_local thread_local global ptr, 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 @Map__get__Node__NodeInfo____(ptr dead_on_unwind noalias writable sret(%struct.tag_____NodeInfo__) align 8, ptr noundef, i32, ptr) #4

; Function Attrs: nounwind uwtable
define dso_local void @Interpreter__evalCallExpression__(ptr dead_on_unwind noalias writable sret(%struct.tag_____EvalResult__) align 8 %0, ptr noundef %1, ptr noundef %2) #4 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.Node__, align 8
  %7 = alloca %struct.Node__, align 8
  %8 = alloca %struct.tag_____NodeInfo__, align 8
  %9 = alloca i32, align 4
  %10 = alloca %struct.Node__, align 8
  %11 = alloca ptr, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  store ptr %2, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #5
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.tag_____CallExpression__, ptr %12, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %13, i64 16, i1 false), !tbaa.struct !9
  %14 = getelementptr inbounds %struct.Node__, ptr %6, i32 0, i32 0
  %15 = load i32, ptr %14, align 8, !tbaa !12
  %16 = icmp eq i32 %15, 4
  br i1 %16, label %17, label %28

17:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %6, i64 16, i1 false), !tbaa.struct !9
  %18 = getelementptr inbounds %struct.Node__, ptr %7, i32 0, i32 0
  %19 = load i32, ptr %18, align 8, !tbaa !12
  %20 = icmp eq i32 %19, 4
  br i1 %20, label %24, label %21

21:                                               ; preds = %17
  %22 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  call void %23(i32 noundef -4)
  br label %24

24:                                               ; preds = %21, %17
  %25 = getelementptr inbounds %struct.Node__, ptr %7, i32 0, i32 1
  %26 = load ptr, ptr %25, align 8, !tbaa !14
  %27 = getelementptr inbounds %struct.tag_____TypeArgsExpression__, ptr %26, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %27, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  br label %28

28:                                               ; preds = %24, %3
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #5
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.tag_____GenerateContext__, ptr %29, i32 0, i32 10
  %31 = load ptr, ptr %30, align 8, !tbaa !15
  %32 = getelementptr inbounds { i32, ptr }, ptr %6, i32 0, i32 0
  %33 = load i32, ptr %32, align 8
  %34 = getelementptr inbounds { i32, ptr }, ptr %6, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8
  call void @Map__get__Node__NodeInfo____(ptr dead_on_unwind writable sret(%struct.tag_____NodeInfo__) align 8 %8, ptr noundef %31, i32 %33, ptr %35)
  %36 = getelementptr inbounds %struct.tag_____NodeInfo__, ptr %8, i32 0, i32 1
  %37 = getelementptr inbounds %struct.Node__, ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 8, !tbaa !18
  %39 = icmp eq i32 %38, 34
  br i1 %39, label %42, label %40

40:                                               ; preds = %28
  call void @llvm.memset.p0.i64(ptr align 8 %0, i8 0, i64 32, i1 false)
  %41 = getelementptr inbounds %struct.tag_____EvalResult__, ptr %0, i32 0, i32 2
  store i32 2, ptr %41, align 8, !tbaa !21
  store i32 1, ptr %9, align 4
  br label %63

42:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  %43 = getelementptr inbounds %struct.tag_____NodeInfo__, ptr %8, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %43, i64 16, i1 false), !tbaa.struct !9
  %44 = getelementptr inbounds %struct.Node__, ptr %10, i32 0, i32 0
  %45 = load i32, ptr %44, align 8, !tbaa !12
  %46 = icmp eq i32 %45, 34
  br i1 %46, label %50, label %47

47:                                               ; preds = %42
  %48 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  call void %49(i32 noundef -4)
  br label %50

50:                                               ; preds = %47, %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %51 = getelementptr inbounds %struct.Node__, ptr %10, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  store ptr %52, ptr %11, align 8, !tbaa !5
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %53, i32 0, i32 17
  %55 = load i32, ptr %54, align 8, !tbaa !24
  %56 = icmp eq i32 %55, 4
  br i1 %56, label %57, label %60

57:                                               ; preds = %50
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Interpreter__evalCast__(ptr dead_on_unwind writable sret(%struct.tag_____EvalResult__) align 8 %0, ptr noundef %58, ptr noundef %59)
  store i32 1, ptr %9, align 4
  br label %62

60:                                               ; preds = %50
  call void @llvm.memset.p0.i64(ptr align 8 %0, i8 0, i64 32, i1 false)
  %61 = getelementptr inbounds %struct.tag_____EvalResult__, ptr %0, i32 0, i32 2
  store i32 2, ptr %61, align 8, !tbaa !21
  store i32 1, ptr %9, align 4
  br label %62

62:                                               ; preds = %60, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %63

63:                                               ; preds = %62, %40
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #5
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @Interpreter__evalCast__(ptr dead_on_unwind noalias writable sret(%struct.tag_____EvalResult__) align 8, ptr noundef, 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 = !{i64 0, i64 4, !10, i64 8, i64 8, !5}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"", !11, i64 0, !6, i64 8}
!14 = !{!13, !6, i64 8}
!15 = !{!16, !6, i64 72}
!16 = !{!"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, !17, i64 80, !11, i64 96, !17, i64 104, !11, i64 120, !6, i64 128, !6, i64 136, !7, i64 144}
!17 = !{!"", !6, i64 0, !11, i64 8}
!18 = !{!19, !11, i64 16}
!19 = !{!"tag_____NodeInfo__", !20, i64 0, !13, i64 16}
!20 = !{!"tag_____Tag__", !6, i64 0, !6, i64 8}
!21 = !{!22, !11, i64 24}
!22 = !{!"tag_____EvalResult__", !20, i64 0, !23, i64 16, !11, i64 24}
!23 = !{!"long", !7, i64 0}
!24 = !{!25, !11, i64 168}
!25 = !{!"tag_____FunctionDef__", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !13, i64 56, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !11, i64 104, !6, i64 112, !17, i64 120, !17, i64 136, !20, i64 152, !11, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !17, i64 208}


; 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.tag_____NodeInfo__ = type { %struct.tag_____Tag__, %struct.Node__ }
%struct.tag_____Tag__ = type { ptr, ptr }
%struct.Node__ = type { i32, ptr }
%struct.tag_____EvalResult__ = type { %struct.tag_____Tag__, i64, i32 }

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 @Map__get__Node__NodeInfo____(ptr dead_on_unwind noalias writable sret(%struct.tag_____NodeInfo__) align 8, ptr noundef, i32, ptr) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @Interpreter__evalCallExpression__(ptr dead_on_unwind noalias writable sret(%struct.tag_____EvalResult__) align 8 %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca %struct.tag_____NodeInfo__, align 8
  %.sroa.05.0.copyload = load i32, ptr %2, align 8, !tbaa !5
  %.sroa.8.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 8
  %.sroa.8.0.copyload = load ptr, ptr %.sroa.8.0..sroa_idx, align 8, !tbaa !9
  %5 = icmp eq i32 %.sroa.05.0.copyload, 4
  br i1 %5, label %6, label %7

6:                                                ; preds = %3
  %.sroa.05.0.copyload7 = load i32, ptr %.sroa.8.0.copyload, align 8, !tbaa !5
  %.sroa.8.0..sroa_idx10 = getelementptr inbounds i8, ptr %.sroa.8.0.copyload, i64 8
  %.sroa.8.0.copyload11 = load ptr, ptr %.sroa.8.0..sroa_idx10, align 8, !tbaa !9
  br label %7

7:                                                ; preds = %6, %3
  %.sroa.05.0 = phi i32 [ %.sroa.05.0.copyload7, %6 ], [ %.sroa.05.0.copyload, %3 ]
  %.sroa.8.0 = phi ptr [ %.sroa.8.0.copyload11, %6 ], [ %.sroa.8.0.copyload, %3 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #3
  %8 = getelementptr inbounds i8, ptr %1, i64 72
  %9 = load ptr, ptr %8, align 8, !tbaa !11
  call void @Map__get__Node__NodeInfo____(ptr dead_on_unwind nonnull writable sret(%struct.tag_____NodeInfo__) align 8 %4, ptr noundef %9, i32 %.sroa.05.0, ptr %.sroa.8.0)
  %10 = getelementptr inbounds i8, ptr %4, i64 16
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %12 = icmp eq i32 %11, 34
  br i1 %12, label %15, label %13

13:                                               ; preds = %7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 0, i64 32, i1 false)
  %14 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 2, ptr %14, align 8, !tbaa !14
  br label %22

15:                                               ; preds = %7
  %.sroa.41.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 24
  %.sroa.41.0.copyload = load ptr, ptr %.sroa.41.0..sroa_idx, align 8, !tbaa !9
  %16 = getelementptr inbounds i8, ptr %.sroa.41.0.copyload, i64 168
  %17 = load i32, ptr %16, align 8, !tbaa !18
  %18 = icmp eq i32 %17, 4
  br i1 %18, label %19, label %20

19:                                               ; preds = %15
  call void @Interpreter__evalCast__(ptr dead_on_unwind writable sret(%struct.tag_____EvalResult__) align 8 %0, ptr noundef nonnull %1, ptr noundef nonnull %2)
  br label %22

20:                                               ; preds = %15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 0, i64 32, i1 false)
  %21 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 2, ptr %21, align 8, !tbaa !14
  br label %22

22:                                               ; preds = %19, %20, %13
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #3
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @Interpreter__evalCast__(ptr dead_on_unwind noalias writable sret(%struct.tag_____EvalResult__) align 8, ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 72}
!12 = !{!"tag_____GenerateContext__", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !6, i64 48, !6, i64 52, !10, i64 56, !10, i64 64, !10, i64 72, !13, i64 80, !6, i64 96, !13, i64 104, !6, i64 120, !10, i64 128, !10, i64 136, !7, i64 144}
!13 = !{!"", !10, i64 0, !6, i64 8}
!14 = !{!15, !6, i64 24}
!15 = !{!"tag_____EvalResult__", !16, i64 0, !17, i64 16, !6, i64 24}
!16 = !{!"tag_____Tag__", !10, i64 0, !10, i64 8}
!17 = !{!"long", !7, i64 0}
!18 = !{!19, !6, i64 168}
!19 = !{!"tag_____FunctionDef__", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !20, i64 56, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !6, i64 104, !10, i64 112, !13, i64 120, !13, i64 136, !16, i64 152, !6, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !13, i64 208}
!20 = !{!"", !6, i64 0, !10, i64 8}


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