; LLVM IR from Robert-van-Engelen/lisp :: src (lisp-pr-single)

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

@ATOM = external dso_local global i32, align 4
@STRG = external dso_local global i32, align 4
@cell = external dso_local global [10240 x float], align 16
@nil = external dso_local global float, align 4
@tru = external dso_local global float, align 4

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @ord(float noundef) #1

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local float @car(float noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local float @cdr(float noundef) #1

; Function Attrs: nounwind uwtable
define dso_local float @f_lt(float noundef %0, ptr noundef %1) #1 {
  %3 = alloca float, align 4
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  store float %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %7 = load float, ptr %3, align 4, !tbaa !5
  %8 = call float @car(float noundef %7)
  store float %8, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %9 = load float, ptr %3, align 4, !tbaa !5
  %10 = call float @cdr(float noundef %9)
  %11 = call float @car(float noundef %10)
  store float %11, ptr %6, align 4, !tbaa !5
  %12 = load i32, ptr %5, align 4, !tbaa !11
  %13 = lshr i32 %12, 20
  %14 = load i32, ptr %6, align 4, !tbaa !11
  %15 = lshr i32 %14, 20
  %16 = icmp eq i32 %13, %15
  br i1 %16, label %17, label %38

17:                                               ; preds = %2
  %18 = load i32, ptr %5, align 4, !tbaa !11
  %19 = lshr i32 %18, 20
  %20 = load i32, ptr @ATOM, align 4, !tbaa !11
  %21 = load i32, ptr @STRG, align 4, !tbaa !11
  %22 = xor i32 %20, %21
  %23 = xor i32 %22, -1
  %24 = and i32 %19, %23
  %25 = load i32, ptr @ATOM, align 4, !tbaa !11
  %26 = icmp eq i32 %24, %25
  br i1 %26, label %27, label %38

27:                                               ; preds = %17
  %28 = load float, ptr %5, align 4, !tbaa !5
  %29 = call i32 @ord(float noundef %28)
  %30 = zext i32 %29 to i64
  %31 = getelementptr inbounds i8, ptr @cell, i64 %30
  %32 = load float, ptr %6, align 4, !tbaa !5
  %33 = call i32 @ord(float noundef %32)
  %34 = zext i32 %33 to i64
  %35 = getelementptr inbounds i8, ptr @cell, i64 %34
  %36 = call i32 @strcmp(ptr noundef %31, ptr noundef %35) #4
  %37 = icmp slt i32 %36, 0
  br i1 %37, label %54, label %56

38:                                               ; preds = %17, %2
  %39 = load float, ptr %5, align 4, !tbaa !5
  %40 = load float, ptr %5, align 4, !tbaa !5
  %41 = fcmp oeq float %39, %40
  br i1 %41, label %42, label %50

42:                                               ; preds = %38
  %43 = load float, ptr %6, align 4, !tbaa !5
  %44 = load float, ptr %6, align 4, !tbaa !5
  %45 = fcmp oeq float %43, %44
  br i1 %45, label %46, label %50

46:                                               ; preds = %42
  %47 = load float, ptr %5, align 4, !tbaa !5
  %48 = load float, ptr %6, align 4, !tbaa !5
  %49 = fcmp olt float %47, %48
  br i1 %49, label %54, label %56

50:                                               ; preds = %42, %38
  %51 = load i32, ptr %5, align 4, !tbaa !11
  %52 = load i32, ptr %6, align 4, !tbaa !11
  %53 = icmp ult i32 %51, %52
  br i1 %53, label %54, label %56

54:                                               ; preds = %50, %46, %27
  %55 = load float, ptr @tru, align 4, !tbaa !5
  br label %58

56:                                               ; preds = %50, %46, %27
  %57 = load float, ptr @nil, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %56, %54
  %59 = phi float [ %55, %54 ], [ %57, %56 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret float %59
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nounwind willreturn memory(read) "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 = { nounwind }
attributes #4 = { nounwind willreturn memory(read) }

!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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !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"

@ATOM = external dso_local local_unnamed_addr global i32, align 4
@STRG = external dso_local local_unnamed_addr global i32, align 4
@cell = external dso_local global [10240 x float], align 16
@nil = external dso_local local_unnamed_addr global float, align 4
@tru = external dso_local local_unnamed_addr global float, align 4

; Function Attrs: nounwind uwtable
declare dso_local i32 @ord(float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local float @car(float noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local float @cdr(float noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local float @f_lt(float noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = tail call float @car(float noundef %0)
  %4 = tail call float @cdr(float noundef %0)
  %5 = tail call float @car(float noundef %4)
  %6 = bitcast float %3 to i32
  %7 = lshr i32 %6, 20
  %8 = bitcast float %5 to i32
  %9 = lshr i32 %8, 20
  %10 = icmp eq i32 %7, %9
  br i1 %10, label %11, label %27

11:                                               ; preds = %2
  %12 = load i32, ptr @ATOM, align 4, !tbaa !5
  %13 = load i32, ptr @STRG, align 4, !tbaa !5
  %14 = xor i32 %12, %13
  %15 = xor i32 %14, -1
  %16 = and i32 %7, %15
  %17 = icmp eq i32 %16, %12
  br i1 %17, label %18, label %27

18:                                               ; preds = %11
  %19 = tail call i32 @ord(float noundef %3)
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds i8, ptr @cell, i64 %20
  %22 = tail call i32 @ord(float noundef %5)
  %23 = zext i32 %22 to i64
  %24 = getelementptr inbounds i8, ptr @cell, i64 %23
  %25 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %21, ptr noundef nonnull dereferenceable(1) %24) #2
  %26 = icmp slt i32 %25, 0
  br i1 %26, label %33, label %32

27:                                               ; preds = %11, %2
  %or.cond = fcmp ord float %3, %5
  br i1 %or.cond, label %28, label %30

28:                                               ; preds = %27
  %29 = fcmp olt float %3, %5
  br i1 %29, label %33, label %32

30:                                               ; preds = %27
  %31 = icmp ult i32 %6, %8
  br i1 %31, label %33, label %32

32:                                               ; preds = %30, %28, %18
  br label %33

33:                                               ; preds = %18, %28, %30, %32
  %.in = phi ptr [ @nil, %32 ], [ @tru, %30 ], [ @tru, %28 ], [ @tru, %18 ]
  %34 = load float, ptr %.in, align 4, !tbaa !9
  ret float %34
}

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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { nounwind willreturn memory(read) }

!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 = !{!"float", !7, i64 0}


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