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

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

@y_data = private global [1 x i8] c"2"
@y = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @y_data, i32 0, i32 0), i64 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)
  %x = alloca %string_descriptor, align 8
  store %string_descriptor zeroinitializer, %string_descriptor* %x, align 1
  %3 = getelementptr %string_descriptor, %string_descriptor* %x, i32 0, i32 1
  store i64 1, i64* %3, align 8
  %4 = getelementptr %string_descriptor, %string_descriptor* %x, i32 0, i32 0
  %5 = call i8* @_lfortran_get_default_allocator()
  %6 = call i8* @_lfortran_malloc_alloc(i8* %5, i64 1)
  store i8* %6, i8** %4, align 8
  %7 = getelementptr %string_descriptor, %string_descriptor* %x, i32 0, i32 0
  %8 = load i8*, i8** %7, align 8
  call void @_lfortran_strcpy_alloc(i8* %2, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @y, i32 0, i32 0), i64* getelementptr inbounds (%string_descriptor, %string_descriptor* @y, i32 0, i32 1), i8 0, i8 0, i8* %8, i64 1)
  br label %return

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

FINALIZE_SYMTABLE_volatile_03:                    ; preds = %return
  br label %Finalize_Variable_x

Finalize_Variable_x:                              ; preds = %FINALIZE_SYMTABLE_volatile_03
  %9 = getelementptr %string_descriptor, %string_descriptor* %x, i32 0, i32 0
  %10 = load i8*, i8** %9, align 8
  call void @_lfortran_free_alloc(i8* %2, i8* %10)
  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 void @_lfortran_free_alloc(i8*, i8*)

declare void @_lfortran_internal_alloc_finalize()
