; ModuleID = 'LFortran'
source_filename = "LFortran"

@__lcompilers_created__nested_context__sub1_x = global i32 0
@n = global i32 0
@x = global i32 0
@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
@3 = private unnamed_addr constant [5 x i8] c"x = \00", align 1
@4 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1

define void @__module_recursion_01_sub1(i32* %x) {
.entry:
  %0 = load i32, i32* %x, align 4
  store i32 %0, i32* @__lcompilers_created__nested_context__sub1_x, align 4
  %1 = load i32, i32* %x, align 4
  %2 = load i32, i32* @n, align 4
  %3 = icmp slt i32 %1, %2
  br i1 %3, label %then, label %else

then:                                             ; preds = %.entry
  %4 = load i32, i32* %x, align 4
  %5 = add i32 %4, 1
  store i32 %5, i32* %x, align 4
  %6 = load i32, i32* %x, align 4
  %7 = sext i32 %6 to i64
  %8 = call i8* (i32, i8*, ...) @_lcompilers_string_format_fortran(i32 4, i8* null, i32 7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i32 2, i64 %7)
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @4, i32 0, i32 0), i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0))
  %9 = load i32, i32* %x, align 4
  store i32 %9, i32* @__lcompilers_created__nested_context__sub1_x, align 4
  call void @__module_recursion_01_sub2()
  %10 = load i32, i32* @__lcompilers_created__nested_context__sub1_x, align 4
  store i32 %10, i32* %x, align 4
  %11 = load i32, i32* %x, align 4
  store i32 %11, i32* @__lcompilers_created__nested_context__sub1_x, align 4
  call void @__module_recursion_01_sub1(i32* @__lcompilers_created__nested_context__sub1_x)
  %12 = load i32, i32* @__lcompilers_created__nested_context__sub1_x, align 4
  store i32 %12, i32* %x, align 4
  br label %ifcont

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

ifcont:                                           ; preds = %else, %then
  %13 = load i32, i32* @__lcompilers_created__nested_context__sub1_x, align 4
  store i32 %13, i32* %x, align 4
  br label %return

return:                                           ; preds = %ifcont
  ret void
}

define void @__module_recursion_01_sub2() {
.entry:
  %0 = load i32, i32* @__lcompilers_created__nested_context__sub1_x, align 4
  %1 = add i32 %0, 1
  store i32 %1, i32* @__lcompilers_created__nested_context__sub1_x, align 4
  %2 = load i32, i32* @__lcompilers_created__nested_context__sub1_x, align 4
  %3 = sext i32 %2 to i64
  %4 = call i8* (i32, i8*, ...) @_lcompilers_string_format_fortran(i32 2, i8* null, i32 2, i64 %3)
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0))
  call void @__module_recursion_01_sub1(i32* @__lcompilers_created__nested_context__sub1_x)
  br label %return

return:                                           ; preds = %.entry
  ret void
}

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

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

define i32 @main(i32 %0, i8** %1) {
.entry:
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  store i32 10, i32* @n, align 4
  call void @__module_recursion_01_sub1(i32* @x)
  call void @_lpython_free_argv()
  br label %return

return:                                           ; preds = %.entry
  ret i32 0
}

declare void @_lpython_call_initial_functions(i32, i8**)

declare void @_lpython_free_argv()
