; ModuleID = 'LFortran'
source_filename = "LFortran"

%0 = type { [25 x i8], i32 }
%compiler_t_polymorphic = type { i64, %compiler_t* }
%compiler_t = type { i32, %string_descriptor, %string_descriptor, %string_descriptor, i1, i1 }
%string_descriptor = type { i8*, i64, i64 }
%array = type { %string_t*, i32, %dimension_descriptor*, i1, i32 }
%string_t = type { %string_descriptor }
%dimension_descriptor = type { i32, i32, i32 }
%__vtab_compiler_t = type { i64 }

@lcompilers__nameless_enum = global [3 x %0] [%0 { [11 x i8] c"id_unknown\00", i32 0 }, %0 { [25 x i8] c"id_intel_classic_windows\00", i32 1 }, %0 { [22 x i8] c"id_intel_llvm_windows\00", i32 2 }]
@0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1

define void @__module_fpm_compiler_enumerate_libraries(%compiler_t_polymorphic* %self, i8** %prefix, %array* %libs, %string_descriptor* %r) {
.entry:
  %0 = alloca %__vtab_compiler_t, align 8
  %1 = getelementptr %__vtab_compiler_t, %__vtab_compiler_t* %0, i32 0, i32 0
  store i64 0, i64* %1, align 4
  %2 = getelementptr %compiler_t_polymorphic, %compiler_t_polymorphic* %self, i32 0, i32 1
  %3 = load %compiler_t*, %compiler_t** %2, align 8
  %4 = getelementptr %compiler_t, %compiler_t* %3, i32 0, i32 0
  %5 = load i32, i32* %4, align 4
  %6 = icmp eq i32 %5, 1
  %7 = getelementptr %compiler_t_polymorphic, %compiler_t_polymorphic* %self, i32 0, i32 1
  %8 = load %compiler_t*, %compiler_t** %7, align 8
  %9 = getelementptr %compiler_t, %compiler_t* %8, i32 0, i32 0
  %10 = load i32, i32* %9, align 4
  %11 = icmp eq i32 %10, 2
  %12 = icmp eq i1 %6, false
  %13 = select i1 %12, i1 %11, i1 %6
  br i1 %13, label %then, label %else

then:                                             ; preds = %.entry
  br label %ifcont

else:                                             ; preds = %.entry
  br label %ifcont

ifcont:                                           ; preds = %else, %then
  br label %return

return:                                           ; preds = %ifcont
  ret void
}

define i32 @main(i32 %0, i8** %1) {
.entry:
  %array_descriptor = alloca %array, align 8
  %i = alloca i32, align 4
  %array_size = alloca i32, align 4
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %__libasr__created__var__0__func_call_res = alloca %string_descriptor, align 8
  %2 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0__func_call_res, i32 0, i32 0
  store i8* null, i8** %2, align 8
  %3 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0__func_call_res, i32 0, i32 1
  store i64 0, i64* %3, align 4
  %4 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0__func_call_res, i32 0, i32 2
  store i64 0, i64* %4, align 4
  %compiler_arg = alloca %compiler_t, align 8
  %5 = getelementptr %compiler_t, %compiler_t* %compiler_arg, i32 0, i32 2
  %6 = getelementptr %string_descriptor, %string_descriptor* %5, i32 0, i32 0
  store i8* null, i8** %6, align 8
  %7 = getelementptr %string_descriptor, %string_descriptor* %5, i32 0, i32 1
  store i64 0, i64* %7, align 4
  %8 = getelementptr %string_descriptor, %string_descriptor* %5, i32 0, i32 2
  store i64 0, i64* %8, align 4
  %9 = getelementptr %compiler_t, %compiler_t* %compiler_arg, i32 0, i32 3
  %10 = getelementptr %string_descriptor, %string_descriptor* %9, i32 0, i32 0
  store i8* null, i8** %10, align 8
  %11 = getelementptr %string_descriptor, %string_descriptor* %9, i32 0, i32 1
  store i64 0, i64* %11, align 4
  %12 = getelementptr %string_descriptor, %string_descriptor* %9, i32 0, i32 2
  store i64 0, i64* %12, align 4
  %13 = getelementptr %compiler_t, %compiler_t* %compiler_arg, i32 0, i32 4
  store i1 true, i1* %13, align 1
  %14 = getelementptr %compiler_t, %compiler_t* %compiler_arg, i32 0, i32 1
  %15 = getelementptr %string_descriptor, %string_descriptor* %14, i32 0, i32 0
  store i8* null, i8** %15, align 8
  %16 = getelementptr %string_descriptor, %string_descriptor* %14, i32 0, i32 1
  store i64 0, i64* %16, align 4
  %17 = getelementptr %string_descriptor, %string_descriptor* %14, i32 0, i32 2
  store i64 0, i64* %17, align 4
  %18 = getelementptr %compiler_t, %compiler_t* %compiler_arg, i32 0, i32 0
  store i32 0, i32* %18, align 4
  %19 = getelementptr %compiler_t, %compiler_t* %compiler_arg, i32 0, i32 5
  store i1 true, i1* %19, align 1
  %libs_arg = alloca [4 x %string_t], align 8
  store i32 4, i32* %array_size, align 4
  store i32 0, i32* %i, align 4
  br label %loop.head

loop.head:                                        ; preds = %loop.body, %.entry
  %20 = load i32, i32* %i, align 4
  %21 = load i32, i32* %array_size, align 4
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %loop.body, label %loop.end

loop.body:                                        ; preds = %loop.head
  %23 = load i32, i32* %i, align 4
  %24 = getelementptr [4 x %string_t], [4 x %string_t]* %libs_arg, i32 0, i32 %23
  %25 = getelementptr %string_t, %string_t* %24, i32 0, i32 0
  %26 = getelementptr %string_descriptor, %string_descriptor* %25, i32 0, i32 0
  store i8* null, i8** %26, align 8
  %27 = getelementptr %string_descriptor, %string_descriptor* %25, i32 0, i32 1
  store i64 0, i64* %27, align 4
  %28 = getelementptr %string_descriptor, %string_descriptor* %25, i32 0, i32 2
  store i64 0, i64* %28, align 4
  %29 = load i32, i32* %i, align 4
  %30 = add i32 %29, 1
  store i32 %30, i32* %i, align 4
  br label %loop.head

loop.end:                                         ; preds = %loop.head
  %prefix_arg = alloca i8*, align 8
  %31 = call i8* @_lfortran_malloc(i32 4)
  call void @_lfortran_string_init(i32 4, i8* %31)
  store i8* %31, i8** %prefix_arg, align 8
  %32 = load i8*, i8** %prefix_arg, align 8
  %33 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0__func_call_res, i32 0, i32 0
  %34 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0__func_call_res, i32 0, i32 1
  %35 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0__func_call_res, i32 0, i32 2
  %36 = load i8*, i8** %33, align 8
  call void @_lfortran_free(i8* %36)
  store i8* null, i8** %33, align 8
  store i64 0, i64* %34, align 4
  store i64 0, i64* %35, align 4
  %37 = alloca %compiler_t_polymorphic, align 8
  %38 = getelementptr %compiler_t_polymorphic, %compiler_t_polymorphic* %37, i32 0, i32 0
  store i64 0, i64* %38, align 4
  %39 = getelementptr %compiler_t_polymorphic, %compiler_t_polymorphic* %37, i32 0, i32 1
  store %compiler_t* %compiler_arg, %compiler_t** %39, align 8
  %40 = getelementptr [4 x %string_t], [4 x %string_t]* %libs_arg, i32 0, i32 0
  %41 = getelementptr %array, %array* %array_descriptor, i32 0, i32 0
  store %string_t* %40, %string_t** %41, align 8
  %42 = getelementptr %array, %array* %array_descriptor, i32 0, i32 1
  store i32 0, i32* %42, align 4
  %43 = getelementptr %array, %array* %array_descriptor, i32 0, i32 2
  %44 = alloca %dimension_descriptor, align 8
  store %dimension_descriptor* %44, %dimension_descriptor** %43, align 8
  %45 = getelementptr %array, %array* %array_descriptor, i32 0, i32 4
  store i32 1, i32* %45, align 4
  %46 = load %dimension_descriptor*, %dimension_descriptor** %43, align 8
  %47 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %46, i32 0
  %48 = getelementptr %dimension_descriptor, %dimension_descriptor* %47, i32 0, i32 0
  %49 = getelementptr %dimension_descriptor, %dimension_descriptor* %47, i32 0, i32 1
  %50 = getelementptr %dimension_descriptor, %dimension_descriptor* %47, i32 0, i32 2
  store i32 1, i32* %48, align 4
  store i32 1, i32* %49, align 4
  store i32 4, i32* %50, align 4
  call void @__module_fpm_compiler_enumerate_libraries(%compiler_t_polymorphic* %37, i8** %prefix_arg, %array* %array_descriptor, %string_descriptor* %__libasr__created__var__0__func_call_res)
  %51 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0__func_call_res, i32 0, i32 0
  %52 = load i8*, i8** %51, align 8
  %53 = call i8* (i32, i8*, ...) @_lcompilers_string_format_fortran(i32 2, i8* null, i32 7, i8* %52)
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0))
  %54 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0__func_call_res, i32 0, i32 0
  %55 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0__func_call_res, i32 0, i32 1
  %56 = getelementptr %string_descriptor, %string_descriptor* %__libasr__created__var__0__func_call_res, i32 0, i32 2
  %57 = load i8*, i8** %54, align 8
  call void @_lfortran_free(i8* %57)
  store i8* null, i8** %54, align 8
  store i64 0, i64* %55, align 4
  store i64 0, i64* %56, align 4
  call void @_lpython_free_argv()
  br label %return

return:                                           ; preds = %loop.end
  ret i32 0
}

declare void @_lpython_call_initial_functions(i32, i8**)

declare i8* @_lfortran_malloc(i32)

declare void @_lfortran_string_init(i32, i8*)

declare void @_lfortran_free(i8*)

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

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

declare void @_lpython_free_argv()
