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

@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 uwtable
declare dso_local i32 @equ(float noundef, 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_eq(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 @STRG, align 4, !tbaa !11
  %15 = icmp eq i32 %13, %14
  br i1 %15, label %16, label %33

16:                                               ; preds = %2
  %17 = load i32, ptr %6, align 4, !tbaa !11
  %18 = lshr i32 %17, 20
  %19 = load i32, ptr @STRG, align 4, !tbaa !11
  %20 = icmp eq i32 %18, %19
  br i1 %20, label %21, label %33

21:                                               ; preds = %16
  %22 = load float, ptr %5, align 4, !tbaa !5
  %23 = call i32 @ord(float noundef %22)
  %24 = zext i32 %23 to i64
  %25 = getelementptr inbounds i8, ptr @cell, i64 %24
  %26 = load float, ptr %6, align 4, !tbaa !5
  %27 = call i32 @ord(float noundef %26)
  %28 = zext i32 %27 to i64
  %29 = getelementptr inbounds i8, ptr @cell, i64 %28
  %30 = call i32 @strcmp(ptr noundef %25, ptr noundef %29) #4
  %31 = icmp ne i32 %30, 0
  %32 = xor i1 %31, true
  br i1 %32, label %38, label %40

33:                                               ; preds = %16, %2
  %34 = load float, ptr %5, align 4, !tbaa !5
  %35 = load float, ptr %6, align 4, !tbaa !5
  %36 = call i32 @equ(float noundef %34, float noundef %35)
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %40

38:                                               ; preds = %33, %21
  %39 = load float, ptr @tru, align 4, !tbaa !5
  br label %42

40:                                               ; preds = %33, %21
  %41 = load float, ptr @nil, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %40, %38
  %43 = phi float [ %39, %38 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret float %43
}

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"

@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: nounwind uwtable
declare dso_local i32 @equ(float noundef, 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_eq(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 = load i32, ptr @STRG, align 4, !tbaa !5
  %9 = icmp eq i32 %7, %8
  br i1 %9, label %10, label %22

10:                                               ; preds = %2
  %11 = bitcast float %5 to i32
  %12 = lshr i32 %11, 20
  %13 = icmp eq i32 %12, %7
  br i1 %13, label %14, label %22

14:                                               ; preds = %10
  %15 = tail call i32 @ord(float noundef %3)
  %16 = zext i32 %15 to i64
  %17 = getelementptr inbounds i8, ptr @cell, i64 %16
  %18 = tail call i32 @ord(float noundef %5)
  %19 = zext i32 %18 to i64
  %20 = getelementptr inbounds i8, ptr @cell, i64 %19
  %21 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) %20) #2
  %.not7 = icmp eq i32 %21, 0
  br i1 %.not7, label %25, label %24

22:                                               ; preds = %10, %2
  %23 = tail call i32 @equ(float noundef %3, float noundef %5)
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %24, label %25

24:                                               ; preds = %22, %14
  br label %25

25:                                               ; preds = %14, %22, %24
  %.in = phi ptr [ @nil, %24 ], [ @tru, %22 ], [ @tru, %14 ]
  %26 = load float, ptr %.in, align 4, !tbaa !9
  ret float %26
}

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,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass