; ModuleID = 'LFortran'
source_filename = "LFortran"

@0 = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1
@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@2 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@3 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@4 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@5 = private unnamed_addr constant [11 x i8] c"ERROR STOP\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 [11 x i8] c"ERROR STOP\00", align 1
@11 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@12 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@13 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@14 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1

define i32 @main(i32 %0, i8** %1) {
.entry:
  %a = alloca i32, align 4
  %b = alloca i32, align 4
  %i = alloca i32, align 4
  %j = alloca i32, align 4
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %a1 = alloca i32, align 4
  %b2 = alloca i32, align 4
  %i3 = alloca i32, align 4
  %j4 = alloca i32, align 4
  store i32 0, i32* %j4, align 4
  store i32 1, i32* %a1, align 4
  store i32 10, i32* %b2, align 4
  %2 = load i32, i32* %a1, align 4
  %3 = sub i32 %2, 1
  store i32 %3, i32* %i3, align 4
  br label %loop.head

loop.head:                                        ; preds = %loop.body, %.entry
  %4 = load i32, i32* %i3, align 4
  %5 = add i32 %4, 1
  %6 = load i32, i32* %b2, align 4
  %7 = icmp sle i32 %5, %6
  br i1 %7, label %loop.body, label %loop.end

loop.body:                                        ; preds = %loop.head
  %8 = load i32, i32* %i3, align 4
  %9 = add i32 %8, 1
  store i32 %9, i32* %i3, align 4
  %10 = load i32, i32* %j4, align 4
  %11 = load i32, i32* %i3, align 4
  %12 = add i32 %10, %11
  store i32 %12, i32* %j4, align 4
  br label %loop.head

loop.end:                                         ; preds = %loop.head
  %13 = load i32, i32* %j4, align 4
  %14 = icmp ne i32 %13, 55
  br i1 %14, label %then, label %else

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

else:                                             ; preds = %loop.end
  br label %ifcont

ifcont:                                           ; preds = %else, %then
  %15 = load i32, i32* %j4, align 4
  %16 = sext i32 %15 to i64
  %17 = call i8* (i32, i8*, ...) @_lcompilers_string_format_fortran(i32 2, i8* null, i32 2, i64 %16)
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @4, i32 0, i32 0), i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @3, i32 0, i32 0))
  store i32 0, i32* %a1, align 4
  store i32 0, i32* %i3, align 4
  br label %loop.head5

loop.head5:                                       ; preds = %loop.end9, %ifcont
  %18 = load i32, i32* %i3, align 4
  %19 = add i32 %18, 1
  %20 = icmp sle i32 %19, 10
  br i1 %20, label %loop.body6, label %loop.end10

loop.body6:                                       ; preds = %loop.head5
  %21 = load i32, i32* %i3, align 4
  %22 = add i32 %21, 1
  store i32 %22, i32* %i3, align 4
  store i32 0, i32* %j4, align 4
  br label %loop.head7

loop.head7:                                       ; preds = %loop.body8, %loop.body6
  %23 = load i32, i32* %j4, align 4
  %24 = add i32 %23, 1
  %25 = icmp sle i32 %24, 10
  br i1 %25, label %loop.body8, label %loop.end9

loop.body8:                                       ; preds = %loop.head7
  %26 = load i32, i32* %j4, align 4
  %27 = add i32 %26, 1
  store i32 %27, i32* %j4, align 4
  %28 = load i32, i32* %a1, align 4
  %29 = load i32, i32* %i3, align 4
  %30 = sub i32 %29, 1
  %31 = mul i32 %30, 10
  %32 = add i32 %28, %31
  %33 = load i32, i32* %j4, align 4
  %34 = add i32 %32, %33
  store i32 %34, i32* %a1, align 4
  br label %loop.head7

loop.end9:                                        ; preds = %loop.head7
  br label %loop.head5

loop.end10:                                       ; preds = %loop.head5
  %35 = load i32, i32* %a1, align 4
  %36 = icmp ne i32 %35, 5050
  br i1 %36, label %then11, label %else12

then11:                                           ; preds = %loop.end10
  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]* @5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont13

else12:                                           ; preds = %loop.end10
  br label %ifcont13

ifcont13:                                         ; preds = %else12, %then11
  %37 = load i32, i32* %a1, align 4
  %38 = sext i32 %37 to i64
  %39 = call i8* (i32, i8*, ...) @_lcompilers_string_format_fortran(i32 2, i8* null, i32 2, i64 %38)
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0))
  store i32 0, i32* %a1, align 4
  store i32 0, i32* %i3, align 4
  br label %loop.head14

loop.head14:                                      ; preds = %loop.end18, %ifcont13
  %40 = load i32, i32* %i3, align 4
  %41 = add i32 %40, 1
  %42 = icmp sle i32 %41, 10
  br i1 %42, label %loop.body15, label %loop.end19

loop.body15:                                      ; preds = %loop.head14
  %43 = load i32, i32* %i3, align 4
  %44 = add i32 %43, 1
  store i32 %44, i32* %i3, align 4
  store i32 0, i32* %j4, align 4
  br label %loop.head16

loop.head16:                                      ; preds = %loop.body17, %loop.body15
  %45 = load i32, i32* %j4, align 4
  %46 = add i32 %45, 1
  %47 = load i32, i32* %i3, align 4
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %loop.body17, label %loop.end18

loop.body17:                                      ; preds = %loop.head16
  %49 = load i32, i32* %j4, align 4
  %50 = add i32 %49, 1
  store i32 %50, i32* %j4, align 4
  %51 = load i32, i32* %a1, align 4
  %52 = load i32, i32* %j4, align 4
  %53 = add i32 %51, %52
  store i32 %53, i32* %a1, align 4
  br label %loop.head16

loop.end18:                                       ; preds = %loop.head16
  br label %loop.head14

loop.end19:                                       ; preds = %loop.head14
  %54 = load i32, i32* %a1, align 4
  %55 = icmp ne i32 %54, 220
  br i1 %55, label %then20, label %else21

then20:                                           ; preds = %loop.end19
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @12, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @10, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @11, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont22

else21:                                           ; preds = %loop.end19
  br label %ifcont22

ifcont22:                                         ; preds = %else21, %then20
  %56 = load i32, i32* %a1, align 4
  %57 = sext i32 %56 to i64
  %58 = call i8* (i32, i8*, ...) @_lcompilers_string_format_fortran(i32 2, i8* null, i32 2, i64 %57)
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @14, i32 0, i32 0), i8* %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @13, i32 0, i32 0))
  call void @_lpython_free_argv()
  br label %return

return:                                           ; preds = %ifcont22
  ret i32 0
}

declare void @_lpython_call_initial_functions(i32, i8**)

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

declare void @exit(i32)

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

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

declare void @_lpython_free_argv()
