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

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

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

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

48:                                               ; preds = %37, %26
  br label %124

49:                                               ; preds = %2
  %50 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %52 = lshr i32 %51, 3
  %53 = and i32 %52, 1
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %100

55:                                               ; preds = %49
  %56 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %57 = getelementptr inbounds i16, ptr %56, i64 1
  %58 = load i16, ptr %57, align 2, !tbaa !11
  store i16 %58, ptr %6, align 2, !tbaa !11
  %59 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %60 = getelementptr inbounds i16, ptr %59, i64 0
  %61 = load i16, ptr %60, align 2, !tbaa !11
  %62 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %63 = getelementptr inbounds i16, ptr %62, i64 1
  store i16 %61, ptr %63, align 2, !tbaa !11
  %64 = load i16, ptr %6, align 2, !tbaa !11
  %65 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %66 = getelementptr inbounds i16, ptr %65, i64 0
  store i16 %64, ptr %66, align 2, !tbaa !11
  %67 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %68 = getelementptr inbounds i16, ptr %67, i64 0
  %69 = load i16, ptr %68, align 2, !tbaa !11
  store i16 %69, ptr %6, align 2, !tbaa !11
  %70 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %71 = getelementptr inbounds i16, ptr %70, i64 1
  %72 = load i16, ptr %71, align 2, !tbaa !11
  %73 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %74 = getelementptr inbounds i16, ptr %73, i64 0
  store i16 %72, ptr %74, align 2, !tbaa !11
  %75 = load i16, ptr %6, align 2, !tbaa !11
  %76 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %77 = getelementptr inbounds i16, ptr %76, i64 1
  store i16 %75, ptr %77, align 2, !tbaa !11
  %78 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %79 = getelementptr inbounds i8, ptr %78, i64 1
  %80 = load i8, ptr %79, align 1, !tbaa !13
  store i8 %80, ptr %7, align 1, !tbaa !13
  %81 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %82 = getelementptr inbounds i8, ptr %81, i64 2
  %83 = load i8, ptr %82, align 1, !tbaa !13
  %84 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %85 = getelementptr inbounds i8, ptr %84, i64 1
  store i8 %83, ptr %85, align 1, !tbaa !13
  %86 = load i8, ptr %7, align 1, !tbaa !13
  %87 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %88 = getelementptr inbounds i8, ptr %87, i64 2
  store i8 %86, ptr %88, align 1, !tbaa !13
  %89 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %90 = getelementptr inbounds i8, ptr %89, i64 3
  %91 = load i8, ptr %90, align 1, !tbaa !13
  store i8 %91, ptr %7, align 1, !tbaa !13
  %92 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %93 = getelementptr inbounds i8, ptr %92, i64 0
  %94 = load i8, ptr %93, align 1, !tbaa !13
  %95 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %96 = getelementptr inbounds i8, ptr %95, i64 3
  store i8 %94, ptr %96, align 1, !tbaa !13
  %97 = load i8, ptr %7, align 1, !tbaa !13
  %98 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %99 = getelementptr inbounds i8, ptr %98, i64 0
  store i8 %97, ptr %99, align 1, !tbaa !13
  br label %123

100:                                              ; preds = %49
  %101 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %102 = getelementptr inbounds i8, ptr %101, i64 3
  %103 = load i8, ptr %102, align 1, !tbaa !13
  store i8 %103, ptr %8, align 1, !tbaa !13
  %104 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %105 = getelementptr inbounds i8, ptr %104, i64 1
  %106 = load i8, ptr %105, align 1, !tbaa !13
  %107 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %108 = getelementptr inbounds i8, ptr %107, i64 3
  store i8 %106, ptr %108, align 1, !tbaa !13
  %109 = load i8, ptr %8, align 1, !tbaa !13
  %110 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %111 = getelementptr inbounds i8, ptr %110, i64 1
  store i8 %109, ptr %111, align 1, !tbaa !13
  %112 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %113 = getelementptr inbounds i8, ptr %112, i64 3
  %114 = load i8, ptr %113, align 1, !tbaa !13
  store i8 %114, ptr %9, align 1, !tbaa !13
  %115 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %116 = getelementptr inbounds i8, ptr %115, i64 0
  %117 = load i8, ptr %116, align 1, !tbaa !13
  %118 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %119 = getelementptr inbounds i8, ptr %118, i64 3
  store i8 %117, ptr %119, align 1, !tbaa !13
  %120 = load i8, ptr %9, align 1, !tbaa !13
  %121 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %122 = getelementptr inbounds i8, ptr %121, i64 0
  store i8 %120, ptr %122, align 1, !tbaa !13
  br label %123

123:                                              ; preds = %100, %55
  br label %124

