; LLVM IR from ponylang/ponyc :: src/libponyc/expr (reference)

; 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.pass_opt_t = type { i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i64, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.typecheck_t, ptr, ptr }
%struct.typecheck_t = type { ptr, %struct.typecheck_stats_t, ptr }
%struct.typecheck_stats_t = type { i64, i64, i64, i64 }
%struct.typecheck_frame_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [76 x i8], align 1

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

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

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

declare void @ast_error_frame(ptr noundef, ptr noundef, ptr noundef, ...) #1

declare void @errorframe_report(ptr noundef, ptr noundef) #1

declare void @ast_settype(ptr noundef, ptr noundef) #1

declare i32 @ast_id(ptr noundef) #1

declare ptr @ast_type(ptr noundef) #1

declare zeroext i1 @is_typecheck_error(ptr noundef) #1

declare ptr @ast_print_type(ptr noundef) #1

declare void @ast_free_unattached(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @expr_fieldref(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca [3 x ptr], align 16
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca [4 x ptr], align 16
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #3
  store ptr %10, ptr %12, align 8, !tbaa !5
  %26 = getelementptr inbounds ptr, ptr %12, i64 1
  store ptr %11, ptr %26, align 8, !tbaa !5
  %27 = getelementptr inbounds ptr, ptr %12, i64 2
  store ptr null, ptr %27, align 8, !tbaa !5
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds [3 x ptr], ptr %12, i64 0, i64 0
  call void @ast_get_children(ptr noundef %28, i64 noundef 2, ptr noundef %29)
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = call ptr @ast_type(ptr noundef %30)
  store ptr %31, ptr %13, align 8, !tbaa !5
  %32 = load ptr, ptr %13, align 8, !tbaa !5
  %33 = call zeroext i1 @is_typecheck_error(ptr noundef %32)
  br i1 %33, label %34, label %35

34:                                               ; preds = %4
  store i1 false, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %143

35:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #3
  store ptr %15, ptr %18, align 8, !tbaa !5
  %36 = getelementptr inbounds ptr, ptr %18, i64 1
  store ptr %16, ptr %36, align 8, !tbaa !5
  %37 = getelementptr inbounds ptr, ptr %18, i64 2
  store ptr %17, ptr %37, align 8, !tbaa !5
  %38 = getelementptr inbounds ptr, ptr %18, i64 3
  store ptr null, ptr %38, align 8, !tbaa !5
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = getelementptr inbounds [4 x ptr], ptr %18, i64 0, i64 0
  call void @ast_get_children(ptr noundef %39, i64 noundef 3, ptr noundef %40)
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #3
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = load ptr, ptr %16, align 8, !tbaa !5
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = call ptr @typeparam_current(ptr noundef %41, ptr noundef %42, ptr noundef %43)
  store ptr %44, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  %46 = load ptr, ptr %16, align 8, !tbaa !5
  %47 = call ptr @viewpoint_type(ptr noundef %45, ptr noundef %46)
  store ptr %47, ptr %19, align 8, !tbaa !5
  %48 = load ptr, ptr %19, align 8, !tbaa !5
  %49 = call i32 @ast_id(ptr noundef %48)
  %50 = icmp eq i32 %49, 17
  br i1 %50, label %51, label %69

51:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %52 = load ptr, ptr %19, align 8, !tbaa !5
  %53 = call ptr @viewpoint_upper(ptr noundef %52)
  store ptr %53, ptr %20, align 8, !tbaa !5
  %54 = load ptr, ptr %20, align 8, !tbaa !5
  %55 = icmp eq ptr %54, null
  br i1 %55, label %56, label %64

56:                                               ; preds = %51
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.pass_opt_t, ptr %57, i32 0, i32 36
  %59 = getelementptr inbounds %struct.typecheck_t, ptr %58, i32 0, i32 2
  %60 = load ptr, ptr %59, align 8, !tbaa !11
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load ptr, ptr %13, align 8, !tbaa !5
  %63 = call ptr @ast_print_type(ptr noundef %62)
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %60, ptr noundef %61, ptr noundef @.str.5, ptr noundef %63)
  store i1 false, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %66

64:                                               ; preds = %51
  %65 = load ptr, ptr %20, align 8, !tbaa !5
  call void @ast_free_unattached(ptr noundef %65)
  store i32 0, ptr %14, align 4
  br label %66

66:                                               ; preds = %64, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  %67 = load i32, ptr %14, align 4
  switch i32 %67, label %142 [
    i32 0, label %68
  ]

68:                                               ; preds = %66
  br label %69

69:                                               ; preds = %68, %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.pass_opt_t, ptr %70, i32 0, i32 36
  %72 = getelementptr inbounds %struct.typecheck_t, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !17
  %74 = getelementptr inbounds %struct.typecheck_frame_t, ptr %73, i32 0, i32 20
  %75 = load ptr, ptr %74, align 8, !tbaa !18
  store ptr %75, ptr %21, align 8, !tbaa !5
  %76 = load ptr, ptr %21, align 8, !tbaa !5
  %77 = icmp ne ptr %76, null
  br i1 %77, label %78, label %133

78:                                               ; preds = %69
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  %80 = load ptr, ptr %21, align 8, !tbaa !5
  %81 = call zeroext i1 @expr_contained_in_recover(ptr noundef %79, ptr noundef %80)
  br i1 %81, label %133, label %82

82:                                               ; preds = %78
  %83 = load ptr, ptr %19, align 8, !tbaa !5
  %84 = call zeroext i1 @sendable(ptr noundef %83)
  br i1 %84, label %95, label %85

85:                                               ; preds = %82
  %86 = load ptr, ptr %13, align 8, !tbaa !5
  %87 = call zeroext i1 @sendable(ptr noundef %86)
  br i1 %87, label %94, label %88

88:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  store ptr null, ptr %22, align 8, !tbaa !5
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %22, ptr noundef %89, ptr noundef @.str.6)
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.pass_opt_t, ptr %90, i32 0, i32 36
  %92 = getelementptr inbounds %struct.typecheck_t, ptr %91, i32 0, i32 2
  %93 = load ptr, ptr %92, align 8, !tbaa !11
  call void @errorframe_report(ptr noundef %22, ptr noundef %93)
  store i1 false, ptr %5, align 1
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  br label %141

94:                                               ; preds = %85
  br label %132

95:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = call ptr @ast_parent(ptr noundef %96)
  store ptr %97, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %98, ptr %24, align 8, !tbaa !5
  br label %99

99:                                               ; preds = %109, %95
  %100 = load ptr, ptr %23, align 8, !tbaa !5
  %101 = call i32 @ast_id(ptr noundef %100)
  %102 = icmp ne i32 %101, 107
  br i1 %102, label %103, label %107

103:                                              ; preds = %99
  %104 = load ptr, ptr %23, align 8, !tbaa !5
  %105 = call i32 @ast_id(ptr noundef %104)
  %106 = icmp ne i32 %105, 24
  br label %107

107:                                              ; preds = %103, %99
  %108 = phi i1 [ false, %99 ], [ %106, %103 ]
  br i1 %108, label %109, label %113

109:                                              ; preds = %107
  %110 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %110, ptr %24, align 8, !tbaa !5
  %111 = load ptr, ptr %23, align 8, !tbaa !5
  %112 = call ptr @ast_parent(ptr noundef %111)
  store ptr %112, ptr %23, align 8, !tbaa !5
  br label %99, !llvm.loop !20

113:                                              ; preds = %107
  %114 = load ptr, ptr %23, align 8, !tbaa !5
  %115 = call i32 @ast_id(ptr noundef %114)
  %116 = icmp eq i32 %115, 24
  br i1 %116, label %117, label %128

117:                                              ; preds = %113
  %118 = load ptr, ptr %23, align 8, !tbaa !5
  %119 = call ptr @ast_childidx(ptr noundef %118, i64 noundef 1)
  %120 = load ptr, ptr %24, align 8, !tbaa !5
  %121 = icmp ne ptr %119, %120
  br i1 %121, label %122, label %128

122:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  store ptr null, ptr %25, align 8, !tbaa !5
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %25, ptr noundef %123, ptr noundef @.str.7)
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.pass_opt_t, ptr %124, i32 0, i32 36
  %126 = getelementptr inbounds %struct.typecheck_t, ptr %125, i32 0, i32 2
  %127 = load ptr, ptr %126, align 8, !tbaa !11
  call void @errorframe_report(ptr noundef %25, ptr noundef %127)
  store i1 false, ptr %5, align 1
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  br label %129

128:                                              ; preds = %117, %113
  store i32 0, ptr %14, align 4
  br label %129

129:                                              ; preds = %128, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  %130 = load i32, ptr %14, align 4
  switch i32 %130, label %141 [
    i32 0, label %131
  ]

131:                                              ; preds = %129
  br label %132

132:                                              ; preds = %131, %94
  br label %133

133:                                              ; preds = %132, %78, %69
  %134 = load ptr, ptr %11, align 8, !tbaa !5
  %135 = load ptr, ptr %16, align 8, !tbaa !5
  call void @ast_settype(ptr noundef %134, ptr noundef %135)
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = load i32, ptr %9, align 4, !tbaa !9
  %138 = call ptr @ast_setid(ptr noundef %136, i32 noundef %137)
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = load ptr, ptr %19, align 8, !tbaa !5
  call void @ast_settype(ptr noundef %139, ptr noundef %140)
  store i1 true, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %141

141:                                              ; preds = %133, %129, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  br label %142

142:                                              ; preds = %141, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  br label %143

143:                                              ; preds = %142, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %144 = load i1, ptr %5, align 1
  ret i1 %144
}

declare ptr @typeparam_current(ptr noundef, ptr noundef, ptr noundef) #1

declare ptr @viewpoint_type(ptr noundef, ptr noundef) #1

declare ptr @viewpoint_upper(ptr noundef) #1

declare void @ast_error(ptr noundef, ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @expr_contained_in_recover(ptr noundef, ptr noundef) #2

declare zeroext i1 @sendable(ptr noundef) #1

declare ptr @ast_parent(ptr noundef) #1

declare ptr @ast_childidx(ptr noundef, i64 noundef) #1

declare ptr @ast_setid(ptr noundef, i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 216}
!12 = !{!"pass_opt_t", !10, i64 0, !10, i64 4, !13, i64 8, !13, i64 9, !13, i64 10, !13, i64 11, !13, i64 12, !13, i64 13, !13, i64 14, !13, i64 15, !13, i64 16, !13, i64 17, !13, i64 18, !13, i64 19, !13, i64 20, !13, i64 21, !10, i64 24, !14, i64 32, !13, i64 40, !13, i64 41, !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, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !15, i64 176, !6, i64 224, !6, i64 232}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"typecheck_t", !6, i64 0, !16, i64 8, !6, i64 40}
!16 = !{!"typecheck_stats_t", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!17 = !{!12, !6, i64 176}
!18 = !{!19, !6, i64 160}
!19 = !{!"typecheck_frame_t", !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, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200}
!20 = distinct !{!20, !21}
!21 = !{!"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"

@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [76 x i8], align 1

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

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

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

declare void @ast_error_frame(ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #1

declare void @errorframe_report(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @ast_settype(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @ast_id(ptr noundef) local_unnamed_addr #1

declare ptr @ast_type(ptr noundef) local_unnamed_addr #1

declare zeroext i1 @is_typecheck_error(ptr noundef) local_unnamed_addr #1

declare ptr @ast_print_type(ptr noundef) local_unnamed_addr #1

declare void @ast_free_unattached(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @expr_fieldref(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [3 x ptr], align 16
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca [4 x ptr], align 16
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #3
  store ptr %5, ptr %7, align 16, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %7, i64 8
  store ptr %6, ptr %14, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %7, i64 16
  store ptr null, ptr %15, align 16, !tbaa !5
  call void @ast_get_children(ptr noundef %1, i64 noundef 2, ptr noundef nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #3
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = call ptr @ast_type(ptr noundef %16) #3
  %18 = call zeroext i1 @is_typecheck_error(ptr noundef %17) #3
  br i1 %18, label %67, label %19

19:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #3
  store ptr %8, ptr %11, align 16, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %11, i64 8
  store ptr %9, ptr %20, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %11, i64 16
  store ptr %10, ptr %21, align 16, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %11, i64 24
  store ptr null, ptr %22, align 8, !tbaa !5
  call void @ast_get_children(ptr noundef %2, i64 noundef 3, ptr noundef nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #3
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = call ptr @typeparam_current(ptr noundef %0, ptr noundef %23, ptr noundef %1) #3
  store ptr %24, ptr %9, align 8, !tbaa !5
  %25 = call ptr @viewpoint_type(ptr noundef %17, ptr noundef %24) #3
  %26 = call i32 @ast_id(ptr noundef %25) #3
  %27 = icmp eq i32 %26, 17
  br i1 %27, label %28, label %34

28:                                               ; preds = %19
  %29 = call ptr @viewpoint_upper(ptr noundef %25) #3
  %.not = icmp eq ptr %29, null
  br i1 %.not, label %.thread, label %33

.thread:                                          ; preds = %28
  %30 = getelementptr inbounds i8, ptr %0, i64 216
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = call ptr @ast_print_type(ptr noundef %17) #3
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %31, ptr noundef %1, ptr noundef nonnull @.str.5, ptr noundef %32) #3
  br label %66

33:                                               ; preds = %28
  call void @ast_free_unattached(ptr noundef nonnull %29) #3
  br label %34

34:                                               ; preds = %33, %19
  %35 = getelementptr inbounds i8, ptr %0, i64 176
  %36 = load ptr, ptr %35, align 8, !tbaa !16
  %37 = getelementptr inbounds i8, ptr %36, i64 160
  %38 = load ptr, ptr %37, align 8, !tbaa !17
  %.not44 = icmp eq ptr %38, null
  br i1 %.not44, label %62, label %39

39:                                               ; preds = %34
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = call zeroext i1 @expr_contained_in_recover(ptr noundef %40, ptr noundef nonnull %38)
  br i1 %41, label %62, label %42

42:                                               ; preds = %39
  %43 = call zeroext i1 @sendable(ptr noundef %25) #3
  br i1 %43, label %49, label %44

44:                                               ; preds = %42
  %45 = call zeroext i1 @sendable(ptr noundef %17) #3
  br i1 %45, label %62, label %46

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #3
  store ptr null, ptr %12, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %12, ptr noundef %1, ptr noundef nonnull @.str.6) #3
  %47 = getelementptr inbounds i8, ptr %0, i64 216
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  call void @errorframe_report(ptr noundef nonnull %12, ptr noundef %48) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #3
  br label %66

49:                                               ; preds = %42
  %50 = call ptr @ast_parent(ptr noundef %1) #3
  %51 = call i32 @ast_id(ptr noundef %50) #3
  %.not4550 = icmp eq i32 %51, 107
  br i1 %.not4550, label %.critedge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %49
  %52 = call i32 @ast_id(ptr noundef %50) #3
  %.not4657 = icmp eq i32 %52, 24
  br i1 %.not4657, label %.critedge, label %.lr.ph59

.lr.ph:                                           ; preds = %.lr.ph59
  %53 = call i32 @ast_id(ptr noundef %54) #3
  %.not46 = icmp eq i32 %53, 24
  br i1 %.not46, label %.critedge, label %.lr.ph59, !llvm.loop !19

.lr.ph59:                                         ; preds = %.lr.ph.preheader, %.lr.ph
  %.0385158 = phi ptr [ %54, %.lr.ph ], [ %50, %.lr.ph.preheader ]
  %54 = call ptr @ast_parent(ptr noundef %.0385158) #3
  %55 = call i32 @ast_id(ptr noundef %54) #3
  %.not45 = icmp eq i32 %55, 107
  br i1 %.not45, label %.critedge, label %.lr.ph, !llvm.loop !19

.critedge:                                        ; preds = %.lr.ph59, %.lr.ph, %.lr.ph.preheader, %49
  %.038.lcssa = phi ptr [ %50, %49 ], [ %50, %.lr.ph.preheader ], [ %54, %.lr.ph ], [ %54, %.lr.ph59 ]
  %.0.lcssa = phi ptr [ %1, %49 ], [ %1, %.lr.ph.preheader ], [ %.0385158, %.lr.ph ], [ %.0385158, %.lr.ph59 ]
  %56 = call i32 @ast_id(ptr noundef %.038.lcssa) #3
  %57 = icmp eq i32 %56, 24
  br i1 %57, label %58, label %62

58:                                               ; preds = %.critedge
  %59 = call ptr @ast_childidx(ptr noundef %.038.lcssa, i64 noundef 1) #3
  %.not47 = icmp eq ptr %59, %.0.lcssa
  br i1 %.not47, label %62, label %.critedge49

.critedge49:                                      ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #3
  store ptr null, ptr %13, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %13, ptr noundef %1, ptr noundef nonnull @.str.7) #3
  %60 = getelementptr inbounds i8, ptr %0, i64 216
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  call void @errorframe_report(ptr noundef nonnull %13, ptr noundef %61) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  br label %66

62:                                               ; preds = %58, %.critedge, %44, %39, %34
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ast_settype(ptr noundef %63, ptr noundef %64) #3
  %65 = call ptr @ast_setid(ptr noundef %1, i32 noundef %3) #3
  call void @ast_settype(ptr noundef %1, ptr noundef %25) #3
  br label %66

66:                                               ; preds = %.thread, %46, %62, %.critedge49
  %.4 = phi i1 [ true, %62 ], [ false, %46 ], [ false, %.critedge49 ], [ false, %.thread ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  br label %67

67:                                               ; preds = %4, %66
  %.5 = phi i1 [ %.4, %66 ], [ false, %4 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  ret i1 %.5
}

declare ptr @typeparam_current(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @viewpoint_type(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @viewpoint_upper(ptr noundef) local_unnamed_addr #1

declare void @ast_error(ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @expr_contained_in_recover(ptr noundef, ptr noundef) local_unnamed_addr #2

declare zeroext i1 @sendable(ptr noundef) local_unnamed_addr #1

declare ptr @ast_parent(ptr noundef) local_unnamed_addr #1

declare ptr @ast_childidx(ptr noundef, i64 noundef) local_unnamed_addr #1

declare ptr @ast_setid(ptr noundef, i32 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 216}
!10 = !{!"pass_opt_t", !11, i64 0, !11, i64 4, !12, i64 8, !12, i64 9, !12, i64 10, !12, i64 11, !12, i64 12, !12, i64 13, !12, i64 14, !12, i64 15, !12, i64 16, !12, i64 17, !12, i64 18, !12, i64 19, !12, i64 20, !12, i64 21, !11, i64 24, !13, i64 32, !12, i64 40, !12, i64 41, !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, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !14, i64 176, !6, i64 224, !6, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"typecheck_t", !6, i64 0, !15, i64 8, !6, i64 40}
!15 = !{!"typecheck_stats_t", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!16 = !{!10, !6, i64 176}
!17 = !{!18, !6, i64 160}
!18 = !{!"typecheck_frame_t", !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, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass