; LLVM IR from interpretml/interpret :: shared/libebm/unzoned (unzoned)

; 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"

@.str = external hidden unnamed_addr constant [89 x i8], align 1
@__func__.ConvertStringToFloat = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@__PRETTY_FUNCTION__.ConvertStringToFloat = external hidden unnamed_addr constant [67 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @SkipWhitespace(ptr noundef) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local ptr @ConvertStringToFloat(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = icmp ne ptr null, %9
  br i1 %10, label %13, label %11

11:                                               ; preds = %2
  call void @LogAssertFailure(i64 noundef 28, ptr noundef @.str, ptr noundef @__func__.ConvertStringToFloat, ptr noundef @.str.1)
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str, i32 noundef 28, ptr noundef @__PRETTY_FUNCTION__.ConvertStringToFloat) #6
  unreachable

12:                                               ; No predecessors!
  br label %13

13:                                               ; preds = %12, %2
  %14 = phi i1 [ true, %2 ], [ false, %12 ]
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = icmp ne ptr null, %15
  br i1 %16, label %19, label %17

17:                                               ; preds = %13
  call void @LogAssertFailure(i64 noundef 29, ptr noundef @.str, ptr noundef @__func__.ConvertStringToFloat, ptr noundef @.str.3)
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str, i32 noundef 29, ptr noundef @__PRETTY_FUNCTION__.ConvertStringToFloat) #6
  unreachable

18:                                               ; No predecessors!
  br label %19

19:                                               ; preds = %18, %13
  %20 = phi i1 [ true, %13 ], [ false, %18 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %21, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = call double @strtod(ptr noundef %22, ptr noundef %6) #7
  store double %23, ptr %7, align 8, !tbaa !9
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = icmp eq ptr %24, %25
  br i1 %26, label %30, label %27

27:                                               ; preds = %19
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = icmp eq ptr null, %28
  br i1 %29, label %30, label %31

30:                                               ; preds = %27, %19
  store ptr null, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %36

31:                                               ; preds = %27
  %32 = load double, ptr %7, align 8, !tbaa !9
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  store double %32, ptr %33, align 8, !tbaa !9
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = call ptr @SkipWhitespace(ptr noundef %34)
  store ptr %35, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %36

36:                                               ; preds = %31, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %37 = load ptr, ptr %3, align 8
  ret ptr %37
}

declare void @LogAssertFailure(i64 noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: nounwind
declare double @strtod(ptr noundef, ptr noundef) #5

attributes #0 = { mustprogress 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 #3 = { "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 = { 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 #5 = { 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 #6 = { noreturn nounwind }
attributes #7 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}


; 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"

@.str = external hidden unnamed_addr constant [89 x i8], align 1
@__func__.ConvertStringToFloat = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@__PRETTY_FUNCTION__.ConvertStringToFloat = external hidden unnamed_addr constant [67 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @SkipWhitespace(ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local ptr @ConvertStringToFloat(ptr noundef %0, ptr noundef writeonly %1) local_unnamed_addr #2 {
  %3 = alloca ptr, align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %5

4:                                                ; preds = %2
  tail call void @LogAssertFailure(i64 noundef 28, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.ConvertStringToFloat, ptr noundef nonnull @.str.1)
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str, i32 noundef 28, ptr noundef nonnull @__PRETTY_FUNCTION__.ConvertStringToFloat) #6
  unreachable

5:                                                ; preds = %2
  %.not11 = icmp eq ptr %1, null
  br i1 %.not11, label %6, label %7

6:                                                ; preds = %5
  tail call void @LogAssertFailure(i64 noundef 29, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.ConvertStringToFloat, ptr noundef nonnull @.str.3)
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str, i32 noundef 29, ptr noundef nonnull @__PRETTY_FUNCTION__.ConvertStringToFloat) #6
  unreachable

7:                                                ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store ptr %0, ptr %3, align 8, !tbaa !5
  %8 = call double @strtod(ptr noundef nonnull %0, ptr noundef nonnull %3) #7
  %9 = load ptr, ptr %3, align 8
  %10 = icmp eq ptr %9, %0
  %11 = icmp eq ptr %9, null
  %or.cond = or i1 %10, %11
  br i1 %or.cond, label %14, label %12

12:                                               ; preds = %7
  store double %8, ptr %1, align 8, !tbaa !9
  %13 = tail call ptr @SkipWhitespace(ptr noundef nonnull %9)
  br label %14

14:                                               ; preds = %7, %12
  %.0 = phi ptr [ %13, %12 ], [ null, %7 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  ret ptr %.0
}

declare void @LogAssertFailure(i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn
declare double @strtod(ptr noundef readonly, ptr nocapture noundef) local_unnamed_addr #5

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 #3 = { "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 = { 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 #5 = { mustprogress nofree nounwind willreturn "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 #6 = { noreturn nounwind }
attributes #7 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass