; ModuleID = 'LFortran'
source_filename = "LFortran"

@intrinsics_02.x = internal global float 0x3FEFEB7AA0000000
@0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@2 = private unnamed_addr constant [11 x i8] c"ERROR STOP\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 [11 x i8] c"ERROR STOP\00", align 1
@9 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@10 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@11 = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1
@12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@14 = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1
@15 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@16 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1

define float @_lcompilers_abs_f32(float* %x) {
.entry:
  %_lcompilers_abs_f32 = alloca float, align 4
  %0 = load float, float* %x, align 4
  %1 = fcmp oge float %0, 0.000000e+00
  br i1 %1, label %then, label %else

then:                                             ; preds = %.entry
  %2 = load float, float* %x, align 4
  store float %2, float* %_lcompilers_abs_f32, align 4
  br label %ifcont

else:                                             ; preds = %.entry
  %3 = load float, float* %x, align 4
  %4 = fneg float %3
  store float %4, float* %_lcompilers_abs_f32, align 4
  br label %ifcont

ifcont:                                           ; preds = %else, %then
  br label %return

return:                                           ; preds = %ifcont
  %5 = load float, float* %_lcompilers_abs_f32, align 4
  ret float %5
}

define double @_lcompilers_abs_f64(double* %x) {
.entry:
  %_lcompilers_abs_f64 = alloca double, align 8
  %0 = load double, double* %x, align 8
  %1 = fcmp oge double %0, 0.000000e+00
  br i1 %1, label %then, label %else

then:                                             ; preds = %.entry
  %2 = load double, double* %x, align 8
  store double %2, double* %_lcompilers_abs_f64, align 8
  br label %ifcont

else:                                             ; preds = %.entry
  %3 = load double, double* %x, align 8
  %4 = fneg double %3
  store double %4, double* %_lcompilers_abs_f64, align 8
  br label %ifcont

ifcont:                                           ; preds = %else, %then
  br label %return

return:                                           ; preds = %ifcont
  %5 = load double, double* %_lcompilers_abs_f64, align 8
  ret double %5
}

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
  %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
  %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_value14 = alloca double, align 8
  %call_arg_value13 = alloca double, align 8
  %call_arg_value12 = alloca float, align 4
  %call_arg_value5 = alloca double, align 8
  %call_arg_value1 = alloca float, align 4
  %call_arg_value = alloca float, align 4
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %y = alloca double, align 8
  store double 0x3FEFEB7A9B2C6D8B, double* %y, align 8
  %2 = load float, float* @intrinsics_02.x, align 4
  %3 = fpext float %2 to double
  %4 = load double, double* %y, align 8
  %5 = call i8* (i32, i8*, ...) @_lcompilers_string_format_fortran(i32 4, i8* null, i32 6, double %3, i32 5, double %4)
  call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0))
  %6 = load float, float* @intrinsics_02.x, align 4
  %7 = fsub float %6, 0x3FEFEB7AA0000000
  store float %7, float* %call_arg_value, align 4
  %8 = call float @_lcompilers_abs_f32(float* %call_arg_value)
  %9 = fcmp ogt float %8, 0x3EB0C6F7A0000000
  br i1 %9, label %then, label %else

then:                                             ; preds = %.entry
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @4, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @2, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @3, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont

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

ifcont:                                           ; preds = %else, %then
  %10 = call float @_lcompilers_sin_f32(float* @intrinsics_02.x)
  %11 = fsub float %10, 0x3FEAE238A0000000
  store float %11, float* %call_arg_value1, align 4
  %12 = call float @_lcompilers_abs_f32(float* %call_arg_value1)
  %13 = fcmp ogt float %12, 0x3EB0C6F7A0000000
  br i1 %13, label %then2, label %else3

then2:                                            ; preds = %ifcont
  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 %ifcont4

else3:                                            ; preds = %ifcont
  br label %ifcont4

ifcont4:                                          ; preds = %else3, %then2
  %14 = load double, double* %y, align 8
  %15 = fsub double %14, 0x3FEFEB7A9FAE5B9E
  store double %15, double* %call_arg_value5, align 8
  %16 = call double @_lcompilers_abs_f64(double* %call_arg_value5)
  %17 = fcmp ogt double %16, 0x3E7AD7F29ABCAF48
  br i1 %17, label %then6, label %else7

then6:                                            ; preds = %ifcont4
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @10, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @8, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @9, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont8

else7:                                            ; preds = %ifcont4
  br label %ifcont8

ifcont8:                                          ; preds = %else7, %then6
  br i1 false, label %then9, label %else10

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

else10:                                           ; preds = %ifcont8
  br label %ifcont11

ifcont11:                                         ; preds = %else10, %then9
  %18 = call double @_lcompilers_sin_f64(double* %y)
  %19 = load float, float* @intrinsics_02.x, align 4
  %20 = call float @_lcompilers_sin_f32(float* @intrinsics_02.x)
  %21 = fadd float %19, %20
  store float %21, float* %call_arg_value12, align 4
  %22 = call float @_lcompilers_sin_f32(float* %call_arg_value12)
  %23 = fpext float %22 to double
  %24 = fadd double %18, %23
  store double %24, double* %call_arg_value13, align 8
  %25 = call double @_lcompilers_sin_f64(double* %call_arg_value13)
  %26 = fsub double %25, 0x3FEF20DD85ACA7BE
  store double %26, double* %call_arg_value14, align 8
  %27 = call double @_lcompilers_abs_f64(double* %call_arg_value14)
  %28 = fcmp ogt double %27, 0x3E7AD7F29ABCAF48
  br i1 %28, label %then15, label %else16

then15:                                           ; preds = %ifcont11
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @16, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @14, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @15, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont17

else16:                                           ; preds = %ifcont11
  br label %ifcont17

ifcont17:                                         ; preds = %else16, %then15
  call void @_lpython_free_argv()
  br label %return

return:                                           ; preds = %ifcont17
  ret i32 0
}

declare void @_lpython_call_initial_functions(i32, i8**)

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

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

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

declare void @exit(i32)

declare void @_lpython_free_argv()
