; ModuleID = 'LFortran'
source_filename = "LFortran"
target datalayout = "..."

%string_descriptor = type <{ i8*, i64 }>
%class_circle2.circle_class = type <{ i32 (...)**, %class_circle2.circle* }>
%class_circle2.circle = type { float }

@__module_class_circle2_pi = global float 0x400921FB60000000
@_Name_circle = private unnamed_addr constant [7 x i8] c"circle\00", align 1
@_Type_Info_circle = linkonce_odr unnamed_addr constant { i8*, i8*, i8* } { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @_Name_circle, i32 0, i32 0), i8* inttoptr (i64 4 to i8*), i8* null }, align 8
@_VTable_circle = linkonce_odr unnamed_addr constant { [6 x i8*] } { [6 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_Type_Info_circle to i8*), i8* bitcast (void (i8*, i8*)* @_copy_class_circle2_circle to i8*), i8* bitcast (void (i8**)* @_allocate_struct_class_circle2_circle to i8*), i8* bitcast (float (%class_circle2.circle_class*)* @__module_class_circle2_circle_area to i8*), i8* bitcast (void (%class_circle2.circle_class*)* @__module_class_circle2_circle_print to i8*)] }, align 8
@0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info = private unnamed_addr constant [25 x i8] c"S-DESC-12,R4,S-DESC-8,R4\00", align 1
@string_const_data = private constant [12 x i8] c"Circle: r = "
@string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([12 x i8], [12 x i8]* @string_const_data, i32 0, i32 0), i64 12 }>
@string_const_data.1 = private constant [8 x i8] c" area = "
@string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.1, i32 0, i32 0), i64 8 }>
@1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1

define float @__module_class_circle2_circle_area(%class_circle2.circle_class* %this) {
.entry:
  %circle_area = alloca float, align 4
  %0 = load float, float* @__module_class_circle2_pi, align 4
  %1 = getelementptr %class_circle2.circle_class, %class_circle2.circle_class* %this, i32 0, i32 1
  %2 = load %class_circle2.circle*, %class_circle2.circle** %1, align 8
  %3 = getelementptr %class_circle2.circle, %class_circle2.circle* %2, i32 0, i32 0
  %4 = load float, float* %3, align 4
  %simplified_pow_operation = fmul float %4, %4
  %5 = fmul float %0, %simplified_pow_operation
  store float %5, float* %circle_area, align 4
  br label %return

return:                                           ; preds = %.entry
  br label %FINALIZE_SYMTABLE_circle_area

FINALIZE_SYMTABLE_circle_area:                    ; preds = %return
  %6 = load float, float* %circle_area, align 4
  ret float %6
}

define void @__module_class_circle2_circle_print(%class_circle2.circle_class* %this) {
.entry:
  %0 = call i8* @_lfortran_get_default_allocator()
  %area = alloca float, align 4
  %1 = bitcast %class_circle2.circle_class* %this to float (%class_circle2.circle_class*)***
  %2 = load float (%class_circle2.circle_class*)**, float (%class_circle2.circle_class*)*** %1, align 8
  %3 = getelementptr inbounds float (%class_circle2.circle_class*)*, float (%class_circle2.circle_class*)** %2, i32 2
  %4 = load float (%class_circle2.circle_class*)*, float (%class_circle2.circle_class*)** %3, align 8
  %5 = call float %4(%class_circle2.circle_class* %this)
  store float %5, float* %area, align 4
  %6 = alloca i64, align 8
  %7 = getelementptr %class_circle2.circle_class, %class_circle2.circle_class* %this, i32 0, i32 1
  %8 = load %class_circle2.circle*, %class_circle2.circle** %7, align 8
  %9 = getelementptr %class_circle2.circle, %class_circle2.circle* %8, i32 0, i32 0
  %10 = load float, float* %9, align 4
  %11 = alloca float, align 4
  store float %10, float* %11, align 4
  %12 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %0, i8* null, i64 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @serialization_info, i32 0, i32 0), i64* %6, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const, float* %11, %string_descriptor* @string_const.2, float* %area)
  %13 = load i64, i64* %6, align 8
  %stringFormat_desc = alloca %string_descriptor, align 8
  %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  store i8* %12, i8** %14, align 8
  %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  store i64 %13, i64* %15, align 8
  %16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  %17 = load i8*, i8** %16, align 8
  %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  %19 = load i64, i64* %18, align 8
  %20 = trunc i64 %19 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %17, i32 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1)
  %21 = icmp eq i8* %12, null
  br i1 %21, label %free_done, label %free_nonnull

free_nonnull:                                     ; preds = %.entry
  call void @_lfortran_free_alloc(i8* %0, i8* %12)
  br label %free_done

free_done:                                        ; preds = %free_nonnull, %.entry
  br label %return

return:                                           ; preds = %free_done
  br label %FINALIZE_SYMTABLE_circle_print

FINALIZE_SYMTABLE_circle_print:                   ; preds = %return
  ret void
}

define void @__module_class_circle2__xx_lcompilers_changed_main_xx() {
.entry:
  %0 = alloca %class_circle2.circle_class, align 8
  %c = alloca %class_circle2.circle, align 8
  %1 = getelementptr %class_circle2.circle, %class_circle2.circle* %c, i32 0, i32 0
  %2 = getelementptr %class_circle2.circle, %class_circle2.circle* %c, i32 0, i32 0
  store float 1.000000e+00, float* %2, align 4
  %3 = getelementptr %class_circle2.circle, %class_circle2.circle* %c, i32 0, i32 0
  store float 1.500000e+00, float* %3, align 4
  %4 = getelementptr %class_circle2.circle_class, %class_circle2.circle_class* %0, i32 0, i32 0
  store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 8
  %5 = getelementptr %class_circle2.circle_class, %class_circle2.circle_class* %0, i32 0, i32 1
  store %class_circle2.circle* %c, %class_circle2.circle** %5, align 8
  call void @__module_class_circle2_circle_print(%class_circle2.circle_class* %0)
  br label %return

return:                                           ; preds = %.entry
  br label %FINALIZE_SYMTABLE_main

FINALIZE_SYMTABLE_main:                           ; preds = %return
  ret void
}

define linkonce_odr void @_copy_class_circle2_circle(i8* %0, i8* %1) {
entry:
  %2 = bitcast i8* %0 to %class_circle2.circle*
  %3 = bitcast i8* %1 to %class_circle2.circle*
  %4 = getelementptr %class_circle2.circle, %class_circle2.circle* %2, i32 0, i32 0
  %5 = load float, float* %4, align 4
  %6 = getelementptr %class_circle2.circle, %class_circle2.circle* %3, i32 0, i32 0
  br i1 true, label %then, label %else

then:                                             ; preds = %entry
  store float %5, float* %6, align 4
  br label %ifcont

else:                                             ; preds = %entry
  br label %ifcont

ifcont:                                           ; preds = %else, %then
  ret void
}

define linkonce_odr void @_allocate_struct_class_circle2_circle(i8** %0) {
entry:
  %1 = call i8* @_lfortran_get_default_allocator()
  %2 = call i8* @_lfortran_malloc_alloc(i8* %1, i64 16)
  call void @llvm.memset.p0i8.i32(i8* %2, i8 0, i32 16, i1 false)
  store i8* %2, i8** %0, align 8
  %3 = load i8*, i8** %0, align 8
  %4 = bitcast i8* %3 to %class_circle2.circle_class*
  %5 = bitcast %class_circle2.circle_class* %4 to i32 (...)***
  store i32 (...)** bitcast (i8** getelementptr inbounds ({ [6 x i8*] }, { [6 x i8*] }* @_VTable_circle, i32 0, i32 0, i32 2) to i32 (...)**), i32 (...)*** %5, align 8
  %6 = getelementptr %class_circle2.circle_class, %class_circle2.circle_class* %4, i32 0, i32 1
  %7 = call i8* @_lfortran_get_default_allocator()
  %8 = call i8* @_lfortran_malloc_alloc(i8* %7, i64 4)
  call void @llvm.memset.p0i8.i32(i8* %8, i8 0, i32 4, i1 false)
  %9 = bitcast i8* %8 to %class_circle2.circle*
  store %class_circle2.circle* %9, %class_circle2.circle** %6, align 8
  %10 = getelementptr %class_circle2.circle, %class_circle2.circle* %9, i32 0, i32 0
  ret void
}

declare i8* @_lfortran_malloc_alloc(i8*, i64)

declare i8* @_lfortran_get_default_allocator()

; Function Attrs: argmemonly nounwind willreturn writeonly
declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg) #0

declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...)

declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32)

declare void @_lfortran_free_alloc(i8*, i8*)

define i32 @main(i32 %0, i8** %1) {
.entry:
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  call void @__module_class_circle2__xx_lcompilers_changed_main_xx()
  br label %return

return:                                           ; preds = %.entry
  br label %FINALIZE_SYMTABLE_circle_test

FINALIZE_SYMTABLE_circle_test:                    ; preds = %return
  call void @_lfortran_internal_alloc_finalize()
  ret i32 0
}

declare void @_lpython_call_initial_functions(i32, i8**)

declare void @_lfortran_internal_alloc_finalize()

attributes #0 = { argmemonly nounwind willreturn writeonly }
