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

@NIL = external dso_local global i32, align 4
@nil = external dso_local global float, align 4

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local float @eval(float noundef, float noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local float @f_begin(float noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local float @f_cond(float noundef %0, ptr noundef %1) #0 {
  %3 = alloca float, align 4
  %4 = alloca ptr, align 8
  store float %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  br label %5

5:                                                ; preds = %21, %2
  %6 = load i32, ptr %3, align 4, !tbaa !11
  %7 = lshr i32 %6, 20
  %8 = load i32, ptr @NIL, align 4, !tbaa !11
  %9 = icmp ne i32 %7, %8
  br i1 %9, label %10, label %19

10:                                               ; preds = %5
  %11 = load float, ptr %3, align 4, !tbaa !5
  %12 = call float @car(float noundef %11)
  %13 = call float @car(float noundef %12)
  %14 = load ptr, ptr %4, align 8, !tbaa !9
  %15 = load float, ptr %14, align 4, !tbaa !5
  %16 = call float @eval(float noundef %13, float noundef %15)
  %17 = call i32 @not(float noundef %16)
  %18 = icmp ne i32 %17, 0
  br label %19

19:                                               ; preds = %10, %5
  %20 = phi i1 [ false, %5 ], [ %18, %10 ]
  br i1 %20, label %21, label %24

21:                                               ; preds = %19
  %22 = load float, ptr %3, align 4, !tbaa !5
  %23 = call float @cdr(float noundef %22)
  store float %23, ptr %3, align 4, !tbaa !5
  br label %5, !llvm.loop !13

24:                                               ; preds = %19
  %25 = load i32, ptr %3, align 4, !tbaa !11
  %26 = lshr i32 %25, 20
  %27 = load i32, ptr @NIL, align 4, !tbaa !11
  %28 = icmp ne i32 %26, %27
  br i1 %28, label %29, label %35

29:                                               ; preds = %24
  %30 = load float, ptr %3, align 4, !tbaa !5
  %31 = call float @car(float noundef %30)
  %32 = call float @cdr(float noundef %31)
  %33 = load ptr, ptr %4, align 8, !tbaa !9
  %34 = call float @f_begin(float noundef %32, ptr noundef %33)
  br label %37

35:                                               ; preds = %24
  %36 = load float, ptr @nil, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %35, %29
  %38 = phi float [ %34, %29 ], [ %36, %35 ]
  ret float %38
}

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

!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}
!13 = distinct !{!13, !14}
!14 = !{!"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"

@NIL = external dso_local local_unnamed_addr global i32, align 4
@nil = external dso_local local_unnamed_addr global float, align 4

; 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
declare dso_local i32 @not(float noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local float @f_cond(float noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = bitcast float %0 to i32
  %4 = lshr i32 %3, 20
  %5 = load i32, ptr @NIL, align 4, !tbaa !5
  %.not8 = icmp eq i32 %4, %5
  br i1 %.not8, label %.critedge.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %2
  %6 = tail call float @car(float noundef %0)
  %7 = tail call float @car(float noundef %6)
  %8 = load float, ptr %1, align 4, !tbaa !9
  %9 = tail call float @eval(float noundef %7, float noundef %8)
  %10 = tail call i32 @not(float noundef %9)
  %.not622 = icmp eq i32 %10, 0
  br i1 %.not622, label %.critedge, label %.lr.ph24

.lr.ph:                                           ; preds = %.lr.ph24
  %11 = tail call float @car(float noundef %16)
  %12 = tail call float @car(float noundef %11)
  %13 = load float, ptr %1, align 4, !tbaa !9
  %14 = tail call float @eval(float noundef %12, float noundef %13)
  %15 = tail call i32 @not(float noundef %14)
  %.not6 = icmp eq i32 %15, 0
  br i1 %.not6, label %.critedge, label %.lr.ph24, !llvm.loop !11

.lr.ph24:                                         ; preds = %.lr.ph.preheader, %.lr.ph
  %.0923 = phi float [ %16, %.lr.ph ], [ %0, %.lr.ph.preheader ]
  %16 = tail call float @cdr(float noundef %.0923)
  %17 = bitcast float %16 to i32
  %18 = lshr i32 %17, 20
  %19 = load i32, ptr @NIL, align 4, !tbaa !5
  %.not = icmp eq i32 %18, %19
  br i1 %.not, label %.critedge.thread, label %.lr.ph, !llvm.loop !11

.critedge:                                        ; preds = %.lr.ph, %.lr.ph.preheader
  %.lcssa = phi i32 [ %4, %.lr.ph.preheader ], [ %18, %.lr.ph ]
  %.09.lcssa = phi float [ %0, %.lr.ph.preheader ], [ %16, %.lr.ph ]
  %.pre.pre = load i32, ptr @NIL, align 4, !tbaa !5
  %.not7 = icmp eq i32 %.lcssa, %.pre.pre
  br i1 %.not7, label %.critedge.thread, label %20

20:                                               ; preds = %.critedge
  %21 = tail call float @car(float noundef %.09.lcssa)
  %22 = tail call float @cdr(float noundef %21)
  %23 = tail call float @f_begin(float noundef %22, ptr noundef nonnull %1)
  br label %25

.critedge.thread:                                 ; preds = %.lr.ph24, %2, %.critedge
  %24 = load float, ptr @nil, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %.critedge.thread, %20
  %26 = phi float [ %23, %20 ], [ %24, %.critedge.thread ]
  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" }

!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}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass