; LLVM IR from marcobambini/gravity :: src/compiler (gravity_codegen)

; 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.codegen_t = type { %struct.gravity_object_r, %struct.gnode_class_r, i32, ptr }
%struct.gravity_object_r = type { i64, i64, ptr }
%struct.gnode_class_r = type { i64, i64, ptr }
%struct.gvisitor = type { i32, ptr, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.gravity_function_t = type { ptr, %struct.gravity_gc_s, ptr, ptr, i16, i16, i16, i16, i32, %union.anon }
%struct.gravity_gc_s = type { i8, i8, ptr, ptr, ptr, ptr }
%union.anon = type { %struct.anon }
%struct.anon = type { %struct.gravity_value_r, %struct.gravity_value_r, %struct.gravity_value_r, i32, ptr, ptr, float, i8 }
%struct.gravity_value_r = type { i64, i64, ptr }

@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [85 x i8], align 1
@__PRETTY_FUNCTION__.gravity_codegen = external hidden unnamed_addr constant [90 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @gravity_codegen(ptr noundef %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca %struct.codegen_t, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.gvisitor, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %13 = zext i1 %3 to i8
  store i8 %13, ptr %8, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #7
  call void @llvm.memset.p0.i64(ptr align 8 %9, i8 0, i64 64, i1 false)
  %14 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %15 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 1
  %16 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 2
  %17 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 3
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %18, ptr %17, align 8, !tbaa !11
  %19 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %20 = getelementptr inbounds %struct.gravity_object_r, ptr %19, i32 0, i32 1
  store i64 0, ptr %20, align 8, !tbaa !16
  %21 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %22 = getelementptr inbounds %struct.gravity_object_r, ptr %21, i32 0, i32 0
  store i64 0, ptr %22, align 8, !tbaa !17
  %23 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %24 = getelementptr inbounds %struct.gravity_object_r, ptr %23, i32 0, i32 2
  store ptr null, ptr %24, align 8, !tbaa !18
  %25 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 1
  %26 = getelementptr inbounds %struct.gnode_class_r, ptr %25, i32 0, i32 1
  store i64 0, ptr %26, align 8, !tbaa !19
  %27 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 1
  %28 = getelementptr inbounds %struct.gnode_class_r, ptr %27, i32 0, i32 0
  store i64 0, ptr %28, align 8, !tbaa !20
  %29 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 1
  %30 = getelementptr inbounds %struct.gnode_class_r, ptr %29, i32 0, i32 2
  store ptr null, ptr %30, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %31 = call ptr @ircode_create(i16 noundef zeroext 0)
  store ptr %31, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = call ptr @gravity_function_new(ptr noundef %32, ptr noundef @.str, i16 noundef zeroext 0, i16 noundef zeroext 0, i16 noundef zeroext 0, ptr noundef %33)
  store ptr %34, ptr %11, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %36 = getelementptr inbounds %struct.gravity_object_r, ptr %35, i32 0, i32 0
  %37 = load i64, ptr %36, align 8, !tbaa !17
  %38 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %39 = getelementptr inbounds %struct.gravity_object_r, ptr %38, i32 0, i32 1
  %40 = load i64, ptr %39, align 8, !tbaa !16
  %41 = icmp eq i64 %37, %40
  br i1 %41, label %42, label %67

42:                                               ; preds = %4
  %43 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %44 = getelementptr inbounds %struct.gravity_object_r, ptr %43, i32 0, i32 1
  %45 = load i64, ptr %44, align 8, !tbaa !16
  %46 = icmp ne i64 %45, 0
  br i1 %46, label %47, label %52

47:                                               ; preds = %42
  %48 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %49 = getelementptr inbounds %struct.gravity_object_r, ptr %48, i32 0, i32 1
  %50 = load i64, ptr %49, align 8, !tbaa !16
  %51 = shl i64 %50, 1
  br label %53

52:                                               ; preds = %42
  br label %53

53:                                               ; preds = %52, %47
  %54 = phi i64 [ %51, %47 ], [ 8, %52 ]
  %55 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %56 = getelementptr inbounds %struct.gravity_object_r, ptr %55, i32 0, i32 1
  store i64 %54, ptr %56, align 8, !tbaa !16
  %57 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %58 = getelementptr inbounds %struct.gravity_object_r, ptr %57, i32 0, i32 2
  %59 = load ptr, ptr %58, align 8, !tbaa !18
  %60 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %61 = getelementptr inbounds %struct.gravity_object_r, ptr %60, i32 0, i32 1
  %62 = load i64, ptr %61, align 8, !tbaa !16
  %63 = mul i64 8, %62
  %64 = call ptr @realloc(ptr noundef %59, i64 noundef %63) #8
  %65 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %66 = getelementptr inbounds %struct.gravity_object_r, ptr %65, i32 0, i32 2
  store ptr %64, ptr %66, align 8, !tbaa !18
  br label %67

67:                                               ; preds = %53, %4
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %70 = getelementptr inbounds %struct.gravity_object_r, ptr %69, i32 0, i32 2
  %71 = load ptr, ptr %70, align 8, !tbaa !18
  %72 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %73 = getelementptr inbounds %struct.gravity_object_r, ptr %72, i32 0, i32 0
  %74 = load i64, ptr %73, align 8, !tbaa !17
  %75 = add i64 %74, 1
  store i64 %75, ptr %73, align 8, !tbaa !17
  %76 = getelementptr inbounds ptr, ptr %71, i64 %74
  store ptr %68, ptr %76, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 208, ptr %12) #7
  %77 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 0
  store i32 0, ptr %77, align 8, !tbaa !22
  %78 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 1
  store ptr %9, ptr %78, align 8, !tbaa !24
  %79 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 2
  %80 = load i8, ptr %8, align 1, !tbaa !9, !range !25, !noundef !26
  %81 = trunc i8 %80 to i1
  %82 = zext i1 %81 to i8
  store i8 %82, ptr %79, align 8, !tbaa !27
  %83 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 3
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %84, ptr %83, align 8, !tbaa !28
  %85 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 4
  store ptr null, ptr %85, align 8, !tbaa !29
  %86 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 5
  store ptr null, ptr %86, align 8, !tbaa !30
  %87 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 6
  store ptr @visit_list_stmt, ptr %87, align 8, !tbaa !31
  %88 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 7
  store ptr @visit_compound_stmt, ptr %88, align 8, !tbaa !32
  %89 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 8
  store ptr @visit_label_stmt, ptr %89, align 8, !tbaa !33
  %90 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 9
  store ptr @visit_flow_stmt, ptr %90, align 8, !tbaa !34
  %91 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 10
  store ptr @visit_jump_stmt, ptr %91, align 8, !tbaa !35
  %92 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 11
  store ptr @visit_loop_stmt, ptr %92, align 8, !tbaa !36
  %93 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 12
  store ptr @visit_empty_stmt, ptr %93, align 8, !tbaa !37
  %94 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 13
  store ptr @visit_function_decl, ptr %94, align 8, !tbaa !38
  %95 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 14
  store ptr @visit_variable_decl, ptr %95, align 8, !tbaa !39
  %96 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 15
  store ptr @visit_enum_decl, ptr %96, align 8, !tbaa !40
  %97 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 16
  store ptr @visit_class_decl, ptr %97, align 8, !tbaa !41
  %98 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 17
  store ptr @visit_module_decl, ptr %98, align 8, !tbaa !42
  %99 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 18
  store ptr @visit_binary_expr, ptr %99, align 8, !tbaa !43
  %100 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 19
  store ptr @visit_unary_expr, ptr %100, align 8, !tbaa !44
  %101 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 20
  store ptr @visit_file_expr, ptr %101, align 8, !tbaa !45
  %102 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 21
  store ptr @visit_literal_expr, ptr %102, align 8, !tbaa !46
  %103 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 22
  store ptr @visit_identifier_expr, ptr %103, align 8, !tbaa !47
  %104 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 23
  store ptr @visit_keyword_expr, ptr %104, align 8, !tbaa !48
  %105 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 24
  store ptr @visit_list_expr, ptr %105, align 8, !tbaa !49
  %106 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 25
  store ptr @visit_postfix_expr, ptr %106, align 8, !tbaa !50
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  call void @gvisit(ptr noundef %12, ptr noundef %107)
  %108 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 1
  %109 = getelementptr inbounds %struct.gnode_class_r, ptr %108, i32 0, i32 0
  %110 = load i64, ptr %109, align 8, !tbaa !20
  %111 = icmp ne i64 %110, 0
  br i1 %111, label %112, label %113

112:                                              ; preds = %67
  call void @fix_superclasses(ptr noundef %12)
  br label %113

113:                                              ; preds = %112, %67
  %114 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %115 = getelementptr inbounds %struct.gravity_object_r, ptr %114, i32 0, i32 2
  %116 = load ptr, ptr %115, align 8, !tbaa !18
  %117 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %118 = getelementptr inbounds %struct.gravity_object_r, ptr %117, i32 0, i32 0
  %119 = load i64, ptr %118, align 8, !tbaa !17
  %120 = add i64 %119, -1
  store i64 %120, ptr %118, align 8, !tbaa !17
  %121 = getelementptr inbounds ptr, ptr %116, i64 %120
  %122 = load ptr, ptr %121, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %124 = getelementptr inbounds %struct.gravity_object_r, ptr %123, i32 0, i32 0
  %125 = load i64, ptr %124, align 8, !tbaa !17
  %126 = icmp eq i64 %125, 0
  br i1 %126, label %127, label %128

127:                                              ; preds = %113
  br label %129

128:                                              ; preds = %113
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 2143, ptr noundef @__PRETTY_FUNCTION__.gravity_codegen) #9
  unreachable

129:                                              ; preds = %127
  %130 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %131 = getelementptr inbounds %struct.gravity_object_r, ptr %130, i32 0, i32 2
  %132 = load ptr, ptr %131, align 8, !tbaa !18
  %133 = icmp ne ptr %132, null
  br i1 %133, label %134, label %138

134:                                              ; preds = %129
  %135 = getelementptr inbounds %struct.codegen_t, ptr %9, i32 0, i32 0
  %136 = getelementptr inbounds %struct.gravity_object_r, ptr %135, i32 0, i32 2
  %137 = load ptr, ptr %136, align 8, !tbaa !18
  call void @free(ptr noundef %137) #7
  br label %138

138:                                              ; preds = %134, %129
  %139 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 0
  %140 = load i32, ptr %139, align 8, !tbaa !22
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %147

142:                                              ; preds = %138
  %143 = load ptr, ptr %10, align 8, !tbaa !5
  call void @ircode_free(ptr noundef %143)
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.gravity_function_t, ptr %144, i32 0, i32 9
  %146 = getelementptr inbounds %struct.anon, ptr %145, i32 0, i32 4
  store ptr null, ptr %146, align 8, !tbaa !51
  br label %147

147:                                              ; preds = %142, %138
  %148 = getelementptr inbounds %struct.gvisitor, ptr %12, i32 0, i32 0
  %149 = load i32, ptr %148, align 8, !tbaa !22
  %150 = icmp eq i32 %149, 0
  br i1 %150, label %151, label %153

151:                                              ; preds = %147
  %152 = load ptr, ptr %11, align 8, !tbaa !5
  br label %154

153:                                              ; preds = %147
  br label %154

154:                                              ; preds = %153, %151
  %155 = phi ptr [ %152, %151 ], [ null, %153 ]
  call void @llvm.lifetime.end.p0(i64 208, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #7
  ret ptr %155
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare ptr @ircode_create(i16 noundef zeroext) #3

declare ptr @gravity_function_new(ptr noundef, ptr noundef, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, ptr noundef) #3

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #4

; Function Attrs: nounwind uwtable
declare hidden void @visit_list_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_compound_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_label_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_flow_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_jump_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_loop_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_empty_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_function_decl(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_variable_decl(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_enum_decl(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_class_decl(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_module_decl(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_binary_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_unary_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_file_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_literal_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_identifier_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_keyword_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_list_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_postfix_expr(ptr noundef, ptr noundef) #0

declare void @gvisit(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @fix_superclasses(ptr noundef) #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

; Function Attrs: nounwind
declare void @free(ptr noundef) #6

declare void @ircode_free(ptr noundef) #3

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

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" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 #4 = { nounwind allocsize(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 #5 = { noreturn nounwind "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 #6 = { nounwind "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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(1) }
attributes #9 = { noreturn 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 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !6, i64 56}
!12 = !{!"codegen_t", !13, i64 0, !13, i64 24, !15, i64 48, !6, i64 56}
!13 = !{!"", !14, i64 0, !14, i64 8, !6, i64 16}
!14 = !{!"long", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!12, !14, i64 8}
!17 = !{!12, !14, i64 0}
!18 = !{!12, !6, i64 16}
!19 = !{!12, !14, i64 32}
!20 = !{!12, !14, i64 24}
!21 = !{!12, !6, i64 40}
!22 = !{!23, !15, i64 0}
!23 = !{!"gvisitor", !15, i64 0, !6, i64 8, !10, 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}
!24 = !{!23, !6, i64 8}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!23, !10, i64 16}
!28 = !{!23, !6, i64 24}
!29 = !{!23, !6, i64 32}
!30 = !{!23, !6, i64 40}
!31 = !{!23, !6, i64 48}
!32 = !{!23, !6, i64 56}
!33 = !{!23, !6, i64 64}
!34 = !{!23, !6, i64 72}
!35 = !{!23, !6, i64 80}
!36 = !{!23, !6, i64 88}
!37 = !{!23, !6, i64 96}
!38 = !{!23, !6, i64 104}
!39 = !{!23, !6, i64 112}
!40 = !{!23, !6, i64 120}
!41 = !{!23, !6, i64 128}
!42 = !{!23, !6, i64 136}
!43 = !{!23, !6, i64 144}
!44 = !{!23, !6, i64 152}
!45 = !{!23, !6, i64 160}
!46 = !{!23, !6, i64 168}
!47 = !{!23, !6, i64 176}
!48 = !{!23, !6, i64 184}
!49 = !{!23, !6, i64 192}
!50 = !{!23, !6, i64 200}
!51 = !{!7, !7, i64 0}


; 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.codegen_t = type { %struct.gravity_object_r, %struct.gnode_class_r, i32, ptr }
%struct.gravity_object_r = type { i64, i64, ptr }
%struct.gnode_class_r = type { i64, i64, ptr }
%struct.gvisitor = type { i32, ptr, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [85 x i8], align 1
@__PRETTY_FUNCTION__.gravity_codegen = external hidden unnamed_addr constant [90 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @gravity_codegen(ptr noundef %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3) local_unnamed_addr #0 {
  %5 = alloca %struct.codegen_t, align 8
  %6 = alloca %struct.gvisitor, align 8
  %7 = zext i1 %3 to i8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %5) #7
  %8 = getelementptr inbounds i8, ptr %5, i64 48
  store i64 0, ptr %8, align 8
  %9 = getelementptr inbounds i8, ptr %5, i64 56
  store ptr %2, ptr %9, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %5, i64 8
  %11 = getelementptr inbounds i8, ptr %5, i64 16
  %12 = getelementptr inbounds i8, ptr %5, i64 24
  %13 = getelementptr inbounds i8, ptr %5, i64 24
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %13, i8 0, i64 24, i1 false)
  %14 = tail call ptr @ircode_create(i16 noundef zeroext 0) #7
  %15 = tail call ptr @gravity_function_new(ptr noundef %2, ptr noundef nonnull @.str, i16 noundef zeroext 0, i16 noundef zeroext 0, i16 noundef zeroext 0, ptr noundef %14) #7
  store i64 8, ptr %10, align 8, !tbaa !13
  %malloc = tail call dereferenceable_or_null(64) ptr @malloc(i64 64)
  store ptr %malloc, ptr %11, align 8, !tbaa !14
  store i64 1, ptr %5, align 8, !tbaa !15
  store ptr %15, ptr %malloc, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %6) #7
  store i32 0, ptr %6, align 8, !tbaa !17
  %16 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %5, ptr %16, align 8, !tbaa !20
  %17 = getelementptr inbounds i8, ptr %6, i64 16
  store i8 %7, ptr %17, align 8, !tbaa !21
  %18 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr %1, ptr %18, align 8, !tbaa !22
  %19 = getelementptr inbounds i8, ptr %6, i64 32
  %20 = getelementptr inbounds i8, ptr %6, i64 48
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %19, i8 0, i64 16, i1 false)
  store ptr @visit_list_stmt, ptr %20, align 8, !tbaa !23
  %21 = getelementptr inbounds i8, ptr %6, i64 56
  store ptr @visit_compound_stmt, ptr %21, align 8, !tbaa !24
  %22 = getelementptr inbounds i8, ptr %6, i64 64
  store ptr @visit_label_stmt, ptr %22, align 8, !tbaa !25
  %23 = getelementptr inbounds i8, ptr %6, i64 72
  store ptr @visit_flow_stmt, ptr %23, align 8, !tbaa !26
  %24 = getelementptr inbounds i8, ptr %6, i64 80
  store ptr @visit_jump_stmt, ptr %24, align 8, !tbaa !27
  %25 = getelementptr inbounds i8, ptr %6, i64 88
  store ptr @visit_loop_stmt, ptr %25, align 8, !tbaa !28
  %26 = getelementptr inbounds i8, ptr %6, i64 96
  store ptr @visit_empty_stmt, ptr %26, align 8, !tbaa !29
  %27 = getelementptr inbounds i8, ptr %6, i64 104
  store ptr @visit_function_decl, ptr %27, align 8, !tbaa !30
  %28 = getelementptr inbounds i8, ptr %6, i64 112
  store ptr @visit_variable_decl, ptr %28, align 8, !tbaa !31
  %29 = getelementptr inbounds i8, ptr %6, i64 120
  store ptr @visit_enum_decl, ptr %29, align 8, !tbaa !32
  %30 = getelementptr inbounds i8, ptr %6, i64 128
  store ptr @visit_class_decl, ptr %30, align 8, !tbaa !33
  %31 = getelementptr inbounds i8, ptr %6, i64 136
  store ptr @visit_module_decl, ptr %31, align 8, !tbaa !34
  %32 = getelementptr inbounds i8, ptr %6, i64 144
  store ptr @visit_binary_expr, ptr %32, align 8, !tbaa !35
  %33 = getelementptr inbounds i8, ptr %6, i64 152
  store ptr @visit_unary_expr, ptr %33, align 8, !tbaa !36
  %34 = getelementptr inbounds i8, ptr %6, i64 160
  store ptr @visit_file_expr, ptr %34, align 8, !tbaa !37
  %35 = getelementptr inbounds i8, ptr %6, i64 168
  store ptr @visit_literal_expr, ptr %35, align 8, !tbaa !38
  %36 = getelementptr inbounds i8, ptr %6, i64 176
  store ptr @visit_identifier_expr, ptr %36, align 8, !tbaa !39
  %37 = getelementptr inbounds i8, ptr %6, i64 184
  store ptr @visit_keyword_expr, ptr %37, align 8, !tbaa !40
  %38 = getelementptr inbounds i8, ptr %6, i64 192
  store ptr @visit_list_expr, ptr %38, align 8, !tbaa !41
  %39 = getelementptr inbounds i8, ptr %6, i64 200
  store ptr @visit_postfix_expr, ptr %39, align 8, !tbaa !42
  call void @gvisit(ptr noundef nonnull %6, ptr noundef %0) #7
  %40 = load i64, ptr %12, align 8, !tbaa !43
  %.not10 = icmp eq i64 %40, 0
  br i1 %.not10, label %42, label %41

41:                                               ; preds = %4
  call void @fix_superclasses(ptr noundef nonnull %6)
  br label %42

42:                                               ; preds = %41, %4
  %43 = load i64, ptr %5, align 8, !tbaa !15
  %44 = add i64 %43, -1
  store i64 %44, ptr %5, align 8, !tbaa !15
  %45 = icmp eq i64 %44, 0
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 2143, ptr noundef nonnull @__PRETTY_FUNCTION__.gravity_codegen) #8
  unreachable

47:                                               ; preds = %42
  %48 = load ptr, ptr %11, align 8, !tbaa !14
  %.not11 = icmp eq ptr %48, null
  br i1 %.not11, label %50, label %49

49:                                               ; preds = %47
  call void @free(ptr noundef nonnull %48) #7
  br label %50

50:                                               ; preds = %49, %47
  %51 = load i32, ptr %6, align 8, !tbaa !17
  %.not12 = icmp eq i32 %51, 0
  br i1 %.not12, label %56, label %52

52:                                               ; preds = %50
  call void @ircode_free(ptr noundef %14) #7
  %53 = getelementptr inbounds i8, ptr %15, i64 160
  store ptr null, ptr %53, align 8, !tbaa !44
  %.pre = load i32, ptr %6, align 8, !tbaa !17
  %54 = icmp eq i32 %.pre, 0
  %55 = select i1 %54, ptr %15, ptr null
  br label %56

56:                                               ; preds = %52, %50
  %57 = phi ptr [ %55, %52 ], [ %15, %50 ]
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #7
  ret ptr %57
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare ptr @ircode_create(i16 noundef zeroext) local_unnamed_addr #3

declare ptr @gravity_function_new(ptr noundef, ptr noundef, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @visit_list_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_compound_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_label_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_flow_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_jump_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_loop_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_empty_stmt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_function_decl(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_variable_decl(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_enum_decl(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_class_decl(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_module_decl(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_binary_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_unary_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_file_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_literal_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_identifier_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_keyword_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_list_expr(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @visit_postfix_expr(ptr noundef, ptr noundef) #0

declare void @gvisit(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @fix_superclasses(ptr noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

declare void @ircode_free(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #6

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" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 #4 = { noreturn nounwind "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #6 = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #7 = { nounwind }
attributes #8 = { noreturn 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, !11, i64 56}
!6 = !{!"codegen_t", !7, i64 0, !7, i64 24, !12, i64 48, !11, i64 56}
!7 = !{!"", !8, i64 0, !8, i64 8, !11, i64 16}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!6, !8, i64 8}
!14 = !{!6, !11, i64 16}
!15 = !{!6, !8, i64 0}
!16 = !{!11, !11, i64 0}
!17 = !{!18, !12, i64 0}
!18 = !{!"gvisitor", !12, i64 0, !11, i64 8, !19, 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, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200}
!19 = !{!"_Bool", !9, i64 0}
!20 = !{!18, !11, i64 8}
!21 = !{!18, !19, i64 16}
!22 = !{!18, !11, i64 24}
!23 = !{!18, !11, i64 48}
!24 = !{!18, !11, i64 56}
!25 = !{!18, !11, i64 64}
!26 = !{!18, !11, i64 72}
!27 = !{!18, !11, i64 80}
!28 = !{!18, !11, i64 88}
!29 = !{!18, !11, i64 96}
!30 = !{!18, !11, i64 104}
!31 = !{!18, !11, i64 112}
!32 = !{!18, !11, i64 120}
!33 = !{!18, !11, i64 128}
!34 = !{!18, !11, i64 136}
!35 = !{!18, !11, i64 144}
!36 = !{!18, !11, i64 152}
!37 = !{!18, !11, i64 160}
!38 = !{!18, !11, i64 168}
!39 = !{!18, !11, i64 176}
!40 = !{!18, !11, i64 184}
!41 = !{!18, !11, i64 192}
!42 = !{!18, !11, i64 200}
!43 = !{!6, !8, i64 24}
!44 = !{!9, !9, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MemCpyOptPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass