; LLVM IR from harharkh/sb_desc :: src/sbessel.ll (sbessel)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@sb_error_log = external global ptr, align 8
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local double @_sbessel(i32 noundef %0, double noundef %1) #0 {
  %3 = alloca double, align 8
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store double %1, ptr %5, align 8, !tbaa !9
  br label %15

15:                                               ; preds = %2
  %16 = load double, ptr %5, align 8, !tbaa !9
  %17 = fcmp olt double %16, 0.000000e+00
  br i1 %17, label %18, label %37

18:                                               ; preds = %15
  %19 = load ptr, ptr @sb_error_log, align 8, !tbaa !11
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %23

21:                                               ; preds = %18
  %22 = load ptr, ptr @sb_error_log, align 8, !tbaa !11
  br label %25

23:                                               ; preds = %18
  %24 = load ptr, ptr @stderr, align 8, !tbaa !11
  br label %25

25:                                               ; preds = %23, %21
  %26 = phi ptr [ %22, %21 ], [ %24, %23 ]
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str) #5
  %28 = load ptr, ptr @sb_error_log, align 8, !tbaa !11
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %32

30:                                               ; preds = %25
  %31 = load ptr, ptr @sb_error_log, align 8, !tbaa !11
  br label %34

32:                                               ; preds = %25
  %33 = load ptr, ptr @stderr, align 8, !tbaa !11
  br label %34

34:                                               ; preds = %32, %30
  %35 = phi ptr [ %31, %30 ], [ %33, %32 ]
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.1) #5
  call void @abort() #6
  unreachable

37:                                               ; preds = %15
  br label %38

38:                                               ; preds = %37
  %39 = load double, ptr %5, align 8, !tbaa !9
  %40 = fcmp olt double %39, 2.000000e-15
  br i1 %40, label %41, label %46

41:                                               ; preds = %38
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %41
  store double 1.000000e+00, ptr %3, align 8
  br label %213

45:                                               ; preds = %41
  store double 0.000000e+00, ptr %3, align 8
  br label %213

46:                                               ; preds = %38
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %54

49:                                               ; preds = %46
  %50 = load double, ptr %5, align 8, !tbaa !9
  %51 = call double @sin(double noundef %50) #5
  %52 = load double, ptr %5, align 8, !tbaa !9
  %53 = fdiv double %51, %52
  store double %53, ptr %3, align 8
  br label %213

54:                                               ; preds = %46
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = icmp eq i32 %55, 1
  br i1 %56, label %57, label %67

57:                                               ; preds = %54
  %58 = load double, ptr %5, align 8, !tbaa !9
  %59 = call double @sin(double noundef %58) #5
  %60 = load double, ptr %5, align 8, !tbaa !9
  %61 = fdiv double %59, %60
  %62 = load double, ptr %5, align 8, !tbaa !9
  %63 = call double @cos(double noundef %62) #5
  %64 = fsub double %61, %63
  %65 = load double, ptr %5, align 8, !tbaa !9
  %66 = fdiv double %64, %65
  store double %66, ptr %3, align 8
  br label %213

67:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  store i8 0, ptr %6, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #5
  store i8 0, ptr %7, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store double 0.000000e+00, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store double 0.000000e+00, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store double 1.000000e+00, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store double 0.000000e+00, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store double 0.000000e+00, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store double 0.000000e+00, ptr %14, align 8, !tbaa !9
  %68 = load double, ptr %5, align 8, !tbaa !9
  %69 = fadd double %68, 0x3FF921FB54442D1A
  %70 = call double @fmod(double noundef %69, double noundef 0x400921FB54442D18) #5
  %71 = fsub double %70, 0x3FF921FB54442D1A
  %72 = call double @llvm.fabs.f64(double %71)
  %73 = fcmp ogt double %72, 0x3FB921FB54442D15
  br i1 %73, label %74, label %79

