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

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

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

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

44:                                               ; preds = %27
  %45 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %46 = load i64, ptr %45, align 8, !tbaa !9
  %47 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %48 = load i64, ptr %47, align 8, !tbaa !9
  %49 = add i64 %48, %46
  store i64 %49, ptr %47, align 8, !tbaa !9
  %50 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %51 = getelementptr inbounds i16, ptr %50, i64 0
  %52 = load i16, ptr %51, align 2, !tbaa !11
  store i16 %52, ptr %6, align 2, !tbaa !11
  %53 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %54 = getelementptr inbounds i16, ptr %53, i64 1
  %55 = load i16, ptr %54, align 2, !tbaa !11
  %56 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %57 = getelementptr inbounds i16, ptr %56, i64 0
  store i16 %55, ptr %57, align 2, !tbaa !11
  %58 = load i16, ptr %6, align 2, !tbaa !11
  %59 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %60 = getelementptr inbounds i16, ptr %59, i64 1
  store i16 %58, ptr %60, align 2, !tbaa !11
  br label %61

61:                                               ; preds = %44, %33
  br label %86

62:                                               ; preds = %21
  %63 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %64 = load i64, ptr %63, align 8, !tbaa !9
  %65 = lshr i64 %64, 1
  %66 = and i64 %65, 1
  %67 = icmp ne i64 %66, 0
  br i1 %67, label %85, label %68

68:                                               ; preds = %62
  %69 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %70 = load i64, ptr %69, align 8, !tbaa !9
  %71 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %72 = load i64, ptr %71, align 8, !tbaa !9
  %73 = add i64 %72, %70
  store i64 %73, ptr %71, align 8, !tbaa !9
  %74 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %75 = getelementptr inbounds i16, ptr %74, i64 2
  %76 = load i16, ptr %75, align 2, !tbaa !11
  store i16 %76, ptr %7, align 2, !tbaa !11
  %77 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %78 = getelementptr inbounds i16, ptr %77, i64 3
  %79 = load i16, ptr %78, align 2, !tbaa !11
  %80 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %81 = getelementptr inbounds i16, ptr %80, i64 2
  store i16 %79, ptr %81, align 2, !tbaa !11
  %82 = load i16, ptr %7, align 2, !tbaa !11
  %83 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %84 = getelementptr inbounds i16, ptr %83, i64 3
  store i16 %82, ptr %84, align 2, !tbaa !11
  br label %85

85:                                               ; preds = %68, %62
  br label %86

86:                                               ; preds = %85, %61
  br label %121

87:                                               ; preds = %2
  %88 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %89 = getelementptr inbounds i16, ptr %88, i64 0
  %90 = load i16, ptr %89, align 2, !tbaa !11
  store i16 %90, ptr %8, align 2, !tbaa !11
  %91 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %92 = getelementptr inbounds i16, ptr %91, i64 2
  %93 = load i16, ptr %92, align 2, !tbaa !11
  %94 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %95 = getelementptr inbounds i16, ptr %94, i64 0
  store i16 %93, ptr %95, align 2, !tbaa !11
  %96 = load i16, ptr %8, align 2, !tbaa !11
  %97 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %98 = getelementptr inbounds i16, ptr %97, i64 2
  store i16 %96, ptr %98, 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
  store i16 %101, ptr %8, align 2, !tbaa !11
  %102 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %103 = getelementptr inbounds i16, ptr %102, i64 3
  %104 = load i16, ptr %103, 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 = load i16, ptr %8, align 2, !tbaa !11
  %108 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %109 = getelementptr inbounds i16, ptr %108, i64 3
  store i16 %107, ptr %109, align 2, !tbaa !11
  %110 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %111 = getelementptr inbounds i8, ptr %110, i64 0
  %112 = load i8, ptr %111, align 1, !tbaa !13
  store i8 %112, ptr %9, align 1, !tbaa !13
  %113 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %114 = getelementptr inbounds i8, ptr %113, i64 1
  %115 = load i8, ptr %114, align 1, !tbaa !13
  %116 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %117 = getelementptr inbounds i8, ptr %116, i64 0
  store i8 %115, ptr %117, align 1, !tbaa !13
  %118 = load i8, ptr %9, align 1, !tbaa !13
  %119 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %120 = getelementptr inbounds i8, ptr %119, i64 1
  store i8 %118, ptr %120, align 1, !tbaa !13
  br label %121

121:                                              ; preds = %87, %86
  %122 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %123 = load i64, ptr %122, align 8, !tbaa !9
  %124 = add i64 %123, 638614615
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = getelementptr inbounds i64, ptr %125, i64 0
  store i64 %124, ptr %126, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 2, 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.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 = !{!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
  %.sroa.0.sroa.26.0.extract.shift322385 = lshr i64 %4, 8
  %.sroa.28.0.extract.shift = lshr i64 %4, 16
  %.sroa.30.0.extract.shift = lshr i64 %4, 32
  %.sroa.36.0.extract.shift = lshr i64 %4, 48
  %.sroa.36.0.extract.trunc = trunc nuw i64 %.sroa.36.0.extract.shift to i16
  %5 = trunc i64 %.sroa.0.sroa.26.0.extract.shift322385 to i16
  %.sroa.0.sroa.26.0.insert.ext324 = shl i16 %5, 8
  %6 = trunc i64 %4 to i16
  %.sroa.0.sroa.0.0.insert.ext273 = and i16 %6, 255
  %.sroa.0.sroa.0.0.insert.insert275 = or disjoint i16 %.sroa.0.sroa.26.0.insert.ext324, %.sroa.0.sroa.0.0.insert.ext273
  %.sroa.28.0.insert.insert = and i64 %4, -65536
  %.sroa.0.0.insert.ext = zext i16 %.sroa.0.sroa.0.0.insert.insert275 to i64
  %.sroa.0.0.insert.insert = or disjoint i64 %.sroa.28.0.insert.insert, %.sroa.0.0.insert.ext
  %7 = and i64 %.sroa.0.0.insert.ext, 16
  %.not = icmp eq i64 %7, 0
  br i1 %.not, label %20, label %8

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

10:                                               ; preds = %8
  %11 = and i64 %.sroa.0.0.insert.ext, 4
  %.not390 = icmp eq i64 %11, 0
  br i1 %.not390, label %14, label %12

12:                                               ; preds = %10
  %13 = shl i64 %.sroa.0.0.insert.insert, 2
  %.sroa.0.sroa.26.0.extract.shift354394 = lshr i64 %13, 8
  %.sroa.28.0.extract.shift93 = lshr i64 %13, 16
  %.sroa.30.0.extract.shift161 = lshr i64 %13, 32
  %.sroa.36.0.extract.shift231 = lshr i64 %13, 48
  %.sroa.36.0.extract.trunc232 = trunc nuw i64 %.sroa.36.0.extract.shift231 to i16
  br label %21

14:                                               ; preds = %10
  %15 = shl i64 %.sroa.0.0.insert.insert, 1
  %.sroa.28.0.extract.shift105 = lshr i64 %15, 16
  %.sroa.30.0.extract.shift173 = lshr i64 %15, 32
  %.sroa.36.0.extract.shift243 = lshr i64 %15, 48
  %.sroa.36.0.extract.trunc244 = trunc nuw i64 %.sroa.36.0.extract.shift243 to i16
  %.sroa.0.sroa.0.0.insert.insert = and i64 %15, 65526
  %.sroa.0.sroa.26.0.extract.shift392 = lshr i64 %15, 24
  br label %21

16:                                               ; preds = %8
  %17 = and i64 %.sroa.0.0.insert.ext, 2
  %.not388 = icmp eq i64 %17, 0
  br i1 %.not388, label %18, label %21

18:                                               ; preds = %16
  %19 = shl i64 %.sroa.0.0.insert.insert, 1
  %.sroa.0.sroa.26.0.extract.shift378389 = lshr i64 %19, 8
  %.sroa.28.0.extract.shift122 = lshr i64 %19, 16
  %.sroa.30.0.extract.shift190 = lshr i64 %19, 32
  %.sroa.30.0.extract.trunc191 = trunc i64 %.sroa.30.0.extract.shift190 to i16
  %.sroa.36.0.extract.shift260 = lshr i64 %19, 48
  br label %21

20:                                               ; preds = %2
  %.sroa.0.sroa.26.0.extract.shift320386 = lshr i64 %4, 40
  br label %21

21:                                               ; preds = %14, %12, %18, %16, %20
  %.sroa.28.0 = phi i64 [ %.sroa.28.0.extract.shift93, %12 ], [ %.sroa.0.sroa.0.0.insert.insert, %14 ], [ %.sroa.28.0.extract.shift, %16 ], [ %.sroa.28.0.extract.shift122, %18 ], [ %.sroa.28.0.extract.shift, %20 ]
  %.sroa.30.0 = phi i64 [ %.sroa.30.0.extract.shift161, %12 ], [ %.sroa.30.0.extract.shift173, %14 ], [ %.sroa.30.0.extract.shift, %16 ], [ %.sroa.36.0.extract.shift260, %18 ], [ %.sroa.36.0.extract.shift, %20 ]
  %.sroa.36.0 = phi i16 [ %.sroa.36.0.extract.trunc232, %12 ], [ %.sroa.36.0.extract.trunc244, %14 ], [ %.sroa.36.0.extract.trunc, %16 ], [ %.sroa.30.0.extract.trunc191, %18 ], [ %.sroa.0.sroa.0.0.insert.insert275, %20 ]
  %.sroa.0.sroa.0.0.in = phi i64 [ %13, %12 ], [ %.sroa.28.0.extract.shift105, %14 ], [ %4, %16 ], [ %19, %18 ], [ %.sroa.0.sroa.26.0.extract.shift320386, %20 ]
  %.sroa.0.sroa.26.0.in = phi i64 [ %.sroa.0.sroa.26.0.extract.shift354394, %12 ], [ %.sroa.0.sroa.26.0.extract.shift392, %14 ], [ %.sroa.0.sroa.26.0.extract.shift322385, %16 ], [ %.sroa.0.sroa.26.0.extract.shift378389, %18 ], [ %.sroa.30.0.extract.shift, %20 ]
  %.sroa.0.sroa.26.0.insert.ext380 = shl nuw i64 %.sroa.0.sroa.26.0.in, 8
  %.sroa.0.sroa.0.0.insert.ext313 = and i64 %.sroa.0.sroa.0.0.in, 255
  %.sroa.36.0.insert.ext263 = zext i16 %.sroa.36.0 to i64
  %.sroa.36.0.insert.shift264 = shl nuw i64 %.sroa.36.0.insert.ext263, 48
  %.sroa.30.0.insert.ext193 = shl nuw i64 %.sroa.30.0, 32
  %.sroa.30.0.insert.shift194 = and i64 %.sroa.30.0.insert.ext193, 281470681743360
  %.sroa.28.0.insert.ext125 = shl nuw i64 %.sroa.28.0, 16
  %.sroa.28.0.insert.shift126 = and i64 %.sroa.28.0.insert.ext125, 4294901760
  %.sroa.0.sroa.26.0.insert.ext380.masked = and i64 %.sroa.0.sroa.26.0.insert.ext380, 65280
  %.sroa.0.0.insert.ext57 = or disjoint i64 %.sroa.0.sroa.0.0.insert.ext313, %.sroa.0.sroa.26.0.insert.ext380.masked
  %.sroa.30.0.insert.insert196 = add nuw nsw i64 %.sroa.28.0.insert.shift126, 638614615
  %.sroa.28.0.insert.insert128 = add nuw nsw i64 %.sroa.30.0.insert.insert196, %.sroa.30.0.insert.shift194
  %.sroa.0.0.insert.insert59 = add i64 %.sroa.28.0.insert.insert128, %.sroa.36.0.insert.shift264
  %22 = add i64 %.sroa.0.0.insert.insert59, %.sroa.0.0.insert.ext57
  store i64 %22, 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: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass