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

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

@"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1
@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
@2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info = private unnamed_addr constant [6 x i8] c"I4,I4\00", align 1
@3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1
@11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@14 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@15 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@16 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info.2 = private unnamed_addr constant [3 x i8] c"I4\00", align 1
@17 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@18 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@19 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@20 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info.3 = private unnamed_addr constant [3 x i8] c"I4\00", align 1
@23 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@24 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@25 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1

define i32 @main(i32 %0, i8** %1) {
.entry:
  %call_arg_value = alloca i32, align 4
  %2 = call i8* @_lfortran_get_default_allocator()
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %i = alloca i32, align 4
  %j = alloca i32, align 4
  store i32 1, i32* %i, align 4
  store i32 1, i32* %j, align 4
  %3 = load i32, i32* %j, align 4
  %4 = icmp ne i32 %3, 1
  br i1 %4, label %then, label %else

then:                                             ; preds = %.entry
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont

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

ifcont:                                           ; preds = %else, %then
  call void @f(i32* %i, i32* %j)
  %5 = alloca i64, align 8
  %6 = 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 ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %5, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %i, i32* %j)
  %7 = load i64, i64* %5, align 8
  %stringFormat_desc = alloca %string_descriptor, align 8
  %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  store i8* %6, i8** %8, align 8
  %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  store i64 %7, i64* %9, align 8
  %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  %11 = load i8*, i8** %10, align 8
  %12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  %13 = load i64, i64* %12, align 8
  %14 = trunc i64 %13 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %11, i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1)
  %15 = icmp eq i8* %6, null
  br i1 %15, label %free_done, label %free_nonnull

free_nonnull:                                     ; preds = %ifcont
  call void @_lfortran_free_alloc(i8* %2, i8* %6)
  br label %free_done

free_done:                                        ; preds = %free_nonnull, %ifcont
  %16 = load i32, i32* %i, align 4
  %17 = icmp ne i32 %16, 1
  br i1 %17, label %then1, label %else2

then1:                                            ; preds = %free_done
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont3

else2:                                            ; preds = %free_done
  br label %ifcont3

ifcont3:                                          ; preds = %else2, %then1
  %18 = load i32, i32* %j, align 4
  %19 = icmp ne i32 %18, 2
  br i1 %19, label %then4, label %else5

then4:                                            ; preds = %ifcont3
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont6

else5:                                            ; preds = %ifcont3
  br label %ifcont6

ifcont6:                                          ; preds = %else5, %then4
  store i32 1, i32* %j, align 4
  %20 = load i32, i32* %j, align 4
  %21 = icmp ne i32 %20, 1
  br i1 %21, label %then7, label %else8

then7:                                            ; preds = %ifcont6
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont9

else8:                                            ; preds = %ifcont6
  br label %ifcont9

ifcont9:                                          ; preds = %else8, %then7
  store i32 3, i32* %call_arg_value, align 4
  call void @f(i32* %call_arg_value, i32* %j)
  %22 = alloca i64, align 8
  %23 = 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 ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %22, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j)
  %24 = load i64, i64* %22, align 8
  %stringFormat_desc10 = alloca %string_descriptor, align 8
  %25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0
  store i8* %23, i8** %25, align 8
  %26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1
  store i64 %24, i64* %26, align 8
  %27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0
  %28 = load i8*, i8** %27, align 8
  %29 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1
  %30 = load i64, i64* %29, align 8
  %31 = trunc i64 %30 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %28, i32 %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1)
  %32 = icmp eq i8* %23, null
  br i1 %32, label %free_done12, label %free_nonnull11

free_nonnull11:                                   ; preds = %ifcont9
  call void @_lfortran_free_alloc(i8* %2, i8* %23)
  br label %free_done12

free_done12:                                      ; preds = %free_nonnull11, %ifcont9
  %33 = load i32, i32* %j, align 4
  %34 = icmp ne i32 %33, 4
  br i1 %34, label %then13, label %else14

then13:                                           ; preds = %free_done12
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont15

else14:                                           ; preds = %free_done12
  br label %ifcont15

ifcont15:                                         ; preds = %else14, %then13
  store i32 1, i32* %j, align 4
  %35 = load i32, i32* %j, align 4
  %36 = icmp ne i32 %35, 1
  br i1 %36, label %then16, label %else17

then16:                                           ; preds = %ifcont15
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @15, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont18

else17:                                           ; preds = %ifcont15
  br label %ifcont18

ifcont18:                                         ; preds = %else17, %then16
  store i32 3, i32* %call_arg_value, align 4
  call void @f(i32* %call_arg_value, i32* %j)
  %37 = alloca i64, align 8
  %38 = 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 ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i64* %37, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j)
  %39 = load i64, i64* %37, align 8
  %stringFormat_desc19 = alloca %string_descriptor, align 8
  %40 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0
  store i8* %38, i8** %40, align 8
  %41 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1
  store i64 %39, i64* %41, align 8
  %42 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 0
  %43 = load i8*, i8** %42, align 8
  %44 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc19, i32 0, i32 1
  %45 = load i64, i64* %44, align 8
  %46 = trunc i64 %45 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* %43, i32 %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0), i32 1)
  %47 = icmp eq i8* %38, null
  br i1 %47, label %free_done21, label %free_nonnull20

free_nonnull20:                                   ; preds = %ifcont18
  call void @_lfortran_free_alloc(i8* %2, i8* %38)
  br label %free_done21

free_done21:                                      ; preds = %free_nonnull20, %ifcont18
  %48 = load i32, i32* %j, align 4
  %49 = icmp ne i32 %48, 4
  br i1 %49, label %then22, label %else23

then22:                                           ; preds = %free_done21
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont24

else23:                                           ; preds = %free_done21
  br label %ifcont24

ifcont24:                                         ; preds = %else23, %then22
  store i32 1, i32* %j, align 4
  %50 = load i32, i32* %j, align 4
  %51 = icmp ne i32 %50, 1
  br i1 %51, label %then25, label %else26

then25:                                           ; preds = %ifcont24
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont27

else26:                                           ; preds = %ifcont24
  br label %ifcont27

ifcont27:                                         ; preds = %else26, %then25
  %52 = load i32, i32* %i, align 4
  %53 = add i32 %52, 2
  store i32 %53, i32* %call_arg_value, align 4
  call void @f(i32* %call_arg_value, i32* %j)
  %54 = alloca i64, align 8
  %55 = 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 ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i64* %54, i32 0, i32 0, i32 0, i32 0, i32 0, i32* %j)
  %56 = load i64, i64* %54, align 8
  %stringFormat_desc28 = alloca %string_descriptor, align 8
  %57 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc28, i32 0, i32 0
  store i8* %55, i8** %57, align 8
  %58 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc28, i32 0, i32 1
  store i64 %56, i64* %58, align 8
  %59 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc28, i32 0, i32 0
  %60 = load i8*, i8** %59, align 8
  %61 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc28, i32 0, i32 1
  %62 = load i64, i64* %61, align 8
  %63 = trunc i64 %62 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* %60, i32 %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0), i32 1)
  %64 = icmp eq i8* %55, null
  br i1 %64, label %free_done30, label %free_nonnull29

free_nonnull29:                                   ; preds = %ifcont27
  call void @_lfortran_free_alloc(i8* %2, i8* %55)
  br label %free_done30

free_done30:                                      ; preds = %free_nonnull29, %ifcont27
  %65 = load i32, i32* %j, align 4
  %66 = icmp ne i32 %65, 4
  br i1 %66, label %then31, label %else32

then31:                                           ; preds = %free_done30
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @25, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @24, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont33

else32:                                           ; preds = %free_done30
  br label %ifcont33

ifcont33:                                         ; preds = %else32, %then31
  br label %return

return:                                           ; preds = %ifcont33
  br label %FINALIZE_SYMTABLE_subroutines_01

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

define void @f(i32* %a, i32* %b) {
.entry:
  %0 = load i32, i32* %a, align 4
  %1 = add i32 %0, 1
  store i32 %1, i32* %b, align 4
  br label %return

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

FINALIZE_SYMTABLE_f:                              ; preds = %return
  ret void
}

declare void @_lpython_call_initial_functions(i32, i8**)

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

declare void @_lfortran_internal_alloc_finalize()

declare void @exit(i32)

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*)
