; LLVM IR from aap/pdp6 :: tools (dtr2dta)

; 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
declare dso_local void @readf(ptr noundef, ptr noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @dumpdta(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %6)
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %6)
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %10

10:                                               ; preds = %43, %2
  %11 = load i32, ptr %8, align 4, !tbaa !9
  %12 = icmp slt i32 %11, 578
  br i1 %12, label %13, label %46

13:                                               ; preds = %10
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %6)
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %7)
  %14 = load i64, ptr %6, align 8, !tbaa !11
  %15 = shl i64 %14, 18
  %16 = load i64, ptr %7, align 8, !tbaa !11
  %17 = or i64 %15, %16
  store i64 %17, ptr %6, align 8, !tbaa !11
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %6)
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %7)
  %18 = load i64, ptr %6, align 8, !tbaa !11
  %19 = shl i64 %18, 18
  %20 = load i64, ptr %7, align 8, !tbaa !11
  %21 = or i64 %19, %20
  store i64 %21, ptr %6, align 8, !tbaa !11
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %6)
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %31, %13
  %23 = load i32, ptr %9, align 4, !tbaa !9
  %24 = icmp slt i32 %23, 128
  br i1 %24, label %25, label %34

25:                                               ; preds = %22
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %6)
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %7)
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = load i64, ptr %6, align 8, !tbaa !11
  %28 = shl i64 %27, 18
  %29 = load i64, ptr %7, align 8, !tbaa !11
  %30 = or i64 %28, %29
  call void @writesimh(ptr noundef %26, i64 noundef %30)
  br label %31

31:                                               ; preds = %25
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %9, align 4, !tbaa !9
  br label %22, !llvm.loop !13

34:                                               ; preds = %22
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %6)
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %6)
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %7)
  %35 = load i64, ptr %6, align 8, !tbaa !11
  %36 = shl i64 %35, 18
  %37 = load i64, ptr %7, align 8, !tbaa !11
  %38 = or i64 %36, %37
  store i64 %38, ptr %6, align 8, !tbaa !11
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %6)
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %7)
  %39 = load i64, ptr %6, align 8, !tbaa !11
  %40 = shl i64 %39, 18
  %41 = load i64, ptr %7, align 8, !tbaa !11
  %42 = or i64 %40, %41
  store i64 %42, ptr %6, align 8, !tbaa !11
  br label %43

43:                                               ; preds = %34
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %8, align 4, !tbaa !9
  br label %10, !llvm.loop !15

46:                                               ; preds = %10
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %6)
  call void @readf(ptr noundef %3, ptr noundef %5, ptr noundef %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #2
  ret void
}

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 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; 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
declare dso_local void @readf(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @writesimh(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @dumpdta(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #2
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  br label %7

7:                                                ; preds = %2, %22
  %.046 = phi i32 [ 0, %2 ], [ %31, %22 ]
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %6)
  %8 = load i64, ptr %5, align 8, !tbaa !9
  %9 = shl i64 %8, 18
  %10 = load i64, ptr %6, align 8, !tbaa !9
  %11 = or i64 %9, %10
  store i64 %11, ptr %5, align 8, !tbaa !9
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %6)
  %12 = load i64, ptr %5, align 8, !tbaa !9
  %13 = shl i64 %12, 18
  %14 = load i64, ptr %6, align 8, !tbaa !9
  %15 = or i64 %13, %14
  store i64 %15, ptr %5, align 8, !tbaa !9
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  br label %16

16:                                               ; preds = %7, %16
  %.05 = phi i32 [ 0, %7 ], [ %21, %16 ]
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %6)
  %17 = load i64, ptr %5, align 8, !tbaa !9
  %18 = shl i64 %17, 18
  %19 = load i64, ptr %6, align 8, !tbaa !9
  %20 = or i64 %18, %19
  call void @writesimh(ptr noundef %1, i64 noundef %20)
  %21 = add nuw nsw i32 %.05, 1
  %exitcond.not = icmp eq i32 %21, 128
  br i1 %exitcond.not, label %22, label %16, !llvm.loop !11

22:                                               ; preds = %16
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %6)
  %23 = load i64, ptr %5, align 8, !tbaa !9
  %24 = shl i64 %23, 18
  %25 = load i64, ptr %6, align 8, !tbaa !9
  %26 = or i64 %24, %25
  store i64 %26, ptr %5, align 8, !tbaa !9
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %6)
  %27 = load i64, ptr %5, align 8, !tbaa !9
  %28 = shl i64 %27, 18
  %29 = load i64, ptr %6, align 8, !tbaa !9
  %30 = or i64 %28, %29
  store i64 %30, ptr %5, align 8, !tbaa !9
  %31 = add nuw nsw i32 %.046, 1
  %exitcond7.not = icmp eq i32 %31, 578
  br i1 %exitcond7.not, label %32, label %7, !llvm.loop !13

32:                                               ; preds = %22
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @readf(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #2
  ret void
}

attributes #0 = { mustprogress 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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; Effective O3 passes: GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass