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

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

@string_const_data = private constant [18 x i8] c"echo \22Hello World\22"
@string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([18 x i8], [18 x i8]* @string_const_data, i32 0, i32 0), i64 18 }>
@string_const_data.1 = private constant [2 x i8] c"ls"
@string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([2 x i8], [2 x i8]* @string_const_data.1, i32 0, i32 0), i64 2 }>

define void @_lcompilers_execute_command_line_(%string_descriptor* %command, i32* %wait) {
.entry:
  %_lcompilers_exit_status = alloca i32, align 4
  %0 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0
  %1 = load i8*, i8** %0, align 8
  %2 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0
  %3 = load i8*, i8** %2, align 8
  %4 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 1
  %5 = load i64, i64* %4, align 8
  %6 = trunc i64 %5 to i32
  %7 = call i32 @_lfortran_exec_command(i8* %3, i32 %6)
  store i32 %7, i32* %_lcompilers_exit_status, align 4
  br label %return

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

FINALIZE_SYMTABLE__lcompilers_execute_command_line_: ; preds = %return
  ret void
}

declare i32 @_lfortran_exec_command(i8*, i32)

define void @_lcompilers_execute_command_line_1(%string_descriptor* %command, i32* %wait) {
.entry:
  %_lcompilers_exit_status = alloca i32, align 4
  %0 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0
  %1 = load i8*, i8** %0, align 8
  %2 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 0
  %3 = load i8*, i8** %2, align 8
  %4 = getelementptr %string_descriptor, %string_descriptor* %command, i32 0, i32 1
  %5 = load i64, i64* %4, align 8
  %6 = trunc i64 %5 to i32
  %7 = call i32 @_lfortran_exec_command(i8* %3, i32 %6)
  store i32 %7, i32* %_lcompilers_exit_status, align 4
  br label %return

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

FINALIZE_SYMTABLE__lcompilers_execute_command_line_1: ; preds = %return
  ret void
}

define i32 @main(i32 %0, i8** %1) {
.entry:
  %call_arg_value = alloca i32, align 4
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  store i32 1, i32* %call_arg_value, align 4
  call void @_lcompilers_execute_command_line_(%string_descriptor* @string_const, i32* %call_arg_value)
  store i32 1, i32* %call_arg_value, align 4
  call void @_lcompilers_execute_command_line_1(%string_descriptor* @string_const.2, i32* %call_arg_value)
  br label %return

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

FINALIZE_SYMTABLE_execute_command_line:           ; 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()
