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

%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }

@jb = external dso_local global [1 x %struct.__jmp_buf_tag], align 16
@sp = external dso_local global i32, align 4
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1

; 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 float @atom(ptr noundef) #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local float @f_catch(float noundef %0, ptr noundef %1) #1 {
  %3 = alloca float, align 4
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca i32, align 4
  %7 = alloca [1 x %struct.__jmp_buf_tag], align 16
  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) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %8 = load i32, ptr @sp, align 4, !tbaa !11
  store i32 %8, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 200, ptr %7) #4
  %9 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %7, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 @jb, i64 200, i1 false)
  %10 = call i32 @_setjmp(ptr noundef @jb) #5
  %11 = sitofp i32 %10 to float
  store float %11, ptr %5, align 4, !tbaa !5
  %12 = load float, ptr %5, align 4, !tbaa !5
  %13 = fcmp une float %12, 0.000000e+00
  br i1 %13, label %14, label %18

14:                                               ; preds = %2
  %15 = call float @atom(ptr noundef @.str.23)
  %16 = load float, ptr %5, align 4, !tbaa !5
  %17 = call float @cons(float noundef %15, float noundef %16)
  br label %24

18:                                               ; preds = %2
  %19 = load float, ptr %3, align 4, !tbaa !5
  %20 = call float @car(float noundef %19)
  %21 = load ptr, ptr %4, align 8, !tbaa !9
  %22 = load float, ptr %21, align 4, !tbaa !5
  %23 = call float @eval(float noundef %20, float noundef %22)
  br label %24

24:                                               ; preds = %18, %14
  %25 = phi float [ %17, %14 ], [ %23, %18 ]
  store float %25, ptr %5, align 4, !tbaa !5
  %26 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %7, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @jb, ptr align 16 %26, i64 200, i1 false)
  %27 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %27, ptr @sp, align 4, !tbaa !11
  %28 = load float, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 200, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret float %28
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind returns_twice "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 = { nounwind }
attributes #5 = { nounwind returns_twice }

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

%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }

@jb = external dso_local global [1 x %struct.__jmp_buf_tag], align 16
@sp = external dso_local local_unnamed_addr global i32, align 4
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress 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 float @atom(ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local float @f_catch(float noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 {
  %.sroa.0 = alloca %struct.__jmp_buf_tag, align 16
  %3 = load i32, ptr @sp, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %.sroa.0)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(200) %.sroa.0, ptr noundef nonnull align 16 dereferenceable(200) @jb, i64 200, i1 false)
  %4 = call i32 @_setjmp(ptr noundef nonnull @jb) #4
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %9, label %5

5:                                                ; preds = %2
  %6 = sitofp i32 %4 to float
  %7 = call float @atom(ptr noundef nonnull @.str.23)
  %8 = call float @cons(float noundef %7, float noundef %6)
  br label %13

9:                                                ; preds = %2
  %10 = call float @car(float noundef %0)
  %11 = load float, ptr %1, align 4, !tbaa !9
  %12 = call float @eval(float noundef %10, float noundef %11)
  br label %13

13:                                               ; preds = %9, %5
  %14 = phi float [ %8, %5 ], [ %12, %9 ]
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(200) @jb, ptr noundef nonnull align 16 dereferenceable(200) %.sroa.0, i64 200, i1 false)
  store i32 %3, ptr @sp, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %.sroa.0)
  ret float %14
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind returns_twice "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 = { nounwind returns_twice }

!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: CorrelatedValuePropagationPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass