; LLVM IR from CLASS-SZ/class_sz :: class-sz/source (primordial)

; 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.primordial = type { double, i32, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i32, double, double, double, double, double, double, double, double, double, double, double, i32, double, i32, ptr, double, double, double, double, double, double, double, double, double, double, i32, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double, double, double, double, i16, [2048 x i8] }

@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [49 x i8], align 1
@__func__.primordial_inflation_check_potential = external hidden unnamed_addr constant [37 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [118 x i8], align 1
@.str.132 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.133 = external hidden unnamed_addr constant [131 x i8], align 1
@.str.134 = external hidden unnamed_addr constant [10 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

declare void @class_protect_sprintf(ptr noundef, ptr noundef, ...) #1

; 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 @primordial_inflation_potential(ptr noundef, double noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @primordial_inflation_check_potential(ptr noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca [2048 x i8], align 16
  %13 = alloca [2048 x i8], align 16
  %14 = alloca [2048 x i8], align 16
  %15 = alloca [2048 x i8], align 16
  %16 = alloca [2048 x i8], align 16
  store ptr %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = load double, ptr %8, align 8, !tbaa !9
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = load ptr, ptr %10, align 8, !tbaa !5
  %21 = load ptr, ptr %11, align 8, !tbaa !5
  %22 = call i32 @primordial_inflation_potential(ptr noundef %17, double noundef %18, ptr noundef %19, ptr noundef %20, ptr noundef %21)
  %23 = icmp eq i32 %22, 1
  br i1 %23, label %24, label %33

24:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 2048, ptr %12) #3
  %25 = getelementptr inbounds [2048 x i8], ptr %12, i64 0, i64 0
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.primordial, ptr %26, i32 0, i32 106
  %28 = getelementptr inbounds [2048 x i8], ptr %27, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %25, ptr noundef @.str.6, ptr noundef @.str.130, ptr noundef %28)
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.primordial, ptr %29, i32 0, i32 106
  %31 = getelementptr inbounds [2048 x i8], ptr %30, i64 0, i64 0
  %32 = getelementptr inbounds [2048 x i8], ptr %12, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %31, ptr noundef @.str.3, ptr noundef @__func__.primordial_inflation_check_potential, i32 noundef 2411, ptr noundef %32)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %12) #3
  store i32 1, ptr %6, align 4
  br label %62

33:                                               ; preds = %5
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = load double, ptr %34, align 8, !tbaa !9
  %36 = fcmp ole double %35, 0.000000e+00
  br i1 %36, label %37, label %46

37:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 2048, ptr %13) #3
  %38 = getelementptr inbounds [2048 x i8], ptr %13, i64 0, i64 0
  %39 = load double, ptr %8, align 8, !tbaa !9
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %38, ptr noundef @.str.131, double noundef %39)
  call void @llvm.lifetime.start.p0(i64 2048, ptr %14) #3
  %40 = getelementptr inbounds [2048 x i8], ptr %14, i64 0, i64 0
  %41 = getelementptr inbounds [2048 x i8], ptr %13, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %40, ptr noundef @.str.1, ptr noundef @.str.132, ptr noundef %41)
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.primordial, ptr %42, i32 0, i32 106
  %44 = getelementptr inbounds [2048 x i8], ptr %43, i64 0, i64 0
  %45 = getelementptr inbounds [2048 x i8], ptr %14, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %44, ptr noundef @.str.3, ptr noundef @__func__.primordial_inflation_check_potential, i32 noundef 2416, ptr noundef %45)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr %13) #3
  store i32 1, ptr %6, align 4
  br label %62

46:                                               ; preds = %33
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = load double, ptr %47, align 8, !tbaa !9
  %49 = fcmp oge double %48, 0.000000e+00
  br i1 %49, label %50, label %61

50:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 2048, ptr %15) #3
  %51 = getelementptr inbounds [2048 x i8], ptr %15, i64 0, i64 0
  %52 = load double, ptr %8, align 8, !tbaa !9
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = load double, ptr %53, align 8, !tbaa !9
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %51, ptr noundef @.str.133, double noundef %52, double noundef %54)
  call void @llvm.lifetime.start.p0(i64 2048, ptr %16) #3
  %55 = getelementptr inbounds [2048 x i8], ptr %16, i64 0, i64 0
  %56 = getelementptr inbounds [2048 x i8], ptr %15, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %55, ptr noundef @.str.1, ptr noundef @.str.134, ptr noundef %56)
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.primordial, ptr %57, i32 0, i32 106
  %59 = getelementptr inbounds [2048 x i8], ptr %58, i64 0, i64 0
  %60 = getelementptr inbounds [2048 x i8], ptr %16, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %59, ptr noundef @.str.3, ptr noundef @__func__.primordial_inflation_check_potential, i32 noundef 2421, ptr noundef %60)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr %15) #3
  store i32 1, ptr %6, align 4
  br label %62

61:                                               ; preds = %46
  store i32 0, ptr %6, align 4
  br label %62

62:                                               ; preds = %61, %50, %37, %24
  %63 = load i32, ptr %6, align 4
  ret i32 %63
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !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"

@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [49 x i8], align 1
@__func__.primordial_inflation_check_potential = external hidden unnamed_addr constant [37 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [118 x i8], align 1
@.str.132 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.133 = external hidden unnamed_addr constant [131 x i8], align 1
@.str.134 = external hidden unnamed_addr constant [10 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

declare void @class_protect_sprintf(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

; 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 i32 @primordial_inflation_potential(ptr noundef, double noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @primordial_inflation_check_potential(ptr noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #2 {
  %6 = alloca [2048 x i8], align 16
  %7 = alloca [2048 x i8], align 16
  %8 = alloca [2048 x i8], align 16
  %9 = alloca [2048 x i8], align 16
  %10 = alloca [2048 x i8], align 16
  %11 = tail call i32 @primordial_inflation_potential(ptr noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4)
  %12 = icmp eq i32 %11, 1
  br i1 %12, label %13, label %15

13:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %6) #3
  %14 = getelementptr inbounds i8, ptr %0, i64 794
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %6, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.130, ptr noundef nonnull %14) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %14, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.primordial_inflation_check_potential, i32 noundef 2411, ptr noundef nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %6) #3
  br label %25

15:                                               ; preds = %5
  %16 = load double, ptr %2, align 8, !tbaa !5
  %17 = fcmp ugt double %16, 0.000000e+00
  br i1 %17, label %20, label %18

18:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %7) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.131, double noundef %1) #3
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %8) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.132, ptr noundef nonnull %7) #3
  %19 = getelementptr inbounds i8, ptr %0, i64 794
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %19, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.primordial_inflation_check_potential, i32 noundef 2416, ptr noundef nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %7) #3
  br label %25

20:                                               ; preds = %15
  %21 = load double, ptr %3, align 8, !tbaa !5
  %22 = fcmp ult double %21, 0.000000e+00
  br i1 %22, label %25, label %23

23:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %9) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %9, ptr noundef nonnull @.str.133, double noundef %1, double noundef %21) #3
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %10) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %10, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.134, ptr noundef nonnull %9) #3
  %24 = getelementptr inbounds i8, ptr %0, i64 794
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %24, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.primordial_inflation_check_potential, i32 noundef 2421, ptr noundef nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %9) #3
  br label %25

25:                                               ; preds = %20, %23, %18, %13
  %.0 = phi i32 [ 1, %13 ], [ 1, %18 ], [ 1, %23 ], [ 0, %20 ]
  ret i32 %.0
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 #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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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