; 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.1 = external hidden unnamed_addr constant [221 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@__func__.transfer_functions_at_q = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @transfer_functions_at_q(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, double noundef %5, ptr noundef %6) #0 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca ptr, align 8
  %16 = alloca [2048 x i8], align 16
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i32 %1, ptr %10, align 4, !tbaa !9
  store i32 %2, ptr %11, align 4, !tbaa !9
  store i32 %3, ptr %12, align 4, !tbaa !9
  store i32 %4, ptr %13, align 4, !tbaa !9
  store double %5, ptr %14, align 8, !tbaa !11
  store ptr %6, ptr %15, align 8, !tbaa !5
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.transfers, ptr %17, i32 0, i32 46
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.transfers, ptr %20, i32 0, i32 49
  %22 = load ptr, ptr %21, align 8, !tbaa !17
  %23 = load i32, ptr %10, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds ptr, ptr %22, i64 %24
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = load i32, ptr %11, align 4, !tbaa !9
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.transfers, ptr %28, i32 0, i32 39
  %30 = load ptr, ptr %29, align 8, !tbaa !18
  %31 = load i32, ptr %10, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr %30, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = mul nsw i32 %27, %34
  %36 = load i32, ptr %12, align 4, !tbaa !9
  %37 = add nsw i32 %35, %36
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.transfers, ptr %38, i32 0, i32 41
  %40 = load ptr, ptr %39, align 8, !tbaa !19
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %40, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !9
  %45 = mul nsw i32 %37, %44
  %46 = load i32, ptr %13, align 4, !tbaa !9
  %47 = add nsw i32 %45, %46
  %48 = sext i32 %47 to i64
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.transfers, ptr %49, i32 0, i32 45
  %51 = load i64, ptr %50, align 8, !tbaa !20
  %52 = mul i64 %48, %51
  %53 = getelementptr inbounds double, ptr %26, i64 %52
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.transfers, ptr %54, i32 0, i32 45
  %56 = load i64, ptr %55, align 8, !tbaa !20
  %57 = trunc i64 %56 to i32
  %58 = load double, ptr %14, align 8, !tbaa !11
  %59 = load ptr, ptr %15, align 8, !tbaa !5
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.transfers, ptr %60, i32 0, i32 52
  %62 = getelementptr inbounds [2048 x i8], ptr %61, i64 0, i64 0
  %63 = call i32 @array_interpolate_two(ptr noundef %19, i32 noundef 1, i32 noundef 0, ptr noundef %53, i32 noundef 1, i32 noundef %57, double noundef %58, ptr noundef %59, i32 noundef 1, ptr noundef %62)
  %64 = icmp eq i32 %63, 1
  br i1 %64, label %65, label %74

65:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 2048, ptr %16) #3
  %66 = getelementptr inbounds [2048 x i8], ptr %16, i64 0, i64 0
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.transfers, ptr %67, i32 0, i32 52
  %69 = getelementptr inbounds [2048 x i8], ptr %68, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %66, ptr noundef @.str, ptr noundef @.str.1, ptr noundef %69)
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.transfers, ptr %70, i32 0, i32 52
  %72 = getelementptr inbounds [2048 x i8], ptr %71, i64 0, i64 0
  %73 = getelementptr inbounds [2048 x i8], ptr %16, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %72, ptr noundef @.str.2, ptr noundef @__func__.transfer_functions_at_q, i32 noundef 87, ptr noundef %73)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %16) #3
  store i32 1, ptr %8, align 4
  br label %75

74:                                               ; preds = %7
  store i32 0, ptr %8, align 4
  br label %75

75:                                               ; preds = %74, %65
  %76 = load i32, ptr %8, align 4
  ret i32 %76
}

declare i32 @array_interpolate_two(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, double noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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) #2

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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 2344}
!14 = !{!"transfers", !12, i64 0, !12, i64 8, !12, i64 16, !7, i64 24, !7, i64 824, !15, i64 1624, !15, i64 1626, !7, i64 1628, !10, i64 1884, !6, i64 1888, !6, i64 1896, !6, i64 1904, !15, i64 1912, !15, i64 1914, !7, i64 1916, !10, i64 2172, !6, i64 2176, !6, i64 2184, !6, i64 2192, !6, i64 2200, !15, i64 2208, !10, i64 2212, !10, i64 2216, !10, i64 2220, !10, i64 2224, !10, i64 2228, !10, i64 2232, !10, i64 2236, !10, i64 2240, !10, i64 2244, !10, i64 2248, !10, i64 2252, !10, i64 2256, !10, i64 2260, !10, i64 2264, !10, i64 2268, !10, i64 2272, !10, i64 2276, !10, i64 2280, !6, i64 2288, !6, i64 2296, !6, i64 2304, !10, i64 2312, !6, i64 2320, !12, i64 2328, !16, i64 2336, !6, i64 2344, !6, i64 2352, !10, 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 2368}
!18 = !{!14, !6, i64 2288}
!19 = !{!14, !6, i64 2304}
!20 = !{!14, !16, i64 2336}


; 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.1 = external hidden unnamed_addr constant [221 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@__func__.transfer_functions_at_q = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @transfer_functions_at_q(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, double noundef %5, ptr noundef %6) local_unnamed_addr #0 {
  %8 = alloca [2048 x i8], align 16
  %9 = getelementptr inbounds i8, ptr %0, i64 2344
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 2368
  %12 = load ptr, ptr %11, align 8, !tbaa !14
  %13 = sext i32 %1 to i64
  %14 = getelementptr inbounds ptr, ptr %12, i64 %13
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %0, i64 2288
  %17 = load ptr, ptr %16, align 8, !tbaa !16
  %18 = getelementptr inbounds i32, ptr %17, i64 %13
  %19 = load i32, ptr %18, align 4, !tbaa !17
  %20 = mul nsw i32 %19, %2
  %21 = add nsw i32 %20, %3
  %22 = getelementptr inbounds i8, ptr %0, i64 2304
  %23 = load ptr, ptr %22, align 8, !tbaa !18
  %24 = getelementptr inbounds i32, ptr %23, i64 %13
  %25 = load i32, ptr %24, align 4, !tbaa !17
  %26 = mul nsw i32 %21, %25
  %27 = add nsw i32 %26, %4
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i8, ptr %0, i64 2336
  %30 = load i64, ptr %29, align 8, !tbaa !19
  %31 = mul i64 %30, %28
  %32 = getelementptr inbounds double, ptr %15, i64 %31
  %33 = trunc i64 %30 to i32
  %34 = getelementptr inbounds i8, ptr %0, i64 2380
  %35 = tail call i32 @array_interpolate_two(ptr noundef %10, i32 noundef 1, i32 noundef 0, ptr noundef %32, i32 noundef 1, i32 noundef %33, double noundef %5, ptr noundef %6, i32 noundef 1, ptr noundef nonnull %34) #3
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %37, label %38

37:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %8) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull %34) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %34, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.transfer_functions_at_q, i32 noundef 87, ptr noundef nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %8) #3
  br label %38

38:                                               ; preds = %7, %37
  %.0 = phi i32 [ 1, %37 ], [ 0, %7 ]
  ret i32 %.0
}

declare i32 @array_interpolate_two(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, double noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

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) #2

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


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