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

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

@intrinsics_02.x = internal global float 0x3FEFEB7AA0000000
@0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info = private unnamed_addr constant [6 x i8] c"R4,R8\00", align 1
@1 = 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
@2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 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
@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 [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 [2 x i8] c"\0A\00", align 1
@11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1

define float @_lcompilers_sin_f32(float* %x) {
.entry:
  %_lcompilers_sin_f32 = alloca float, align 4
  %0 = load float, float* %x, align 4
  %1 = call float @_lfortran_ssin(float %0)
  store float %1, float* %_lcompilers_sin_f32, align 4
  br label %return

return:                                           ; preds = %.entry
  br label %FINALIZE_SYMTABLE__lcompilers_sin_f32

FINALIZE_SYMTABLE__lcompilers_sin_f32:            ; preds = %return
  %2 = load float, float* %_lcompilers_sin_f32, align 4
  ret float %2
}

declare float @_lfortran_ssin(float)

define double @_lcompilers_sin_f64(double* %x) {
.entry:
  %_lcompilers_sin_f64 = alloca double, align 8
  %0 = load double, double* %x, align 8
  %1 = call double @_lfortran_dsin(double %0)
  store double %1, double* %_lcompilers_sin_f64, align 8
  br label %return

return:                                           ; preds = %.entry
  br label %FINALIZE_SYMTABLE__lcompilers_sin_f64

FINALIZE_SYMTABLE__lcompilers_sin_f64:            ; preds = %return
  %2 = load double, double* %_lcompilers_sin_f64, align 8
  ret double %2
}

declare double @_lfortran_dsin(double)

define i32 @main(i32 %0, i8** %1) {
.entry:
  %call_arg_value10 = alloca double, align 8
  %call_arg_value = alloca float, align 4
  %stringFormat_desc = alloca %string_descriptor, align 8
  %2 = call i8* @_lfortran_get_default_allocator()
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %y = alloca double, align 8
  store double 0x3FEFEB7A9B2C6D8B, double* %y, align 8
  %3 = alloca i64, align 8
  %4 = call i8* (i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...) @_lcompilers_string_format_fortran(i8* %2, i8* null, i64 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @serialization_info, i32 0, i32 0), i64* %3, i32 0, i32 0, i32 0, i32 0, i32 0, float* @intrinsics_02.x, double* %y)
  %5 = load i64, i64* %3, align 8
  %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  store i8* %4, i8** %6, align 8
  %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  store i64 %5, i64* %7, align 8
  %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  %9 = load i8*, i8** %8, align 8
  %10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  %11 = load i64, i64* %10, align 8
  %12 = trunc i64 %11 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %9, i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1)
  %13 = icmp eq i8* %4, null
  br i1 %13, label %free_done, label %free_nonnull

free_nonnull:                                     ; preds = %.entry
  call void @_lfortran_free_alloc(i8* %2, i8* %4)
  br label %free_done

free_done:                                        ; preds = %free_nonnull, %.entry
  %14 = load float, float* @intrinsics_02.x, align 4
  %15 = fsub float %14, 0x3FEFEB7AA0000000
  %16 = call float @llvm.fabs.f32(float %15)
  %17 = fcmp ogt float %16, 0x3EB0C6F7A0000000
  br i1 %17, label %then, label %else

then:                                             ; preds = %free_done
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, 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]* @2, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont

else:                                             ; preds = %free_done
  br label %ifcont

ifcont:                                           ; preds = %else, %then
  %18 = call float @_lcompilers_sin_f32(float* @intrinsics_02.x)
  %19 = fsub float %18, 0x3FEAE238A0000000
  %20 = call float @llvm.fabs.f32(float %19)
  %21 = fcmp ogt float %20, 0x3EB0C6F7A0000000
  br i1 %21, label %then1, label %else2

then1:                                            ; preds = %ifcont
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, 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]* @4, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont3

else2:                                            ; preds = %ifcont
  br label %ifcont3

ifcont3:                                          ; preds = %else2, %then1
  %22 = load double, double* %y, align 8
  %23 = fsub double %22, 0x3FEFEB7AA0000000
  %24 = call double @llvm.fabs.f64(double %23)
  %25 = fcmp ogt double %24, 0x3E7AD7F2A0000000
  br i1 %25, label %then4, label %else5

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

else5:                                            ; preds = %ifcont3
  br label %ifcont6

ifcont6:                                          ; preds = %else5, %then4
  br i1 false, label %then7, label %else8

then7:                                            ; preds = %ifcont6
  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 %ifcont9

else8:                                            ; preds = %ifcont6
  br label %ifcont9

ifcont9:                                          ; preds = %else8, %then7
  %26 = call double @_lcompilers_sin_f64(double* %y)
  %27 = load float, float* @intrinsics_02.x, align 4
  %28 = call float @_lcompilers_sin_f32(float* @intrinsics_02.x)
  %29 = fadd float %27, %28
  store float %29, float* %call_arg_value, align 4
  %30 = call float @_lcompilers_sin_f32(float* %call_arg_value)
  %31 = fpext float %30 to double
  %32 = fadd double %26, %31
  store double %32, double* %call_arg_value10, align 8
  %33 = call double @_lcompilers_sin_f64(double* %call_arg_value10)
  %34 = fsub double %33, 0x3FEF20DD80000000
  %35 = call double @llvm.fabs.f64(double %34)
  %36 = fcmp ogt double %35, 0x3E7AD7F2A0000000
  br i1 %36, label %then11, label %else12

then11:                                           ; preds = %ifcont9
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, 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]* @10, i32 0, i32 0))
  call void @_lfortran_internal_alloc_finalize()
  call void @exit(i32 1)
  br label %ifcont13

else12:                                           ; preds = %ifcont9
  br label %ifcont13

ifcont13:                                         ; preds = %else12, %then11
  br label %return

return:                                           ; preds = %ifcont13
  br label %FINALIZE_SYMTABLE_intrinsics_02

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

declare void @_lpython_call_initial_functions(i32, i8**)

declare i8* @_lcompilers_string_format_fortran(i8*, i8*, i64, i8*, i64*, i32, i32, i32, i32, i32, ...)

declare i8* @_lfortran_get_default_allocator()

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

declare void @_lfortran_free_alloc(i8*, i8*)

; Function Attrs: nounwind readnone speculatable willreturn
declare float @llvm.fabs.f32(float) #0

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

declare void @_lfortran_internal_alloc_finalize()

declare void @exit(i32)

; Function Attrs: nounwind readnone speculatable willreturn
declare double @llvm.fabs.f64(double) #0

attributes #0 = { nounwind readnone speculatable willreturn }
