; LLVM IR from ponylang/ponyc :: src/libponyc/verify (control)

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

@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@__func__.verify_disposing_block = external hidden unnamed_addr constant [23 x i8], align 1

declare i32 @ast_id(ptr noundef) #0

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #0

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

declare void @ast_get_children(ptr noundef, i64 noundef, ptr noundef) #0

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

declare zeroext i1 @ast_canerror(ptr noundef) #0

declare void @ast_seterror(ptr noundef) #0

declare zeroext i1 @ast_cansend(ptr noundef) #0

declare void @ast_setsend(ptr noundef) #0

declare zeroext i1 @ast_mightsend(ptr noundef) #0

declare void @ast_setmightsend(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @verify_disposing_block(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [3 x ptr], align 16
  store ptr %0, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = call i32 @ast_id(ptr noundef %6)
  %8 = icmp eq i32 %7, 206
  br i1 %8, label %9, label %10

9:                                                ; preds = %1
  br label %11

10:                                               ; preds = %1
  call void @ponyint_assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i64 noundef 33, ptr noundef @__func__.verify_disposing_block)
  br label %11

11:                                               ; preds = %10, %9
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #3
  store ptr %3, ptr %5, align 8, !tbaa !5
  %12 = getelementptr inbounds ptr, ptr %5, i64 1
  store ptr %4, ptr %12, align 8, !tbaa !5
  %13 = getelementptr inbounds ptr, ptr %5, i64 2
  store ptr null, ptr %13, align 8, !tbaa !5
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds [3 x ptr], ptr %5, i64 0, i64 0
  call void @ast_get_children(ptr noundef %14, i64 noundef 2, ptr noundef %15)
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #3
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = call zeroext i1 @ast_canerror(ptr noundef %16)
  br i1 %17, label %18, label %20

18:                                               ; preds = %11
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  call void @ast_seterror(ptr noundef %19)
  br label %20

20:                                               ; preds = %18, %11
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = call zeroext i1 @ast_cansend(ptr noundef %21)
  br i1 %22, label %26, label %23

23:                                               ; preds = %20
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call zeroext i1 @ast_cansend(ptr noundef %24)
  br i1 %25, label %26, label %28

26:                                               ; preds = %23, %20
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  call void @ast_setsend(ptr noundef %27)
  br label %28

28:                                               ; preds = %26, %23
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = call zeroext i1 @ast_mightsend(ptr noundef %29)
  br i1 %30, label %34, label %31

31:                                               ; preds = %28
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = call zeroext i1 @ast_mightsend(ptr noundef %32)
  br i1 %33, label %34, label %36

34:                                               ; preds = %31, %28
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  call void @ast_setmightsend(ptr noundef %35)
  br label %36

36:                                               ; preds = %34, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret i1 true
}

attributes #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 #1 = { nocallback nofree nosync 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"}


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

@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@__func__.verify_disposing_block = external hidden unnamed_addr constant [23 x i8], align 1

declare i32 @ast_id(ptr noundef) local_unnamed_addr #0

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

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

declare void @ast_get_children(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

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

declare zeroext i1 @ast_canerror(ptr noundef) local_unnamed_addr #0

declare void @ast_seterror(ptr noundef) local_unnamed_addr #0

declare zeroext i1 @ast_cansend(ptr noundef) local_unnamed_addr #0

declare void @ast_setsend(ptr noundef) local_unnamed_addr #0

declare zeroext i1 @ast_mightsend(ptr noundef) local_unnamed_addr #0

declare void @ast_setmightsend(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @verify_disposing_block(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca [3 x ptr], align 16
  %5 = tail call i32 @ast_id(ptr noundef %0) #3
  %6 = icmp eq i32 %5, 206
  br i1 %6, label %8, label %7

7:                                                ; preds = %1
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i64 noundef 33, ptr noundef nonnull @__func__.verify_disposing_block) #3
  br label %8

8:                                                ; preds = %1, %7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #3
  store ptr %2, ptr %4, align 16, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr %3, ptr %9, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %4, i64 16
  store ptr null, ptr %10, align 16, !tbaa !5
  call void @ast_get_children(ptr noundef %0, i64 noundef 2, ptr noundef nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = call zeroext i1 @ast_canerror(ptr noundef %11) #3
  br i1 %12, label %13, label %14

13:                                               ; preds = %8
  call void @ast_seterror(ptr noundef %0) #3
  br label %14

14:                                               ; preds = %13, %8
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = call zeroext i1 @ast_cansend(ptr noundef %15) #3
  br i1 %16, label %20, label %17

17:                                               ; preds = %14
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = call zeroext i1 @ast_cansend(ptr noundef %18) #3
  br i1 %19, label %20, label %21

20:                                               ; preds = %17, %14
  call void @ast_setsend(ptr noundef %0) #3
  br label %21

21:                                               ; preds = %20, %17
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = call zeroext i1 @ast_mightsend(ptr noundef %22) #3
  br i1 %23, label %27, label %24

24:                                               ; preds = %21
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = call zeroext i1 @ast_mightsend(ptr noundef %25) #3
  br i1 %26, label %27, label %28

27:                                               ; preds = %24, %21
  call void @ast_setmightsend(ptr noundef %0) #3
  br label %28

28:                                               ; preds = %27, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret i1 true
}

attributes #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 #1 = { mustprogress nocallback nofree nosync 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"}


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