; 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
  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
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds i64, ptr %9, i64 0
  %11 = load i64, ptr %10, align 8, !tbaa !9
  %12 = xor i64 %11, 700325083
  %13 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  store i64 %12, ptr %13, align 8, !tbaa !9
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %14

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

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

25:                                               ; preds = %20
  %26 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %27 = load i64, ptr %26, align 8, !tbaa !9
  %28 = load i64, ptr %6, align 8, !tbaa !9
  %29 = icmp eq i64 %27, %28
  br i1 %29, label %30, label %42

30:                                               ; preds = %25
  %31 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %32 = getelementptr inbounds i16, ptr %31, i64 2
  %33 = load i16, ptr %32, align 2, !tbaa !11
  store i16 %33, ptr %7, align 2, !tbaa !11
  %34 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %35 = getelementptr inbounds i16, ptr %34, i64 0
  %36 = load i16, ptr %35, align 2, !tbaa !11
  %37 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %38 = getelementptr inbounds i16, ptr %37, i64 2
  store i16 %36, ptr %38, align 2, !tbaa !11
  %39 = load i16, ptr %7, align 2, !tbaa !11
  %40 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %41 = getelementptr inbounds i16, ptr %40, i64 0
  store i16 %39, ptr %41, align 2, !tbaa !11
  br label %52

42:                                               ; preds = %25
  %43 = load i64, ptr %6, align 8, !tbaa !9
  %44 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !9
  %46 = and i64 %45, 7
  %47 = or i64 %46, 1
  %48 = load i64, ptr %6, align 8, !tbaa !9
  %49 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !9
  %51 = shl i64 %50, %47
  store i64 %51, ptr %49, align 8, !tbaa !9
  br label %52

52:                                               ; preds = %42, %30
  br label %76

53:                                               ; preds = %20
  %54 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %55 = getelementptr inbounds i8, ptr %54, i64 2
  %56 = load i8, ptr %55, align 1, !tbaa !13
  store i8 %56, ptr %8, align 1, !tbaa !13
  %57 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %58 = getelementptr inbounds i8, ptr %57, i64 6
  %59 = load i8, ptr %58, align 1, !tbaa !13
  %60 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %61 = getelementptr inbounds i8, ptr %60, i64 2
  store i8 %59, ptr %61, align 1, !tbaa !13
  %62 = load i8, ptr %8, align 1, !tbaa !13
  %63 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %64 = getelementptr inbounds i8, ptr %63, i64 6
  store i8 %62, ptr %64, align 1, !tbaa !13
  %65 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %66 = getelementptr inbounds i8, ptr %65, i64 7
  %67 = load i8, ptr %66, align 1, !tbaa !13
  store i8 %67, ptr %8, align 1, !tbaa !13
  %68 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %69 = getelementptr inbounds i8, ptr %68, i64 5
  %70 = load i8, ptr %69, align 1, !tbaa !13
  %71 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %72 = getelementptr inbounds i8, ptr %71, i64 7
  store i8 %70, ptr %72, align 1, !tbaa !13
  %73 = load i8, ptr %8, align 1, !tbaa !13
  %74 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %75 = getelementptr inbounds i8, ptr %74, i64 5
  store i8 %73, ptr %75, align 1, !tbaa !13
  br label %76

76:                                               ; preds = %53, %52
  %77 = load i64, ptr %6, align 8, !tbaa !9
  %78 = add i64 %77, 2
  store i64 %78, ptr %6, align 8, !tbaa !9
  br label %14, !llvm.loop !14

79:                                               ; preds = %14
  %80 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %81 = load i64, ptr %80, align 8, !tbaa !9
  %82 = shl i64 %81, 3
  %83 = or i64 %82, 738189287
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds i64, ptr %84, i64 0
  store i64 %83, ptr %85, align 8, !tbaa !9
  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"}


; 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 = xor i64 %3, 700325083
  %.sroa.0.0.extract.trunc = trunc i64 %4 to i16
  %.sroa.7.0.extract.shift = lshr i64 %4, 16
  %.sroa.7.0.extract.trunc = trunc i64 %.sroa.7.0.extract.shift to i8
  %.sroa.9.0.extract.shift = lshr i64 %4, 24
  %.sroa.9.0.extract.trunc = trunc i64 %.sroa.9.0.extract.shift to i16
  %.sroa.944.0.extract.shift = lshr i64 %3, 40
  %.sroa.944.0.extract.trunc = trunc i64 %.sroa.944.0.extract.shift to i8
  %.sroa.11.0.extract.shift = lshr i64 %3, 48
  %.sroa.11.0.extract.trunc = trunc i64 %.sroa.11.0.extract.shift to i8
  %.sroa.13.0.extract.shift = lshr i64 %3, 56
  %.sroa.13.0.extract.trunc = trunc nuw i64 %.sroa.13.0.extract.shift to i8
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %.not93 = icmp eq i64 %6, 0
  br i1 %.not93, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2, %11
  %.087 = phi i64 [ %12, %11 ], [ 0, %2 ]
  %.sroa.0.086 = phi i16 [ %.sroa.0.1, %11 ], [ %.sroa.0.0.extract.trunc, %2 ]
  %.sroa.7.085 = phi i8 [ %.sroa.7.1, %11 ], [ %.sroa.7.0.extract.trunc, %2 ]
  %.sroa.9.084 = phi i16 [ %.sroa.9.1, %11 ], [ %.sroa.9.0.extract.trunc, %2 ]
  %.sroa.944.083 = phi i8 [ %.sroa.944.1, %11 ], [ %.sroa.944.0.extract.trunc, %2 ]
  %.sroa.11.082 = phi i8 [ %.sroa.11.1, %11 ], [ %.sroa.11.0.extract.trunc, %2 ]
  %.sroa.13.081 = phi i8 [ %.sroa.13.1, %11 ], [ %.sroa.13.0.extract.trunc, %2 ]
  %.sroa.13.0.insert.ext = zext i8 %.sroa.13.081 to i64
  %.sroa.13.0.insert.shift = shl nuw i64 %.sroa.13.0.insert.ext, 56
  %.sroa.11.0.insert.ext = zext i8 %.sroa.11.082 to i64
  %.sroa.11.0.insert.shift = shl nuw nsw i64 %.sroa.11.0.insert.ext, 48
  %.sroa.11.0.insert.insert = or disjoint i64 %.sroa.11.0.insert.shift, %.sroa.13.0.insert.shift
  %.sroa.944.0.insert.ext = zext i8 %.sroa.944.083 to i64
  %.sroa.944.0.insert.shift = shl nuw nsw i64 %.sroa.944.0.insert.ext, 40
  %.sroa.944.0.insert.insert = or disjoint i64 %.sroa.11.0.insert.insert, %.sroa.944.0.insert.shift
  %.sroa.9.0.insert.ext = zext i16 %.sroa.9.084 to i64
  %.sroa.9.0.insert.shift = shl nuw nsw i64 %.sroa.9.0.insert.ext, 24
  %.sroa.9.0.insert.insert = or disjoint i64 %.sroa.944.0.insert.insert, %.sroa.9.0.insert.shift
  %.sroa.7.0.insert.ext = zext i8 %.sroa.7.085 to i64
  %.sroa.7.0.insert.shift = shl nuw nsw i64 %.sroa.7.0.insert.ext, 16
  %.sroa.7.0.insert.insert = or disjoint i64 %.sroa.9.0.insert.insert, %.sroa.7.0.insert.shift
  %.sroa.0.0.insert.ext = zext i16 %.sroa.0.086 to i64
  %.sroa.0.0.insert.insert = or disjoint i64 %.sroa.7.0.insert.insert, %.sroa.0.0.insert.ext
  %.not = icmp eq i64 %.sroa.0.0.insert.insert, %.087
  br i1 %.not, label %11, label %7

7:                                                ; preds = %.lr.ph
  %8 = and i64 %.sroa.0.0.insert.insert, 6
  %9 = or disjoint i64 %8, 1
  %10 = shl i64 %.sroa.0.0.insert.insert, %9
  %.sroa.0.0.extract.trunc19 = trunc i64 %10 to i16
  %.sroa.7.0.extract.shift30 = lshr i64 %10, 16
  %.sroa.7.0.extract.trunc31 = trunc i64 %.sroa.7.0.extract.shift30 to i8
  %.sroa.9.0.extract.shift42 = lshr i64 %10, 24
  %.sroa.9.0.extract.trunc43 = trunc i64 %.sroa.9.0.extract.shift42 to i16
  %.sroa.944.0.extract.shift55 = lshr i64 %10, 40
  %.sroa.944.0.extract.trunc56 = trunc i64 %.sroa.944.0.extract.shift55 to i8
  %.sroa.11.0.extract.shift67 = lshr i64 %10, 48
  %.sroa.11.0.extract.trunc68 = trunc i64 %.sroa.11.0.extract.shift67 to i8
  %.sroa.13.0.extract.shift79 = lshr i64 %10, 56
  %.sroa.13.0.extract.trunc80 = trunc nuw i64 %.sroa.13.0.extract.shift79 to i8
  br label %11

11:                                               ; preds = %.lr.ph, %7
  %.sroa.13.1 = phi i8 [ %.sroa.13.0.extract.trunc80, %7 ], [ %.sroa.944.083, %.lr.ph ]
  %.sroa.11.1 = phi i8 [ %.sroa.11.0.extract.trunc68, %7 ], [ %.sroa.7.085, %.lr.ph ]
  %.sroa.944.1 = phi i8 [ %.sroa.944.0.extract.trunc56, %7 ], [ %.sroa.13.081, %.lr.ph ]
  %.sroa.9.1 = phi i16 [ %.sroa.9.0.extract.trunc43, %7 ], [ %.sroa.9.084, %.lr.ph ]
  %.sroa.7.1 = phi i8 [ %.sroa.7.0.extract.trunc31, %7 ], [ %.sroa.11.082, %.lr.ph ]
  %.sroa.0.1 = phi i16 [ %.sroa.0.0.extract.trunc19, %7 ], [ %.sroa.0.086, %.lr.ph ]
  %12 = add nuw i64 %.087, 2
  %13 = icmp ult i64 %12, %6
  br i1 %13, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %11, %2
  %.sroa.13.0.lcssa = phi i8 [ %.sroa.13.0.extract.trunc, %2 ], [ %.sroa.13.1, %11 ]
  %.sroa.11.0.lcssa = phi i8 [ %.sroa.11.0.extract.trunc, %2 ], [ %.sroa.11.1, %11 ]
  %.sroa.944.0.lcssa = phi i8 [ %.sroa.944.0.extract.trunc, %2 ], [ %.sroa.944.1, %11 ]
  %.sroa.9.0.lcssa = phi i16 [ %.sroa.9.0.extract.trunc, %2 ], [ %.sroa.9.1, %11 ]
  %.sroa.7.0.lcssa = phi i8 [ %.sroa.7.0.extract.trunc, %2 ], [ %.sroa.7.1, %11 ]
  %.sroa.0.0.lcssa = phi i16 [ %.sroa.0.0.extract.trunc, %2 ], [ %.sroa.0.1, %11 ]
  %.sroa.13.0.insert.ext70 = zext i8 %.sroa.13.0.lcssa to i64
  %.sroa.13.0.insert.shift71 = shl nuw i64 %.sroa.13.0.insert.ext70, 56
  %.sroa.11.0.insert.ext58 = zext i8 %.sroa.11.0.lcssa to i64
  %.sroa.11.0.insert.shift59 = shl nuw nsw i64 %.sroa.11.0.insert.ext58, 48
  %.sroa.11.0.insert.insert61 = or disjoint i64 %.sroa.11.0.insert.shift59, %.sroa.13.0.insert.shift71
  %.sroa.944.0.insert.ext46 = zext i8 %.sroa.944.0.lcssa to i64
  %.sroa.944.0.insert.shift47 = shl nuw nsw i64 %.sroa.944.0.insert.ext46, 40
  %.sroa.944.0.insert.insert49 = or disjoint i64 %.sroa.11.0.insert.insert61, %.sroa.944.0.insert.shift47
  %.sroa.9.0.insert.ext33 = zext i16 %.sroa.9.0.lcssa to i64
  %.sroa.9.0.insert.shift34 = shl nuw nsw i64 %.sroa.9.0.insert.ext33, 24
  %.sroa.9.0.insert.insert36 = or disjoint i64 %.sroa.944.0.insert.insert49, %.sroa.9.0.insert.shift34
  %.sroa.7.0.insert.ext21 = zext i8 %.sroa.7.0.lcssa to i64
  %.sroa.7.0.insert.shift22 = shl nuw nsw i64 %.sroa.7.0.insert.ext21, 16
  %.sroa.7.0.insert.insert24 = or disjoint i64 %.sroa.9.0.insert.insert36, %.sroa.7.0.insert.shift22
  %.sroa.0.0.insert.ext12 = zext i16 %.sroa.0.0.lcssa to i64
  %.sroa.0.0.insert.insert14 = or disjoint i64 %.sroa.7.0.insert.insert24, %.sroa.0.0.insert.ext12
  %14 = shl i64 %.sroa.0.0.insert.insert14, 3
  %15 = or i64 %14, 738189287
  store i64 %15, ptr %1, align 8, !tbaa !5
  ret void
}

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

!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