124:                                              ; preds = %123, %48
  %125 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %126 = load i32, ptr %125, align 4, !tbaa !9
  %127 = or i32 %126, 1904639456
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds i32, ptr %128, i64 0
  store i32 %127, ptr %129, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #2
  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 2, 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 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!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
  %.not246 = icmp eq i32 %7, 0
  %8 = lshr i32 %4, 1
  br i1 %.not246, label %13, label %9

9:                                                ; preds = %6
  %10 = and i32 %8, 6
  %11 = or disjoint i32 %10, 1
  %12 = shl i32 %4, %11
  %.sroa.0.sroa.21.0.extract.shift222250 = lshr i32 %12, 8
  %.sroa.25.0.extract.shift59 = lshr i32 %12, 16
  %sum.shift251 = lshr i32 %12, 24
  br label %19

13:                                               ; preds = %6
  %14 = and i32 %8, 4
  %15 = or disjoint i32 %14, 1
  %16 = lshr i32 %4, %15
  %.sroa.0.sroa.21.0.extract.shift232247 = lshr i32 %16, 8
  %.sroa.25.0.extract.shift71 = lshr i32 %16, 16
  %sum.shift248 = lshr i32 %16, 24
  br label %19

17:                                               ; preds = %2
  %sum.shift = lshr i32 %4, 24
  %.sroa.25.0.extract.shift = lshr i32 %4, 16
  %.sroa.0.sroa.21.0.extract.shift204243 = lshr i32 %4, 8
  %18 = and i32 %4, 8
  %.not245 = icmp eq i32 %18, 0
  %.sroa.25.0.extract.shift..sroa.0.sroa.21.0.extract.shift204243 = select i1 %.not245, i32 %.sroa.25.0.extract.shift, i32 %.sroa.0.sroa.21.0.extract.shift204243
  %.sroa.0.sroa.21.0.extract.shift204243.sum.shift = select i1 %.not245, i32 %.sroa.0.sroa.21.0.extract.shift204243, i32 %sum.shift
  %sum.shift..sroa.25.0.extract.shift = select i1 %.not245, i32 %sum.shift, i32 %.sroa.25.0.extract.shift
  br label %19

19:                                               ; preds = %17, %9, %13
  %.sroa.25.sroa.0.0.in = phi i32 [ %.sroa.25.0.extract.shift59, %9 ], [ %.sroa.25.0.extract.shift71, %13 ], [ %.sroa.25.0.extract.shift..sroa.0.sroa.21.0.extract.shift204243, %17 ]
  %.sroa.25.sroa.19.0.in = phi i32 [ %sum.shift251, %9 ], [ %sum.shift248, %13 ], [ %4, %17 ]
  %.sroa.0.sroa.0.0.in = phi i32 [ %12, %9 ], [ %16, %13 ], [ %.sroa.0.sroa.21.0.extract.shift204243.sum.shift, %17 ]
  %.sroa.0.sroa.21.0.in = phi i32 [ %.sroa.0.sroa.21.0.extract.shift222250, %9 ], [ %.sroa.0.sroa.21.0.extract.shift232247, %13 ], [ %sum.shift..sroa.25.0.extract.shift, %17 ]
  %.sroa.0.sroa.21.0.insert.ext238 = shl nuw i32 %.sroa.0.sroa.21.0.in, 8
  %.sroa.0.sroa.0.0.insert.ext195 = and i32 %.sroa.0.sroa.0.0.in, 31
  %.sroa.25.sroa.19.0.insert.ext151 = shl i32 %.sroa.25.sroa.19.0.in, 8
  %.sroa.25.sroa.0.0.insert.ext112 = and i32 %.sroa.25.sroa.0.0.in, 121
  %.sroa.25.sroa.19.0.insert.ext151.masked = and i32 %.sroa.25.sroa.19.0.insert.ext151, 36352
  %.sroa.25.0.insert.ext79 = or disjoint i32 %.sroa.25.sroa.19.0.insert.ext151.masked, %.sroa.25.sroa.0.0.insert.ext112
  %.sroa.25.0.insert.shift80 = shl nuw i32 %.sroa.25.0.insert.ext79, 16
  %.sroa.0.sroa.21.0.insert.ext238.masked = and i32 %.sroa.0.sroa.21.0.insert.ext238, 33280
  %.sroa.0.0.insert.ext37 = or disjoint i32 %.sroa.0.sroa.0.0.insert.ext195, %.sroa.0.sroa.21.0.insert.ext238.masked
  %.sroa.0.0.insert.insert39 = or disjoint i32 %.sroa.0.0.insert.ext37, %.sroa.25.0.insert.shift80
  %20 = or disjoint i32 %.sroa.0.0.insert.insert39, 1904639456
  store i32 %20, 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