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

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

@.str.1 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@__func__.literal_member_access = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [38 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 ptr @ast_setdata(ptr 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 zeroext i1 @is_typecheck_error(ptr noundef) #1

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

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

declare i32 @ast_id(ptr noundef) #1

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

declare ptr @ast_type(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @literal_member_access(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca [3 x ptr], align 16
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %2
  br label %18

17:                                               ; preds = %2
  call void @ponyint_assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i64 noundef 884, ptr noundef @__func__.literal_member_access)
  br label %18

18:                                               ; preds = %17, %16
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = call i32 @ast_id(ptr noundef %19)
  %21 = icmp eq i32 %20, 19
  br i1 %21, label %30, label %22

22:                                               ; preds = %18
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = call i32 @ast_id(ptr noundef %23)
  %25 = icmp eq i32 %24, 20
  br i1 %25, label %30, label %26

26:                                               ; preds = %22
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = call i32 @ast_id(ptr noundef %27)
  %29 = icmp eq i32 %28, 21
  br i1 %29, label %30, label %31

30:                                               ; preds = %26, %22, %18
  br label %32

31:                                               ; preds = %26
  call void @ponyint_assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i64 noundef 886, ptr noundef @__func__.literal_member_access)
  br label %32

32:                                               ; preds = %31, %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #3
  store ptr %6, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds ptr, ptr %8, i64 1
  store ptr %7, ptr %33, align 8, !tbaa !5
  %34 = getelementptr inbounds ptr, ptr %8, i64 2
  store ptr null, ptr %34, align 8, !tbaa !5
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds [3 x ptr], ptr %8, i64 0, i64 0
  call void @ast_get_children(ptr noundef %35, i64 noundef 2, ptr noundef %36)
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #3
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = call zeroext i1 @unify(ptr noundef %37, ptr noundef %38, i1 noundef zeroext true)
  br i1 %39, label %41, label %40

40:                                               ; preds = %32
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %87

41:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = call ptr @ast_type(ptr noundef %42)
  store ptr %43, ptr %10, align 8, !tbaa !5
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = call zeroext i1 @is_typecheck_error(ptr noundef %44)
  br i1 %45, label %46, label %47

46:                                               ; preds = %41
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %86

47:                                               ; preds = %41
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = call i32 @ast_id(ptr noundef %48)
  %50 = icmp ne i32 %49, 159
  br i1 %50, label %51, label %52

51:                                               ; preds = %47
  store i1 true, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %86

52:                                               ; preds = %47
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = call i32 @ast_id(ptr noundef %53)
  %55 = icmp eq i32 %54, 8
  br i1 %55, label %56, label %57

56:                                               ; preds = %52
  br label %58

57:                                               ; preds = %52
  call void @ponyint_assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i64 noundef 903, ptr noundef @__func__.literal_member_access)
  br label %58

58:                                               ; preds = %57, %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = call ptr @ast_name(ptr noundef %59)
  store ptr %60, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = call ptr @lookup_literal_op(ptr noundef %61)
  store ptr %62, ptr %12, align 8, !tbaa !5
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = icmp eq ptr %63, null
  br i1 %64, label %70, label %65

65:                                               ; preds = %58
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = call ptr @ast_parent(ptr noundef %66)
  %68 = call i32 @ast_id(ptr noundef %67)
  %69 = icmp ne i32 %68, 177
  br i1 %69, label %70, label %77

70:                                               ; preds = %65, %58
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.pass_opt_t, ptr %71, i32 0, i32 36
  %73 = getelementptr inbounds %struct.typecheck_t, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %74, ptr noundef %75, ptr noundef @.str.6, ptr noundef %76)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %85

77:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = call ptr @ast_from(ptr noundef %78, i32 noundef 161)
  store ptr %79, ptr %13, align 8, !tbaa !5
  %80 = load ptr, ptr %13, align 8, !tbaa !5
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = call ptr @ast_setdata(ptr noundef %80, ptr noundef %81)
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  call void @ast_settype(ptr noundef %83, ptr noundef %84)
  store i1 true, ptr %3, align 1
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %85

85:                                               ; preds = %77, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %86

86:                                               ; preds = %85, %51, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %87

87:                                               ; preds = %86, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %88 = load i1, ptr %3, align 1
  ret i1 %88
}

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

declare ptr @ast_name(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @lookup_literal_op(ptr noundef) #2

declare ptr @ast_parent(ptr noundef) #1

declare void @ast_error(ptr noundef, ptr noundef, ptr 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, !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}


; 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 [76 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@__func__.literal_member_access = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [38 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 ptr @ast_setdata(ptr 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 zeroext i1 @is_typecheck_error(ptr noundef) local_unnamed_addr #1

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

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

declare i32 @ast_id(ptr noundef) local_unnamed_addr #1

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

declare ptr @ast_type(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @literal_member_access(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [3 x ptr], align 16
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %6, label %7

6:                                                ; preds = %2
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i64 noundef 884, ptr noundef nonnull @__func__.literal_member_access) #3
  br label %7

7:                                                ; preds = %2, %6
  %8 = tail call i32 @ast_id(ptr noundef %0) #3
  %9 = icmp eq i32 %8, 19
  br i1 %9, label %17, label %10

10:                                               ; preds = %7
  %11 = tail call i32 @ast_id(ptr noundef %0) #3
  %12 = icmp eq i32 %11, 20
  br i1 %12, label %17, label %13

13:                                               ; preds = %10
  %14 = tail call i32 @ast_id(ptr noundef %0) #3
  %15 = icmp eq i32 %14, 21
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i64 noundef 886, ptr noundef nonnull @__func__.literal_member_access) #3
  br label %17

17:                                               ; preds = %7, %10, %13, %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  store ptr %3, ptr %5, align 16, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %4, ptr %18, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %5, i64 16
  store ptr null, ptr %19, align 16, !tbaa !5
  call void @ast_get_children(ptr noundef %0, i64 noundef 2, ptr noundef nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = call zeroext i1 @unify(ptr noundef %20, ptr noundef %1, i1 noundef zeroext true)
  br i1 %21, label %22, label %47

22:                                               ; preds = %17
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = call ptr @ast_type(ptr noundef %23) #3
  %25 = call zeroext i1 @is_typecheck_error(ptr noundef %24) #3
  br i1 %25, label %47, label %26

26:                                               ; preds = %22
  %27 = call i32 @ast_id(ptr noundef %24) #3
  %.not21 = icmp eq i32 %27, 159
  br i1 %.not21, label %28, label %47

28:                                               ; preds = %26
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = call i32 @ast_id(ptr noundef %29) #3
  %31 = icmp eq i32 %30, 8
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @ponyint_assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i64 noundef 903, ptr noundef nonnull @__func__.literal_member_access) #3
  br label %33

33:                                               ; preds = %28, %32
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = call ptr @ast_name(ptr noundef %34) #3
  %36 = call ptr @lookup_literal_op(ptr noundef %35)
  %37 = icmp eq ptr %36, null
  br i1 %37, label %41, label %38

38:                                               ; preds = %33
  %39 = call ptr @ast_parent(ptr noundef %0) #3
  %40 = call i32 @ast_id(ptr noundef %39) #3
  %.not22 = icmp eq i32 %40, 177
  br i1 %.not22, label %44, label %41

41:                                               ; preds = %38, %33
  %42 = getelementptr inbounds i8, ptr %1, i64 216
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %43, ptr noundef %0, ptr noundef nonnull @.str.6, ptr noundef %35) #3
  br label %47

44:                                               ; preds = %38
  %45 = call ptr @ast_from(ptr noundef %0, i32 noundef 161) #3
  %46 = call ptr @ast_setdata(ptr noundef %45, ptr noundef nonnull %36) #3
  call void @ast_settype(ptr noundef %0, ptr noundef %45) #3
  br label %47

47:                                               ; preds = %22, %26, %44, %41, %17
  %.2 = phi i1 [ false, %17 ], [ false, %22 ], [ true, %26 ], [ false, %41 ], [ true, %44 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret i1 %.2
}

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

declare ptr @ast_name(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @lookup_literal_op(ptr noundef) local_unnamed_addr #2

declare ptr @ast_parent(ptr noundef) local_unnamed_addr #1

declare void @ast_error(ptr noundef, ptr noundef, ptr 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}


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