; 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:
  %i = alloca i32, align 4
  %j = alloca i32, align 4
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %i1 = alloca i32, align 4
  %j2 = alloca i32, align 4
  store i32 0, i32* %j2, align 4
  store i32 0, i32* %i1, align 4
  br label %loop.head

loop.head:                                        ; preds = %ifcont5, %.entry
  %2 = load i32, i32* %i1, align 4
  %3 = add i32 %2, 1
  %4 = icmp sle i32 %3, 10
  br i1 %4, label %loop.body, label %loop.end

loop.body:                                        ; preds = %loop.head
  %5 = load i32, i32* %i1, align 4
  %6 = add i32 %5, 1
  store i32 %6, i32* %i1, align 4
  %7 = load i32, i32* %j2, align 4
  %8 = load i32, i32* %i1, align 4
  %9 = add i32 %7, %8
  store i32 %9, i32* %j2, align 4
  %10 = load i32, i32* %i1, align 4
  %11 = icmp eq i32 %10, 3
  br i1 %11, label %then, label %else

then:                                             ; preds = %loop.body
  br label %ifcont

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

ifcont:                                           ; preds = %else, %then
  %12 = load i32, i32* %i1, align 4
  %13 = icmp eq i32 %12, 2
  br i1 %13, label %then3, label %else4

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

unreachable_after_exit:                           ; No predecessors!
  br label %ifcont5

else4:                                            ; preds = %ifcont
  br label %ifcont5

ifcont5:                                          ; preds = %else4, %unreachable_after_exit
  br label %loop.head

loop.end:                                         ; preds = %then3, %loop.head
  %14 = load i32, i32* %j2, align 4
  %15 = icmp ne i32 %14, 3
  br i1 %15, label %then6, label %else7

then6:                                            ; 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 %ifcont8

else7:                                            ; preds = %loop.end
  br label %ifcont8

ifcont8:                                          ; preds = %else7, %then6
  %16 = load i32, i32* %j2, align 4
  %17 = sext i32 %16 to i64
  %18 = call i8* (i32, i8*, ...) @_lcompilers_string_format_fortran(i32 2, i8* null, i32 2, i64 %17)
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @4, i32 0, i32 0), i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @3, i32 0, i32 0))
  store i32 0, i32* %j2, align 4
  store i32 0, i32* %i1, align 4
  br label %loop.head9

loop.head9:                                       ; preds = %ifcont14, %ifcont8
  %19 = load i32, i32* %i1, align 4
  %20 = add i32 %19, 1
  %21 = icmp sle i32 %20, 10
  br i1 %21, label %loop.body10, label %loop.end15

loop.body10:                                      ; preds = %loop.head9
  %22 = load i32, i32* %i1, align 4
  %23 = add i32 %22, 1
  store i32 %23, i32* %i1, align 4
  %24 = load i32, i32* %i1, align 4
  %25 = icmp eq i32 %24, 2
  br i1 %25, label %then11, label %else13

then11:                                           ; preds = %loop.body10
  br label %loop.end15

unreachable_after_exit12:                         ; No predecessors!
  br label %ifcont14

else13:                                           ; preds = %loop.body10
  br label %ifcont14

ifcont14:                                         ; preds = %else13, %unreachable_after_exit12
  %26 = load i32, i32* %j2, align 4
  %27 = load i32, i32* %i1, align 4
  %28 = add i32 %26, %27
  store i32 %28, i32* %j2, align 4
  br label %loop.head9

loop.end15:                                       ; preds = %then11, %loop.head9
  %29 = load i32, i32* %j2, align 4
  %30 = icmp ne i32 %29, 1
  br i1 %30, label %then16, label %else17

then16:                                           ; preds = %loop.end15
  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 %ifcont18

else17:                                           ; preds = %loop.end15
  br label %ifcont18

ifcont18:                                         ; preds = %else17, %then16
  %31 = load i32, i32* %j2, align 4
  %32 = sext i32 %31 to i64
  %33 = call i8* (i32, i8*, ...) @_lcompilers_string_format_fortran(i32 2, i8* null, i32 2, i64 %32)
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* %33, 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 %loop.head19

loop.head19:                                      ; preds = %ifcont23, %then21, %ifcont18
  %34 = load i32, i32* %i1, align 4
  %35 = add i32 %34, 1
  %36 = icmp sle i32 %35, 10
  br i1 %36, label %loop.body20, label %loop.end24

loop.body20:                                      ; preds = %loop.head19
  %37 = load i32, i32* %i1, align 4
  %38 = add i32 %37, 1
  store i32 %38, i32* %i1, align 4
  %39 = load i32, i32* %i1, align 4
  %40 = icmp eq i32 %39, 2
  br i1 %40, label %then21, label %else22

then21:                                           ; preds = %loop.body20
  br label %loop.head19

unreachable_after_cycle:                          ; No predecessors!
  br label %ifcont23

else22:                                           ; preds = %loop.body20
  br label %ifcont23

ifcont23:                                         ; preds = %else22, %unreachable_after_cycle
  %41 = load i32, i32* %j2, align 4
  %42 = load i32, i32* %i1, align 4
  %43 = add i32 %41, %42
  store i32 %43, i32* %j2, align 4
  br label %loop.head19

loop.end24:                                       ; preds = %loop.head19
  %44 = load i32, i32* %j2, align 4
  %45 = icmp ne i32 %44, 53
  br i1 %45, label %then25, label %else26

then25:                                           ; preds = %loop.end24
  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 %ifcont27

else26:                                           ; preds = %loop.end24
  br label %ifcont27

ifcont27:                                         ; preds = %else26, %then25
  %46 = load i32, i32* %j2, align 4
  %47 = sext i32 %46 to i64
  %48 = call i8* (i32, i8*, ...) @_lcompilers_string_format_fortran(i32 2, i8* null, i32 2, i64 %47)
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @14, i32 0, i32 0), i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @13, i32 0, i32 0))
  call void @_lpython_free_argv()
  br label %return

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