; 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 i32], align 4
  %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 4, 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 i32, ptr %7, i64 0
  %9 = load i32, ptr %8, align 4, !tbaa !9
  %10 = xor i32 %9, 700325083
  %11 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  store i32 %10, ptr %11, align 4, !tbaa !9
  %12 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %13 = load i32, ptr %12, align 4, !tbaa !9
  %14 = lshr i32 %13, 4
  %15 = and i32 %14, 1
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %17, label %46

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

23:                                               ; preds = %17
  %24 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = lshr i32 %25, 1
  %27 = and i32 %26, 7
  %28 = zext i32 %27 to i64
  %29 = or i64 %28, 1
  %30 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = trunc i64 %29 to i32
  %33 = shl i32 %31, %32
  store i32 %33, ptr %30, align 4, !tbaa !9
  br label %45

34:                                               ; preds = %17
  %35 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = lshr i32 %36, 1
  %38 = and i32 %37, 7
  %39 = zext i32 %38 to i64
  %40 = or i64 %39, 1
  %41 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = trunc i64 %40 to i32
  %44 = lshr i32 %42, %43
  store i32 %44, ptr %41, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %34, %23
  br label %68

46:                                               ; preds = %2
  %47 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = lshr i32 %48, 1
  %50 = and i32 %49, 7
  %51 = zext i32 %50 to i64
  %52 = or i64 %51, 1
  %53 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = trunc i64 %52 to i32
  %56 = shl i32 %54, %55
  store i32 %56, ptr %53, align 4, !tbaa !9
  %57 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %58 = getelementptr inbounds i8, ptr %57, i64 3
  %59 = load i8, ptr %58, align 1, !tbaa !11
  store i8 %59, ptr %6, align 1, !tbaa !11
  %60 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %61 = getelementptr inbounds i8, ptr %60, i64 0
  %62 = load i8, ptr %61, align 1, !tbaa !11
  %63 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %64 = getelementptr inbounds i8, ptr %63, i64 3
  store i8 %62, ptr %64, align 1, !tbaa !11
  %65 = load i8, ptr %6, align 1, !tbaa !11
  %66 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %67 = getelementptr inbounds i8, ptr %66, i64 0
  store i8 %65, ptr %67, align 1, !tbaa !11
  br label %68

68:                                               ; preds = %46, %45
  %69 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %70 = load i32, ptr %69, align 4, !tbaa !9
  %71 = lshr i32 %70, 7
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds i32, ptr %72, i64 0
  store i32 %71, ptr %73, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 4, 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 = !{!"int", !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 i32, ptr %0, align 4, !tbaa !5
  %4 = xor i32 %3, 700325083
  %5 = and i32 %4, 16
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %17, label %6

6:                                                ; preds = %2
  %7 = and i32 %3, 4
  %.not131 = icmp eq i32 %7, 0
  %8 = lshr i32 %4, 1
  br i1 %.not131, label %13, label %9

9:                                                ; preds = %6
  %10 = and i32 %8, 6
  %11 = or disjoint i32 %10, 1
  %12 = shl i32 %4, %11
  %.sroa.1783.0.extract.shift99 = lshr i32 %12, 24
  br label %23

13:                                               ; preds = %6
  %14 = and i32 %8, 4
  %15 = or disjoint i32 %14, 1
  %16 = lshr i32 %4, %15
  %.sroa.1783.0.extract.shift111 = lshr i32 %16, 24
  br label %23

17:                                               ; preds = %2
  %18 = lshr i32 %4, 1
  %19 = and i32 %18, 6
  %20 = or disjoint i32 %19, 1
  %21 = shl i32 %4, %20
  %.sroa.1783.0.extract.shift123 = lshr i32 %21, 24
  %22 = and i32 %21, 254
  br label %23

23:                                               ; preds = %9, %13, %17
  %.sroa.17.0.in.in = phi i32 [ %12, %9 ], [ %16, %13 ], [ %21, %17 ]
  %.sroa.0.0.in = phi i32 [ %12, %9 ], [ %16, %13 ], [ %.sroa.1783.0.extract.shift123, %17 ]
  %.sroa.1783.0.in = phi i32 [ %.sroa.1783.0.extract.shift99, %9 ], [ %.sroa.1783.0.extract.shift111, %13 ], [ %22, %17 ]
  %.sroa.1783.0.insert.shift127 = shl nuw i32 %.sroa.1783.0.in, 24
  %.sroa.17.0.insert.ext79 = and i32 %.sroa.17.0.in.in, 16776960
  %.sroa.17.0.insert.insert82 = or disjoint i32 %.sroa.1783.0.insert.shift127, %.sroa.17.0.insert.ext79
  %.sroa.0.0.insert.ext34 = and i32 %.sroa.0.0.in, 128
  %.sroa.0.0.insert.insert36 = or disjoint i32 %.sroa.17.0.insert.insert82, %.sroa.0.0.insert.ext34
  %24 = lshr exact i32 %.sroa.0.0.insert.insert36, 7
  store i32 %24, ptr %1, align 4, !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 = !{!"int", !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