; LLVM IR from nickmqb/muon :: bootstrap/mu.ll_TypeChecker (checkAbandon__)

; 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_____Tag__ = type { ptr, ptr }
%struct.tag_____CallExpression__ = type { %struct.Node__, ptr, ptr, ptr, ptr, ptr }
%struct.Node__ = type { i32, ptr }
%struct.tag_____List__Node____ = type { ptr, i32, i32 }
%struct.tag_____TypeCheckerContext__ = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, i32, i8 }
%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 }

; 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: 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) #1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @TypeChecker__checkRemainingArgs__(ptr noundef, ptr noundef, i32 noundef, i8 noundef zeroext) #2

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

; Function Attrs: nounwind uwtable
define dso_local { ptr, ptr } @TypeChecker__checkAbandon__(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca %struct.tag_____Tag__, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.tag_____Tag__, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %7 = load ptr, ptr %5, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.tag_____CallExpression__, ptr %7, i32 0, i32 2
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = getelementptr inbounds %struct.tag_____List__Node____, ptr %9, i32 0, i32 1
  %11 = load i32, ptr %10, align 8, !tbaa !13
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %18

13:                                               ; preds = %2
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %14, i32 0, i32 4
  %16 = load ptr, ptr %15, align 8, !tbaa !15
  %17 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %16, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %17, i64 16, i1 false), !tbaa.struct !17
  br label %41

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #3
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %21, i32 0, i32 4
  %23 = load ptr, ptr %22, align 8, !tbaa !15
  %24 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %23, i32 0, i32 5
  %25 = getelementptr inbounds { ptr, ptr }, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8
  %27 = getelementptr inbounds { ptr, ptr }, ptr %24, i32 0, i32 1
  %28 = load ptr, ptr %27, align 8
  %29 = call { ptr, ptr } @TypeChecker__getArgOfType__(ptr noundef %19, ptr noundef %20, i32 noundef 0, ptr %26, ptr %28)
  %30 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 0
  %31 = extractvalue { ptr, ptr } %29, 0
  store ptr %31, ptr %30, align 8
  %32 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 1
  %33 = extractvalue { ptr, ptr } %29, 1
  store ptr %33, ptr %32, align 8
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = call zeroext i8 @TypeChecker__checkRemainingArgs__(ptr noundef %34, ptr noundef %35, i32 noundef 1, i8 noundef zeroext 0)
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %37, i32 0, i32 4
  %39 = load ptr, ptr %38, align 8, !tbaa !15
  %40 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %39, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %40, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #3
  br label %41

41:                                               ; preds = %18, %13
  %42 = load { ptr, ptr }, ptr %3, align 8
  ret { ptr, ptr } %42
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"tag_____CallExpression__", !11, i64 0, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!11 = !{!"", !12, i64 0, !6, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"tag_____List__Node____", !6, i64 0, !12, i64 8, !12, i64 12}
!15 = !{!16, !6, i64 32}
!16 = !{!"tag_____TypeCheckerContext__", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !12, i64 120, !12, i64 124, !6, i64 128, !12, i64 136, !7, i64 140}
!17 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}


; 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"

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @TypeChecker__checkRemainingArgs__(ptr noundef, ptr noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local { ptr, ptr } @TypeChecker__checkAbandon__(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 24
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 8
  %6 = load i32, ptr %5, align 8, !tbaa !12
  %7 = icmp eq i32 %6, 0
  %8 = getelementptr inbounds i8, ptr %0, i64 32
  br i1 %7, label %17, label %9

9:                                                ; preds = %2
  %10 = load ptr, ptr %8, align 8, !tbaa !14
  %11 = getelementptr inbounds i8, ptr %10, i64 80
  %12 = load ptr, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr %10, i64 88
  %14 = load ptr, ptr %13, align 8
  %15 = tail call { ptr, ptr } @TypeChecker__getArgOfType__(ptr noundef %0, ptr noundef nonnull %1, i32 noundef 0, ptr %12, ptr %14)
  %16 = tail call zeroext i8 @TypeChecker__checkRemainingArgs__(ptr noundef %0, ptr noundef nonnull %1, i32 noundef 1, i8 noundef zeroext 0)
  br label %17

17:                                               ; preds = %2, %9
  %.sroa.08.0.in = load ptr, ptr %8, align 8, !tbaa !14
  %.sroa.310.0.in = getelementptr inbounds i8, ptr %.sroa.08.0.in, i64 8
  %.sroa.310.0 = load ptr, ptr %.sroa.310.0.in, align 8, !tbaa !16
  %.sroa.08.0 = load ptr, ptr %.sroa.08.0.in, align 8, !tbaa !16
  %.fca.0.insert = insertvalue { ptr, ptr } poison, ptr %.sroa.08.0, 0
  %.fca.1.insert = insertvalue { ptr, ptr } %.fca.0.insert, ptr %.sroa.310.0, 1
  ret { ptr, ptr } %.fca.1.insert
}

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_____CallExpression__", !7, i64 0, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48}
!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__Node____", !11, i64 0, !8, i64 8, !8, i64 12}
!14 = !{!15, !11, i64 32}
!15 = !{!"tag_____TypeCheckerContext__", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !8, i64 120, !8, i64 124, !11, i64 128, !8, i64 136, !9, i64 140}
!16 = !{!11, !11, i64 0}


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