74:                                               ; preds = %67
  store i32 0, ptr %13, align 4, !tbaa !5
  %75 = load double, ptr %5, align 8, !tbaa !9
  %76 = call double @sin(double noundef %75) #5
  %77 = load double, ptr %5, align 8, !tbaa !9
  %78 = fdiv double %76, %77
  store double %78, ptr %14, align 8, !tbaa !9
  br label %89

79:                                               ; preds = %67
  store i32 1, ptr %13, align 4, !tbaa !5
  %80 = load double, ptr %5, align 8, !tbaa !9
  %81 = call double @sin(double noundef %80) #5
  %82 = load double, ptr %5, align 8, !tbaa !9
  %83 = fdiv double %81, %82
  %84 = load double, ptr %5, align 8, !tbaa !9
  %85 = call double @cos(double noundef %84) #5
  %86 = fsub double %83, %85
  %87 = load double, ptr %5, align 8, !tbaa !9
  %88 = fdiv double %86, %87
  store double %88, ptr %14, align 8, !tbaa !9
  br label %89

89:                                               ; preds = %79, %74
  br label %90

90:                                               ; preds = %205, %89
  %91 = load i8, ptr %6, align 1, !tbaa !13, !range !15, !noundef !16
  %92 = trunc i8 %91 to i1
  br i1 %92, label %108, label %93

93:                                               ; preds = %90
  %94 = load i8, ptr %7, align 1, !tbaa !13, !range !15, !noundef !16
  %95 = trunc i8 %94 to i1
  br i1 %95, label %108, label %96

96:                                               ; preds = %93
  %97 = load double, ptr %8, align 8, !tbaa !9
  %98 = load double, ptr %9, align 8, !tbaa !9
  %99 = fsub double %97, %98
  %100 = load double, ptr %9, align 8, !tbaa !9
  %101 = fdiv double %99, %100
  %102 = call double @llvm.fabs.f64(double %101)
  %103 = fcmp ogt double %102, 2.000000e-14
  br i1 %103, label %108, label %104

104:                                              ; preds = %96
  %105 = load i32, ptr %13, align 4, !tbaa !5
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = icmp ule i32 %105, %106
  br label %108

108:                                              ; preds = %104, %96, %93, %90
  %109 = phi i1 [ true, %96 ], [ true, %93 ], [ true, %90 ], [ %107, %104 ]
  br i1 %109, label %110, label %206

110:                                              ; preds = %108
  %111 = load i32, ptr %13, align 4, !tbaa !5
  %112 = uitofp i32 %111 to double
  %113 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %112, double 3.000000e+00)
  %114 = load double, ptr %5, align 8, !tbaa !9
  %115 = fdiv double %113, %114
  store double %115, ptr %12, align 8, !tbaa !9
  %116 = load double, ptr %12, align 8, !tbaa !9
  %117 = load double, ptr %8, align 8, !tbaa !9
  %118 = fsub double %116, %117
  store double %118, ptr %8, align 8, !tbaa !9
  %119 = load i8, ptr %6, align 1, !tbaa !13, !range !15, !noundef !16
  %120 = trunc i8 %119 to i1
  br i1 %120, label %135, label %121

121:                                              ; preds = %110
  %122 = load double, ptr %8, align 8, !tbaa !9
  %123 = call double @llvm.fabs.f64(double %122)
  %124 = fcmp ogt double %123, 2.000000e-15
  br i1 %124, label %125, label %131

125:                                              ; preds = %121
  %126 = load double, ptr %10, align 8, !tbaa !9
  %127 = load double, ptr %8, align 8, !tbaa !9
  %128 = fmul double %126, %127
  store double %128, ptr %10, align 8, !tbaa !9
  %129 = load double, ptr %8, align 8, !tbaa !9
  %130 = fdiv double 1.000000e+00, %129
  store double %130, ptr %8, align 8, !tbaa !9
  br label %134

131:                                              ; preds = %121
  store i8 1, ptr %6, align 1, !tbaa !13
  store double 0.000000e+00, ptr %8, align 8, !tbaa !9
  %132 = load double, ptr %10, align 8, !tbaa !9
  %133 = fneg double %132
  store double %133, ptr %10, align 8, !tbaa !9
  br label %134

134:                                              ; preds = %131, %125
  br label %136

135:                                              ; preds = %110
  store i8 0, ptr %6, align 1, !tbaa !13
  store double 0.000000e+00, ptr %8, align 8, !tbaa !9
  br label %136

136:                                              ; preds = %135, %134
  %137 = load double, ptr %10, align 8, !tbaa !9
  %138 = call double @llvm.fabs.f64(double %137)
  %139 = fcmp ogt double %138, 1.000000e+02
  br i1 %139, label %144, label %140

140:                                              ; preds = %136
  %141 = load double, ptr %10, align 8, !tbaa !9
  %142 = call double @llvm.fabs.f64(double %141)
  %143 = fcmp olt double %142, 1.000000e-02
  br i1 %143, label %144, label %152

144:                                              ; preds = %140, %136
  %145 = load double, ptr %11, align 8, !tbaa !9
  %146 = load double, ptr %10, align 8, !tbaa !9
  %147 = call double @llvm.fabs.f64(double %146)
  %148 = call double @log(double noundef %147) #5
  %149 = fsub double %145, %148
  store double %149, ptr %11, align 8, !tbaa !9
  %150 = load double, ptr %10, align 8, !tbaa !9
  %151 = call double @llvm.copysign.f64(double 1.000000e+00, double %150)
  store double %151, ptr %10, align 8, !tbaa !9
  br label %152

152:                                              ; preds = %144, %140
  %153 = load i32, ptr %13, align 4, !tbaa !5
  %154 = add i32 %153, 1
  store i32 %154, ptr %13, align 4, !tbaa !5
  br label %155

155:                                              ; preds = %152
  %156 = load i32, ptr %13, align 4, !tbaa !5
  %157 = icmp ugt i32 %156, 10000
  br i1 %157, label %158, label %177

158:                                              ; preds = %155
  %159 = load ptr, ptr @sb_error_log, align 8, !tbaa !11
  %160 = icmp ne ptr %159, null
  br i1 %160, label %161, label %163

161:                                              ; preds = %158
  %162 = load ptr, ptr @sb_error_log, align 8, !tbaa !11
  br label %165

163:                                              ; preds = %158
  %164 = load ptr, ptr @stderr, align 8, !tbaa !11
  br label %165

165:                                              ; preds = %163, %161
  %166 = phi ptr [ %162, %161 ], [ %164, %163 ]
  %167 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %166, ptr noundef @.str.2) #5
  %168 = load ptr, ptr @sb_error_log, align 8, !tbaa !11
  %169 = icmp ne ptr %168, null
  br i1 %169, label %170, label %172

170:                                              ; preds = %165
  %171 = load ptr, ptr @sb_error_log, align 8, !tbaa !11
  br label %174

172:                                              ; preds = %165
  %173 = load ptr, ptr @stderr, align 8, !tbaa !11
  br label %174

174:                                              ; preds = %172, %170
  %175 = phi ptr [ %171, %170 ], [ %173, %172 ]
  %176 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %175, ptr noundef @.str.1) #5
  br label %179

177:                                              ; preds = %155
  br label %178

178:                                              ; preds = %177
  br label %179

179:                                              ; preds = %178, %174
  %180 = load i32, ptr %13, align 4, !tbaa !5
  %181 = load i32, ptr %4, align 4, !tbaa !5
  %182 = icmp ugt i32 %180, %181
  br i1 %182, label %183, label %205

183:                                              ; preds = %179
  %184 = load double, ptr %12, align 8, !tbaa !9
  %185 = load double, ptr %9, align 8, !tbaa !9
  %186 = fsub double %184, %185
  store double %186, ptr %9, align 8, !tbaa !9
  %187 = load i8, ptr %7, align 1, !tbaa !13, !range !15, !noundef !16
  %188 = trunc i8 %187 to i1
  br i1 %188, label %203, label %189

189:                                              ; preds = %183
  %190 = load double, ptr %9, align 8, !tbaa !9
  %191 = call double @llvm.fabs.f64(double %190)
  %192 = fcmp ogt double %191, 2.000000e-15
  br i1 %192, label %193, label %199

193:                                              ; preds = %189
  %194 = load double, ptr %10, align 8, !tbaa !9
  %195 = load double, ptr %9, align 8, !tbaa !9
  %196 = fdiv double %194, %195
  store double %196, ptr %10, align 8, !tbaa !9
  %197 = load double, ptr %9, align 8, !tbaa !9
  %198 = fdiv double 1.000000e+00, %197
  store double %198, ptr %9, align 8, !tbaa !9
  br label %202

199:                                              ; preds = %189
  store i8 1, ptr %7, align 1, !tbaa !13
  store double 0.000000e+00, ptr %9, align 8, !tbaa !9
  %200 = load double, ptr %10, align 8, !tbaa !9
  %201 = fneg double %200
  store double %201, ptr %10, align 8, !tbaa !9
  br label %202

202:                                              ; preds = %199, %193
  br label %204

203:                                              ; preds = %183
  store i8 0, ptr %7, align 1, !tbaa !13
  store double 0.000000e+00, ptr %9, align 8, !tbaa !9
  br label %204

204:                                              ; preds = %203, %202
  br label %205

205:                                              ; preds = %204, %179
  br label %90, !llvm.loop !17

206:                                              ; preds = %108
  %207 = load double, ptr %14, align 8, !tbaa !9
  %208 = load double, ptr %10, align 8, !tbaa !9
  %209 = fdiv double %207, %208
  %210 = load double, ptr %11, align 8, !tbaa !9
  %211 = call double @exp(double noundef %210) #5
  %212 = fmul double %209, %211
  store double %212, ptr %3, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  br label %213

213:                                              ; preds = %206, %57, %49, %45, %44
  %214 = load double, ptr %3, align 8
  ret double %214
}

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @abort() #2

; Function Attrs: nounwind
declare double @sin(double noundef) #1

; Function Attrs: nounwind
declare double @cos(double noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: nounwind
declare double @fmod(double noundef, double noundef) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: nounwind
declare double @log(double noundef) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.copysign.f64(double, double) #4

; Function Attrs: nounwind
declare double @exp(double noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@sb_error_log = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local double @_sbessel(i32 noundef %0, double noundef %1) local_unnamed_addr #0 {
  %3 = fcmp olt double %1, 0.000000e+00
  br i1 %3, label %4, label %13

4:                                                ; preds = %2
  %5 = load ptr, ptr @sb_error_log, align 8
  %.not74 = icmp eq ptr %5, null
  %6 = load ptr, ptr @stderr, align 8
  %7 = select i1 %.not74, ptr %6, ptr %5
  %8 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str) #5
  %9 = load ptr, ptr @sb_error_log, align 8
  %.not75 = icmp eq ptr %9, null
  %10 = load ptr, ptr @stderr, align 8
  %11 = select i1 %.not75, ptr %10, ptr %9
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.1) #5
  tail call void @abort() #6
  unreachable

13:                                               ; preds = %2
  %14 = fcmp olt double %1, 2.000000e-15
  br i1 %14, label %15, label %17

15:                                               ; preds = %13
  %16 = icmp eq i32 %0, 0
  %. = select i1 %16, double 1.000000e+00, double 0.000000e+00
  br label %100

17:                                               ; preds = %13
  switch i32 %0, label %27 [
    i32 0, label %18
    i32 1, label %21
  ]

18:                                               ; preds = %17
  %19 = tail call double @sin(double noundef %1) #5
  %20 = fdiv double %19, %1
  br label %100

21:                                               ; preds = %17
  %22 = tail call double @sin(double noundef %1) #5
  %23 = fdiv double %22, %1
  %24 = tail call double @cos(double noundef %1) #5
  %25 = fsub double %23, %24
  %26 = fdiv double %25, %1
  br label %100

27:                                               ; preds = %17
  %28 = fadd double %1, 0x3FF921FB54442D1A
  %29 = tail call double @fmod(double noundef %28, double noundef 0x400921FB54442D18) #5
  %30 = fadd double %29, 0xBFF921FB54442D1A
  %31 = tail call double @llvm.fabs.f64(double %30)
  %32 = fcmp ogt double %31, 0x3FB921FB54442D15
  %33 = tail call double @sin(double noundef %1) #5
  br i1 %32, label %38, label %34

34:                                               ; preds = %27
  %35 = fdiv double %33, %1
  %36 = tail call double @cos(double noundef %1) #5
  %37 = fsub double %35, %36
  br label %38

38:                                               ; preds = %27, %34
  %.055 = phi i32 [ 1, %34 ], [ 0, %27 ]
  %.pn = phi double [ %37, %34 ], [ %33, %27 ]
  br label %.outer

.outer:                                           ; preds = %.outer.backedge, %38
  %.066.ph = phi i1 [ false, %38 ], [ %.167, %.outer.backedge ]
  %.064.ph = phi i8 [ 0, %38 ], [ %.064.ph.be, %.outer.backedge ]
  %.062.ph = phi double [ 0.000000e+00, %38 ], [ %.163, %.outer.backedge ]
  %.058.ph = phi double [ 1.000000e+00, %38 ], [ %.058.ph.be, %.outer.backedge ]
  %.056.ph = phi double [ 0.000000e+00, %38 ], [ %.157, %.outer.backedge ]
  %.1.ph = phi i32 [ %.055, %38 ], [ %73, %.outer.backedge ]
  %39 = trunc nuw i8 %.064.ph to i1
  %40 = trunc nuw i8 %.064.ph to i1
  br label %.outer77

.outer77:                                         ; preds = %.outer, %91
  %.066.ph78 = phi i1 [ %.066.ph, %.outer ], [ %.167, %91 ]
  %.062.ph79 = phi double [ %.062.ph, %.outer ], [ %.163, %91 ]
  %.060.ph = phi double [ 0.000000e+00, %.outer ], [ %93, %91 ]
  %.058.ph80 = phi double [ %.058.ph, %.outer ], [ %92, %91 ]
  %.056.ph81 = phi double [ %.056.ph, %.outer ], [ %.157, %91 ]
  %.1.ph82 = phi i32 [ %.1.ph, %.outer ], [ %73, %91 ]
  br label %41

41:                                               ; preds = %.outer77, %84
  %.066 = phi i1 [ %.167, %84 ], [ %.066.ph78, %.outer77 ]
  %.062 = phi double [ %.163, %84 ], [ %.062.ph79, %.outer77 ]
  %.058 = phi double [ %.2, %84 ], [ %.058.ph80, %.outer77 ]
  %.056 = phi double [ %.157, %84 ], [ %.056.ph81, %.outer77 ]
  %.1 = phi i32 [ %73, %84 ], [ %.1.ph82, %.outer77 ]
  br i1 %.066, label %.critedge, label %42

42:                                               ; preds = %41
  br i1 %39, label %51, label %43

43:                                               ; preds = %42
  %44 = fsub double %.062, %.060.ph
  %45 = fdiv double %44, %.060.ph
  %46 = tail call double @llvm.fabs.f64(double %45)
  %47 = fcmp ule double %46, 2.000000e-14
  %.not = icmp ugt i32 %.1, %0
  %or.cond = and i1 %47, %.not
  br i1 %or.cond, label %96, label %51

.critedge:                                        ; preds = %41
  %48 = uitofp i32 %.1 to double
  %49 = tail call double @llvm.fmuladd.f64(double %48, double 2.000000e+00, double 3.000000e+00)
  %50 = fdiv double %49, %1
  br label %63

51:                                               ; preds = %43, %42
  %52 = uitofp i32 %.1 to double
  %53 = tail call double @llvm.fmuladd.f64(double %52, double 2.000000e+00, double 3.000000e+00)
  %54 = fdiv double %53, %1
  %55 = fsub double %54, %.062
  %56 = tail call double @llvm.fabs.f64(double %55)
  %57 = fcmp ogt double %56, 2.000000e-15
  br i1 %57, label %58, label %61

58:                                               ; preds = %51
  %59 = fmul double %.058, %55
  %60 = fdiv double 1.000000e+00, %55
  br label %63

61:                                               ; preds = %51
  %62 = fneg double %.058
  br label %63

63:                                               ; preds = %.critedge, %58, %61
  %64 = phi double [ %54, %58 ], [ %54, %61 ], [ %50, %.critedge ]
  %.167 = phi i1 [ false, %58 ], [ true, %61 ], [ false, %.critedge ]
  %.163 = phi double [ %60, %58 ], [ 0.000000e+00, %61 ], [ 0.000000e+00, %.critedge ]
  %.159 = phi double [ %59, %58 ], [ %62, %61 ], [ %.058, %.critedge ]
  %65 = tail call double @llvm.fabs.f64(double %.159)
  %66 = fcmp ogt double %65, 1.000000e+02
  %67 = fcmp olt double %65, 1.000000e-02
  %or.cond76 = or i1 %66, %67
  br i1 %or.cond76, label %68, label %72

68:                                               ; preds = %63
  %69 = tail call double @log(double noundef %65) #5
  %70 = fsub double %.056, %69
  %71 = tail call double @llvm.copysign.f64(double 1.000000e+00, double %.159)
  br label %72

72:                                               ; preds = %63, %68
  %.2 = phi double [ %71, %68 ], [ %.159, %63 ]
  %.157 = phi double [ %70, %68 ], [ %.056, %63 ]
  %73 = add i32 %.1, 1
  %74 = icmp ugt i32 %73, 10000
  br i1 %74, label %75, label %84

75:                                               ; preds = %72
  %76 = load ptr, ptr @sb_error_log, align 8
  %.not72 = icmp eq ptr %76, null
  %77 = load ptr, ptr @stderr, align 8
  %78 = select i1 %.not72, ptr %77, ptr %76
  %79 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef nonnull @.str.2) #5
  %80 = load ptr, ptr @sb_error_log, align 8
  %.not73 = icmp eq ptr %80, null
  %81 = load ptr, ptr @stderr, align 8
  %82 = select i1 %.not73, ptr %81, ptr %80
  %83 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef nonnull @.str.1) #5
  br label %84

84:                                               ; preds = %72, %75
  %85 = icmp ugt i32 %73, %0
  br i1 %85, label %86, label %41, !llvm.loop !5

86:                                               ; preds = %84
  %87 = fsub double %64, %.060.ph
  br i1 %40, label %.outer.backedge, label %88, !llvm.loop !5

88:                                               ; preds = %86
  %89 = tail call double @llvm.fabs.f64(double %87)
  %90 = fcmp ogt double %89, 2.000000e-15
  br i1 %90, label %91, label %94

91:                                               ; preds = %88
  %92 = fdiv double %.2, %87
  %93 = fdiv double 1.000000e+00, %87
  br label %.outer77, !llvm.loop !5

94:                                               ; preds = %88
  %95 = fneg double %.2
  br label %.outer.backedge

.outer.backedge:                                  ; preds = %86, %94
  %.064.ph.be = phi i8 [ 1, %94 ], [ 0, %86 ]
  %.058.ph.be = phi double [ %95, %94 ], [ %.2, %86 ]
  br label %.outer, !llvm.loop !5

96:                                               ; preds = %43
  %.0 = fdiv double %.pn, %1
  %97 = fdiv double %.0, %.058
  %98 = tail call double @exp(double noundef %.056) #5
  %99 = fmul double %97, %98
  br label %100

100:                                              ; preds = %15, %96, %21, %18
  %.068 = phi double [ %20, %18 ], [ %26, %21 ], [ %99, %96 ], [ %., %15 ]
  ret double %.068
}

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @fmod(double noundef, double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log(double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.copysign.f64(double, double) #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @exp(double noundef) local_unnamed_addr #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass