; 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 i32], align 4
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = 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
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #2
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds i32, ptr %9, i64 0
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = zext i32 %11 to i64
  %13 = add i64 %12, 51238316
  %14 = add i64 %13, 274866410
  %15 = trunc i64 %14 to i32
  %16 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  store i32 %15, ptr %16, align 4, !tbaa !9
  %17 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %19 = lshr i32 %18, 4
  %20 = and i32 %19, 1
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %64

22:                                               ; preds = %2
  %23 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %24 = load i32, ptr %23, align 4, !tbaa !9
  %25 = lshr i32 %24, 3
  %26 = and i32 %25, 1
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %51

28:                                               ; preds = %22
  %29 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %30 = getelementptr inbounds i8, ptr %29, i64 1
  %31 = load i8, ptr %30, align 1, !tbaa !11
  store i8 %31, ptr %6, align 1, !tbaa !11
  %32 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %33 = getelementptr inbounds i8, ptr %32, i64 3
  %34 = load i8, ptr %33, align 1, !tbaa !11
  %35 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %36 = getelementptr inbounds i8, ptr %35, i64 1
  store i8 %34, ptr %36, align 1, !tbaa !11
  %37 = load i8, ptr %6, align 1, !tbaa !11
  %38 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %39 = getelementptr inbounds i8, ptr %38, i64 3
  store i8 %37, ptr %39, align 1, !tbaa !11
  %40 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %41 = getelementptr inbounds i8, ptr %40, i64 3
  %42 = load i8, ptr %41, align 1, !tbaa !11
  store i8 %42, ptr %6, align 1, !tbaa !11
  %43 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %44 = getelementptr inbounds i8, ptr %43, i64 0
  %45 = load i8, ptr %44, align 1, !tbaa !11
  %46 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %47 = getelementptr inbounds i8, ptr %46, i64 3
  store i8 %45, ptr %47, align 1, !tbaa !11
  %48 = load i8, ptr %6, align 1, !tbaa !11
  %49 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %50 = getelementptr inbounds i8, ptr %49, i64 0
  store i8 %48, ptr %50, align 1, !tbaa !11
  br label %63

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

63:                                               ; preds = %51, %28
  br label %76

64:                                               ; preds = %2
  %65 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %66 = getelementptr inbounds i8, ptr %65, i64 2
  %67 = load i8, ptr %66, align 1, !tbaa !11
  store i8 %67, ptr %8, align 1, !tbaa !11
  %68 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %69 = getelementptr inbounds i8, ptr %68, i64 1
  %70 = load i8, ptr %69, align 1, !tbaa !11
  %71 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %72 = getelementptr inbounds i8, ptr %71, i64 2
  store i8 %70, ptr %72, align 1, !tbaa !11
  %73 = load i8, ptr %8, align 1, !tbaa !11
  %74 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %75 = getelementptr inbounds i8, ptr %74, i64 1
  store i8 %73, ptr %75, align 1, !tbaa !11
  br label %76

76:                                               ; preds = %64, %63
  %77 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = zext i32 %78 to i64
  %80 = add i64 %79, 119333056
  %81 = add i64 %80, 980743330
  %82 = trunc i64 %81 to i32
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds i32, ptr %83, i64 0
  store i32 %82, ptr %84, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, 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 4, 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 = !{!"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 = add i32 %3, 326104726
  %.sroa.8.0.extract.shift = lshr i32 %4, 8
  %.sroa.14.0.extract.shift = lshr i32 %4, 16
  %.sroa.18.0.extract.shift = lshr i32 %4, 24
  %5 = and i32 %4, 24
  %or.cond.not = icmp eq i32 %5, 24
  br i1 %or.cond.not, label %6, label %8

6:                                                ; preds = %2
  %7 = and i32 %4, 255
  br label %8

8:                                                ; preds = %2, %6
  %.sroa.0.0.in = phi i32 [ %.sroa.8.0.extract.shift, %6 ], [ %4, %2 ]
  %.sroa.8.0 = phi i32 [ %.sroa.18.0.extract.shift, %6 ], [ %.sroa.14.0.extract.shift, %2 ]
  %.sroa.14.0 = phi i32 [ %.sroa.14.0.extract.shift, %6 ], [ %.sroa.8.0.extract.shift, %2 ]
  %.sroa.18.0 = phi i32 [ %7, %6 ], [ %.sroa.18.0.extract.shift, %2 ]
  %.sroa.18.0.insert.shift43 = shl nuw i32 %.sroa.18.0, 24
  %.sroa.14.0.insert.ext31 = shl i32 %.sroa.14.0, 16
  %.sroa.14.0.insert.shift32 = and i32 %.sroa.14.0.insert.ext31, 16711680
  %.sroa.8.0.insert.ext19 = shl nuw nsw i32 %.sroa.8.0, 8
  %.sroa.8.0.insert.shift20 = and i32 %.sroa.8.0.insert.ext19, 65280
  %.sroa.0.0.insert.ext10 = and i32 %.sroa.0.0.in, 255
  %.sroa.14.0.insert.insert34 = add nuw nsw i32 %.sroa.0.0.insert.ext10, 1100076386
  %.sroa.8.0.insert.insert22 = add nuw nsw i32 %.sroa.14.0.insert.insert34, %.sroa.8.0.insert.shift20
  %.sroa.0.0.insert.insert12 = add nuw nsw i32 %.sroa.8.0.insert.insert22, %.sroa.14.0.insert.shift32
  %9 = add i32 %.sroa.0.0.insert.insert12, %.sroa.18.0.insert.shift43
  store i32 %9, 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