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

@CONS = external dso_local global i32, align 4
@NIL = external dso_local global i32, align 4
@out = external dso_local global ptr, align 8
@.str.66 = external hidden unnamed_addr constant [4 x i8], align 1

; 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
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

declare i32 @putc(i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @printlist(float noundef %0) #0 {
  %2 = alloca float, align 4
  store float %0, ptr %2, align 4, !tbaa !5
  %3 = load ptr, ptr @out, align 8, !tbaa !9
  %4 = call i32 @putc(i32 noundef 40, ptr noundef %3)
  br label %5

5:                                                ; preds = %24, %1
  %6 = load float, ptr %2, align 4, !tbaa !5
  %7 = call float @car(float noundef %6)
  call void @print(float noundef %7)
  %8 = load float, ptr %2, align 4, !tbaa !5
  %9 = call float @cdr(float noundef %8)
  store float %9, ptr %2, align 4, !tbaa !5
  %10 = load i32, ptr %2, align 4, !tbaa !11
  %11 = lshr i32 %10, 20
  %12 = load i32, ptr @NIL, align 4, !tbaa !11
  %13 = icmp eq i32 %11, %12
  br i1 %13, label %14, label %15

14:                                               ; preds = %5
  br label %27

15:                                               ; preds = %5
  %16 = load i32, ptr %2, align 4, !tbaa !11
  %17 = lshr i32 %16, 20
  %18 = load i32, ptr @CONS, align 4, !tbaa !11
  %19 = icmp ne i32 %17, %18
  br i1 %19, label %20, label %24

20:                                               ; preds = %15
  %21 = load ptr, ptr @out, align 8, !tbaa !9
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef @.str.66) #3
  %23 = load float, ptr %2, align 4, !tbaa !5
  call void @print(float noundef %23)
  br label %27

24:                                               ; preds = %15
  %25 = load ptr, ptr @out, align 8, !tbaa !9
  %26 = call i32 @putc(i32 noundef 32, ptr noundef %25)
  br label %5

27:                                               ; preds = %20, %14
  %28 = load ptr, ptr @out, align 8, !tbaa !9
  %29 = call i32 @putc(i32 noundef 41, ptr noundef %28)
  ret void
}

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

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

@CONS = external dso_local local_unnamed_addr global i32, align 4
@NIL = external dso_local local_unnamed_addr global i32, align 4
@out = external dso_local local_unnamed_addr global ptr, align 8
@.str.66 = external hidden unnamed_addr constant [4 x i8], align 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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @printlist(float noundef %0) local_unnamed_addr #0 {
  %2 = load ptr, ptr @out, align 8, !tbaa !5
  %3 = tail call i32 @putc(i32 noundef 40, ptr noundef %2)
  %4 = tail call float @car(float noundef %0)
  tail call void @print(float noundef %4)
  %5 = tail call float @cdr(float noundef %0)
  %6 = bitcast float %5 to i32
  %7 = lshr i32 %6, 20
  %8 = load i32, ptr @NIL, align 4, !tbaa !9
  %9 = icmp eq i32 %7, %8
  br i1 %9, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %1, %16
  %10 = phi i32 [ %21, %16 ], [ %7, %1 ]
  %11 = phi float [ %19, %16 ], [ %5, %1 ]
  %12 = load i32, ptr @CONS, align 4, !tbaa !9
  %.not = icmp eq i32 %10, %12
  %13 = load ptr, ptr @out, align 8, !tbaa !5
  br i1 %.not, label %16, label %14

14:                                               ; preds = %.lr.ph
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.66) #2
  tail call void @print(float noundef %11)
  br label %.loopexit

16:                                               ; preds = %.lr.ph
  %17 = tail call i32 @putc(i32 noundef 32, ptr noundef %13)
  %18 = tail call float @car(float noundef %11)
  tail call void @print(float noundef %18)
  %19 = tail call float @cdr(float noundef %11)
  %20 = bitcast float %19 to i32
  %21 = lshr i32 %20, 20
  %22 = load i32, ptr @NIL, align 4, !tbaa !9
  %23 = icmp eq i32 %21, %22
  br i1 %23, label %.loopexit, label %.lr.ph

.loopexit:                                        ; preds = %16, %1, %14
  %24 = load ptr, ptr @out, align 8, !tbaa !5
  %25 = tail call i32 @putc(i32 noundef 41, ptr noundef %24)
  ret void
}

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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}


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