; 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 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 1, ptr %6) #2
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds i64, ptr %7, i64 0
  %9 = load i64, ptr %8, align 8, !tbaa !9
  %10 = add i64 %9, 914778474
  %11 = xor i64 %10, -832765941
  %12 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  store i64 %11, ptr %12, align 8, !tbaa !9
  %13 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %14 = load i64, ptr %13, align 8, !tbaa !9
  %15 = and i64 %14, 1
  %16 = icmp ne i64 %15, 0
  br i1 %16, label %17, label %49

17:                                               ; preds = %2
  %18 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %19 = load i64, ptr %18, align 8, !tbaa !9
  %20 = lshr i64 %19, 1
  %21 = and i64 %20, 1
  %22 = icmp ne i64 %21, 0
  br i1 %22, label %23, label %32

23:                                               ; preds = %17
  %24 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %25 = load i64, ptr %24, align 8, !tbaa !9
  %26 = lshr i64 %25, 2
  %27 = and i64 %26, 7
  %28 = or i64 %27, 1
  %29 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %30 = load i64, ptr %29, align 8, !tbaa !9
  %31 = shl i64 %30, %28
  store i64 %31, ptr %29, align 8, !tbaa !9
  br label %48

32:                                               ; preds = %17
  %33 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %36 = load i64, ptr %35, align 8, !tbaa !9
  %37 = mul i64 %34, %36
  %38 = and i64 %37, 15
  %39 = shl i64 %38, 2
  %40 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = or i64 %41, %39
  store i64 %42, ptr %40, align 8, !tbaa !9
  %43 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %44 = load i64, ptr %43, align 8, !tbaa !9
  %45 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %46 = load i64, ptr %45, align 8, !tbaa !9
  %47 = add i64 %46, %44
  store i64 %47, ptr %45, align 8, !tbaa !9
  br label %48

48:                                               ; preds = %32, %23
  br label %61

49:                                               ; preds = %2
  %50 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %51 = getelementptr inbounds i8, ptr %50, i64 2
  %52 = load i8, ptr %51, align 1, !tbaa !11
  store i8 %52, ptr %6, align 1, !tbaa !11
  %53 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %54 = getelementptr inbounds i8, ptr %53, i64 0
  %55 = load i8, ptr %54, align 1, !tbaa !11
  %56 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %57 = getelementptr inbounds i8, ptr %56, i64 2
  store i8 %55, ptr %57, align 1, !tbaa !11
  %58 = load i8, ptr %6, align 1, !tbaa !11
  %59 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %60 = getelementptr inbounds i8, ptr %59, i64 0
  store i8 %58, ptr %60, align 1, !tbaa !11
  br label %61

61:                                               ; preds = %49, %48
  %62 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %63 = load i64, ptr %62, align 8, !tbaa !9
  %64 = add i64 %63, 56272562534560086
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds i64, ptr %65, i64 0
  store i64 %64, ptr %66, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, 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}


; 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: mustprogress nofree norecurse nosync nounwind willreturn 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, 914778474
  %.sroa.0.0.insert.insert = xor i64 %4, -832765941
  %5 = and i64 %.sroa.0.0.insert.insert, 1
  %.not = icmp eq i64 %5, 0
  br i1 %.not, label %18, label %6

6:                                                ; preds = %2
  %7 = and i64 %.sroa.0.0.insert.insert, 2
  %.not205 = icmp eq i64 %7, 0
  br i1 %.not205, label %13, label %8

8:                                                ; preds = %6
  %9 = lshr i64 %.sroa.0.0.insert.insert, 2
  %10 = and i64 %9, 6
  %11 = or disjoint i64 %10, 1
  %12 = shl i64 %.sroa.0.0.insert.insert, %11
  %.sroa.18.0.extract.shift56 = lshr i64 %12, 8
  %.sroa.1892.0.extract.shift108 = lshr i64 %12, 16
  %.sroa.20.0.extract.shift159 = lshr i64 %12, 24
  br label %19

13:                                               ; preds = %6
  %14 = shl i64 %.sroa.0.0.insert.insert, 2
  %15 = mul i64 %14, %.sroa.0.0.insert.insert
  %16 = and i64 %15, 52
  %.sroa.1892.0.insert.insert131 = and i64 %.sroa.0.0.insert.insert, 9223372036854710272
  %.sroa.18.0.insert.ext76 = and i64 %4, 32768
  %.sroa.18.0.insert.insert79 = or disjoint i64 %.sroa.1892.0.insert.insert131, %.sroa.18.0.insert.ext76
  %.sroa.0.0.insert.ext29 = or i64 %16, %.sroa.0.0.insert.insert
  %.sroa.0.0.extract.trunc36 = shl i64 %.sroa.0.0.insert.ext29, 1
  %.sroa.0.0.insert.insert31 = lshr i64 %4, 7
  %.sroa.1892.0.extract.shift137 = lshr exact i64 %.sroa.18.0.insert.insert79, 15
  %.sroa.20.0.extract.shift188 = lshr i64 %.sroa.0.0.insert.insert, 23
  %17 = and i64 %.sroa.20.0.extract.shift188, 1099511627775
  br label %19

18:                                               ; preds = %2
  %.sroa.18.0.extract.shift = lshr i64 %4, 8
  %.sroa.1892.0.extract.shift = lshr i64 %.sroa.0.0.insert.insert, 16
  %.sroa.20.0.extract.shift = lshr i64 %.sroa.0.0.insert.insert, 24
  br label %19

19:                                               ; preds = %8, %13, %18
  %.sroa.1892.0.in = phi i64 [ %.sroa.1892.0.extract.shift108, %8 ], [ %.sroa.1892.0.extract.shift137, %13 ], [ %.sroa.0.0.insert.insert, %18 ]
  %.sroa.18.0.in = phi i64 [ %.sroa.18.0.extract.shift56, %8 ], [ %.sroa.0.0.insert.insert31, %13 ], [ %.sroa.18.0.extract.shift, %18 ]
  %.sroa.0.0 = phi i64 [ %12, %8 ], [ %.sroa.0.0.extract.trunc36, %13 ], [ %.sroa.1892.0.extract.shift, %18 ]
  %.sroa.20.sroa.0.0.in = phi i64 [ %.sroa.20.0.extract.shift159, %8 ], [ %17, %13 ], [ %.sroa.20.0.extract.shift, %18 ]
  %.sroa.20.0.insert.shift192 = shl nuw i64 %.sroa.20.sroa.0.0.in, 24
  %.sroa.1892.0.insert.ext140 = shl i64 %.sroa.1892.0.in, 16
  %.sroa.1892.0.insert.shift141 = and i64 %.sroa.1892.0.insert.ext140, 16711680
  %.sroa.18.0.insert.ext88 = shl i64 %.sroa.18.0.in, 8
  %.sroa.18.0.insert.shift89 = and i64 %.sroa.18.0.insert.ext88, 65280
  %.sroa.0.0.insert.ext38 = and i64 %.sroa.0.0, 255
  %.sroa.1892.0.insert.insert143 = add nuw nsw i64 %.sroa.1892.0.insert.shift141, 56272562534560086
  %.sroa.18.0.insert.insert91 = add nuw nsw i64 %.sroa.1892.0.insert.insert143, %.sroa.0.0.insert.ext38
  %.sroa.0.0.insert.insert40 = add nuw nsw i64 %.sroa.18.0.insert.insert91, %.sroa.18.0.insert.shift89
  %20 = add i64 %.sroa.0.0.insert.insert40, %.sroa.20.0.insert.shift192
  store i64 %20, ptr %1, align 8, !tbaa !5
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn 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"}


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