; ModuleID = 'LFortran'
source_filename = "LFortran"
target datalayout = "..."

%string_descriptor = type <{ i8*, i64 }>

@0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@string_const_data = private constant [1 x i8] c"1"
@string_const = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data, i32 0, i32 0), i64 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
@string_const_data.1 = private constant [1 x i8] c"2"
@string_const.2 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.1, i32 0, i32 0), i64 1 }>
@3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@string_const_data.3 = private constant [1 x i8] c"3"
@string_const.4 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.3, i32 0, i32 0), i64 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
@string_const_data.5 = private constant [1 x i8] c"4"
@string_const.6 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.5, i32 0, i32 0), i64 1 }>
@7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\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 [2 x i8] c"\0A\00", align 1
@string_const_data.7 = private constant [1 x i8] c"1"
@string_const.8 = private global %string_descriptor <{ i8* getelementptr inbounds ([1 x i8], [1 x i8]* @string_const_data.7, i32 0, i32 0), i64 1 }>
@11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@string_const_data.9 = private constant [5 x i8] c"2,3,4"
@string_const.10 = private global %string_descriptor <{ i8* getelementptr inbounds ([5 x i8], [5 x i8]* @string_const_data.9, i32 0, i32 0), i64 5 }>
@13 = private unnamed_addr constant [5 x i8] c"%s%s\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

define i32 @main(i32 %0, i8** %1) {
.entry:
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %i = alloca i64, align 8
  %out = alloca i64, align 8
  store i64 4, i64* %i, align 8
  %2 = load i64, i64* %i, align 8
  %3 = icmp eq i64 %2, 1
  br i1 %3, label %then, label %else

then:                                             ; preds = %.entry
  store i64 10, i64* %out, align 8
  %4 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const, i32 0, i32 0), align 8
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %4, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1)
  br label %ifcont9

else:                                             ; preds = %.entry
  %5 = load i64, i64* %i, align 8
  %6 = icmp eq i64 %5, 2
  br i1 %6, label %then1, label %else2

then1:                                            ; preds = %else
  store i64 20, i64* %out, align 8
  %7 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.2, i32 0, i32 0), align 8
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %7, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1)
  br label %ifcont8

else2:                                            ; preds = %else
  %8 = load i64, i64* %i, align 8
  %9 = icmp eq i64 %8, 3
  br i1 %9, label %then3, label %else4

then3:                                            ; preds = %else2
  store i64 30, i64* %out, align 8
  %10 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.4, i32 0, i32 0), align 8
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %10, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1)
  br label %ifcont7

else4:                                            ; preds = %else2
  %11 = load i64, i64* %i, align 8
  %12 = icmp eq i64 %11, 4
  br i1 %12, label %then5, label %else6

then5:                                            ; preds = %else4
  store i64 40, i64* %out, align 8
  %13 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.6, i32 0, i32 0), align 8
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %13, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1)
  br label %ifcont

else6:                                            ; preds = %else4
  br label %ifcont

ifcont:                                           ; preds = %else6, %then5
  br label %ifcont7

ifcont7:                                          ; preds = %ifcont, %then3
  br label %ifcont8

ifcont8:                                          ; preds = %ifcont7, %then1
  br label %ifcont9

ifcont9:                                          ; preds = %ifcont8, %then
  %14 = load i64, i64* %out, align 8
  %15 = icmp ne i64 %14, 40
  br i1 %15, label %then10, label %else11

then10:                                           ; preds = %ifcont9
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont12

else11:                                           ; preds = %ifcont9
  br label %ifcont12

ifcont12:                                         ; preds = %else11, %then10
  %16 = load i64, i64* %i, align 8
  %17 = icmp eq i64 %16, 1
  br i1 %17, label %then13, label %else14

then13:                                           ; preds = %ifcont12
  store i64 11, i64* %out, align 8
  %18 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.8, i32 0, i32 0), align 8
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* %18, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0), i32 1)
  br label %ifcont18

else14:                                           ; preds = %ifcont12
  %19 = load i64, i64* %i, align 8
  %20 = icmp eq i64 %19, 2
  %21 = load i64, i64* %i, align 8
  %22 = icmp eq i64 %21, 3
  %23 = or i1 %20, %22
  %24 = load i64, i64* %i, align 8
  %25 = icmp eq i64 %24, 4
  %26 = or i1 %23, %25
  br i1 %26, label %then15, label %else16

then15:                                           ; preds = %else14
  store i64 22, i64* %out, align 8
  %27 = load i8*, i8** getelementptr inbounds (%string_descriptor, %string_descriptor* @string_const.10, i32 0, i32 0), align 8
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* %27, i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0), i32 1)
  br label %ifcont17

else16:                                           ; preds = %else14
  br label %ifcont17

ifcont17:                                         ; preds = %else16, %then15
  br label %ifcont18

ifcont18:                                         ; preds = %ifcont17, %then13
  %28 = load i64, i64* %out, align 8
  %29 = icmp ne i64 %28, 22
  br i1 %29, label %then19, label %else20

then19:                                           ; preds = %ifcont18
  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]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @14, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont21

else20:                                           ; preds = %ifcont18
  br label %ifcont21

ifcont21:                                         ; preds = %else20, %then19
  br label %return

return:                                           ; preds = %ifcont21
  br label %FINALIZE_SYMTABLE_case_01

FINALIZE_SYMTABLE_case_01:                        ; preds = %return
  call void @_lfortran_internal_alloc_finalize()
  ret i32 0
}

declare void @_lpython_call_initial_functions(i32, i8**)

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

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

declare void @_lfortran_internal_alloc_finalize()

declare void @exit(i32)
