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

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

26:                                               ; preds = %20
  %27 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %28 = load i64, ptr %27, align 8, !tbaa !9
  %29 = lshr i64 %28, 2
  %30 = and i64 %29, 1
  %31 = icmp ne i64 %30, 0
  br i1 %31, label %32, label %43

32:                                               ; preds = %26
  %33 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %36 = load i64, ptr %35, align 8, !tbaa !9
  %37 = add i64 %36, %34
  store i64 %37, ptr %35, align 8, !tbaa !9
  %38 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = add i64 %41, %39
  store i64 %42, ptr %40, align 8, !tbaa !9
  br label %60

43:                                               ; preds = %26
  %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
  %49 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %50 = getelementptr inbounds i16, ptr %49, i64 0
  %51 = load i16, ptr %50, align 2, !tbaa !11
  store i16 %51, ptr %6, align 2, !tbaa !11
  %52 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %53 = getelementptr inbounds i16, ptr %52, i64 1
  %54 = load i16, ptr %53, align 2, !tbaa !11
  %55 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %56 = getelementptr inbounds i16, ptr %55, i64 0
  store i16 %54, ptr %56, align 2, !tbaa !11
  %57 = load i16, ptr %6, align 2, !tbaa !11
  %58 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %59 = getelementptr inbounds i16, ptr %58, i64 1
  store i16 %57, ptr %59, align 2, !tbaa !11
  br label %60

60:                                               ; preds = %43, %32
  br label %89

61:                                               ; preds = %20
  %62 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %63 = load i64, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %65 = load i64, ptr %64, align 8, !tbaa !9
  %66 = add i64 %65, %63
  store i64 %66, ptr %64, align 8, !tbaa !9
  %67 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %68 = getelementptr inbounds i8, ptr %67, i64 0
  %69 = load i8, ptr %68, align 1, !tbaa !13
  store i8 %69, ptr %7, align 1, !tbaa !13
  %70 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %71 = getelementptr inbounds i8, ptr %70, i64 4
  %72 = load i8, ptr %71, align 1, !tbaa !13
  %73 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %74 = getelementptr inbounds i8, ptr %73, i64 0
  store i8 %72, ptr %74, align 1, !tbaa !13
  %75 = load i8, ptr %7, align 1, !tbaa !13
  %76 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %77 = getelementptr inbounds i8, ptr %76, i64 4
  store i8 %75, ptr %77, align 1, !tbaa !13
  %78 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %79 = getelementptr inbounds i8, ptr %78, i64 5
  %80 = load i8, ptr %79, align 1, !tbaa !13
  store i8 %80, ptr %7, align 1, !tbaa !13
  %81 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %82 = getelementptr inbounds i8, ptr %81, i64 7
  %83 = load i8, ptr %82, align 1, !tbaa !13
  %84 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %85 = getelementptr inbounds i8, ptr %84, i64 5
  store i8 %83, ptr %85, align 1, !tbaa !13
  %86 = load i8, ptr %7, align 1, !tbaa !13
  %87 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %88 = getelementptr inbounds i8, ptr %87, i64 7
  store i8 %86, ptr %88, align 1, !tbaa !13
  br label %89

89:                                               ; preds = %61, %60
  br label %118

90:                                               ; preds = %2
  %91 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %92 = load i64, ptr %91, align 8, !tbaa !9
  %93 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %94 = load i64, ptr %93, align 8, !tbaa !9
  %95 = add i64 %94, %92
  store i64 %95, ptr %93, align 8, !tbaa !9
  %96 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %97 = getelementptr inbounds i16, ptr %96, i64 1
  %98 = load i16, ptr %97, align 2, !tbaa !11
  store i16 %98, ptr %8, align 2, !tbaa !11
  %99 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %100 = getelementptr inbounds i16, ptr %99, i64 2
  %101 = load i16, ptr %100, align 2, !tbaa !11
  %102 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %103 = getelementptr inbounds i16, ptr %102, i64 1
  store i16 %101, ptr %103, align 2, !tbaa !11
  %104 = load i16, ptr %8, align 2, !tbaa !11
  %105 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %106 = getelementptr inbounds i16, ptr %105, i64 2
  store i16 %104, ptr %106, align 2, !tbaa !11
  %107 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %108 = getelementptr inbounds i16, ptr %107, i64 2
  %109 = load i16, ptr %108, align 2, !tbaa !11
  store i16 %109, ptr %8, align 2, !tbaa !11
  %110 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %111 = getelementptr inbounds i16, ptr %110, i64 0
  %112 = load i16, ptr %111, align 2, !tbaa !11
  %113 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %114 = getelementptr inbounds i16, ptr %113, i64 2
  store i16 %112, ptr %114, align 2, !tbaa !11
  %115 = load i16, ptr %8, align 2, !tbaa !11
  %116 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %117 = getelementptr inbounds i16, ptr %116, i64 0
  store i16 %115, ptr %117, align 2, !tbaa !11
  br label %118

118:                                              ; preds = %90, %89
  %119 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %120 = load i64, ptr %119, align 8, !tbaa !9
  %121 = add i64 %120, 946399179
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds i64, ptr %122, i64 0
  store i64 %121, ptr %123, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, 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 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 = !{!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 i64, ptr %0, align 8, !tbaa !5
  %4 = add i64 %3, 326104726
  %5 = and i64 %4, 16
  %.not = icmp eq i64 %5, 0
  br i1 %.not, label %17, label %6

6:                                                ; preds = %2
  %7 = and i64 %4, 8
  %.not632 = icmp eq i64 %7, 0
  br i1 %.not632, label %14, label %8

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

10:                                               ; preds = %8
  %11 = shl i64 %4, 2
  %.sroa.0.sroa.28.0.extract.shift586643 = lshr i64 %11, 8
  %.sroa.28.0.extract.shift97 = lshr i64 %11, 16
  %.sroa.32.0.extract.shift173 = lshr i64 %11, 32
  %.sroa.32.sroa.28.0.extract.shift448644 = lshr i64 %11, 40
  %.sroa.40294.0.extract.shift327 = lshr i64 %11, 56
  br label %19

12:                                               ; preds = %8
  %13 = shl i64 %4, 1
  %.sroa.28.0.extract.shift109 = lshr i64 %13, 16
  %.sroa.32.0.extract.shift185 = lshr i64 %13, 32
  %.sroa.32.sroa.28.0.extract.shift458637 = lshr i64 %13, 40
  %.sroa.40294.0.extract.shift339 = lshr i64 %13, 56
  %.sroa.0.sroa.0.0.insert.insert = and i64 %13, 65526
  %.sroa.0.sroa.28.0.extract.shift638 = lshr i64 %13, 24
  br label %19

14:                                               ; preds = %6
  %15 = shl i64 %4, 1
  %.sroa.0.sroa.28.0.extract.shift606633 = lshr i64 %15, 8
  %.sroa.28.0.extract.shift121 = lshr i64 %15, 16
  %.sroa.32.0.extract.shift197 = lshr i64 %15, 32
  %.sroa.32.sroa.28.0.extract.shift468634 = lshr i64 %15, 40
  %.sroa.40294.0.extract.shift351 = lshr i64 %15, 56
  %16 = and i64 %.sroa.32.sroa.28.0.extract.shift468634, 255
  br label %19

17:                                               ; preds = %2
  %18 = shl i64 %4, 1
  %.sroa.28.0.extract.shift133 = lshr i64 %18, 16
  %.sroa.32.0.extract.shift209 = lshr i64 %18, 32
  %.sroa.40294.0.extract.shift363 = lshr i64 %18, 56
  %.sroa.32.sroa.0.0.insert.insert416 = and i64 %.sroa.32.0.extract.shift209, 65535
  %.sroa.32.sroa.28.0.extract.shift494630 = lshr i64 %18, 8
  %sum.shift = lshr i64 %18, 24
  br label %19

19:                                               ; preds = %14, %12, %10, %17
  %.sroa.32.sroa.0.0.in = phi i64 [ %.sroa.32.0.extract.shift173, %10 ], [ %.sroa.32.0.extract.shift185, %12 ], [ %15, %14 ], [ %18, %17 ]
  %.sroa.40294.0.in = phi i64 [ %.sroa.40294.0.extract.shift327, %10 ], [ %.sroa.40294.0.extract.shift339, %12 ], [ %16, %14 ], [ %.sroa.40294.0.extract.shift363, %17 ]
  %.sroa.40.0.in.in = phi i64 [ %11, %10 ], [ %13, %12 ], [ %15, %14 ], [ %18, %17 ]
  %.sroa.28.0 = phi i64 [ %.sroa.28.0.extract.shift97, %10 ], [ %.sroa.0.sroa.0.0.insert.insert, %12 ], [ %.sroa.28.0.extract.shift121, %14 ], [ %.sroa.32.sroa.0.0.insert.insert416, %17 ]
  %.sroa.32.sroa.28.0.in = phi i64 [ %.sroa.32.sroa.28.0.extract.shift448644, %10 ], [ %.sroa.32.sroa.28.0.extract.shift458637, %12 ], [ %.sroa.40294.0.extract.shift351, %14 ], [ %.sroa.32.sroa.28.0.extract.shift494630, %17 ]
  %.sroa.0.sroa.0.0.in = phi i64 [ %11, %10 ], [ %.sroa.28.0.extract.shift109, %12 ], [ %.sroa.32.0.extract.shift197, %14 ], [ %.sroa.28.0.extract.shift133, %17 ]
  %.sroa.0.sroa.28.0.in = phi i64 [ %.sroa.0.sroa.28.0.extract.shift586643, %10 ], [ %.sroa.0.sroa.28.0.extract.shift638, %12 ], [ %.sroa.0.sroa.28.0.extract.shift606633, %14 ], [ %sum.shift, %17 ]
  %.sroa.0.sroa.28.0.insert.ext618 = shl nuw i64 %.sroa.0.sroa.28.0.in, 8
  %.sroa.0.sroa.0.0.insert.ext545 = and i64 %.sroa.0.sroa.0.0.in, 255
  %.sroa.32.sroa.28.0.insert.ext480 = shl nuw i64 %.sroa.32.sroa.28.0.in, 8
  %.sroa.32.sroa.0.0.insert.ext411 = and i64 %.sroa.32.sroa.0.0.in, 255
  %.sroa.40294.0.insert.shift367 = shl nuw i64 %.sroa.40294.0.in, 56
  %.sroa.40.0.insert.ext290 = and i64 %.sroa.40.0.in.in, 71776119061217280
  %.sroa.32.sroa.28.0.insert.ext480.masked = and i64 %.sroa.32.sroa.28.0.insert.ext480, 65280
  %.sroa.32.0.insert.ext212 = or disjoint i64 %.sroa.32.sroa.28.0.insert.ext480.masked, %.sroa.32.sroa.0.0.insert.ext411
  %.sroa.32.0.insert.shift213 = shl nuw nsw i64 %.sroa.32.0.insert.ext212, 32
  %.sroa.28.0.insert.ext136 = shl nuw i64 %.sroa.28.0, 16
  %.sroa.28.0.insert.shift137 = and i64 %.sroa.28.0.insert.ext136, 4294901760
  %.sroa.0.sroa.28.0.insert.ext618.masked = and i64 %.sroa.0.sroa.28.0.insert.ext618, 65280
  %.sroa.0.0.insert.ext62 = or disjoint i64 %.sroa.0.sroa.0.0.insert.ext545, %.sroa.0.sroa.28.0.insert.ext618.masked
  %.sroa.40.0.insert.insert293 = or disjoint i64 %.sroa.40294.0.insert.shift367, %.sroa.40.0.insert.ext290
  %.sroa.32.0.insert.insert215 = or disjoint i64 %.sroa.40.0.insert.insert293, 946399179
  %.sroa.28.0.insert.insert139 = add nuw nsw i64 %.sroa.32.0.insert.insert215, %.sroa.28.0.insert.shift137
  %.sroa.0.0.insert.insert64 = add i64 %.sroa.28.0.insert.insert139, %.sroa.32.0.insert.shift213
  %20 = add i64 %.sroa.0.0.insert.insert64, %.sroa.0.0.insert.ext62
  store i64 %20, 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: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass