; 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.13 = external hidden unnamed_addr constant [92 x i8], align 1
@__func__.nonlinear_pks_at_z = external hidden unnamed_addr constant [19 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [85 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @nonlinear_pk_at_z(ptr noundef, ptr noundef, i32 noundef, i32 noundef, double noundef, i32 noundef, ptr noundef, ptr noundef) #0

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

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

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

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

26:                                               ; preds = %9
  %27 = load ptr, ptr %11, align 8, !tbaa !5
  %28 = load ptr, ptr %12, align 8, !tbaa !5
  %29 = load i32, ptr %13, align 4, !tbaa !9
  %30 = load i32, ptr %14, align 4, !tbaa !9
  %31 = load double, ptr %15, align 8, !tbaa !11
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.nonlinear, ptr %32, i32 0, i32 14
  %34 = load i32, ptr %33, align 8, !tbaa !16
  %35 = load ptr, ptr %18, align 8, !tbaa !5
  %36 = load ptr, ptr %19, align 8, !tbaa !5
  %37 = call i32 @nonlinear_pk_at_z(ptr noundef %27, ptr noundef %28, i32 noundef %29, i32 noundef %30, double noundef %31, i32 noundef %34, ptr noundef %35, ptr noundef %36)
  %38 = icmp eq i32 %37, 1
  br i1 %38, label %39, label %48

39:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 2048, ptr %20) #3
  %40 = getelementptr inbounds [2048 x i8], ptr %20, i64 0, i64 0
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.nonlinear, ptr %41, i32 0, i32 45
  %43 = getelementptr inbounds [2048 x i8], ptr %42, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %40, ptr noundef @.str.4, ptr noundef @.str.13, ptr noundef %43)
  %44 = load ptr, ptr %12, 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
  %47 = getelementptr inbounds [2048 x i8], ptr %20, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %46, ptr noundef @.str.3, ptr noundef @__func__.nonlinear_pks_at_z, i32 noundef 315, ptr noundef %47)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %20) #3
  store i32 1, ptr %10, align 4
  br label %78

48:                                               ; preds = %26
  br label %49

49:                                               ; preds = %48, %9
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.nonlinear, ptr %50, i32 0, i32 11
  %52 = load i16, ptr %51, align 8, !tbaa !17
  %53 = icmp ne i16 %52, 0
  br i1 %53, label %54, label %77

54:                                               ; preds = %49
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = load i32, ptr %13, align 4, !tbaa !9
  %58 = load i32, ptr %14, align 4, !tbaa !9
  %59 = load double, ptr %15, align 8, !tbaa !11
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.nonlinear, ptr %60, i32 0, i32 13
  %62 = load i32, ptr %61, align 4, !tbaa !18
  %63 = load ptr, ptr %16, align 8, !tbaa !5
  %64 = load ptr, ptr %17, align 8, !tbaa !5
  %65 = call i32 @nonlinear_pk_at_z(ptr noundef %55, ptr noundef %56, i32 noundef %57, i32 noundef %58, double noundef %59, i32 noundef %62, ptr noundef %63, ptr noundef %64)
  %66 = icmp eq i32 %65, 1
  br i1 %66, label %67, label %76

67:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 2048, ptr %21) #3
  %68 = getelementptr inbounds [2048 x i8], ptr %21, i64 0, i64 0
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.nonlinear, ptr %69, i32 0, i32 45
  %71 = getelementptr inbounds [2048 x i8], ptr %70, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %68, ptr noundef @.str.4, ptr noundef @.str.14, ptr noundef %71)
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.nonlinear, ptr %72, i32 0, i32 45
  %74 = getelementptr inbounds [2048 x i8], ptr %73, i64 0, i64 0
  %75 = getelementptr inbounds [2048 x i8], ptr %21, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %74, ptr noundef @.str.3, ptr noundef @__func__.nonlinear_pks_at_z, i32 noundef 330, ptr noundef %75)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %21) #3
  store i32 1, ptr %10, align 4
  br label %78

76:                                               ; preds = %54
  br label %77

77:                                               ; preds = %76, %49
  store i32 0, ptr %10, align 4
  br label %78

78:                                               ; preds = %77, %67, %39
  %79 = load i32, ptr %10, align 4
  ret i32 %79
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"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.13 = external hidden unnamed_addr constant [92 x i8], align 1
@__func__.nonlinear_pks_at_z = external hidden unnamed_addr constant [19 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [85 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @nonlinear_pk_at_z(ptr noundef, ptr noundef, i32 noundef, i32 noundef, double noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

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

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

19:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %10) #3
  %20 = getelementptr inbounds i8, ptr %1, i64 266
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %10, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.13, ptr noundef nonnull %20) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %20, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.nonlinear_pks_at_z, i32 noundef 315, ptr noundef nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %10) #3
  br label %31

21:                                               ; preds = %14, %9
  %22 = getelementptr inbounds i8, ptr %1, i64 64
  %23 = load i16, ptr %22, align 8, !tbaa !14
  %.not22 = icmp eq i16 %23, 0
  br i1 %.not22, label %31, label %24

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

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %11) #3
  %30 = getelementptr inbounds i8, ptr %1, i64 266
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %11, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.14, ptr noundef nonnull %30) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %30, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.nonlinear_pks_at_z, i32 noundef 330, ptr noundef nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %11) #3
  br label %31

31:                                               ; preds = %21, %24, %29, %19
  %.0 = phi i32 [ 1, %19 ], [ 1, %29 ], [ 0, %24 ], [ 0, %21 ]
  ret i32 %.0
}

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !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