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

%string_descriptor = type <{ i8*, i64 }>

@string_const_data = private constant [4 x i8] c"Mr. "
@string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([4 x i8], [4 x i8]* @string_const_data, i32 0, i32 0), i64 4 }>
@string_const_data.1 = private constant [6 x i8] c"Rowan "
@string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([6 x i8], [6 x i8]* @string_const_data.1, i32 0, i32 0), i64 6 }>
@string_const_data.3 = private constant [8 x i8] c"Atkinson"
@string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.3, i32 0, i32 0), i64 8 }>
@string_const_data.5 = private constant [25 x i8] c"A big hello from Mr. Bean"
@string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([25 x i8], [25 x i8]* @string_const_data.5, i32 0, i32 0), i64 25 }>
@0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info = private unnamed_addr constant [38 x i8] c"S-DESC-8,S-DESC-6,S-DESC-15,S-DESC-15\00", align 1
@string_const_data.7 = private constant [8 x i8] c"Here is "
@string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([8 x i8], [8 x i8]* @string_const_data.7, i32 0, i32 0), i64 8 }>
@1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1

define i32 @main(i32 %0, i8** %1) {
.entry:
  %2 = call i8* @_lfortran_get_default_allocator()
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %firstname = alloca %string_descriptor, align 8
  store %string_descriptor zeroinitializer, %string_descriptor* %firstname, align 1
  %3 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 1
  store i64 15, i64* %3, align 8
  %4 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 0
  %5 = call i8* @_lfortran_get_default_allocator()
  %6 = call i8* @_lfortran_malloc_alloc(i8* %5, i64 15)
  store i8* %6, i8** %4, align 8
  %greetings = alloca %string_descriptor, align 8
  store %string_descriptor zeroinitializer, %string_descriptor* %greetings, align 1
  %7 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 1
  store i64 25, i64* %7, align 8
  %8 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0
  %9 = call i8* @_lfortran_get_default_allocator()
  %10 = call i8* @_lfortran_malloc_alloc(i8* %9, i64 25)
  store i8* %10, i8** %8, align 8
  %surname = alloca %string_descriptor, align 8
  store %string_descriptor zeroinitializer, %string_descriptor* %surname, align 1
  %11 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 1
  store i64 15, i64* %11, align 8
  %12 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 0
  %13 = call i8* @_lfortran_get_default_allocator()
  %14 = call i8* @_lfortran_malloc_alloc(i8* %13, i64 15)
  store i8* %14, i8** %12, align 8
  %title = alloca %string_descriptor, align 8
  store %string_descriptor zeroinitializer, %string_descriptor* %title, align 1
  %15 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 1
  store i64 6, i64* %15, align 8
  %16 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0
  %17 = call i8* @_lfortran_get_default_allocator()
  %18 = call i8* @_lfortran_malloc_alloc(i8* %17, i64 6)
  store i8* %18, i8** %16, align 8
  %19 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0
  %20 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 1
  %21 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8
  call void @_lfortran_strcpy_alloc(i8* %2, i8** %19, i64* %20, i8 0, i8 0, i8* %21, i64 4)
  %22 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 0
  %23 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 1
  %24 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8
  call void @_lfortran_strcpy_alloc(i8* %2, i8** %22, i64* %23, i8 0, i8 0, i8* %24, i64 6)
  %25 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 0
  %26 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 1
  %27 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8
  call void @_lfortran_strcpy_alloc(i8* %2, i8** %25, i64* %26, i8 0, i8 0, i8* %27, i64 8)
  %28 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0
  %29 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 1
  %30 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8
  call void @_lfortran_strcpy_alloc(i8* %2, i8** %28, i64* %29, i8 0, i8 0, i8* %30, i64 25)
  %31 = alloca i64, align 8
  %32 = load %string_descriptor, %string_descriptor* %title, align 1
  %33 = alloca %string_descriptor, align 8
  store %string_descriptor %32, %string_descriptor* %33, align 1
  %34 = load %string_descriptor, %string_descriptor* %firstname, align 1
  %35 = alloca %string_descriptor, align 8
  store %string_descriptor %34, %string_descriptor* %35, align 1
  %36 = load %string_descriptor, %string_descriptor* %surname, align 1
  %37 = alloca %string_descriptor, align 8
  store %string_descriptor %36, %string_descriptor* %37, align 1
  %38 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @serialization_info, i32 0, i32 0), i64* %31, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.8, %string_descriptor* %33, %string_descriptor* %35, %string_descriptor* %37)
  %39 = load i64, i64* %31, align 8
  %stringFormat_desc = alloca %string_descriptor, align 8
  %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  store i8* %38, i8** %40, align 8
  %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  store i64 %39, i64* %41, align 8
  %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  %43 = load i8*, i8** %42, align 8
  %44 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  %45 = load i64, i64* %44, align 8
  %46 = trunc i64 %45 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %43, i32 %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1)
  %47 = icmp eq i8* %38, null
  br i1 %47, label %free_done, label %free_nonnull

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

free_done:                                        ; preds = %free_nonnull, %.entry
  %48 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0
  %49 = load i8*, i8** %48, align 8
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %49, i32 25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1)
  br label %return

return:                                           ; preds = %free_done
  br label %FINALIZE_SYMTABLE_string_02

FINALIZE_SYMTABLE_string_02:                      ; preds = %return
  br label %Finalize_Variable_firstname

Finalize_Variable_firstname:                      ; preds = %FINALIZE_SYMTABLE_string_02
  %50 = getelementptr %string_descriptor, %string_descriptor* %firstname, i32 0, i32 0
  %51 = load i8*, i8** %50, align 8
  call void @_lfortran_free_alloc(i8* %2, i8* %51)
  br label %Finalize_Variable_greetings

Finalize_Variable_greetings:                      ; preds = %Finalize_Variable_firstname
  %52 = getelementptr %string_descriptor, %string_descriptor* %greetings, i32 0, i32 0
  %53 = load i8*, i8** %52, align 8
  call void @_lfortran_free_alloc(i8* %2, i8* %53)
  br label %Finalize_Variable_surname

Finalize_Variable_surname:                        ; preds = %Finalize_Variable_greetings
  %54 = getelementptr %string_descriptor, %string_descriptor* %surname, i32 0, i32 0
  %55 = load i8*, i8** %54, align 8
  call void @_lfortran_free_alloc(i8* %2, i8* %55)
  br label %Finalize_Variable_title

Finalize_Variable_title:                          ; preds = %Finalize_Variable_surname
  %56 = getelementptr %string_descriptor, %string_descriptor* %title, i32 0, i32 0
  %57 = load i8*, i8** %56, align 8
  call void @_lfortran_free_alloc(i8* %2, i8* %57)
  call void @_lfortran_internal_alloc_finalize()
  ret i32 0
}

declare void @_lpython_call_initial_functions(i32, i8**)

declare i8* @_lfortran_malloc_alloc(i8*, i64)

declare i8* @_lfortran_get_default_allocator()

declare void @_lfortran_strcpy_alloc(i8*, i8**, i64*, i8, i8, i8*, i64)

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*)

declare void @_lfortran_internal_alloc_finalize()
