; 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
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  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 1, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 4, 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 = add i64 %11, 1373777115
  %13 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  store i64 %12, ptr %13, align 8, !tbaa !9
  %14 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %15 = load i64, ptr %14, align 8, !tbaa !9
  %16 = and i64 %15, 1
  %17 = icmp ne i64 %16, 0
  br i1 %17, label %18, label %67

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

24:                                               ; preds = %18
  %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 %6, 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 %6, 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
  %36 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %37 = load i64, ptr %36, align 8, !tbaa !9
  %38 = lshr i64 %37, 3
  %39 = and i64 %38, 7
  %40 = or i64 %39, 1
  %41 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %42 = load i64, ptr %41, align 8, !tbaa !9
  %43 = shl i64 %42, %40
  store i64 %43, ptr %41, align 8, !tbaa !9
  br label %66

44:                                               ; preds = %18
  %45 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %46 = getelementptr inbounds i8, ptr %45, i64 0
  %47 = load i8, ptr %46, align 1, !tbaa !11
  store i8 %47, ptr %7, align 1, !tbaa !11
  %48 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %49 = getelementptr inbounds i8, ptr %48, i64 6
  %50 = load i8, ptr %49, align 1, !tbaa !11
  %51 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %52 = getelementptr inbounds i8, ptr %51, i64 0
  store i8 %50, ptr %52, align 1, !tbaa !11
  %53 = load i8, ptr %7, align 1, !tbaa !11
  %54 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %55 = getelementptr inbounds i8, ptr %54, i64 6
  store i8 %53, ptr %55, align 1, !tbaa !11
  %56 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %59 = load i64, ptr %58, align 8, !tbaa !9
  %60 = mul i64 %57, %59
  %61 = and i64 %60, 15
  %62 = shl i64 %61, 3
  %63 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %64 = load i64, ptr %63, align 8, !tbaa !9
  %65 = or i64 %64, %62
  store i64 %65, ptr %63, align 8, !tbaa !9
  br label %66

66:                                               ; preds = %44, %24
  br label %97

67:                                               ; preds = %2
  %68 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %69 = getelementptr inbounds i32, ptr %68, i64 0
  %70 = load i32, ptr %69, align 4, !tbaa !12
  store i32 %70, ptr %8, align 4, !tbaa !12
  %71 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %72 = getelementptr inbounds i32, ptr %71, i64 1
  %73 = load i32, ptr %72, align 4, !tbaa !12
  %74 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %75 = getelementptr inbounds i32, ptr %74, i64 0
  store i32 %73, ptr %75, align 4, !tbaa !12
  %76 = load i32, ptr %8, align 4, !tbaa !12
  %77 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %78 = getelementptr inbounds i32, ptr %77, i64 1
  store i32 %76, ptr %78, align 4, !tbaa !12
  %79 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %80 = getelementptr inbounds i32, ptr %79, i64 1
  %81 = load i32, ptr %80, align 4, !tbaa !12
  store i32 %81, ptr %8, align 4, !tbaa !12
  %82 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %83 = getelementptr inbounds i32, ptr %82, i64 0
  %84 = load i32, ptr %83, align 4, !tbaa !12
  %85 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %86 = getelementptr inbounds i32, ptr %85, i64 1
  store i32 %84, ptr %86, align 4, !tbaa !12
  %87 = load i32, ptr %8, align 4, !tbaa !12
  %88 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %89 = getelementptr inbounds i32, ptr %88, i64 0
  store i32 %87, ptr %89, align 4, !tbaa !12
  %90 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = and i64 %91, 7
  %93 = shl i64 %92, 2
  %94 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %95 = load i64, ptr %94, align 8, !tbaa !9
  %96 = or i64 %95, %93
  store i64 %96, ptr %94, align 8, !tbaa !9
  br label %97

97:                                               ; preds = %67, %66
  %98 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %99 = load i64, ptr %98, align 8, !tbaa !9
  %100 = sub i64 %99, 774950844
  %101 = add i64 %100, 737924136960
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds i64, ptr %102, i64 0
  store i64 %101, ptr %103, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 1, 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.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 = !{!13, !13, i64 0}
!13 = !{!"int", !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.0.0.extract.trunc306 = trunc i64 %4 to i32
  %5 = lshr i32 %.sroa.0.sroa.0.0.extract.trunc306, 8
  %.sroa.24.0.extract.shift = lshr i64 %4, 32
  %.sroa.24.sroa.0.0.extract.trunc = trunc nuw i64 %.sroa.24.0.extract.shift to i32
  %.sroa.24.sroa.22193.0.extract.shift452 = lshr i64 %4, 48
  %.sroa.24.sroa.22193.0.extract.trunc = trunc nuw nsw i64 %.sroa.24.sroa.22193.0.extract.shift452 to i32
  %.sroa.0.sroa.22.0.insert.ext348 = and i32 %5, 255
  %.sroa.0.sroa.22.0.insert.shift349 = shl nuw nsw i32 %.sroa.0.sroa.22.0.insert.ext348, 8
  %.sroa.0.sroa.0.0.insert.insert309 = or i32 %.sroa.0.sroa.22.0.insert.shift349, %.sroa.0.sroa.0.0.extract.trunc306
  %.sroa.24.sroa.22193.0.insert.ext = and i32 %.sroa.24.sroa.22193.0.extract.trunc, 255
  %.sroa.24.sroa.22193.0.insert.shift = shl nuw nsw i32 %.sroa.24.sroa.22193.0.insert.ext, 16
  %6 = and i32 %.sroa.24.sroa.0.0.extract.trunc, -16711936
  %.sroa.24.sroa.22.0.insert.insert = or disjoint i32 %.sroa.24.sroa.22193.0.insert.shift, %6
  %.sroa.0.0.insert.ext = zext i32 %.sroa.0.sroa.0.0.insert.insert309 to i64
  %7 = and i64 %.sroa.0.0.insert.ext, 1
  %.not = icmp eq i64 %7, 0
  br i1 %.not, label %21, label %8

8:                                                ; preds = %2
  %9 = and i64 %.sroa.0.0.insert.ext, 4
  %.not473 = icmp eq i64 %9, 0
  br i1 %.not473, label %16, label %10

10:                                               ; preds = %8
  %.sroa.24.sroa.0.0.insert.ext = shl nuw nsw i64 %.sroa.24.0.extract.shift, 8
  %.sroa.0.sroa.22.0.insert.shift357 = and i64 %.sroa.24.sroa.0.0.insert.ext, 65280
  %.sroa.0.sroa.22.0.insert.insert359 = and i64 %4, 4294902015
  %.sroa.24.sroa.0.0.insert.insert106 = or disjoint i32 %.sroa.24.sroa.22.0.insert.insert, %.sroa.0.sroa.22.0.insert.ext348
  %.sroa.24.0.insert.ext53 = zext i32 %.sroa.24.sroa.0.0.insert.insert106 to i64
  %.sroa.24.0.insert.shift54 = shl nuw i64 %.sroa.24.0.insert.ext53, 32
  %11 = or disjoint i64 %.sroa.0.sroa.22.0.insert.shift357, %.sroa.24.0.insert.shift54
  %.sroa.0.0.insert.insert14 = or disjoint i64 %11, %.sroa.0.sroa.22.0.insert.insert359
  %12 = lshr i64 %4, 3
  %13 = and i64 %12, 6
  %14 = or disjoint i64 %13, 1
  %15 = shl i64 %.sroa.0.0.insert.insert14, %14
  %.sroa.24.0.extract.shift62 = lshr i64 %15, 32
  %.sroa.24.sroa.22193.0.extract.shift206481 = lshr i64 %15, 48
  br label %25

16:                                               ; preds = %8
  %.sroa.0.sroa.0.0.insert.insert322 = or disjoint i32 %.sroa.0.sroa.22.0.insert.shift349, %.sroa.24.sroa.22193.0.insert.ext
  %.sroa.0.0.insert.ext21 = zext nneg i32 %.sroa.0.sroa.0.0.insert.insert322 to i64
  %17 = shl nuw nsw i64 %.sroa.0.0.insert.ext21, 3
  %18 = mul nuw nsw i64 %17, %.sroa.0.0.insert.ext21
  %19 = and i64 %18, 120
  %20 = or i64 %19, %.sroa.0.0.insert.ext21
  br label %25

21:                                               ; preds = %2
  %22 = shl i64 %4, 2
  %23 = and i64 %22, 28
  %24 = or i64 %23, %4
  br label %25

25:                                               ; preds = %10, %16, %21
  %.sroa.24.sroa.24.0.in.in = phi i64 [ %15, %10 ], [ %4, %16 ], [ %4, %21 ]
  %.sroa.24.sroa.22193.0.in = phi i64 [ %.sroa.24.sroa.22193.0.extract.shift206481, %10 ], [ %4, %16 ], [ %.sroa.24.sroa.22193.0.extract.shift452, %21 ]
  %.sroa.24.sroa.0.0.in = phi i64 [ %.sroa.24.0.extract.shift62, %10 ], [ %.sroa.24.0.extract.shift, %16 ], [ %.sroa.24.0.extract.shift, %21 ]
  %.sroa.0.sroa.0.0.in = phi i64 [ %15, %10 ], [ %20, %16 ], [ %24, %21 ]
  %.sroa.0.sroa.22.0.in.in = phi i64 [ %15, %10 ], [ %.sroa.0.0.insert.ext21, %16 ], [ %4, %21 ]
  %.sroa.0.sroa.24.0.insert.shift445 = and i64 %.sroa.24.sroa.24.0.in.in, 4294901760
  %.sroa.0.sroa.22.0.insert.ext390 = and i64 %.sroa.0.sroa.22.0.in.in, 65280
  %.sroa.0.sroa.0.0.insert.ext337 = and i64 %.sroa.0.sroa.0.0.in, 255
  %.sroa.24.sroa.22193.0.insert.ext232 = shl i64 %.sroa.24.sroa.22193.0.in, 16
  %.sroa.24.sroa.22193.0.insert.shift233 = and i64 %.sroa.24.sroa.22193.0.insert.ext232, 16711680
  %26 = and i64 %.sroa.24.sroa.0.0.in, 4278255615
  %.sroa.24.sroa.0.0.insert.insert130 = or disjoint i64 %26, %.sroa.24.sroa.22193.0.insert.shift233
  %.sroa.24.0.insert.shift95 = shl nuw i64 %.sroa.24.sroa.0.0.insert.insert130, 32
  %.sroa.0.sroa.0.0.insert.insert339 = add nuw nsw i64 %.sroa.0.sroa.24.0.insert.shift445, 737149186116
  %.sroa.0.0.insert.insert45 = add nuw nsw i64 %.sroa.0.sroa.0.0.insert.insert339, %.sroa.0.sroa.0.0.insert.ext337
  %.sroa.0.sroa.22.0.insert.insert393 = add nuw nsw i64 %.sroa.0.0.insert.insert45, %.sroa.0.sroa.22.0.insert.ext390
  %27 = add i64 %.sroa.0.sroa.22.0.insert.insert393, %.sroa.24.0.insert.shift95
  store i64 %27, 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: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass