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

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

@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [100 x i8], align 1
@__func__.nonlinear_pks_at_k_and_z = external hidden unnamed_addr constant [25 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [93 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 @nonlinear_pk_at_k_and_z(ptr noundef, ptr noundef, ptr noundef, i32 noundef, double noundef, double noundef, i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @nonlinear_pks_at_k_and_z(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, double noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) #2 {
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca [2048 x i8], align 16
  %23 = alloca [2048 x i8], align 16
  store ptr %0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %13, align 8, !tbaa !5
  store ptr %2, ptr %14, align 8, !tbaa !5
  store i32 %3, ptr %15, align 4, !tbaa !9
  store double %4, ptr %16, align 8, !tbaa !11
  store double %5, ptr %17, align 8, !tbaa !11
  store ptr %6, ptr %18, align 8, !tbaa !5
  store ptr %7, ptr %19, align 8, !tbaa !5
  store ptr %8, ptr %20, align 8, !tbaa !5
  store ptr %9, ptr %21, align 8, !tbaa !5
  %24 = load ptr, ptr %14, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.nonlinear, ptr %24, i32 0, i32 12
  %26 = load i16, ptr %25, align 2, !tbaa !13
  %27 = icmp ne i16 %26, 0
  br i1 %27, label %28, label %52

28:                                               ; preds = %10
  %29 = load ptr, ptr %12, align 8, !tbaa !5
  %30 = load ptr, ptr %13, align 8, !tbaa !5
  %31 = load ptr, ptr %14, align 8, !tbaa !5
  %32 = load i32, ptr %15, align 4, !tbaa !9
  %33 = load double, ptr %16, align 8, !tbaa !11
  %34 = load double, ptr %17, align 8, !tbaa !11
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.nonlinear, ptr %35, i32 0, i32 14
  %37 = load i32, ptr %36, align 8, !tbaa !16
  %38 = load ptr, ptr %20, align 8, !tbaa !5
  %39 = load ptr, ptr %21, align 8, !tbaa !5
  %40 = call i32 @nonlinear_pk_at_k_and_z(ptr noundef %29, ptr noundef %30, ptr noundef %31, i32 noundef %32, double noundef %33, double noundef %34, i32 noundef %37, ptr noundef %38, ptr noundef %39)
  %41 = icmp eq i32 %40, 1
  br i1 %41, label %42, label %51

42:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 2048, ptr %22) #3
  %43 = getelementptr inbounds [2048 x i8], ptr %22, i64 0, i64 0
  %44 = load ptr, ptr %14, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.nonlinear, ptr %44, i32 0, i32 45
  %46 = getelementptr inbounds [2048 x i8], ptr %45, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %43, ptr noundef @.str.4, ptr noundef @.str.30, ptr noundef %46)
  %47 = load ptr, ptr %14, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.nonlinear, ptr %47, i32 0, i32 45
  %49 = getelementptr inbounds [2048 x i8], ptr %48, i64 0, i64 0
  %50 = getelementptr inbounds [2048 x i8], ptr %22, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %49, ptr noundef @.str.3, ptr noundef @__func__.nonlinear_pks_at_k_and_z, i32 noundef 711, ptr noundef %50)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %22) #3
  store i32 1, ptr %11, align 4
  br label %82

51:                                               ; preds = %28
  br label %52

52:                                               ; preds = %51, %10
  %53 = load ptr, ptr %14, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.nonlinear, ptr %53, i32 0, i32 11
  %55 = load i16, ptr %54, align 8, !tbaa !17
  %56 = icmp ne i16 %55, 0
  br i1 %56, label %57, label %81

57:                                               ; preds = %52
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = load ptr, ptr %14, align 8, !tbaa !5
  %61 = load i32, ptr %15, align 4, !tbaa !9
  %62 = load double, ptr %16, align 8, !tbaa !11
  %63 = load double, ptr %17, align 8, !tbaa !11
  %64 = load ptr, ptr %14, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.nonlinear, ptr %64, i32 0, i32 13
  %66 = load i32, ptr %65, align 4, !tbaa !18
  %67 = load ptr, ptr %18, align 8, !tbaa !5
  %68 = load ptr, ptr %19, align 8, !tbaa !5
  %69 = call i32 @nonlinear_pk_at_k_and_z(ptr noundef %58, ptr noundef %59, ptr noundef %60, i32 noundef %61, double noundef %62, double noundef %63, i32 noundef %66, ptr noundef %67, ptr noundef %68)
  %70 = icmp eq i32 %69, 1
  br i1 %70, label %71, label %80

71:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 2048, ptr %23) #3
  %72 = getelementptr inbounds [2048 x i8], ptr %23, i64 0, i64 0
  %73 = load ptr, ptr %14, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.nonlinear, ptr %73, i32 0, i32 45
  %75 = getelementptr inbounds [2048 x i8], ptr %74, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %72, ptr noundef @.str.4, ptr noundef @.str.31, ptr noundef %75)
  %76 = load ptr, ptr %14, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.nonlinear, ptr %76, i32 0, i32 45
  %78 = getelementptr inbounds [2048 x i8], ptr %77, i64 0, i64 0
  %79 = getelementptr inbounds [2048 x i8], ptr %23, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %78, ptr noundef @.str.3, ptr noundef @__func__.nonlinear_pks_at_k_and_z, i32 noundef 726, ptr noundef %79)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %23) #3
  store i32 1, ptr %11, align 4
  br label %82

80:                                               ; preds = %57
  br label %81

81:                                               ; preds = %80, %52
  store i32 0, ptr %11, align 4
  br label %82

82:                                               ; preds = %81, %71, %42
  %83 = load i32, ptr %11, align 4
  ret i32 %83
}

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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !15, i64 66}
!14 = !{!"nonlinear", !10, i64 0, !10, i64 4, !10, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !15, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !6, i64 56, !15, i64 64, !15, i64 66, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !15, i64 88, !10, i64 92, !6, i64 96, !6, i64 104, !6, i64 112, !10, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !10, i64 184, !10, i64 188, !6, i64 192, !6, i64 200, !6, i64 208, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !10, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !15, i64 264, !7, i64 266}
!15 = !{!"short", !7, i64 0}
!16 = !{!14, !10, i64 72}
!17 = !{!14, !15, i64 64}
!18 = !{!14, !10, i64 68}


; 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.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [100 x i8], align 1
@__func__.nonlinear_pks_at_k_and_z = external hidden unnamed_addr constant [25 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [93 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 @nonlinear_pk_at_k_and_z(ptr noundef, ptr noundef, ptr noundef, i32 noundef, double noundef, double noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @nonlinear_pks_at_k_and_z(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, double noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) local_unnamed_addr #2 {
  %11 = alloca [2048 x i8], align 16
  %12 = alloca [2048 x i8], align 16
  %13 = getelementptr inbounds i8, ptr %2, i64 66
  %14 = load i16, ptr %13, align 2, !tbaa !5
  %.not = icmp eq i16 %14, 0
  br i1 %.not, label %22, label %15

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %2, i64 72
  %17 = load i32, ptr %16, align 8, !tbaa !13
  %18 = tail call i32 @nonlinear_pk_at_k_and_z(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %2, i32 noundef %3, double noundef %4, double noundef %5, i32 noundef %17, ptr noundef %8, ptr noundef %9)
  %19 = icmp eq i32 %18, 1
  br i1 %19, label %20, label %22

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %11) #3
  %21 = getelementptr inbounds i8, ptr %2, i64 266
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %11, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.30, ptr noundef nonnull %21) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %21, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.nonlinear_pks_at_k_and_z, i32 noundef 711, ptr noundef nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %11) #3
  br label %32

22:                                               ; preds = %15, %10
  %23 = getelementptr inbounds i8, ptr %2, i64 64
  %24 = load i16, ptr %23, align 8, !tbaa !14
  %.not24 = icmp eq i16 %24, 0
  br i1 %.not24, label %32, label %25

25:                                               ; preds = %22
  %26 = getelementptr inbounds i8, ptr %2, i64 68
  %27 = load i32, ptr %26, align 4, !tbaa !15
  %28 = tail call i32 @nonlinear_pk_at_k_and_z(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %2, i32 noundef %3, double noundef %4, double noundef %5, i32 noundef %27, ptr noundef %6, ptr noundef %7)
  %29 = icmp eq i32 %28, 1
  br i1 %29, label %30, label %32

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %12) #3
  %31 = getelementptr inbounds i8, ptr %2, i64 266
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %12, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.31, ptr noundef nonnull %31) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %31, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.nonlinear_pks_at_k_and_z, i32 noundef 726, ptr noundef nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %12) #3
  br label %32

32:                                               ; preds = %22, %25, %30, %20
  %.0 = phi i32 [ 1, %20 ], [ 1, %30 ], [ 0, %25 ], [ 0, %22 ]
  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, !11, i64 66}
!6 = !{!"nonlinear", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !11, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !12, i64 56, !11, i64 64, !11, i64 66, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !11, i64 88, !7, i64 92, !12, i64 96, !12, i64 104, !12, i64 112, !7, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !7, i64 184, !7, i64 188, !12, i64 192, !12, i64 200, !12, i64 208, !7, i64 216, !7, i64 220, !7, i64 224, !7, i64 228, !7, i64 232, !12, i64 240, !12, i64 248, !12, i64 256, !11, i64 264, !8, i64 266}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!6, !7, i64 72}
!14 = !{!6, !11, i64 64}
!15 = !{!6, !7, i64 68}


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