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

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

@.str.14 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [17 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

; 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

declare i32 @printf(ptr noundef, ...) #2

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

8:                                                ; preds = %55, %1
  %9 = load i32, ptr %6, align 4, !tbaa !9
  %10 = icmp slt i32 %9, 578
  br i1 %10, label %11, label %58

11:                                               ; preds = %8
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %4)
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %5)
  %12 = load i64, ptr %4, align 8, !tbaa !11
  %13 = shl i64 %12, 18
  %14 = load i64, ptr %5, align 8, !tbaa !11
  %15 = or i64 %13, %14
  store i64 %15, ptr %4, align 8, !tbaa !11
  %16 = load i64, ptr %4, align 8, !tbaa !11
  %17 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i64 noundef %16)
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %4)
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %5)
  %18 = load i64, ptr %4, align 8, !tbaa !11
  %19 = shl i64 %18, 18
  %20 = load i64, ptr %5, align 8, !tbaa !11
  %21 = or i64 %19, %20
  store i64 %21, ptr %4, align 8, !tbaa !11
  %22 = load i64, ptr %4, align 8, !tbaa !11
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i64 noundef %22)
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %4)
  %24 = load i64, ptr %4, align 8, !tbaa !11
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, i64 noundef %24)
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %37, %11
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = icmp slt i32 %27, 128
  br i1 %28, label %29, label %40

29:                                               ; preds = %26
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %4)
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %5)
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = load i64, ptr %4, align 8, !tbaa !11
  %33 = shl i64 %32, 18
  %34 = load i64, ptr %5, align 8, !tbaa !11
  %35 = or i64 %33, %34
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, i32 noundef %30, i32 noundef %31, i64 noundef %35)
  br label %37

37:                                               ; preds = %29
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %7, align 4, !tbaa !9
  br label %26, !llvm.loop !13

40:                                               ; preds = %26
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %4)
  %41 = load i64, ptr %4, align 8, !tbaa !11
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, i64 noundef %41)
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %4)
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %5)
  %43 = load i64, ptr %4, align 8, !tbaa !11
  %44 = shl i64 %43, 18
  %45 = load i64, ptr %5, align 8, !tbaa !11
  %46 = or i64 %44, %45
  store i64 %46, ptr %4, align 8, !tbaa !11
  %47 = load i64, ptr %4, align 8, !tbaa !11
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i64 noundef %47)
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %4)
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %5)
  %49 = load i64, ptr %4, align 8, !tbaa !11
  %50 = shl i64 %49, 18
  %51 = load i64, ptr %5, align 8, !tbaa !11
  %52 = or i64 %50, %51
  store i64 %52, ptr %4, align 8, !tbaa !11
  %53 = load i64, ptr %4, align 8, !tbaa !11
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.19, i64 noundef %53)
  br label %55

55:                                               ; preds = %40
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %6, align 4, !tbaa !9
  br label %8, !llvm.loop !15

58:                                               ; preds = %8
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %4)
  call void @readf(ptr noundef %2, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #3
  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 = { "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 = !{!"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"

@.str.14 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [17 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

; 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

6:                                                ; preds = %1, %26
  %.068 = phi i32 [ 0, %1 ], [ %39, %26 ]
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %5)
  %7 = load i64, ptr %4, align 8, !tbaa !9
  %8 = shl i64 %7, 18
  %9 = load i64, ptr %5, align 8, !tbaa !9
  %10 = or i64 %8, %9
  store i64 %10, ptr %4, align 8, !tbaa !9
  %11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i64 noundef %10)
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %5)
  %12 = load i64, ptr %4, align 8, !tbaa !9
  %13 = shl i64 %12, 18
  %14 = load i64, ptr %5, align 8, !tbaa !9
  %15 = or i64 %13, %14
  store i64 %15, ptr %4, align 8, !tbaa !9
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i64 noundef %15)
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %17 = load i64, ptr %4, align 8, !tbaa !9
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, i64 noundef %17)
  br label %19

19:                                               ; preds = %6, %19
  %.07 = phi i32 [ 0, %6 ], [ %25, %19 ]
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %5)
  %20 = load i64, ptr %4, align 8, !tbaa !9
  %21 = shl i64 %20, 18
  %22 = load i64, ptr %5, align 8, !tbaa !9
  %23 = or i64 %21, %22
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, i32 noundef %.068, i32 noundef %.07, i64 noundef %23)
  %25 = add nuw nsw i32 %.07, 1
  %exitcond.not = icmp eq i32 %25, 128
  br i1 %exitcond.not, label %26, label %19, !llvm.loop !11

26:                                               ; preds = %19
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %27 = load i64, ptr %4, align 8, !tbaa !9
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, i64 noundef %27)
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %5)
  %29 = load i64, ptr %4, align 8, !tbaa !9
  %30 = shl i64 %29, 18
  %31 = load i64, ptr %5, align 8, !tbaa !9
  %32 = or i64 %30, %31
  store i64 %32, ptr %4, align 8, !tbaa !9
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i64 noundef %32)
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %5)
  %34 = load i64, ptr %4, align 8, !tbaa !9
  %35 = shl i64 %34, 18
  %36 = load i64, ptr %5, align 8, !tbaa !9
  %37 = or i64 %35, %36
  store i64 %37, ptr %4, align 8, !tbaa !9
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i64 noundef %37)
  %39 = add nuw nsw i32 %.068, 1
  %exitcond9.not = icmp eq i32 %39, 578
  br i1 %exitcond9.not, label %40, label %6, !llvm.loop !13

40:                                               ; preds = %26
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @readf(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #3
  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 = { nofree nounwind "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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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