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

; 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.transfers = type { double, double, double, [100 x double], [100 x double], i16, i16, [256 x i8], i32, ptr, ptr, ptr, i16, i16, [256 x i8], i32, ptr, ptr, ptr, ptr, i16, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, i32, ptr, double, i64, ptr, ptr, i32, ptr, 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.56 = external hidden unnamed_addr constant [94 x i8], align 1
@__func__.transfer_source_tau_size_max = external hidden unnamed_addr constant [29 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 @transfer_source_tau_size_max(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, double noundef %4, double noundef %5, ptr noundef %6) #2 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca [2048 x i8], align 16
  %20 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store double %4, ptr %13, align 8, !tbaa !9
  store double %5, ptr %14, align 8, !tbaa !9
  store ptr %6, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  store i32 0, ptr %18, align 4, !tbaa !11
  %21 = load ptr, ptr %15, align 8, !tbaa !5
  store i32 0, ptr %21, align 4, !tbaa !11
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %22

22:                                               ; preds = %76, %7
  %23 = load i32, ptr %16, align 4, !tbaa !11
  %24 = load ptr, ptr %12, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.transfers, ptr %24, i32 0, i32 21
  %26 = load i32, ptr %25, align 4, !tbaa !13
  %27 = icmp slt i32 %23, %26
  br i1 %27, label %28, label %79

28:                                               ; preds = %22
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %29

29:                                               ; preds = %72, %28
  %30 = load i32, ptr %17, align 4, !tbaa !11
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.transfers, ptr %31, i32 0, i32 39
  %33 = load ptr, ptr %32, align 8, !tbaa !17
  %34 = load i32, ptr %16, align 4, !tbaa !11
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i32, ptr %33, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !11
  %38 = icmp slt i32 %30, %37
  br i1 %38, label %39, label %75

39:                                               ; preds = %29
  %40 = load ptr, ptr %9, align 8, !tbaa !5
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = load double, ptr %13, align 8, !tbaa !9
  %45 = load double, ptr %14, align 8, !tbaa !9
  %46 = load i32, ptr %16, align 4, !tbaa !11
  %47 = load i32, ptr %17, align 4, !tbaa !11
  %48 = call i32 @transfer_source_tau_size(ptr noundef %40, ptr noundef %41, ptr noundef %42, ptr noundef %43, double noundef %44, double noundef %45, i32 noundef %46, i32 noundef %47, ptr noundef %18)
  %49 = icmp eq i32 %48, 1
  br i1 %49, label %50, label %59

50:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 2048, ptr %19) #3
  %51 = getelementptr inbounds [2048 x i8], ptr %19, i64 0, i64 0
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.transfers, ptr %52, i32 0, i32 52
  %54 = getelementptr inbounds [2048 x i8], ptr %53, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %51, ptr noundef @.str, ptr noundef @.str.56, ptr noundef %54)
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.transfers, ptr %55, i32 0, i32 52
  %57 = getelementptr inbounds [2048 x i8], ptr %56, i64 0, i64 0
  %58 = getelementptr inbounds [2048 x i8], ptr %19, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %57, ptr noundef @.str.2, ptr noundef @__func__.transfer_source_tau_size_max, i32 noundef 1478, ptr noundef %58)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %19) #3
  store i32 1, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %80

59:                                               ; preds = %39
  %60 = load ptr, ptr %15, align 8, !tbaa !5
  %61 = load i32, ptr %60, align 4, !tbaa !11
  %62 = load i32, ptr %18, align 4, !tbaa !11
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %64, label %66

64:                                               ; preds = %59
  %65 = load i32, ptr %18, align 4, !tbaa !11
  br label %69

66:                                               ; preds = %59
  %67 = load ptr, ptr %15, align 8, !tbaa !5
  %68 = load i32, ptr %67, align 4, !tbaa !11
  br label %69

69:                                               ; preds = %66, %64
  %70 = phi i32 [ %65, %64 ], [ %68, %66 ]
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  store i32 %70, ptr %71, align 4, !tbaa !11
  br label %72

72:                                               ; preds = %69
  %73 = load i32, ptr %17, align 4, !tbaa !11
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %17, align 4, !tbaa !11
  br label %29, !llvm.loop !18

75:                                               ; preds = %29
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %16, align 4, !tbaa !11
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %16, align 4, !tbaa !11
  br label %22, !llvm.loop !20

79:                                               ; preds = %22
  store i32 0, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %80

80:                                               ; preds = %79, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  %81 = load i32, ptr %8, align 4
  ret i32 %81
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @transfer_source_tau_size(ptr noundef, ptr noundef, ptr noundef, ptr noundef, double noundef, double noundef, i32 noundef, i32 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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 2212}
!14 = !{!"transfers", !10, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !7, i64 824, !15, i64 1624, !15, i64 1626, !7, i64 1628, !12, i64 1884, !6, i64 1888, !6, i64 1896, !6, i64 1904, !15, i64 1912, !15, i64 1914, !7, i64 1916, !12, i64 2172, !6, i64 2176, !6, i64 2184, !6, i64 2192, !6, i64 2200, !15, i64 2208, !12, i64 2212, !12, i64 2216, !12, i64 2220, !12, i64 2224, !12, i64 2228, !12, i64 2232, !12, i64 2236, !12, i64 2240, !12, i64 2244, !12, i64 2248, !12, i64 2252, !12, i64 2256, !12, i64 2260, !12, i64 2264, !12, i64 2268, !12, i64 2272, !12, i64 2276, !12, i64 2280, !6, i64 2288, !6, i64 2296, !6, i64 2304, !12, i64 2312, !6, i64 2320, !10, i64 2328, !16, i64 2336, !6, i64 2344, !6, i64 2352, !12, i64 2360, !6, i64 2368, !15, i64 2376, !15, i64 2378, !7, i64 2380}
!15 = !{!"short", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!14, !6, i64 2288}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; 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.56 = external hidden unnamed_addr constant [94 x i8], align 1
@__func__.transfer_source_tau_size_max = external hidden unnamed_addr constant [29 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 @transfer_source_tau_size_max(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, double noundef %4, double noundef %5, ptr nocapture noundef %6) local_unnamed_addr #2 {
  %8 = alloca i32, align 4
  %9 = alloca [2048 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  store i32 0, ptr %6, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %3, i64 2212
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.preheader.lr.ph, label %.loopexit

.preheader.lr.ph:                                 ; preds = %7
  %13 = getelementptr inbounds i8, ptr %3, i64 2288
  %.pre = load ptr, ptr %13, align 8, !tbaa !15
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %14 = phi i32 [ %11, %.preheader.lr.ph ], [ %32, %._crit_edge ]
  %15 = phi ptr [ %.pre, %.preheader.lr.ph ], [ %33, %._crit_edge ]
  %indvars.iv = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next, %._crit_edge ]
  %16 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  %19 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %24
  %.025 = phi i32 [ %27, %24 ], [ 0, %.lr.ph.preheader ]
  %20 = call i32 @transfer_source_tau_size(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull %3, double noundef %4, double noundef %5, i32 noundef %19, i32 noundef %.025, ptr noundef nonnull %8)
  %21 = icmp eq i32 %20, 1
  br i1 %21, label %22, label %24

22:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %9) #4
  %23 = getelementptr inbounds i8, ptr %3, i64 2380
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %9, ptr noundef nonnull @.str, ptr noundef nonnull @.str.56, ptr noundef nonnull %23) #4
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %23, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.transfer_source_tau_size_max, i32 noundef 1478, ptr noundef nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %9) #4
  br label %.loopexit

24:                                               ; preds = %.lr.ph
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = load i32, ptr %8, align 4, !tbaa !5
  %. = call i32 @llvm.smax.i32(i32 %25, i32 %26)
  store i32 %., ptr %6, align 4, !tbaa !5
  %27 = add nuw nsw i32 %.025, 1
  %28 = load ptr, ptr %13, align 8, !tbaa !15
  %29 = getelementptr inbounds i32, ptr %28, i64 %indvars.iv
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = icmp slt i32 %27, %30
  br i1 %31, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !16

._crit_edge.loopexit:                             ; preds = %24
  %.pre28 = load i32, ptr %10, align 4, !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %32 = phi i32 [ %.pre28, %._crit_edge.loopexit ], [ %14, %.preheader ]
  %33 = phi ptr [ %28, %._crit_edge.loopexit ], [ %15, %.preheader ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = sext i32 %32 to i64
  %35 = icmp slt i64 %indvars.iv.next, %34
  br i1 %35, label %.preheader, label %.loopexit, !llvm.loop !18

.loopexit:                                        ; preds = %._crit_edge, %7, %22
  %.022 = phi i32 [ 1, %22 ], [ 0, %7 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  ret i32 %.022
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 2212}
!10 = !{!"transfers", !11, i64 0, !11, i64 8, !11, i64 16, !7, i64 24, !7, i64 824, !12, i64 1624, !12, i64 1626, !7, i64 1628, !6, i64 1884, !13, i64 1888, !13, i64 1896, !13, i64 1904, !12, i64 1912, !12, i64 1914, !7, i64 1916, !6, i64 2172, !13, i64 2176, !13, i64 2184, !13, i64 2192, !13, i64 2200, !12, i64 2208, !6, i64 2212, !6, i64 2216, !6, i64 2220, !6, i64 2224, !6, i64 2228, !6, i64 2232, !6, i64 2236, !6, i64 2240, !6, i64 2244, !6, i64 2248, !6, i64 2252, !6, i64 2256, !6, i64 2260, !6, i64 2264, !6, i64 2268, !6, i64 2272, !6, i64 2276, !6, i64 2280, !13, i64 2288, !13, i64 2296, !13, i64 2304, !6, i64 2312, !13, i64 2320, !11, i64 2328, !14, i64 2336, !13, i64 2344, !13, i64 2352, !6, i64 2360, !13, i64 2368, !12, i64 2376, !12, i64 2378, !7, i64 2380}
!11 = !{!"double", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!10, !13, i64 2288}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass