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

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

@mnemonics = external dso_local global [448 x ptr], align 16
@iomnemonics = external dso_local global [8 x ptr], align 16
@disasm.s = external hidden global [100 x i8], align 16
@.str.458 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.459 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.460 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.461 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.462 = external hidden unnamed_addr constant [5 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
define dso_local ptr @disasm(i64 noundef %0) #1 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i64 %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 4, 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 @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %11 = load i64, ptr %2, align 8, !tbaa !5
  %12 = and i64 %11, 262143
  %13 = trunc i64 %12 to i32
  store i32 %13, ptr %6, align 4, !tbaa !9
  %14 = load i64, ptr %2, align 8, !tbaa !5
  %15 = lshr i64 %14, 18
  %16 = and i64 %15, 15
  %17 = trunc i64 %16 to i32
  store i32 %17, ptr %5, align 4, !tbaa !9
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %19 = lshr i64 %18, 22
  %20 = and i64 %19, 1
  %21 = trunc i64 %20 to i32
  store i32 %21, ptr %4, align 4, !tbaa !9
  %22 = load i64, ptr %2, align 8, !tbaa !5
  %23 = lshr i64 %22, 23
  %24 = and i64 %23, 15
  %25 = trunc i64 %24 to i32
  store i32 %25, ptr %7, align 4, !tbaa !9
  %26 = load i64, ptr %2, align 8, !tbaa !5
  %27 = lshr i64 %26, 27
  %28 = and i64 %27, 511
  %29 = trunc i64 %28 to i32
  store i32 %29, ptr %9, align 4, !tbaa !9
  %30 = load i64, ptr %2, align 8, !tbaa !5
  %31 = lshr i64 %30, 24
  %32 = and i64 %31, 508
  %33 = trunc i64 %32 to i32
  store i32 %33, ptr %8, align 4, !tbaa !9
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = and i32 %34, 7
  store i32 %35, ptr %10, align 4, !tbaa !9
  store ptr @disasm.s, ptr %3, align 8, !tbaa !11
  %36 = load i32, ptr %9, align 4, !tbaa !9
  %37 = and i32 %36, 448
  %38 = icmp eq i32 %37, 448
  br i1 %38, label %39, label %55

39:                                               ; preds = %1
  %40 = load ptr, ptr %3, align 8, !tbaa !11
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds [8 x ptr], ptr @iomnemonics, i64 0, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %40, ptr noundef @.str.458, ptr noundef %44) #3
  %46 = load ptr, ptr %3, align 8, !tbaa !11
  %47 = sext i32 %45 to i64
  %48 = getelementptr inbounds i8, ptr %46, i64 %47
  store ptr %48, ptr %3, align 8, !tbaa !11
  %49 = load ptr, ptr %3, align 8, !tbaa !11
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %49, ptr noundef @.str.459, i32 noundef %50) #3
  %52 = load ptr, ptr %3, align 8, !tbaa !11
  %53 = sext i32 %51 to i64
  %54 = getelementptr inbounds i8, ptr %52, i64 %53
  store ptr %54, ptr %3, align 8, !tbaa !11
  br label %71

55:                                               ; preds = %1
  %56 = load ptr, ptr %3, align 8, !tbaa !11
  %57 = load i32, ptr %9, align 4, !tbaa !9
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds [448 x ptr], ptr @mnemonics, i64 0, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !11
  %61 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %56, ptr noundef @.str.458, ptr noundef %60) #3
  %62 = load ptr, ptr %3, align 8, !tbaa !11
  %63 = sext i32 %61 to i64
  %64 = getelementptr inbounds i8, ptr %62, i64 %63
  store ptr %64, ptr %3, align 8, !tbaa !11
  %65 = load ptr, ptr %3, align 8, !tbaa !11
  %66 = load i32, ptr %7, align 4, !tbaa !9
  %67 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %65, ptr noundef @.str.459, i32 noundef %66) #3
  %68 = load ptr, ptr %3, align 8, !tbaa !11
  %69 = sext i32 %67 to i64
  %70 = getelementptr inbounds i8, ptr %68, i64 %69
  store ptr %70, ptr %3, align 8, !tbaa !11
  br label %71

71:                                               ; preds = %55, %39
  %72 = load i32, ptr %4, align 4, !tbaa !9
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %80

74:                                               ; preds = %71
  %75 = load ptr, ptr %3, align 8, !tbaa !11
  %76 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %75, ptr noundef @.str.460) #3
  %77 = load ptr, ptr %3, align 8, !tbaa !11
  %78 = sext i32 %76 to i64
  %79 = getelementptr inbounds i8, ptr %77, i64 %78
  store ptr %79, ptr %3, align 8, !tbaa !11
  br label %80

80:                                               ; preds = %74, %71
  %81 = load ptr, ptr %3, align 8, !tbaa !11
  %82 = load i32, ptr %6, align 4, !tbaa !9
  %83 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %81, ptr noundef @.str.461, i32 noundef %82) #3
  %84 = load ptr, ptr %3, align 8, !tbaa !11
  %85 = sext i32 %83 to i64
  %86 = getelementptr inbounds i8, ptr %84, i64 %85
  store ptr %86, ptr %3, align 8, !tbaa !11
  %87 = load i32, ptr %5, align 4, !tbaa !9
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %96

89:                                               ; preds = %80
  %90 = load ptr, ptr %3, align 8, !tbaa !11
  %91 = load i32, ptr %5, align 4, !tbaa !9
  %92 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %90, ptr noundef @.str.462, i32 noundef %91) #3
  %93 = load ptr, ptr %3, align 8, !tbaa !11
  %94 = sext i32 %92 to i64
  %95 = getelementptr inbounds i8, ptr %93, i64 %94
  store ptr %95, ptr %3, align 8, !tbaa !11
  br label %96

96:                                               ; preds = %89, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  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 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret ptr @disasm.s
}

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #2

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 "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 = !{!"long", !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 = !{!"any pointer", !7, 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"

@mnemonics = external dso_local local_unnamed_addr global [448 x ptr], align 16
@iomnemonics = external dso_local local_unnamed_addr global [8 x ptr], align 16
@disasm.s = external hidden global [100 x i8], align 16
@.str.458 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.459 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.460 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.461 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.462 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local noundef nonnull ptr @disasm(i64 noundef %0) local_unnamed_addr #0 {
  %2 = trunc i64 %0 to i32
  %3 = and i32 %2, 262143
  %4 = lshr i32 %2, 18
  %5 = and i32 %4, 15
  %6 = lshr i32 %2, 23
  %7 = and i64 %0, 60129542144
  %8 = icmp eq i64 %7, 60129542144
  br i1 %8, label %9, label %16

9:                                                ; preds = %1
  %10 = and i32 %6, 7
  %11 = lshr i64 %0, 24
  %12 = trunc i64 %11 to i32
  %13 = and i32 %12, 508
  %14 = zext nneg i32 %10 to i64
  %15 = getelementptr inbounds [8 x ptr], ptr @iomnemonics, i64 0, i64 %14
  br label %21

16:                                               ; preds = %1
  %17 = lshr i64 %0, 27
  %18 = and i64 %17, 511
  %19 = and i32 %6, 15
  %20 = getelementptr inbounds [448 x ptr], ptr @mnemonics, i64 0, i64 %18
  br label %21

21:                                               ; preds = %16, %9
  %.sink = phi ptr [ %20, %16 ], [ %15, %9 ]
  %.sink34 = phi i32 [ %19, %16 ], [ %13, %9 ]
  %22 = load ptr, ptr %.sink, align 8, !tbaa !5
  %23 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) @disasm.s, ptr noundef nonnull dereferenceable(1) @.str.458, ptr noundef %22) #2
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i8, ptr @disasm.s, i64 %24
  %26 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %25, ptr noundef nonnull dereferenceable(1) @.str.459, i32 noundef %.sink34) #2
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i8, ptr %25, i64 %27
  %29 = and i64 %0, 4194304
  %.not = icmp eq i64 %29, 0
  br i1 %.not, label %34, label %30

30:                                               ; preds = %21
  %31 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %28, ptr noundef nonnull dereferenceable(1) @.str.460) #2
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i8, ptr %28, i64 %32
  br label %34

34:                                               ; preds = %30, %21
  %.1 = phi ptr [ %33, %30 ], [ %28, %21 ]
  %35 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %.1, ptr noundef nonnull dereferenceable(1) @.str.461, i32 noundef %3) #2
  %.not30 = icmp eq i32 %5, 0
  br i1 %.not30, label %40, label %36

36:                                               ; preds = %34
  %37 = sext i32 %35 to i64
  %38 = getelementptr inbounds i8, ptr %.1, i64 %37
  %39 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %38, ptr noundef nonnull dereferenceable(1) @.str.462, i32 noundef %5) #2
  br label %40

40:                                               ; preds = %36, %34
  ret ptr @disasm.s
}

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, 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" }
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"}


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