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

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

@0 = private unnamed_addr constant [2 x i8] c" \00", align 1
@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@string_const_data = private constant [11 x i8] c"Hello World"
@string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([11 x i8], [11 x i8]* @string_const_data, i32 0, i32 0), i64 11 }>
@2 = 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()
  %lfortran_iomsg = alloca %string_descriptor, align 8
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  store %string_descriptor zeroinitializer, %string_descriptor* %lfortran_iomsg, align 1
  %3 = getelementptr %string_descriptor, %string_descriptor* %lfortran_iomsg, i32 0, i32 1
  store i64 0, i64* %3, align 8
  %4 = getelementptr %string_descriptor, %string_descriptor* %lfortran_iomsg, 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
  %nwrite = alloca i32, align 4
  store i32 6, i32* %nwrite, align 4
  store i32 6, i32* %nwrite, align 4
  %7 = load i32, i32* %nwrite, align 4
  %8 = alloca i32*, align 8
  store i32* null, i32** %8, align 8
  %9 = load i32*, i32** %8, align 8
  %10 = call i32 @_lfortran_get_decimal_mode(i32 %7)
  %11 = call i32 @_lfortran_get_sign_mode(i32 %7)
  %12 = call i32 @_lfortran_get_round_mode(i32 %7)
  %13 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8
  call void (i32, i32*, i8*, i64, ...) @_lfortran_file_write(i32 %7, i32* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @2, i32 0, i32 0), i64 4, i8* %13, i64 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0), i64 1)
  br label %return

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

FINALIZE_SYMTABLE_main:                           ; preds = %return
  br label %Finalize_Variable_lfortran_iomsg

Finalize_Variable_lfortran_iomsg:                 ; preds = %FINALIZE_SYMTABLE_main
  %14 = getelementptr %string_descriptor, %string_descriptor* %lfortran_iomsg, i32 0, i32 0
  %15 = load i8*, i8** %14, align 8
  call void @_lfortran_free_alloc(i8* %2, i8* %15)
  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 i32 @_lfortran_get_decimal_mode(i32)

declare i32 @_lfortran_get_sign_mode(i32)

declare i32 @_lfortran_get_round_mode(i32)

declare void @_lfortran_file_write(i32, i32*, i8*, i64, ...)

declare void @_lfortran_free_alloc(i8*, i8*)

declare void @_lfortran_internal_alloc_finalize()
