; 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 i8, align 1
  %7 = 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 1, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 2, 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
  %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 %74

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, 2
  %21 = and i64 %20, 1
  %22 = icmp ne i64 %21, 0
  br i1 %22, label %23, label %50

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, 3
  %27 = and i64 %26, 1
  %28 = icmp ne i64 %27, 0
  br i1 %28, label %29, label %43

29:                                               ; preds = %23
  %30 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %31 = load i64, ptr %30, align 8, !tbaa !9
  %32 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %33 = load i64, ptr %32, align 8, !tbaa !9
  %34 = lshr i64 %33, 2
  %35 = and i64 %34, 7
  %36 = or i64 %35, 1
  %37 = shl i64 %31, %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
  br label %49

43:                                               ; preds = %23
  %44 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %45 = load i64, ptr %44, align 8, !tbaa !9
  %46 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %47 = load i64, ptr %46, align 8, !tbaa !9
  %48 = add i64 %47, %45
  store i64 %48, ptr %46, align 8, !tbaa !9
  br label %49

49:                                               ; preds = %43, %29
  br label %73

50:                                               ; preds = %17
  %51 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %52 = getelementptr inbounds i8, ptr %51, i64 7
  %53 = load i8, ptr %52, align 1, !tbaa !11
  store i8 %53, ptr %6, align 1, !tbaa !11
  %54 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %55 = getelementptr inbounds i8, ptr %54, i64 5
  %56 = load i8, ptr %55, align 1, !tbaa !11
  %57 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %58 = getelementptr inbounds i8, ptr %57, i64 7
  store i8 %56, ptr %58, align 1, !tbaa !11
  %59 = load i8, ptr %6, align 1, !tbaa !11
  %60 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %61 = getelementptr inbounds i8, ptr %60, i64 5
  store i8 %59, ptr %61, align 1, !tbaa !11
  %62 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %63 = getelementptr inbounds i8, ptr %62, i64 4
  %64 = load i8, ptr %63, align 1, !tbaa !11
  store i8 %64, ptr %6, align 1, !tbaa !11
  %65 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %66 = getelementptr inbounds i8, ptr %65, i64 0
  %67 = load i8, ptr %66, align 1, !tbaa !11
  %68 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %69 = getelementptr inbounds i8, ptr %68, i64 4
  store i8 %67, ptr %69, align 1, !tbaa !11
  %70 = load i8, ptr %6, align 1, !tbaa !11
  %71 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %72 = getelementptr inbounds i8, ptr %71, i64 0
  store i8 %70, ptr %72, align 1, !tbaa !11
  br label %73

73:                                               ; preds = %50, %49
  br label %86

74:                                               ; preds = %2
  %75 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %76 = getelementptr inbounds i16, ptr %75, i64 2
  %77 = load i16, ptr %76, align 2, !tbaa !12
  store i16 %77, ptr %7, align 2, !tbaa !12
  %78 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %79 = getelementptr inbounds i16, ptr %78, i64 0
  %80 = load i16, ptr %79, align 2, !tbaa !12
  %81 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %82 = getelementptr inbounds i16, ptr %81, i64 2
  store i16 %80, ptr %82, align 2, !tbaa !12
  %83 = load i16, ptr %7, align 2, !tbaa !12
  %84 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %85 = getelementptr inbounds i16, ptr %84, i64 0
  store i16 %83, ptr %85, align 2, !tbaa !12
  br label %86

86:                                               ; preds = %74, %73
  %87 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %88 = load i64, ptr %87, align 8, !tbaa !9
  %89 = shl i64 %88, 1
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds i64, ptr %90, i64 0
  store i64 %89, ptr %91, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #2
  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.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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !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, 1373777115
  %.sroa.0.sroa.18.0.extract.shift321364 = lshr i64 %4, 8
  %.sroa.1883.0.extract.shift = lshr i64 %4, 32
  %.sroa.1883.sroa.18.0.extract.shift365 = lshr i64 %4, 40
  %.sroa.24174.0.extract.shift = lshr i64 %4, 56
  %.sroa.1883.sroa.18.0.insert.ext = shl nuw nsw i64 %.sroa.1883.sroa.18.0.extract.shift365, 8
  %.sroa.1883.sroa.0.0.insert.ext = and i64 %.sroa.1883.0.extract.shift, 255
  %.sroa.1883.sroa.18.0.insert.ext.masked = and i64 %.sroa.1883.sroa.18.0.insert.ext, 65280
  %.sroa.1883.0.insert.ext = or disjoint i64 %.sroa.1883.sroa.18.0.insert.ext.masked, %.sroa.1883.sroa.0.0.insert.ext
  %5 = and i64 %4, 1
  %.not = icmp eq i64 %5, 0
  br i1 %.not, label %24, label %6

6:                                                ; preds = %2
  %7 = lshr i64 %4, 2
  %8 = and i64 %4, 4
  %.not366 = icmp eq i64 %8, 0
  br i1 %.not366, label %22, label %9

9:                                                ; preds = %6
  %10 = and i64 %4, 8
  %.not367 = icmp eq i64 %10, 0
  br i1 %.not367, label %17, label %11

11:                                               ; preds = %9
  %12 = and i64 %7, 7
  %13 = shl i64 %4, %12
  %14 = shl i64 %13, 2
  %15 = and i64 %14, 32
  %16 = or i64 %15, %4
  br label %24

17:                                               ; preds = %9
  %18 = shl nuw nsw i64 %.sroa.1883.0.insert.ext, 33
  %19 = shl i64 %4, 1
  %20 = and i64 %19, -562941363486738
  %21 = or disjoint i64 %18, %20
  %.sroa.0.sroa.18.0.extract.shift357368 = lshr i64 %21, 8
  %.sroa.1883.0.extract.shift121 = lshr i64 %21, 32
  %.sroa.1883.sroa.18.0.extract.shift279369 = lshr i64 %21, 40
  %.sroa.24174.0.extract.shift212 = lshr i64 %19, 56
  br label %24

22:                                               ; preds = %6
  %23 = and i64 %.sroa.1883.sroa.18.0.extract.shift365, 255
  br label %24

24:                                               ; preds = %2, %22, %17, %11
  %.sroa.1883.sroa.18.0.in = phi i64 [ %.sroa.1883.sroa.18.0.extract.shift365, %11 ], [ %.sroa.1883.sroa.18.0.extract.shift279369, %17 ], [ %.sroa.24174.0.extract.shift, %22 ], [ %.sroa.0.sroa.18.0.extract.shift321364, %2 ]
  %.sroa.1883.sroa.0.0.in = phi i64 [ %.sroa.1883.0.extract.shift, %11 ], [ %.sroa.1883.0.extract.shift121, %17 ], [ %4, %22 ], [ %4, %2 ]
  %.sroa.24174.0 = phi i64 [ %.sroa.24174.0.extract.shift, %11 ], [ %.sroa.24174.0.extract.shift212, %17 ], [ %23, %22 ], [ %.sroa.24174.0.extract.shift, %2 ]
  %.sroa.24.0.in.in = phi i64 [ %4, %11 ], [ %21, %17 ], [ %4, %22 ], [ %4, %2 ]
  %.sroa.0.sroa.0.0.in = phi i64 [ %16, %11 ], [ %19, %17 ], [ %.sroa.1883.0.extract.shift, %22 ], [ %.sroa.1883.0.extract.shift, %2 ]
  %.sroa.0.sroa.18.0.in = phi i64 [ %.sroa.0.sroa.18.0.extract.shift321364, %11 ], [ %.sroa.0.sroa.18.0.extract.shift357368, %17 ], [ %.sroa.0.sroa.18.0.extract.shift321364, %22 ], [ %.sroa.1883.sroa.18.0.extract.shift365, %2 ]
  %.sroa.0.sroa.18.0.insert.ext359 = shl nuw i64 %.sroa.0.sroa.18.0.in, 8
  %.sroa.0.sroa.0.0.insert.ext318 = and i64 %.sroa.0.sroa.0.0.in, 255
  %.sroa.1883.sroa.18.0.insert.ext281 = shl nuw i64 %.sroa.1883.sroa.18.0.in, 8
  %.sroa.1883.sroa.0.0.insert.ext242 = and i64 %.sroa.1883.sroa.0.0.in, 255
  %.sroa.24174.0.insert.shift216 = shl nuw i64 %.sroa.24174.0, 56
  %.sroa.24.0.insert.ext170 = and i64 %.sroa.24.0.in.in, 71776119061217280
  %.sroa.24.0.insert.insert173 = or disjoint i64 %.sroa.24.0.insert.ext170, %.sroa.24174.0.insert.shift216
  %.sroa.1883.sroa.18.0.insert.ext281.masked = and i64 %.sroa.1883.sroa.18.0.insert.ext281, 65280
  %.sroa.1883.0.insert.ext124 = or disjoint i64 %.sroa.1883.sroa.18.0.insert.ext281.masked, %.sroa.1883.sroa.0.0.insert.ext242
  %.sroa.1883.0.insert.shift125 = shl nuw nsw i64 %.sroa.1883.0.insert.ext124, 32
  %.sroa.1883.0.insert.insert127 = or disjoint i64 %.sroa.24.0.insert.insert173, %.sroa.1883.0.insert.shift125
  %.sroa.18.0.insert.ext79 = and i64 %.sroa.24.0.in.in, 4294901760
  %.sroa.18.0.insert.insert82 = or disjoint i64 %.sroa.1883.0.insert.insert127, %.sroa.18.0.insert.ext79
  %.sroa.0.sroa.18.0.insert.ext359.masked = and i64 %.sroa.0.sroa.18.0.insert.ext359, 65280
  %.sroa.0.0.insert.ext36 = or disjoint i64 %.sroa.0.sroa.0.0.insert.ext318, %.sroa.0.sroa.18.0.insert.ext359.masked
  %.sroa.0.0.insert.insert38 = or disjoint i64 %.sroa.0.0.insert.ext36, %.sroa.18.0.insert.insert82
  %25 = shl i64 %.sroa.0.0.insert.insert38, 1
  store i64 %25, 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