; LLVM IR from tum-i4/obfuscation-benchmarks :: tigress-generated-programs (RandomFunc)

; 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: nounwind uwtable
define dso_local void @RandomFunc(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [1 x i64], align 8
  %6 = alloca i64, align 8
  %7 = alloca i16, align 2
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  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 8, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #2
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = getelementptr inbounds i64, ptr %10, i64 0
  %12 = load i64, ptr %11, align 8, !tbaa !9
  %13 = xor i64 %12, 700325083
  %14 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  store i64 %13, ptr %14, align 8, !tbaa !9
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %15

15:                                               ; preds = %21, %2
  %16 = load i64, ptr %6, align 8, !tbaa !9
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds i64, ptr %17, i64 1
  %19 = load i64, ptr %18, align 8, !tbaa !9
  %20 = icmp ult i64 %16, %19
  br i1 %20, label %21, label %50

21:                                               ; preds = %15
  %22 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %23 = getelementptr inbounds i16, ptr %22, i64 1
  %24 = load i16, ptr %23, align 2, !tbaa !11
  store i16 %24, ptr %7, align 2, !tbaa !11
  %25 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %26 = getelementptr inbounds i16, ptr %25, i64 2
  %27 = load i16, ptr %26, align 2, !tbaa !11
  %28 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %29 = getelementptr inbounds i16, ptr %28, i64 1
  store i16 %27, ptr %29, align 2, !tbaa !11
  %30 = load i16, ptr %7, align 2, !tbaa !11
  %31 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %32 = getelementptr inbounds i16, ptr %31, i64 2
  store i16 %30, ptr %32, align 2, !tbaa !11
  %33 = load i64, ptr %6, align 8, !tbaa !9
  %34 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %33
  %35 = getelementptr inbounds i8, ptr %34, i64 5
  %36 = load i8, ptr %35, align 1, !tbaa !13
  store i8 %36, ptr %8, align 1, !tbaa !13
  %37 = load i64, ptr %6, align 8, !tbaa !9
  %38 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %37
  %39 = getelementptr inbounds i8, ptr %38, i64 2
  %40 = load i8, ptr %39, align 1, !tbaa !13
  %41 = load i64, ptr %6, align 8, !tbaa !9
  %42 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %41
  %43 = getelementptr inbounds i8, ptr %42, i64 5
  store i8 %40, ptr %43, align 1, !tbaa !13
  %44 = load i8, ptr %8, align 1, !tbaa !13
  %45 = load i64, ptr %6, align 8, !tbaa !9
  %46 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %45
  %47 = getelementptr inbounds i8, ptr %46, i64 2
  store i8 %44, ptr %47, align 1, !tbaa !13
  %48 = load i64, ptr %6, align 8, !tbaa !9
  %49 = add i64 %48, 2
  store i64 %49, ptr %6, align 8, !tbaa !9
  br label %15, !llvm.loop !14

50:                                               ; preds = %15
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %51

51:                                               ; preds = %57, %50
  %52 = load i64, ptr %6, align 8, !tbaa !9
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds i64, ptr %53, i64 1
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = icmp ult i64 %52, %55
  br i1 %56, label %57, label %90

57:                                               ; preds = %51
  %58 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %59 = getelementptr inbounds i8, ptr %58, i64 2
  %60 = load i8, ptr %59, align 1, !tbaa !13
  store i8 %60, ptr %9, align 1, !tbaa !13
  %61 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %62 = getelementptr inbounds i8, ptr %61, i64 6
  %63 = load i8, ptr %62, align 1, !tbaa !13
  %64 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %65 = getelementptr inbounds i8, ptr %64, i64 2
  store i8 %63, ptr %65, align 1, !tbaa !13
  %66 = load i8, ptr %9, align 1, !tbaa !13
  %67 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %68 = getelementptr inbounds i8, ptr %67, i64 6
  store i8 %66, ptr %68, align 1, !tbaa !13
  %69 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %70 = getelementptr inbounds i8, ptr %69, i64 7
  %71 = load i8, ptr %70, align 1, !tbaa !13
  store i8 %71, ptr %9, align 1, !tbaa !13
  %72 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %73 = getelementptr inbounds i8, ptr %72, i64 5
  %74 = load i8, ptr %73, align 1, !tbaa !13
  %75 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %76 = getelementptr inbounds i8, ptr %75, i64 7
  store i8 %74, ptr %76, align 1, !tbaa !13
  %77 = load i8, ptr %9, align 1, !tbaa !13
  %78 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %79 = getelementptr inbounds i8, ptr %78, i64 5
  store i8 %77, ptr %79, align 1, !tbaa !13
  %80 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %81 = load i64, ptr %80, align 8, !tbaa !9
  %82 = load i64, ptr %6, align 8, !tbaa !9
  %83 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %85 = xor i64 %81, %84
  %86 = load i64, ptr %6, align 8, !tbaa !9
  %87 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %86
  store i64 %85, ptr %87, align 8, !tbaa !9
  %88 = load i64, ptr %6, align 8, !tbaa !9
  %89 = add i64 %88, 2
  store i64 %89, ptr %6, align 8, !tbaa !9
  br label %51, !llvm.loop !16

90:                                               ; preds = %51
  %91 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %92 = load i64, ptr %91, align 8, !tbaa !9
  %93 = and i64 %92, 576551744
  %94 = xor i64 %93, 132452434
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds i64, ptr %95, i64 0
  store i64 %94, ptr %96, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


; 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: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @RandomFunc(ptr nocapture noundef readonly %0, ptr nocapture noundef writeonly %1) local_unnamed_addr #0 {
  %3 = alloca [1 x i64], align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #2
  %4 = load i64, ptr %0, align 8, !tbaa !5
  %5 = xor i64 %4, 700325083
  store i64 %5, ptr %3, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %.not = icmp eq i64 %7, 0
  br i1 %.not, label %.preheader.._crit_edge_crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %8 = getelementptr inbounds i8, ptr %3, i64 2
  %9 = add i64 %7, -1
  %10 = icmp ult i64 %7, 3
  br i1 %10, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %11 = lshr i64 %9, 1
  %12 = add nuw i64 %11, 1
  %unroll_iter = and i64 %12, -2
  br label %15

.preheader.._crit_edge_crit_edge:                 ; preds = %2
  %.pre22 = load i64, ptr %3, align 8, !tbaa !5
  %13 = and i64 %.pre22, 576551744
  %14 = xor i64 %13, 132452434
  br label %._crit_edge

15:                                               ; preds = %15, %.lr.ph.new
  %.017 = phi i64 [ 0, %.lr.ph.new ], [ %31, %15 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %15 ]
  %16 = load <2 x i16>, ptr %8, align 2, !tbaa !9
  %17 = shufflevector <2 x i16> %16, <2 x i16> poison, <2 x i32> <i32 1, i32 0>
  store <2 x i16> %17, ptr %8, align 2, !tbaa !9
  %18 = getelementptr inbounds [1 x i64], ptr %3, i64 0, i64 %.017
  %19 = getelementptr inbounds i8, ptr %18, i64 5
  %20 = load i8, ptr %19, align 1, !tbaa !11
  %21 = getelementptr inbounds i8, ptr %18, i64 2
  %22 = load i8, ptr %21, align 2, !tbaa !11
  store i8 %22, ptr %19, align 1, !tbaa !11
  store i8 %20, ptr %21, align 2, !tbaa !11
  %23 = or disjoint i64 %.017, 2
  %24 = load <2 x i16>, ptr %8, align 2, !tbaa !9
  %25 = shufflevector <2 x i16> %24, <2 x i16> poison, <2 x i32> <i32 1, i32 0>
  store <2 x i16> %25, ptr %8, align 2, !tbaa !9
  %26 = getelementptr inbounds [1 x i64], ptr %3, i64 0, i64 %23
  %27 = getelementptr inbounds i8, ptr %26, i64 5
  %28 = load i8, ptr %27, align 1, !tbaa !11
  %29 = getelementptr inbounds i8, ptr %26, i64 2
  %30 = load i8, ptr %29, align 2, !tbaa !11
  store i8 %30, ptr %27, align 1, !tbaa !11
  store i8 %28, ptr %29, align 2, !tbaa !11
  %31 = add nuw i64 %.017, 4
  %niter.next.1 = add nuw i64 %niter, 2
  %niter.ncmp.1.not = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1.not, label %._crit_edge.loopexit.unr-lcssa, label %15, !llvm.loop !12

._crit_edge.loopexit.unr-lcssa:                   ; preds = %15, %.lr.ph
  %.017.unr = phi i64 [ 0, %.lr.ph ], [ %31, %15 ]
  %32 = and i64 %9, 2
  %lcmp.mod.not.not = icmp eq i64 %32, 0
  br i1 %lcmp.mod.not.not, label %._crit_edge.loopexit.epilog-lcssa, label %._crit_edge

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %33 = load <2 x i16>, ptr %8, align 2, !tbaa !9
  %34 = shufflevector <2 x i16> %33, <2 x i16> poison, <2 x i32> <i32 1, i32 0>
  store <2 x i16> %34, ptr %8, align 2, !tbaa !9
  %35 = getelementptr inbounds [1 x i64], ptr %3, i64 0, i64 %.017.unr
  %36 = getelementptr inbounds i8, ptr %35, i64 5
  %37 = load i8, ptr %36, align 1, !tbaa !11
  %38 = getelementptr inbounds i8, ptr %35, i64 2
  %39 = load i8, ptr %38, align 2, !tbaa !11
  store i8 %39, ptr %36, align 1, !tbaa !11
  store i8 %37, ptr %38, align 2, !tbaa !11
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %.preheader.._crit_edge_crit_edge
  %40 = phi i64 [ %14, %.preheader.._crit_edge_crit_edge ], [ 132452434, %._crit_edge.loopexit.unr-lcssa ], [ 132452434, %._crit_edge.loopexit.epilog-lcssa ]
  store i64 %40, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #2
  ret void
}

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

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

attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass