; LLVM IR from jgaeddert/liquid-dsp :: sandbox (fec_g2412product_test)

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

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

; 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 @g2412p_iterate(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  store i32 0, ptr %4, align 4, !tbaa !9
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %5

5:                                                ; preds = %17, %1
  %6 = load i32, ptr %3, align 4, !tbaa !9
  %7 = icmp ult i32 %6, 24
  br i1 %7, label %8, label %20

8:                                                ; preds = %5
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = load i32, ptr %3, align 4, !tbaa !9
  call void @g2412p_load_col(ptr noundef %9, i32 noundef %10)
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = call i32 @g2412p_step(ptr noundef %11)
  %13 = load i32, ptr %4, align 4, !tbaa !9
  %14 = add nsw i32 %13, %12
  store i32 %14, ptr %4, align 4, !tbaa !9
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = load i32, ptr %3, align 4, !tbaa !9
  call void @g2412p_save_col(ptr noundef %15, i32 noundef %16)
  br label %17

17:                                               ; preds = %8
  %18 = load i32, ptr %3, align 4, !tbaa !9
  %19 = add i32 %18, 1
  store i32 %19, ptr %3, align 4, !tbaa !9
  br label %5, !llvm.loop !11

20:                                               ; preds = %5
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %33, %20
  %22 = load i32, ptr %3, align 4, !tbaa !9
  %23 = icmp ult i32 %22, 12
  br i1 %23, label %24, label %36

24:                                               ; preds = %21
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = load i32, ptr %3, align 4, !tbaa !9
  call void @g2412p_load_row(ptr noundef %25, i32 noundef %26)
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = call i32 @g2412p_step(ptr noundef %27)
  %29 = load i32, ptr %4, align 4, !tbaa !9
  %30 = add nsw i32 %29, %28
  store i32 %30, ptr %4, align 4, !tbaa !9
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = load i32, ptr %3, align 4, !tbaa !9
  call void @g2412p_save_row(ptr noundef %31, i32 noundef %32)
  br label %33

33:                                               ; preds = %24
  %34 = load i32, ptr %3, align 4, !tbaa !9
  %35 = add i32 %34, 1
  store i32 %35, ptr %3, align 4, !tbaa !9
  br label %21, !llvm.loop !13

36:                                               ; preds = %21
  %37 = load i32, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret i32 %37
}

