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

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

@.str = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.209 = external hidden unnamed_addr constant [68 x i8], align 1
@__func__.thermodynamics_recombination = external hidden unnamed_addr constant [29 x i8], align 1
@.str.210 = external hidden unnamed_addr constant [70 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
define dso_local i32 @thermodynamics_recombination(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, 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
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  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
  %14 = load ptr, ptr %9, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.thermo, ptr %14, i32 0, i32 1
  %16 = load i32, ptr %15, align 8, !tbaa !9
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %18, label %36

18:                                               ; preds = %5
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = load ptr, ptr %9, align 8, !tbaa !5
  %22 = load ptr, ptr %10, align 8, !tbaa !5
  %23 = load ptr, ptr %11, align 8, !tbaa !5
  %24 = call i32 @thermodynamics_recombination_with_hyrec(ptr noundef %19, ptr noundef %20, ptr noundef %21, ptr noundef %22, ptr noundef %23)
  %25 = icmp eq i32 %24, 1
  br i1 %25, label %26, label %35

26:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 2048, ptr %12) #3
  %27 = getelementptr inbounds [2048 x i8], ptr %12, i64 0, i64 0
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.thermo, ptr %28, i32 0, i32 93
  %30 = getelementptr inbounds [2048 x i8], ptr %29, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %27, ptr noundef @.str, ptr noundef @.str.209, ptr noundef %30)
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.thermo, ptr %31, i32 0, i32 93
  %33 = getelementptr inbounds [2048 x i8], ptr %32, i64 0, i64 0
  %34 = getelementptr inbounds [2048 x i8], ptr %12, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %33, ptr noundef @.str.2, ptr noundef @__func__.thermodynamics_recombination, i32 noundef 3093, ptr noundef %34)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %12) #3
  store i32 1, ptr %6, align 4
  br label %60

35:                                               ; preds = %18
  br label %36

36:                                               ; preds = %35, %5
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.thermo, ptr %37, i32 0, i32 1
  %39 = load i32, ptr %38, align 8, !tbaa !9
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %59

41:                                               ; preds = %36
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = call i32 @thermodynamics_recombination_with_recfast(ptr noundef %42, ptr noundef %43, ptr noundef %44, ptr noundef %45, ptr noundef %46)
  %48 = icmp eq i32 %47, 1
  br i1 %48, label %49, label %58

49:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 2048, ptr %13) #3
  %50 = getelementptr inbounds [2048 x i8], ptr %13, i64 0, i64 0
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.thermo, ptr %51, i32 0, i32 93
  %53 = getelementptr inbounds [2048 x i8], ptr %52, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %50, ptr noundef @.str, ptr noundef @.str.210, ptr noundef %53)
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.thermo, ptr %54, i32 0, i32 93
  %56 = getelementptr inbounds [2048 x i8], ptr %55, i64 0, i64 0
  %57 = getelementptr inbounds [2048 x i8], ptr %13, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %56, ptr noundef @.str.2, ptr noundef @__func__.thermodynamics_recombination, i32 noundef 3101, ptr noundef %57)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %13) #3
  store i32 1, ptr %6, align 4
  br label %60

58:                                               ; preds = %41
  br label %59

59:                                               ; preds = %58, %36
  store i32 0, ptr %6, align 4
  br label %60

60:                                               ; preds = %59, %49, %26
  %61 = load i32, ptr %6, align 4
  ret i32 %61
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @thermodynamics_recombination_with_hyrec(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @thermodynamics_recombination_with_recfast(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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, !12, i64 8}
!10 = !{!"thermo", !11, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !11, i64 24, !11, i64 32, !13, i64 40, !13, i64 42, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !12, i64 80, !6, i64 88, !6, i64 96, !11, i64 104, !12, i64 112, !6, i64 120, !6, i64 128, !11, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !11, i64 168, !13, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !12, i64 272, !12, i64 276, !12, i64 280, !12, i64 284, !12, i64 288, !12, i64 292, !12, i64 296, !12, i64 300, !12, i64 304, !12, i64 308, !12, i64 312, !12, i64 316, !12, i64 320, !12, i64 324, !12, i64 328, !12, i64 332, !12, i64 336, !12, i64 340, !12, i64 344, !12, i64 348, !12, i64 352, !12, i64 356, !12, i64 360, !12, i64 364, !12, i64 368, !12, i64 372, !12, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !11, i64 408, !11, i64 416, !11, i64 424, !11, i64 432, !11, i64 440, !11, i64 448, !11, i64 456, !11, i64 464, !11, i64 472, !11, i64 480, !11, i64 488, !11, i64 496, !11, i64 504, !11, i64 512, !11, i64 520, !11, i64 528, !11, i64 536, !11, i64 544, !11, i64 552, !11, i64 560, !11, i64 568, !11, i64 576, !11, i64 584, !11, i64 592, !13, i64 600, !13, i64 602, !13, i64 604, !7, i64 606}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"short", !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 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.209 = external hidden unnamed_addr constant [68 x i8], align 1
@__func__.thermodynamics_recombination = external hidden unnamed_addr constant [29 x i8], align 1
@.str.210 = external hidden unnamed_addr constant [70 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
define dso_local range(i32 0, 2) i32 @thermodynamics_recombination(ptr noundef %0, ptr 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 = getelementptr inbounds i8, ptr %2, i64 8
  %9 = load i32, ptr %8, align 8, !tbaa !5
  %10 = icmp eq i32 %9, 1
  br i1 %10, label %11, label %16

11:                                               ; preds = %5
  %12 = tail call i32 @thermodynamics_recombination_with_hyrec(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %2, ptr noundef %3, ptr noundef %4)
  %13 = icmp eq i32 %12, 1
  br i1 %13, label %14, label %thread-pre-split

14:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %6) #3
  %15 = getelementptr inbounds i8, ptr %2, i64 606
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %6, ptr noundef nonnull @.str, ptr noundef nonnull @.str.209, ptr noundef nonnull %15) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.thermodynamics_recombination, i32 noundef 3093, ptr noundef nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %6) #3
  br label %24

thread-pre-split:                                 ; preds = %11
  %.pr = load i32, ptr %8, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %thread-pre-split, %5
  %17 = phi i32 [ %.pr, %thread-pre-split ], [ %9, %5 ]
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %24

19:                                               ; preds = %16
  %20 = tail call i32 @thermodynamics_recombination_with_recfast(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %2, ptr noundef %3, ptr noundef %4)
  %21 = icmp eq i32 %20, 1
  br i1 %21, label %22, label %24

22:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %7) #3
  %23 = getelementptr inbounds i8, ptr %2, i64 606
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str, ptr noundef nonnull @.str.210, ptr noundef nonnull %23) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %23, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.thermodynamics_recombination, i32 noundef 3101, ptr noundef nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %7) #3
  br label %24

24:                                               ; preds = %16, %19, %22, %14
  %.0 = phi i32 [ 1, %14 ], [ 1, %22 ], [ 0, %19 ], [ 0, %16 ]
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @thermodynamics_recombination_with_hyrec(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @thermodynamics_recombination_with_recfast(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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, !10, i64 8}
!6 = !{!"thermo", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !7, i64 24, !7, i64 32, !11, i64 40, !11, i64 42, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !10, i64 80, !12, i64 88, !12, i64 96, !7, i64 104, !10, i64 112, !12, i64 120, !12, i64 128, !7, i64 136, !10, i64 144, !12, i64 152, !12, i64 160, !7, i64 168, !11, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !10, i64 272, !10, i64 276, !10, i64 280, !10, i64 284, !10, i64 288, !10, i64 292, !10, i64 296, !10, i64 300, !10, i64 304, !10, i64 308, !10, i64 312, !10, i64 316, !10, i64 320, !10, i64 324, !10, i64 328, !10, i64 332, !10, i64 336, !10, i64 340, !10, i64 344, !10, i64 348, !10, i64 352, !10, i64 356, !10, i64 360, !10, i64 364, !10, i64 368, !10, i64 372, !10, i64 376, !12, i64 384, !12, i64 392, !12, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !7, i64 432, !7, i64 440, !7, i64 448, !7, i64 456, !7, i64 464, !7, i64 472, !7, i64 480, !7, i64 488, !7, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !7, i64 528, !7, i64 536, !7, i64 544, !7, i64 552, !7, i64 560, !7, i64 568, !7, i64 576, !7, i64 584, !7, i64 592, !11, i64 600, !11, i64 602, !11, i64 604, !8, i64 606}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}


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