; ModuleID = 'LFortran'
source_filename = "LFortran"

@main.main_out = internal global i32 999
@0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@1 = private unnamed_addr constant [13 x i8] c"early return\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 [14 x i8] c"normal return\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 [13 x i8] c"main1 called\00", align 1
@8 = 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)
  call void @main1(i32* @main.main_out)
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @8, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0))
  call void @_lpython_free_argv()
  br label %return

return:                                           ; preds = %.entry
  ret i32 0
}

define void @main1(i32* %out_var) {
.entry:
  %i = alloca i32, align 4
  store i32 10, i32* %i, align 4
  %0 = load i32, i32* %i, align 4
  %1 = icmp sgt i32 %0, 5
  br i1 %1, label %then, label %else

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

unreachable_after_return:                         ; No predecessors!
  br label %ifcont

else:                                             ; preds = %.entry
  br label %ifcont

ifcont:                                           ; preds = %else, %unreachable_after_return
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @4, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @3, i32 0, i32 0))
  %3 = load i32, i32* %i, align 4
  store i32 %3, i32* %out_var, align 4
  br label %return

return:                                           ; preds = %ifcont, %then
  ret void
}

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

declare void @_lpython_call_initial_functions(i32, i8**)

declare void @_lpython_free_argv()