; Function Attrs: nounwind uwtable
declare dso_local void @g2412p_load_col(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @g2412p_step(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @g2412p_save_col(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @g2412p_load_row(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @g2412p_save_row(ptr noundef, i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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

; Function Attrs: nounwind uwtable
define dso_local i32 @g2412p_iterate(ptr noundef %0) local_unnamed_addr #0 {
.preheader.preheader:
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 0)
  %1 = tail call i32 @g2412p_step(ptr noundef %0)
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 0)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 1)
  %2 = tail call i32 @g2412p_step(ptr noundef %0)
  %3 = add nsw i32 %2, %1
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 1)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 2)
  %4 = tail call i32 @g2412p_step(ptr noundef %0)
  %5 = add nsw i32 %4, %3
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 2)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 3)
  %6 = tail call i32 @g2412p_step(ptr noundef %0)
  %7 = add nsw i32 %6, %5
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 3)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 4)
  %8 = tail call i32 @g2412p_step(ptr noundef %0)
  %9 = add nsw i32 %8, %7
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 4)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 5)
  %10 = tail call i32 @g2412p_step(ptr noundef %0)
  %11 = add nsw i32 %10, %9
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 5)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 6)
  %12 = tail call i32 @g2412p_step(ptr noundef %0)
  %13 = add nsw i32 %12, %11
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 6)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 7)
  %14 = tail call i32 @g2412p_step(ptr noundef %0)
  %15 = add nsw i32 %14, %13
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 7)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 8)
  %16 = tail call i32 @g2412p_step(ptr noundef %0)
  %17 = add nsw i32 %16, %15
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 8)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 9)
  %18 = tail call i32 @g2412p_step(ptr noundef %0)
  %19 = add nsw i32 %18, %17
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 9)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 10)
  %20 = tail call i32 @g2412p_step(ptr noundef %0)
  %21 = add nsw i32 %20, %19
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 10)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 11)
  %22 = tail call i32 @g2412p_step(ptr noundef %0)
  %23 = add nsw i32 %22, %21
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 11)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 12)
  %24 = tail call i32 @g2412p_step(ptr noundef %0)
  %25 = add nsw i32 %24, %23
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 12)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 13)
  %26 = tail call i32 @g2412p_step(ptr noundef %0)
  %27 = add nsw i32 %26, %25
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 13)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 14)
  %28 = tail call i32 @g2412p_step(ptr noundef %0)
  %29 = add nsw i32 %28, %27
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 14)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 15)
  %30 = tail call i32 @g2412p_step(ptr noundef %0)
  %31 = add nsw i32 %30, %29
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 15)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 16)
  %32 = tail call i32 @g2412p_step(ptr noundef %0)
  %33 = add nsw i32 %32, %31
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 16)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 17)
  %34 = tail call i32 @g2412p_step(ptr noundef %0)
  %35 = add nsw i32 %34, %33
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 17)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 18)
  %36 = tail call i32 @g2412p_step(ptr noundef %0)
  %37 = add nsw i32 %36, %35
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 18)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 19)
  %38 = tail call i32 @g2412p_step(ptr noundef %0)
  %39 = add nsw i32 %38, %37
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 19)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 20)
  %40 = tail call i32 @g2412p_step(ptr noundef %0)
  %41 = add nsw i32 %40, %39
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 20)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 21)
  %42 = tail call i32 @g2412p_step(ptr noundef %0)
  %43 = add nsw i32 %42, %41
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 21)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 22)
  %44 = tail call i32 @g2412p_step(ptr noundef %0)
  %45 = add nsw i32 %44, %43
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 22)
  tail call void @g2412p_load_col(ptr noundef %0, i32 noundef 23)
  %46 = tail call i32 @g2412p_step(ptr noundef %0)
  %47 = add nsw i32 %46, %45
  tail call void @g2412p_save_col(ptr noundef %0, i32 noundef 23)
  tail call void @g2412p_load_row(ptr noundef %0, i32 noundef 0)
  %48 = tail call i32 @g2412p_step(ptr noundef %0)
  %49 = add nsw i32 %48, %47
  tail call void @g2412p_save_row(ptr noundef %0, i32 noundef 0)
  tail call void @g2412p_load_row(ptr noundef %0, i32 noundef 1)
  %50 = tail call i32 @g2412p_step(ptr noundef %0)
  %51 = add nsw i32 %50, %49
  tail call void @g2412p_save_row(ptr noundef %0, i32 noundef 1)
  tail call void @g2412p_load_row(ptr noundef %0, i32 noundef 2)
  %52 = tail call i32 @g2412p_step(ptr noundef %0)
  %53 = add nsw i32 %52, %51
  tail call void @g2412p_save_row(ptr noundef %0, i32 noundef 2)
  tail call void @g2412p_load_row(ptr noundef %0, i32 noundef 3)
  %54 = tail call i32 @g2412p_step(ptr noundef %0)
  %55 = add nsw i32 %54, %53
  tail call void @g2412p_save_row(ptr noundef %0, i32 noundef 3)
  tail call void @g2412p_load_row(ptr noundef %0, i32 noundef 4)
  %56 = tail call i32 @g2412p_step(ptr noundef %0)
  %57 = add nsw i32 %56, %55
  tail call void @g2412p_save_row(ptr noundef %0, i32 noundef 4)
  tail call void @g2412p_load_row(ptr noundef %0, i32 noundef 5)
  %58 = tail call i32 @g2412p_step(ptr noundef %0)
  %59 = add nsw i32 %58, %57
  tail call void @g2412p_save_row(ptr noundef %0, i32 noundef 5)
  tail call void @g2412p_load_row(ptr noundef %0, i32 noundef 6)
  %60 = tail call i32 @g2412p_step(ptr noundef %0)
  %61 = add nsw i32 %60, %59
  tail call void @g2412p_save_row(ptr noundef %0, i32 noundef 6)
  tail call void @g2412p_load_row(ptr noundef %0, i32 noundef 7)
  %62 = tail call i32 @g2412p_step(ptr noundef %0)
  %63 = add nsw i32 %62, %61
  tail call void @g2412p_save_row(ptr noundef %0, i32 noundef 7)
  tail call void @g2412p_load_row(ptr noundef %0, i32 noundef 8)
  %64 = tail call i32 @g2412p_step(ptr noundef %0)
  %65 = add nsw i32 %64, %63
  tail call void @g2412p_save_row(ptr noundef %0, i32 noundef 8)
  tail call void @g2412p_load_row(ptr noundef %0, i32 noundef 9)
  %66 = tail call i32 @g2412p_step(ptr noundef %0)
  %67 = add nsw i32 %66, %65
  tail call void @g2412p_save_row(ptr noundef %0, i32 noundef 9)
  tail call void @g2412p_load_row(ptr noundef %0, i32 noundef 10)
  %68 = tail call i32 @g2412p_step(ptr noundef %0)
  %69 = add nsw i32 %68, %67
  tail call void @g2412p_save_row(ptr noundef %0, i32 noundef 10)
  tail call void @g2412p_load_row(ptr noundef %0, i32 noundef 11)
  %70 = tail call i32 @g2412p_step(ptr noundef %0)
  %71 = add nsw i32 %70, %69
  tail call void @g2412p_save_row(ptr noundef %0, i32 noundef 11)
  ret i32 %71
}

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @g2412p_save_row(ptr noundef, i32 noundef) local_unnamed_addr #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)"}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass