; ModuleID = 'LFortran'
source_filename = "LFortran"

@0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@1 = private unnamed_addr constant [2 x i8] c"1\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 [2 x i8] c"2\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 [2 x i8] c"3\00", align 1
@8 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@9 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@10 = private unnamed_addr constant [2 x i8] c"4\00", align 1
@11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@12 = private unnamed_addr constant [11 x i8] c"ERROR STOP\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
@15 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@16 = private unnamed_addr constant [2 x i8] c"1\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 [6 x i8] c"2,3,4\00", align 1
@20 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@21 = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1
@22 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@23 = 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
  %out = alloca i32, align 4
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %i1 = alloca i32, align 4
  %out2 = alloca i32, align 4
  store i32 4, i32* %i1, align 4
  %2 = load i32, i32* %i1, align 4
  %3 = icmp eq i32 %2, 1
  br i1 %3, label %then, label %else

then:                                             ; preds = %.entry
  store i32 10, i32* %out2, align 4
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @2, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0))
  br label %ifcont11

else:                                             ; preds = %.entry
  %4 = load i32, i32* %i1, align 4
  %5 = icmp eq i32 %4, 2
  br i1 %5, label %then3, label %else4

then3:                                            ; preds = %else
  store i32 20, i32* %out2, align 4
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @3, i32 0, i32 0))
  br label %ifcont10

else4:                                            ; preds = %else
  %6 = load i32, i32* %i1, align 4
  %7 = icmp eq i32 %6, 3
  br i1 %7, label %then5, label %else6

then5:                                            ; preds = %else4
  store i32 30, i32* %out2, align 4
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @8, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0))
  br label %ifcont9

else6:                                            ; preds = %else4
  %8 = load i32, i32* %i1, align 4
  %9 = icmp eq i32 %8, 4
  br i1 %9, label %then7, label %else8

then7:                                            ; preds = %else6
  store i32 40, i32* %out2, align 4
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @9, i32 0, i32 0))
  br label %ifcont

else8:                                            ; preds = %else6
  br label %ifcont

ifcont:                                           ; preds = %else8, %then7
  br label %ifcont9

ifcont9:                                          ; preds = %ifcont, %then5
  br label %ifcont10

ifcont10:                                         ; preds = %ifcont9, %then3
  br label %ifcont11

ifcont11:                                         ; preds = %ifcont10, %then
  %10 = load i32, i32* %out2, align 4
  %11 = icmp ne i32 %10, 40
  br i1 %11, label %then12, label %else13

then12:                                           ; preds = %ifcont11
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @14, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @12, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @13, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont14

else13:                                           ; preds = %ifcont11
  br label %ifcont14

ifcont14:                                         ; preds = %else13, %then12
  %12 = load i32, i32* %i1, align 4
  %13 = icmp eq i32 %12, 1
  br i1 %13, label %then15, label %else16

then15:                                           ; preds = %ifcont14
  store i32 11, i32* %out2, align 4
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @17, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @15, i32 0, i32 0))
  br label %ifcont20

else16:                                           ; preds = %ifcont14
  %14 = load i32, i32* %i1, align 4
  %15 = icmp eq i32 %14, 2
  %16 = load i32, i32* %i1, align 4
  %17 = icmp eq i32 %16, 3
  %18 = icmp eq i1 %15, false
  %19 = select i1 %18, i1 %17, i1 %15
  %20 = load i32, i32* %i1, align 4
  %21 = icmp eq i32 %20, 4
  %22 = icmp eq i1 %19, false
  %23 = select i1 %22, i1 %21, i1 %19
  br i1 %23, label %then17, label %else18

then17:                                           ; preds = %else16
  store i32 22, i32* %out2, align 4
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @20, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @19, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @18, i32 0, i32 0))
  br label %ifcont19

else18:                                           ; preds = %else16
  br label %ifcont19

ifcont19:                                         ; preds = %else18, %then17
  br label %ifcont20

ifcont20:                                         ; preds = %ifcont19, %then15
  %24 = load i32, i32* %out2, align 4
  %25 = icmp ne i32 %24, 22
  br i1 %25, label %then21, label %else22

then21:                                           ; preds = %ifcont20
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @23, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @21, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @22, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont23

else22:                                           ; preds = %ifcont20
  br label %ifcont23

ifcont23:                                         ; preds = %else22, %then21
  call void @_lpython_free_argv()
  br label %return

return:                                           ; preds = %ifcont23
  ret i32 0
}

declare void @_lpython_call_initial_functions(i32, i8**)

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

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

declare void @exit(i32)

declare void @_lpython_free_argv()
