; 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] }

; Function Attrs: nounwind uwtable
define dso_local i32 @nonlinear_hmcode_baryonic_feedback(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds %struct.nonlinear, ptr %3, i32 0, i32 2
  %5 = load i32, ptr %4, align 8, !tbaa !9
  switch i32 %5, label %32 [
    i32 0, label %6
    i32 1, label %11
    i32 2, label %16
    i32 3, label %21
    i32 4, label %26
    i32 5, label %31
  ]

6:                                                ; preds = %1
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.nonlinear, ptr %7, i32 0, i32 4
  store double 0x3FE34BC6A7EF9DB2, ptr %8, align 8, !tbaa !14
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.nonlinear, ptr %9, i32 0, i32 3
  store double 3.130000e+00, ptr %10, align 8, !tbaa !15
  br label %32

11:                                               ; preds = %1
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.nonlinear, ptr %12, i32 0, i32 4
  store double 6.400000e-01, ptr %13, align 8, !tbaa !14
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.nonlinear, ptr %14, i32 0, i32 3
  store double 3.430000e+00, ptr %15, align 8, !tbaa !15
  br label %32

16:                                               ; preds = %1
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.nonlinear, ptr %17, i32 0, i32 4
  store double 6.800000e-01, ptr %18, align 8, !tbaa !14
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.nonlinear, ptr %19, i32 0, i32 3
  store double 3.910000e+00, ptr %20, align 8, !tbaa !15
  br label %32

21:                                               ; preds = %1
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.nonlinear, ptr %22, i32 0, i32 4
  store double 7.600000e-01, ptr %23, align 8, !tbaa !14
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.nonlinear, ptr %24, i32 0, i32 3
  store double 2.320000e+00, ptr %25, align 8, !tbaa !15
  br label %32

26:                                               ; preds = %1
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.nonlinear, ptr %27, i32 0, i32 4
  store double 0x3FE6666666666666, ptr %28, align 8, !tbaa !14
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.nonlinear, ptr %29, i32 0, i32 3
  store double 3.010000e+00, ptr %30, align 8, !tbaa !15
  br label %32

31:                                               ; preds = %1
  br label %32

32:                                               ; preds = %31, %26, %21, %16, %11, %6, %1
  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" }

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


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

@switch.table.nonlinear_hmcode_baryonic_feedback = private unnamed_addr constant [5 x double] [double 0x3FE34BC6A7EF9DB2, double 6.400000e-01, double 6.800000e-01, double 7.600000e-01, double 0x3FE6666666666666], align 8
@switch.table.nonlinear_hmcode_baryonic_feedback.1 = private unnamed_addr constant [5 x double] [double 3.130000e+00, double 3.430000e+00, double 3.910000e+00, double 2.320000e+00, double 3.010000e+00], align 8

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local noundef i32 @nonlinear_hmcode_baryonic_feedback(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = icmp ult i32 %3, 5
  br i1 %4, label %switch.lookup, label %9

switch.lookup:                                    ; preds = %1
  %5 = zext nneg i32 %3 to i64
  %switch.gep = getelementptr inbounds [5 x double], ptr @switch.table.nonlinear_hmcode_baryonic_feedback, i64 0, i64 %5
  %switch.load = load double, ptr %switch.gep, align 8
  %6 = zext nneg i32 %3 to i64
  %switch.gep14 = getelementptr inbounds [5 x double], ptr @switch.table.nonlinear_hmcode_baryonic_feedback.1, i64 0, i64 %6
  %switch.load15 = load double, ptr %switch.gep14, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  store double %switch.load, ptr %7, align 8, !tbaa !13
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  store double %switch.load15, ptr %8, align 8, !tbaa !14
  br label %9

9:                                                ; preds = %1, %switch.lookup
  ret i32 0
}

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

!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, !7, i64 8}
!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, !10, i64 24}
!14 = !{!6, !10, i64 16}


; Effective O3 passes: GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass