; LLVM IR from aap/pdp6 :: newemu (pdp6)

; 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.PDP6 = type { i32, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i64, i64, i8, i64, i64, i64, i32, i32, i32, i32, i32, i32, i64, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i64, i64, i64, i8, i8, i8, i8, i64, i8, i8, i8, i32, %struct.FD, i64, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, %struct.FD, i32, i64, i64, %struct.FD, i8, i64, i64, i64, i64, i64, i8, i64 }
%struct.FD = type { i32, i32, i32 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@simtime = external global i64, align 8
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @pulse(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.PDP6, ptr %5, i32 0, i32 171
  %7 = load i8, ptr %6, align 4, !tbaa !9, !range !15, !noundef !16
  %8 = trunc i8 %7 to i1
  br i1 %8, label %9, label %12

9:                                                ; preds = %2
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %10)
  br label %12

12:                                               ; preds = %9, %2
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.PDP6, ptr %13, i32 0, i32 171
  %15 = load i8, ptr %14, align 4, !tbaa !9, !range !15, !noundef !16
  %16 = trunc i8 %15 to i1
  br i1 %16, label %17, label %28

17:                                               ; preds = %12
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.PDP6, ptr %18, i32 0, i32 31
  %20 = load i64, ptr %19, align 8, !tbaa !17
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.PDP6, ptr %21, i32 0, i32 28
  %23 = load i64, ptr %22, align 8, !tbaa !18
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.PDP6, ptr %24, i32 0, i32 29
  %26 = load i64, ptr %25, align 8, !tbaa !19
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %20, i64 noundef %23, i64 noundef %26)
  br label %28

28:                                               ; preds = %17, %12
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.PDP6, ptr %29, i32 0, i32 171
  %31 = load i8, ptr %30, align 4, !tbaa !9, !range !15, !noundef !16
  %32 = trunc i8 %31 to i1
  br i1 %32, label %33, label %41

33:                                               ; preds = %28
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.PDP6, ptr %34, i32 0, i32 38
  %36 = load i32, ptr %35, align 8, !tbaa !20
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.PDP6, ptr %37, i32 0, i32 39
  %39 = load i32, ptr %38, align 4, !tbaa !21
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %36, i32 noundef %39)
  br label %41

41:                                               ; preds = %33, %28
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.PDP6, ptr %42, i32 0, i32 171
  %44 = load i8, ptr %43, align 4, !tbaa !9, !range !15, !noundef !16
  %45 = trunc i8 %44 to i1
  br i1 %45, label %46, label %57

46:                                               ; preds = %41
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.PDP6, ptr %47, i32 0, i32 37
  %49 = load i32, ptr %48, align 4, !tbaa !22
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.PDP6, ptr %50, i32 0, i32 34
  %52 = load i32, ptr %51, align 8, !tbaa !23
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.PDP6, ptr %53, i32 0, i32 35
  %55 = load i32, ptr %54, align 4, !tbaa !24
  %56 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %49, i32 noundef %52, i32 noundef %55)
  br label %57

57:                                               ; preds = %46, %41
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.PDP6, ptr %58, i32 0, i32 171
  %60 = load i8, ptr %59, align 4, !tbaa !9, !range !15, !noundef !16
  %61 = trunc i8 %60 to i1
  br i1 %61, label %62, label %65

62:                                               ; preds = %57
  %63 = load i64, ptr @simtime, align 8, !tbaa !25
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %63)
  br label %65

65:                                               ; preds = %62, %57
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.PDP6, ptr %66, i32 0, i32 171
  %68 = load i8, ptr %67, align 4, !tbaa !9, !range !15, !noundef !16
  %69 = trunc i8 %68 to i1
  br i1 %69, label %70, label %72

70:                                               ; preds = %65
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %72

72:                                               ; preds = %70, %65
  ret void
}

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

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

!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, !12, i64 372}
!10 = !{!"PDP6", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !12, i64 16, !12, i64 17, !12, i64 18, !12, i64 19, !12, i64 20, !12, i64 21, !12, i64 22, !12, i64 23, !12, i64 24, !12, i64 25, !12, i64 26, !12, i64 27, !12, i64 28, !12, i64 29, !12, i64 30, !12, i64 31, !12, i64 32, !12, i64 33, !12, i64 34, !12, i64 35, !12, i64 36, !12, i64 37, !12, i64 38, !12, i64 39, !13, i64 40, !13, i64 48, !7, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !13, i64 112, !7, i64 120, !12, i64 121, !12, i64 122, !12, i64 123, !12, i64 124, !12, i64 125, !12, i64 126, !12, i64 127, !12, i64 128, !12, i64 129, !12, i64 130, !12, i64 131, !12, i64 132, !12, i64 133, !12, i64 134, !12, i64 135, !12, i64 136, !12, i64 137, !12, i64 138, !12, i64 139, !12, i64 140, !12, i64 141, !12, i64 142, !12, i64 143, !12, i64 144, !12, i64 145, !12, i64 146, !12, i64 147, !12, i64 148, !12, i64 149, !12, i64 150, !12, i64 151, !12, i64 152, !12, i64 153, !12, i64 154, !12, i64 155, !12, i64 156, !12, i64 157, !12, i64 158, !12, i64 159, !12, i64 160, !12, i64 161, !12, i64 162, !12, i64 163, !12, i64 164, !12, i64 165, !12, i64 166, !12, i64 167, !12, i64 168, !12, i64 169, !12, i64 170, !12, i64 171, !12, i64 172, !12, i64 173, !12, i64 174, !12, i64 175, !12, i64 176, !12, i64 177, !12, i64 178, !12, i64 179, !7, i64 180, !7, i64 181, !7, i64 182, !7, i64 183, !12, i64 184, !12, i64 185, !12, i64 186, !12, i64 187, !12, i64 188, !11, i64 192, !11, i64 196, !11, i64 200, !12, i64 204, !12, i64 205, !12, i64 206, !12, i64 207, !12, i64 208, !12, i64 209, !12, i64 210, !12, i64 211, !12, i64 212, !12, i64 213, !12, i64 214, !12, i64 215, !7, i64 216, !12, i64 217, !12, i64 218, !12, i64 219, !12, i64 220, !12, i64 221, !12, i64 222, !12, i64 223, !12, i64 224, !12, i64 225, !12, i64 226, !12, i64 227, !12, i64 228, !12, i64 229, !7, i64 230, !11, i64 232, !11, i64 236, !13, i64 240, !13, i64 248, !13, i64 256, !12, i64 264, !12, i64 265, !12, i64 266, !7, i64 267, !13, i64 272, !12, i64 280, !12, i64 281, !12, i64 282, !11, i64 284, !14, i64 288, !13, i64 304, !7, i64 312, !12, i64 313, !12, i64 314, !12, i64 315, !7, i64 316, !12, i64 317, !12, i64 318, !7, i64 319, !11, i64 320, !11, i64 324, !14, i64 328, !11, i64 340, !13, i64 344, !13, i64 352, !14, i64 360, !12, i64 372, !13, i64 376, !13, i64 384, !13, i64 392, !13, i64 400, !13, i64 408, !12, i64 416, !13, i64 424}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"FD", !11, i64 0, !11, i64 4, !11, i64 8}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!10, !13, i64 64}
!18 = !{!10, !13, i64 40}
!19 = !{!10, !13, i64 48}
!20 = !{!10, !11, i64 104}
!21 = !{!10, !11, i64 108}
!22 = !{!10, !11, i64 100}
!23 = !{!10, !11, i64 88}
!24 = !{!10, !11, i64 92}
!25 = !{!13, !13, i64 0}


; 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 [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@simtime = external local_unnamed_addr global i64, align 8
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local void @pulse(ptr nocapture noundef readonly %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 372
  %4 = load i8, ptr %3, align 4, !tbaa !5, !range !13, !noundef !14
  %5 = trunc nuw i8 %4 to i1
  br i1 %5, label %6, label %8

6:                                                ; preds = %2
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %1)
  %.pre = load i8, ptr %3, align 4, !tbaa !5, !range !13
  br label %8

8:                                                ; preds = %6, %2
  %9 = phi i8 [ %.pre, %6 ], [ %4, %2 ]
  %10 = trunc nuw i8 %9 to i1
  br i1 %10, label %11, label %19

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %0, i64 64
  %13 = load i64, ptr %12, align 8, !tbaa !15
  %14 = getelementptr inbounds i8, ptr %0, i64 40
  %15 = load i64, ptr %14, align 8, !tbaa !16
  %16 = getelementptr inbounds i8, ptr %0, i64 48
  %17 = load i64, ptr %16, align 8, !tbaa !17
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %13, i64 noundef %15, i64 noundef %17)
  %.pre15 = load i8, ptr %3, align 4, !tbaa !5, !range !13
  br label %19

19:                                               ; preds = %11, %8
  %20 = phi i8 [ %.pre15, %11 ], [ %9, %8 ]
  %21 = trunc nuw i8 %20 to i1
  br i1 %21, label %22, label %28

22:                                               ; preds = %19
  %23 = getelementptr inbounds i8, ptr %0, i64 104
  %24 = load i32, ptr %23, align 8, !tbaa !18
  %25 = getelementptr inbounds i8, ptr %0, i64 108
  %26 = load i32, ptr %25, align 4, !tbaa !19
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24, i32 noundef %26)
  %.pre16 = load i8, ptr %3, align 4, !tbaa !5, !range !13
  br label %28

28:                                               ; preds = %22, %19
  %29 = phi i8 [ %.pre16, %22 ], [ %20, %19 ]
  %30 = trunc nuw i8 %29 to i1
  br i1 %30, label %31, label %39

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %0, i64 100
  %33 = load i32, ptr %32, align 4, !tbaa !20
  %34 = getelementptr inbounds i8, ptr %0, i64 88
  %35 = load i32, ptr %34, align 8, !tbaa !21
  %36 = getelementptr inbounds i8, ptr %0, i64 92
  %37 = load i32, ptr %36, align 4, !tbaa !22
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %33, i32 noundef %35, i32 noundef %37)
  %.pre17 = load i8, ptr %3, align 4, !tbaa !5, !range !13
  br label %39

39:                                               ; preds = %31, %28
  %40 = phi i8 [ %.pre17, %31 ], [ %29, %28 ]
  %41 = trunc nuw i8 %40 to i1
  br i1 %41, label %42, label %45

42:                                               ; preds = %39
  %43 = load i64, ptr @simtime, align 8, !tbaa !23
  %44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %43)
  %.pre18 = load i8, ptr %3, align 4, !tbaa !5, !range !13
  br label %45

45:                                               ; preds = %42, %39
  %46 = phi i8 [ %.pre18, %42 ], [ %40, %39 ]
  %47 = trunc nuw i8 %46 to i1
  br i1 %47, label %48, label %50

48:                                               ; preds = %45
  %49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %50

50:                                               ; preds = %48, %45
  ret void
}

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

attributes #0 = { nofree 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 = { 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" }

!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, !10, i64 372}
!6 = !{!"PDP6", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 17, !10, i64 18, !10, i64 19, !10, i64 20, !10, i64 21, !10, i64 22, !10, i64 23, !10, i64 24, !10, i64 25, !10, i64 26, !10, i64 27, !10, i64 28, !10, i64 29, !10, i64 30, !10, i64 31, !10, i64 32, !10, i64 33, !10, i64 34, !10, i64 35, !10, i64 36, !10, i64 37, !10, i64 38, !10, i64 39, !11, i64 40, !11, i64 48, !8, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !11, i64 112, !8, i64 120, !10, i64 121, !10, i64 122, !10, i64 123, !10, i64 124, !10, i64 125, !10, i64 126, !10, i64 127, !10, i64 128, !10, i64 129, !10, i64 130, !10, i64 131, !10, i64 132, !10, i64 133, !10, i64 134, !10, i64 135, !10, i64 136, !10, i64 137, !10, i64 138, !10, i64 139, !10, i64 140, !10, i64 141, !10, i64 142, !10, i64 143, !10, i64 144, !10, i64 145, !10, i64 146, !10, i64 147, !10, i64 148, !10, i64 149, !10, i64 150, !10, i64 151, !10, i64 152, !10, i64 153, !10, i64 154, !10, i64 155, !10, i64 156, !10, i64 157, !10, i64 158, !10, i64 159, !10, i64 160, !10, i64 161, !10, i64 162, !10, i64 163, !10, i64 164, !10, i64 165, !10, i64 166, !10, i64 167, !10, i64 168, !10, i64 169, !10, i64 170, !10, i64 171, !10, i64 172, !10, i64 173, !10, i64 174, !10, i64 175, !10, i64 176, !10, i64 177, !10, i64 178, !10, i64 179, !8, i64 180, !8, i64 181, !8, i64 182, !8, i64 183, !10, i64 184, !10, i64 185, !10, i64 186, !10, i64 187, !10, i64 188, !7, i64 192, !7, i64 196, !7, i64 200, !10, i64 204, !10, i64 205, !10, i64 206, !10, i64 207, !10, i64 208, !10, i64 209, !10, i64 210, !10, i64 211, !10, i64 212, !10, i64 213, !10, i64 214, !10, i64 215, !8, i64 216, !10, i64 217, !10, i64 218, !10, i64 219, !10, i64 220, !10, i64 221, !10, i64 222, !10, i64 223, !10, i64 224, !10, i64 225, !10, i64 226, !10, i64 227, !10, i64 228, !10, i64 229, !8, i64 230, !7, i64 232, !7, i64 236, !11, i64 240, !11, i64 248, !11, i64 256, !10, i64 264, !10, i64 265, !10, i64 266, !8, i64 267, !11, i64 272, !10, i64 280, !10, i64 281, !10, i64 282, !7, i64 284, !12, i64 288, !11, i64 304, !8, i64 312, !10, i64 313, !10, i64 314, !10, i64 315, !8, i64 316, !10, i64 317, !10, i64 318, !8, i64 319, !7, i64 320, !7, i64 324, !12, i64 328, !7, i64 340, !11, i64 344, !11, i64 352, !12, i64 360, !10, i64 372, !11, i64 376, !11, i64 384, !11, i64 392, !11, i64 400, !11, i64 408, !10, i64 416, !11, i64 424}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_Bool", !8, i64 0}
!11 = !{!"long long", !8, i64 0}
!12 = !{!"FD", !7, i64 0, !7, i64 4, !7, i64 8}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!6, !11, i64 64}
!16 = !{!6, !11, i64 40}
!17 = !{!6, !11, i64 48}
!18 = !{!6, !7, i64 104}
!19 = !{!6, !7, i64 108}
!20 = !{!6, !7, i64 100}
!21 = !{!6, !7, i64 88}
!22 = !{!6, !7, i64 92}
!23 = !{!11, !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass