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

define i32 @main(i32 %0, i8** %1) {
.entry:
  %i = alloca i32, align 4
  %j = alloca i32, align 4
  %k = alloca i32, align 4
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %i1 = alloca i32, align 4
  %j2 = alloca i32, align 4
  %k3 = alloca i32, align 4
  store i32 0, i32* %j2, align 4
  store i32 2, i32* %k3, align 4
  %2 = load i32, i32* %k3, align 4
  %3 = sub i32 1, %2
  store i32 %3, i32* %i1, align 4
  br label %loop.head

loop.head:                                        ; preds = %loop.body, %.entry
  %4 = load i32, i32* %k3, align 4
  %5 = icmp sgt i32 %4, 0
  %6 = load i32, i32* %i1, align 4
  %7 = load i32, i32* %k3, align 4
  %8 = add i32 %6, %7
  %9 = icmp sle i32 %8, 10
  %10 = icmp eq i1 %5, false
  %11 = select i1 %10, i1 %5, i1 %9
  %12 = load i32, i32* %k3, align 4
  %13 = icmp sle i32 %12, 0
  %14 = load i32, i32* %i1, align 4
  %15 = load i32, i32* %k3, align 4
  %16 = add i32 %14, %15
  %17 = icmp sge i32 %16, 10
  %18 = icmp eq i1 %13, false
  %19 = select i1 %18, i1 %13, i1 %17
  %20 = icmp eq i1 %11, false
  %21 = select i1 %20, i1 %19, i1 %11
  br i1 %21, label %loop.body, label %loop.end

loop.body:                                        ; preds = %loop.head
  %22 = load i32, i32* %i1, align 4
  %23 = load i32, i32* %k3, align 4
  %24 = add i32 %22, %23
  store i32 %24, i32* %i1, align 4
  %25 = load i32, i32* %j2, align 4
  %26 = load i32, i32* %i1, align 4
  %27 = add i32 %25, %26
  store i32 %27, i32* %j2, align 4
  br label %loop.head

loop.end:                                         ; preds = %loop.head
  %28 = load i32, i32* %j2, align 4
  %29 = icmp ne i32 %28, 25
  br i1 %29, 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
  %30 = load i32, i32* %j2, align 4
  %31 = sext i32 %30 to i64
  %32 = call i8* (i32, i8*, ...) @_lcompilers_string_format_fortran(i32 2, i8* null, i32 2, i64 %31)
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @4, i32 0, i32 0), i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @3, i32 0, i32 0))
  store i32 0, i32* %j2, align 4
  store i32 -2, i32* %k3, align 4
  %33 = load i32, i32* %k3, align 4
  %34 = sub i32 10, %33
  store i32 %34, i32* %i1, align 4
  br label %loop.head4

loop.head4:                                       ; preds = %loop.body5, %ifcont
  %35 = load i32, i32* %k3, align 4
  %36 = icmp sgt i32 %35, 0
  %37 = load i32, i32* %i1, align 4
  %38 = load i32, i32* %k3, align 4
  %39 = add i32 %37, %38
  %40 = icmp sle i32 %39, 1
  %41 = icmp eq i1 %36, false
  %42 = select i1 %41, i1 %36, i1 %40
  %43 = load i32, i32* %k3, align 4
  %44 = icmp sle i32 %43, 0
  %45 = load i32, i32* %i1, align 4
  %46 = load i32, i32* %k3, align 4
  %47 = add i32 %45, %46
  %48 = icmp sge i32 %47, 1
  %49 = icmp eq i1 %44, false
  %50 = select i1 %49, i1 %44, i1 %48
  %51 = icmp eq i1 %42, false
  %52 = select i1 %51, i1 %50, i1 %42
  br i1 %52, label %loop.body5, label %loop.end6

loop.body5:                                       ; preds = %loop.head4
  %53 = load i32, i32* %i1, align 4
  %54 = load i32, i32* %k3, align 4
  %55 = add i32 %53, %54
  store i32 %55, i32* %i1, align 4
  %56 = load i32, i32* %j2, align 4
  %57 = load i32, i32* %i1, align 4
  %58 = add i32 %56, %57
  store i32 %58, i32* %j2, align 4
  br label %loop.head4

loop.end6:                                        ; preds = %loop.head4
  %59 = load i32, i32* %j2, align 4
  %60 = icmp ne i32 %59, 30
  br i1 %60, label %then7, label %else8

then7:                                            ; preds = %loop.end6
  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 %ifcont9

else8:                                            ; preds = %loop.end6
  br label %ifcont9

ifcont9:                                          ; preds = %else8, %then7
  %61 = load i32, i32* %j2, align 4
  %62 = sext i32 %61 to i64
  %63 = call i8* (i32, i8*, ...) @_lcompilers_string_format_fortran(i32 2, i8* null, i32 2, i64 %62)
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0))
  store i32 0, i32* %j2, align 4
  store i32 0, i32* %i1, align 4
  br label %a.head

a.head:                                           ; preds = %ifcont12, %ifcont9
  %64 = load i32, i32* %i1, align 4
  %65 = add i32 %64, 1
  %66 = icmp sle i32 %65, 10
  br i1 %66, label %a.body, label %a.end

a.body:                                           ; preds = %a.head
  %67 = load i32, i32* %i1, align 4
  %68 = add i32 %67, 1
  store i32 %68, i32* %i1, align 4
  %69 = load i32, i32* %j2, align 4
  %70 = load i32, i32* %i1, align 4
  %71 = add i32 %69, %70
  store i32 %71, i32* %j2, align 4
  %72 = load i32, i32* %i1, align 4
  %73 = icmp eq i32 %72, 2
  br i1 %73, label %then10, label %else11

then10:                                           ; preds = %a.body
  br label %a.end

unreachable_after_exit:                           ; No predecessors!
  br label %ifcont12

else11:                                           ; preds = %a.body
  br label %ifcont12

ifcont12:                                         ; preds = %else11, %unreachable_after_exit
  br label %a.head

a.end:                                            ; preds = %then10, %a.head
  %74 = load i32, i32* %j2, align 4
  %75 = icmp ne i32 %74, 3
  br i1 %75, label %then13, label %else14

then13:                                           ; preds = %a.end
  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 %ifcont15

else14:                                           ; preds = %a.end
  br label %ifcont15

ifcont15:                                         ; preds = %else14, %then13
  store i32 0, i32* %j2, align 4
  store i32 -1, i32* %i1, align 4
  br label %b.head

b.head:                                           ; preds = %ifcont19, %ifcont15
  %76 = load i32, i32* %i1, align 4
  %77 = add i32 %76, 2
  %78 = icmp sle i32 %77, 10
  br i1 %78, label %b.body, label %b.end

b.body:                                           ; preds = %b.head
  %79 = load i32, i32* %i1, align 4
  %80 = add i32 %79, 2
  store i32 %80, i32* %i1, align 4
  %81 = load i32, i32* %j2, align 4
  %82 = load i32, i32* %i1, align 4
  %83 = add i32 %81, %82
  store i32 %83, i32* %j2, align 4
  %84 = load i32, i32* %i1, align 4
  %85 = icmp eq i32 %84, 3
  br i1 %85, label %then16, label %else18

then16:                                           ; preds = %b.body
  br label %b.end

unreachable_after_exit17:                         ; No predecessors!
  br label %ifcont19

else18:                                           ; preds = %b.body
  br label %ifcont19

ifcont19:                                         ; preds = %else18, %unreachable_after_exit17
  br label %b.head

b.end:                                            ; preds = %then16, %b.head
  %86 = load i32, i32* %j2, align 4
  %87 = icmp ne i32 %86, 4
  br i1 %87, label %then20, label %else21

then20:                                           ; preds = %b.end
  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]* @13, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont22

else21:                                           ; preds = %b.end
  br label %ifcont22

ifcont22:                                         ; preds = %else21, %then20
  store i32 0, i32* %j2, align 4
  store i32 1, i32* %i1, align 4
  br label %c.head

c.head:                                           ; preds = %ifcont26, %ifcont22
  br i1 true, label %c.body, label %c.end

c.body:                                           ; preds = %c.head
  %88 = load i32, i32* %j2, align 4
  %89 = load i32, i32* %i1, align 4
  %90 = add i32 %88, %89
  store i32 %90, i32* %j2, align 4
  %91 = load i32, i32* %i1, align 4
  %92 = icmp eq i32 %91, 2
  br i1 %92, label %then23, label %else25

then23:                                           ; preds = %c.body
  br label %c.end

unreachable_after_exit24:                         ; No predecessors!
  br label %ifcont26

else25:                                           ; preds = %c.body
  br label %ifcont26

ifcont26:                                         ; preds = %else25, %unreachable_after_exit24
  %93 = load i32, i32* %i1, align 4
  %94 = add i32 %93, 1
  store i32 %94, i32* %i1, align 4
  br label %c.head

c.end:                                            ; preds = %then23, %c.head
  %95 = load i32, i32* %j2, align 4
  %96 = icmp ne i32 %95, 3
  br i1 %96, label %then27, label %else28

then27:                                           ; preds = %c.end
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @18, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @17, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont29

else28:                                           ; preds = %c.end
  br label %ifcont29

ifcont29:                                         ; preds = %else28, %then27
  store i32 2, i32* %k3, align 4
  %97 = load i32, i32* %k3, align 4
  %98 = sub i32 1, %97
  store i32 %98, i32* %i1, align 4
  br label %loop.head30

loop.head30:                                      ; preds = %goto_target, %ifcont29
  %99 = load i32, i32* %k3, align 4
  %100 = icmp sgt i32 %99, 0
  %101 = load i32, i32* %i1, align 4
  %102 = load i32, i32* %k3, align 4
  %103 = add i32 %101, %102
  %104 = icmp sle i32 %103, 10
  %105 = icmp eq i1 %100, false
  %106 = select i1 %105, i1 %100, i1 %104
  %107 = load i32, i32* %k3, align 4
  %108 = icmp sle i32 %107, 0
  %109 = load i32, i32* %i1, align 4
  %110 = load i32, i32* %k3, align 4
  %111 = add i32 %109, %110
  %112 = icmp sge i32 %111, 10
  %113 = icmp eq i1 %108, false
  %114 = select i1 %113, i1 %108, i1 %112
  %115 = icmp eq i1 %106, false
  %116 = select i1 %115, i1 %114, i1 %106
  br i1 %116, label %loop.body31, label %loop.end32

loop.body31:                                      ; preds = %loop.head30
  %117 = load i32, i32* %i1, align 4
  %118 = load i32, i32* %k3, align 4
  %119 = add i32 %117, %118
  store i32 %119, i32* %i1, align 4
  br label %goto_target

goto_target:                                      ; preds = %loop.body31
  br label %loop.head30

loop.end32:                                       ; preds = %loop.head30
  call void @_lpython_free_argv()
  br label %return

return:                                           ; preds = %loop.end32
  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()
