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

; Function Attrs: nounwind uwtable
define dso_local void @RandomFunc(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [1 x i64], align 8
  %6 = alloca i64, align 8
  %7 = 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 1, ptr %7) #2
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds i64, ptr %8, i64 0
  %10 = load i64, ptr %9, align 8, !tbaa !9
  %11 = add i64 %10, 1373777115
  %12 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  store i64 %11, ptr %12, align 8, !tbaa !9
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %13

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

19:                                               ; preds = %13
  %20 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %21 = load i64, ptr %20, align 8, !tbaa !9
  %22 = load i64, ptr %6, align 8, !tbaa !9
  %23 = icmp eq i64 %21, %22
  br i1 %23, label %24, label %36

24:                                               ; preds = %19
  %25 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %26 = getelementptr inbounds i8, ptr %25, i64 1
  %27 = load i8, ptr %26, align 1, !tbaa !11
  store i8 %27, ptr %7, align 1, !tbaa !11
  %28 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %29 = getelementptr inbounds i8, ptr %28, i64 4
  %30 = load i8, ptr %29, align 1, !tbaa !11
  %31 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %32 = getelementptr inbounds i8, ptr %31, i64 1
  store i8 %30, ptr %32, align 1, !tbaa !11
  %33 = load i8, ptr %7, align 1, !tbaa !11
  %34 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %35 = getelementptr inbounds i8, ptr %34, i64 4
  store i8 %33, ptr %35, align 1, !tbaa !11
  br label %59

36:                                               ; preds = %19
  %37 = load i64, ptr %6, align 8, !tbaa !9
  %38 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = lshr i64 %41, 2
  %43 = and i64 %42, 15
  %44 = or i64 %43, 1
  %45 = lshr i64 %39, %44
  %46 = load i64, ptr %6, align 8, !tbaa !9
  %47 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !9
  %49 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %50 = load i64, ptr %49, align 8, !tbaa !9
  %51 = lshr i64 %50, 2
  %52 = and i64 %51, 15
  %53 = or i64 %52, 1
  %54 = sub i64 64, %53
  %55 = shl i64 %48, %54
  %56 = or i64 %45, %55
  %57 = load i64, ptr %6, align 8, !tbaa !9
  %58 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %57
  store i64 %56, ptr %58, align 8, !tbaa !9
  br label %59

59:                                               ; preds = %36, %24
  %60 = load i64, ptr %6, align 8, !tbaa !9
  %61 = add i64 %60, 1
  store i64 %61, ptr %6, align 8, !tbaa !9
  br label %13, !llvm.loop !12

62:                                               ; preds = %13
  %63 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %64 = load i64, ptr %63, align 8, !tbaa !9
  %65 = mul i64 %64, 8312934688
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds i64, ptr %66, i64 0
  store i64 %65, ptr %67, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, 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.end.p0(i64 immarg, ptr nocapture) #0

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


; 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 = load i64, ptr %0, align 8, !tbaa !5
  %4 = add i64 %3, 1373777115
  %.sroa.0.0.extract.trunc = trunc i64 %4 to i8
  %.sroa.7.0.extract.shift = lshr i64 %4, 8
  %.sroa.7.0.extract.trunc = trunc i64 %.sroa.7.0.extract.shift to i8
  %.sroa.9.0.extract.shift = lshr i64 %4, 16
  %.sroa.9.0.extract.trunc = trunc i64 %.sroa.9.0.extract.shift to i16
  %.sroa.943.0.extract.shift = lshr i64 %4, 32
  %.sroa.943.0.extract.trunc = trunc i64 %.sroa.943.0.extract.shift to i8
  %.sroa.11.0.extract.shift = lshr i64 %4, 40
  %.sroa.11.0.extract.trunc = trunc nuw i64 %.sroa.11.0.extract.shift to i24
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2, %13
  %.075 = phi i64 [ %14, %13 ], [ 0, %2 ]
  %.sroa.0.074 = phi i8 [ %.sroa.0.1, %13 ], [ %.sroa.0.0.extract.trunc, %2 ]
  %.sroa.7.073 = phi i8 [ %.sroa.7.1, %13 ], [ %.sroa.7.0.extract.trunc, %2 ]
  %.sroa.9.072 = phi i16 [ %.sroa.9.1, %13 ], [ %.sroa.9.0.extract.trunc, %2 ]
  %.sroa.943.071 = phi i8 [ %.sroa.943.1, %13 ], [ %.sroa.943.0.extract.trunc, %2 ]
  %.sroa.11.sroa.0.070 = phi i24 [ %.sroa.11.sroa.0.1, %13 ], [ %.sroa.11.0.extract.trunc, %2 ]
  %.sroa.11.0.insert.ext = zext i24 %.sroa.11.sroa.0.070 to i64
  %.sroa.11.0.insert.shift = shl nuw i64 %.sroa.11.0.insert.ext, 40
  %.sroa.943.0.insert.ext = zext i8 %.sroa.943.071 to i64
  %.sroa.943.0.insert.shift = shl nuw nsw i64 %.sroa.943.0.insert.ext, 32
  %.sroa.943.0.insert.insert = or disjoint i64 %.sroa.943.0.insert.shift, %.sroa.11.0.insert.shift
  %.sroa.9.0.insert.ext = zext i16 %.sroa.9.072 to i64
  %.sroa.9.0.insert.shift = shl nuw nsw i64 %.sroa.9.0.insert.ext, 16
  %.sroa.9.0.insert.insert = or disjoint i64 %.sroa.943.0.insert.insert, %.sroa.9.0.insert.shift
  %.sroa.7.0.insert.ext = zext i8 %.sroa.7.073 to i64
  %.sroa.7.0.insert.shift = shl nuw nsw i64 %.sroa.7.0.insert.ext, 8
  %.sroa.7.0.insert.insert = or disjoint i64 %.sroa.9.0.insert.insert, %.sroa.7.0.insert.shift
  %.sroa.0.0.insert.ext = zext i8 %.sroa.0.074 to i64
  %.sroa.0.0.insert.insert = or disjoint i64 %.sroa.7.0.insert.insert, %.sroa.0.0.insert.ext
  %7 = icmp eq i64 %.sroa.0.0.insert.insert, %.075
  br i1 %7, label %13, label %8

8:                                                ; preds = %.lr.ph
  %9 = lshr i64 %.sroa.0.0.insert.insert, 2
  %10 = and i64 %9, 14
  %11 = or disjoint i64 %10, 1
  %12 = tail call i64 @llvm.fshr.i64(i64 %.sroa.0.0.insert.insert, i64 %.sroa.0.0.insert.insert, i64 %11)
  %.sroa.0.0.extract.trunc18 = trunc i64 %12 to i8
  %.sroa.7.0.extract.shift29 = lshr i64 %12, 8
  %.sroa.7.0.extract.trunc30 = trunc i64 %.sroa.7.0.extract.shift29 to i8
  %.sroa.9.0.extract.shift41 = lshr i64 %12, 16
  %.sroa.9.0.extract.trunc42 = trunc i64 %.sroa.9.0.extract.shift41 to i16
  %.sroa.943.0.extract.shift54 = lshr i64 %12, 32
  %.sroa.943.0.extract.trunc55 = trunc i64 %.sroa.943.0.extract.shift54 to i8
  %.sroa.11.0.extract.shift66 = lshr i64 %12, 40
  %.sroa.11.0.extract.trunc67 = trunc nuw i64 %.sroa.11.0.extract.shift66 to i24
  br label %13

13:                                               ; preds = %.lr.ph, %8
  %.sroa.11.sroa.0.1 = phi i24 [ %.sroa.11.0.extract.trunc67, %8 ], [ %.sroa.11.sroa.0.070, %.lr.ph ]
  %.sroa.943.1 = phi i8 [ %.sroa.943.0.extract.trunc55, %8 ], [ %.sroa.7.073, %.lr.ph ]
  %.sroa.9.1 = phi i16 [ %.sroa.9.0.extract.trunc42, %8 ], [ %.sroa.9.072, %.lr.ph ]
  %.sroa.7.1 = phi i8 [ %.sroa.7.0.extract.trunc30, %8 ], [ %.sroa.943.071, %.lr.ph ]
  %.sroa.0.1 = phi i8 [ %.sroa.0.0.extract.trunc18, %8 ], [ %.sroa.0.074, %.lr.ph ]
  %14 = add nuw i64 %.075, 1
  %exitcond.not = icmp eq i64 %14, %6
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %13, %2
  %.sroa.11.sroa.0.0.lcssa = phi i24 [ %.sroa.11.0.extract.trunc, %2 ], [ %.sroa.11.sroa.0.1, %13 ]
  %.sroa.943.0.lcssa = phi i8 [ %.sroa.943.0.extract.trunc, %2 ], [ %.sroa.943.1, %13 ]
  %.sroa.9.0.lcssa = phi i16 [ %.sroa.9.0.extract.trunc, %2 ], [ %.sroa.9.1, %13 ]
  %.sroa.7.0.lcssa = phi i8 [ %.sroa.7.0.extract.trunc, %2 ], [ %.sroa.7.1, %13 ]
  %.sroa.0.0.lcssa = phi i8 [ %.sroa.0.0.extract.trunc, %2 ], [ %.sroa.0.1, %13 ]
  %.sroa.11.0.insert.ext57 = zext i24 %.sroa.11.sroa.0.0.lcssa to i64
  %.sroa.11.0.insert.shift58 = shl nuw i64 %.sroa.11.0.insert.ext57, 40
  %.sroa.943.0.insert.ext45 = zext i8 %.sroa.943.0.lcssa to i64
  %.sroa.943.0.insert.shift46 = shl nuw nsw i64 %.sroa.943.0.insert.ext45, 32
  %.sroa.943.0.insert.insert48 = or disjoint i64 %.sroa.943.0.insert.shift46, %.sroa.11.0.insert.shift58
  %.sroa.9.0.insert.ext32 = zext i16 %.sroa.9.0.lcssa to i64
  %.sroa.9.0.insert.shift33 = shl nuw nsw i64 %.sroa.9.0.insert.ext32, 16
  %.sroa.9.0.insert.insert35 = or disjoint i64 %.sroa.943.0.insert.insert48, %.sroa.9.0.insert.shift33
  %.sroa.7.0.insert.ext20 = zext i8 %.sroa.7.0.lcssa to i64
  %.sroa.7.0.insert.shift21 = shl nuw nsw i64 %.sroa.7.0.insert.ext20, 8
  %.sroa.7.0.insert.insert23 = or disjoint i64 %.sroa.9.0.insert.insert35, %.sroa.7.0.insert.shift21
  %.sroa.0.0.insert.ext11 = zext i8 %.sroa.0.0.lcssa to i64
  %.sroa.0.0.insert.insert13 = or disjoint i64 %.sroa.7.0.insert.insert23, %.sroa.0.0.insert.ext11
  %15 = mul i64 %.sroa.0.0.insert.insert13, 8312934688
  store i64 %15, ptr %1, align 8, !tbaa !5
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.fshr.i64(i64, i64, i64) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass