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

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

@0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info = private unnamed_addr constant [13 x i8] c"S-DESC-5,L32\00", align 1
@string_const_data = private constant [5 x i8] c"tf=0:"
@string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data, i32 0, i32 0), i64 5 }>
@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
@serialization_info.1 = private unnamed_addr constant [13 x i8] c"S-DESC-5,L32\00", align 1
@string_const_data.2 = private constant [5 x i8] c"tf=1:"
@string_const.3 = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data.2, i32 0, i32 0), i64 5 }>
@3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1

define void @__module_overload_assignment_m_logical_gets_integer(i32* %tf, i32* %i) {
.entry:
  %0 = load i32, i32* %i, align 4
  %1 = icmp eq i32 %0, 0
  %2 = zext i1 %1 to i32
  store i32 %2, i32* %tf, align 4
  br label %return

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

FINALIZE_SYMTABLE_logical_gets_integer:           ; preds = %return
  ret void
}

define i32 @main(i32 %0, i8** %1) {
.entry:
  %2 = call i8* @_lfortran_get_default_allocator()
  %call_arg_value = alloca i32, align 4
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %tf = alloca i32, align 4
  store i32 0, i32* %call_arg_value, align 4
  call void @__module_overload_assignment_m_logical_gets_integer(i32* %tf, i32* %call_arg_value)
  %3 = alloca i64, align 8
  %4 = 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 ([13 x i8], [13 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const, i32* %tf)
  %5 = load i64, i64* %3, align 8
  %stringFormat_desc = alloca %string_descriptor, align 8
  %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  store i8* %4, i8** %6, align 8
  %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  store i64 %5, i64* %7, align 8
  %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  %9 = load i8*, i8** %8, align 8
  %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  %11 = load i64, i64* %10, align 8
  %12 = trunc i64 %11 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1)
  %13 = icmp eq i8* %4, null
  br i1 %13, label %free_done, label %free_nonnull

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

free_done:                                        ; preds = %free_nonnull, %.entry
  store i32 1, i32* %call_arg_value, align 4
  call void @__module_overload_assignment_m_logical_gets_integer(i32* %tf, i32* %call_arg_value)
  %14 = alloca i64, align 8
  %15 = 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 ([13 x i8], [13 x i8]* @serialization_info.1, i32 0, i32 0), i64* %14, i32 0, i32 0, i32 0, i32 0, i32 0, %string_descriptor* @string_const.3, i32* %tf)
  %16 = load i64, i64* %14, align 8
  %stringFormat_desc1 = alloca %string_descriptor, align 8
  %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0
  store i8* %15, i8** %17, align 8
  %18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1
  store i64 %16, i64* %18, align 8
  %19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0
  %20 = load i8*, i8** %19, align 8
  %21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1
  %22 = load i64, i64* %21, align 8
  %23 = trunc i64 %22 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %20, i32 %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1)
  %24 = icmp eq i8* %15, null
  br i1 %24, label %free_done3, label %free_nonnull2

free_nonnull2:                                    ; preds = %free_done
  call void @_lfortran_free_alloc(i8* %2, i8* %15)
  br label %free_done3

free_done3:                                       ; preds = %free_nonnull2, %free_done
  br label %return

return:                                           ; preds = %free_done3
  br label %FINALIZE_SYMTABLE_main

FINALIZE_SYMTABLE_main:                           ; preds = %return
  call void @_lfortran_internal_alloc_finalize()
  ret i32 0
}

declare void @_lpython_call_initial_functions(i32, i8**)

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

declare i8* @_lfortran_get_default_allocator()

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

declare void @_lfortran_free_alloc(i8*, i8*)

declare void @_lfortran_internal_alloc_finalize()
