; 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 i64, align 8
  %8 = alloca i16, align 2
  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 8, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 2, 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 %7, align 8, !tbaa !9
  br label %14

14:                                               ; preds = %73, %2
  %15 = load i64, ptr %7, 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 %76

20:                                               ; preds = %14
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %21

21:                                               ; preds = %70, %20
  %22 = load i64, ptr %6, align 8, !tbaa !9
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds i64, ptr %23, i64 1
  %25 = load i64, ptr %24, align 8, !tbaa !9
  %26 = icmp ult i64 %22, %25
  br i1 %26, label %27, label %73

27:                                               ; preds = %21
  %28 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %29 = load i64, ptr %28, align 8, !tbaa !9
  %30 = load i64, ptr %6, align 8, !tbaa !9
  %31 = load i64, ptr %7, align 8, !tbaa !9
  %32 = lshr i64 %31, 4
  %33 = and i64 %32, 7
  %34 = or i64 %33, 1
  %35 = shl i64 %30, %34
  %36 = icmp eq i64 %29, %35
  br i1 %36, label %37, label %60

37:                                               ; preds = %27
  %38 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %39 = getelementptr inbounds i16, ptr %38, i64 1
  %40 = load i16, ptr %39, align 2, !tbaa !11
  store i16 %40, ptr %8, align 2, !tbaa !11
  %41 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %42 = getelementptr inbounds i16, ptr %41, i64 3
  %43 = load i16, ptr %42, align 2, !tbaa !11
  %44 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %45 = getelementptr inbounds i16, ptr %44, i64 1
  store i16 %43, ptr %45, align 2, !tbaa !11
  %46 = load i16, ptr %8, align 2, !tbaa !11
  %47 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %48 = getelementptr inbounds i16, ptr %47, i64 3
  store i16 %46, ptr %48, align 2, !tbaa !11
  %49 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %50 = getelementptr inbounds i16, ptr %49, i64 0
  %51 = load i16, ptr %50, align 2, !tbaa !11
  store i16 %51, ptr %8, align 2, !tbaa !11
  %52 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %53 = getelementptr inbounds i16, ptr %52, i64 2
  %54 = load i16, ptr %53, align 2, !tbaa !11
  %55 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %56 = getelementptr inbounds i16, ptr %55, i64 0
  store i16 %54, ptr %56, align 2, !tbaa !11
  %57 = load i16, ptr %8, align 2, !tbaa !11
  %58 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %59 = getelementptr inbounds i16, ptr %58, i64 2
  store i16 %57, ptr %59, align 2, !tbaa !11
  br label %70

60:                                               ; preds = %27
  %61 = load i64, ptr %6, align 8, !tbaa !9
  %62 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !9
  %64 = and i64 %63, 7
  %65 = or i64 %64, 1
  %66 = load i64, ptr %6, align 8, !tbaa !9
  %67 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !9
  %69 = shl i64 %68, %65
  store i64 %69, ptr %67, align 8, !tbaa !9
  br label %70

70:                                               ; preds = %60, %37
  %71 = load i64, ptr %6, align 8, !tbaa !9
  %72 = add i64 %71, 2
  store i64 %72, ptr %6, align 8, !tbaa !9
  br label %21, !llvm.loop !13

73:                                               ; preds = %21
  %74 = load i64, ptr %7, align 8, !tbaa !9
  %75 = add i64 %74, 2
  store i64 %75, ptr %7, align 8, !tbaa !9
  br label %14, !llvm.loop !15

76:                                               ; preds = %14
  %77 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %78 = load i64, ptr %77, align 8, !tbaa !9
  %79 = or i64 %78, 293908934
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds i64, ptr %80, i64 0
  store i64 %79, ptr %81, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 8, 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 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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.9.0.extract.shift = lshr i64 %4, 16
  %.sroa.9.0.extract.trunc = trunc i64 %.sroa.9.0.extract.shift to i16
  %.sroa.11.0.extract.shift = lshr i64 %3, 32
  %.sroa.11.0.extract.trunc = trunc i64 %.sroa.11.0.extract.shift to i16
  %.sroa.13.0.extract.shift = lshr i64 %3, 48
  %.sroa.13.0.extract.trunc = trunc nuw i64 %.sroa.13.0.extract.shift to i16
  %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 %.preheader

.preheader:                                       ; preds = %2, %20
  %.01369 = phi i64 [ %21, %20 ], [ 0, %2 ]
  %.sroa.0.068 = phi i16 [ %.sroa.0.2, %20 ], [ %.sroa.0.0.extract.trunc, %2 ]
  %.sroa.9.067 = phi i16 [ %.sroa.9.2, %20 ], [ %.sroa.9.0.extract.trunc, %2 ]
  %.sroa.11.066 = phi i16 [ %.sroa.11.2, %20 ], [ %.sroa.11.0.extract.trunc, %2 ]
  %.sroa.13.065 = phi i16 [ %.sroa.13.2, %20 ], [ %.sroa.13.0.extract.trunc, %2 ]
  %7 = lshr i64 %.01369, 4
  %8 = and i64 %7, 6
  %9 = or disjoint i64 %8, 1
  br label %10

10:                                               ; preds = %.preheader, %17
  %.064 = phi i64 [ 0, %.preheader ], [ %18, %17 ]
  %.sroa.0.163 = phi i16 [ %.sroa.0.068, %.preheader ], [ %.sroa.0.2, %17 ]
  %.sroa.9.162 = phi i16 [ %.sroa.9.067, %.preheader ], [ %.sroa.9.2, %17 ]
  %.sroa.11.161 = phi i16 [ %.sroa.11.066, %.preheader ], [ %.sroa.11.2, %17 ]
  %.sroa.13.160 = phi i16 [ %.sroa.13.065, %.preheader ], [ %.sroa.13.2, %17 ]
  %.sroa.13.0.insert.ext = zext i16 %.sroa.13.160 to i64
  %.sroa.13.0.insert.shift = shl nuw i64 %.sroa.13.0.insert.ext, 48
  %.sroa.11.0.insert.ext = zext i16 %.sroa.11.161 to i64
  %.sroa.11.0.insert.shift = shl nuw nsw i64 %.sroa.11.0.insert.ext, 32
  %.sroa.11.0.insert.insert = or disjoint i64 %.sroa.11.0.insert.shift, %.sroa.13.0.insert.shift
  %.sroa.9.0.insert.ext = zext i16 %.sroa.9.162 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.11.0.insert.insert, %.sroa.9.0.insert.shift
  %.sroa.0.0.insert.ext = zext i16 %.sroa.0.163 to i64
  %.sroa.0.0.insert.insert = or disjoint i64 %.sroa.9.0.insert.insert, %.sroa.0.0.insert.ext
  %11 = shl i64 %.064, %9
  %12 = icmp eq i64 %.sroa.0.0.insert.insert, %11
  br i1 %12, label %17, label %13

13:                                               ; preds = %10
  %14 = and i64 %.sroa.0.0.insert.ext, 6
  %15 = or disjoint i64 %14, 1
  %16 = shl i64 %.sroa.0.0.insert.insert, %15
  %.sroa.0.0.extract.trunc23 = trunc i64 %16 to i16
  %.sroa.9.0.extract.shift34 = lshr i64 %16, 16
  %.sroa.9.0.extract.trunc35 = trunc i64 %.sroa.9.0.extract.shift34 to i16
  %.sroa.11.0.extract.shift46 = lshr i64 %16, 32
  %.sroa.11.0.extract.trunc47 = trunc i64 %.sroa.11.0.extract.shift46 to i16
  %.sroa.13.0.extract.shift58 = lshr i64 %16, 48
  %.sroa.13.0.extract.trunc59 = trunc nuw i64 %.sroa.13.0.extract.shift58 to i16
  br label %17

17:                                               ; preds = %10, %13
  %.sroa.13.2 = phi i16 [ %.sroa.13.0.extract.trunc59, %13 ], [ %.sroa.9.162, %10 ]
  %.sroa.11.2 = phi i16 [ %.sroa.11.0.extract.trunc47, %13 ], [ %.sroa.0.163, %10 ]
  %.sroa.9.2 = phi i16 [ %.sroa.9.0.extract.trunc35, %13 ], [ %.sroa.13.160, %10 ]
  %.sroa.0.2 = phi i16 [ %.sroa.0.0.extract.trunc23, %13 ], [ %.sroa.11.161, %10 ]
  %18 = add nuw i64 %.064, 2
  %19 = icmp ult i64 %18, %6
  br i1 %19, label %10, label %20, !llvm.loop !9

20:                                               ; preds = %17
  %21 = add nuw i64 %.01369, 2
  %22 = icmp ult i64 %21, %6
  br i1 %22, label %.preheader, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %20, %2
  %.sroa.13.0.lcssa = phi i16 [ %.sroa.13.0.extract.trunc, %2 ], [ %.sroa.13.2, %20 ]
  %.sroa.11.0.lcssa = phi i16 [ %.sroa.11.0.extract.trunc, %2 ], [ %.sroa.11.2, %20 ]
  %.sroa.9.0.lcssa = phi i16 [ %.sroa.9.0.extract.trunc, %2 ], [ %.sroa.9.2, %20 ]
  %.sroa.0.0.lcssa = phi i16 [ %.sroa.0.0.extract.trunc, %2 ], [ %.sroa.0.2, %20 ]
  %.sroa.13.0.insert.ext49 = zext i16 %.sroa.13.0.lcssa to i64
  %.sroa.13.0.insert.shift50 = shl nuw i64 %.sroa.13.0.insert.ext49, 48
  %.sroa.11.0.insert.ext37 = zext i16 %.sroa.11.0.lcssa to i64
  %.sroa.11.0.insert.shift38 = shl nuw nsw i64 %.sroa.11.0.insert.ext37, 32
  %.sroa.11.0.insert.insert40 = or disjoint i64 %.sroa.11.0.insert.shift38, %.sroa.13.0.insert.shift50
  %.sroa.9.0.insert.ext25 = zext i16 %.sroa.9.0.lcssa to i64
  %.sroa.9.0.insert.shift26 = shl nuw nsw i64 %.sroa.9.0.insert.ext25, 16
  %.sroa.9.0.insert.insert28 = or disjoint i64 %.sroa.11.0.insert.insert40, %.sroa.9.0.insert.shift26
  %.sroa.0.0.insert.ext16 = zext i16 %.sroa.0.0.lcssa to i64
  %.sroa.0.0.insert.insert18 = or disjoint i64 %.sroa.9.0.insert.insert28, %.sroa.0.0.insert.ext16
  %23 = or i64 %.sroa.0.0.insert.insert18, 293908934
  store i64 %23, 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"}
!11 = distinct !{!11, !10}


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