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

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

28:                                               ; preds = %23
  %29 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %30 = load i64, ptr %29, align 8, !tbaa !9
  %31 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %32 = load i64, ptr %31, align 8, !tbaa !9
  %33 = add i64 %32, %30
  store i64 %33, ptr %31, align 8, !tbaa !9
  %34 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %35 = getelementptr inbounds i32, ptr %34, i64 0
  %36 = load i32, ptr %35, align 4, !tbaa !11
  store i32 %36, ptr %6, align 4, !tbaa !11
  %37 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %38 = getelementptr inbounds i32, ptr %37, i64 1
  %39 = load i32, ptr %38, align 4, !tbaa !11
  %40 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %41 = getelementptr inbounds i32, ptr %40, i64 0
  store i32 %39, ptr %41, align 4, !tbaa !11
  %42 = load i32, ptr %6, align 4, !tbaa !11
  %43 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %44 = getelementptr inbounds i32, ptr %43, i64 1
  store i32 %42, ptr %44, align 4, !tbaa !11
  br label %68

45:                                               ; preds = %23
  %46 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %47 = getelementptr inbounds i8, ptr %46, i64 2
  %48 = load i8, ptr %47, align 1, !tbaa !13
  store i8 %48, ptr %7, align 1, !tbaa !13
  %49 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %50 = getelementptr inbounds i8, ptr %49, i64 7
  %51 = load i8, ptr %50, align 1, !tbaa !13
  %52 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %53 = getelementptr inbounds i8, ptr %52, i64 2
  store i8 %51, ptr %53, align 1, !tbaa !13
  %54 = load i8, ptr %7, align 1, !tbaa !13
  %55 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %56 = getelementptr inbounds i8, ptr %55, i64 7
  store i8 %54, ptr %56, align 1, !tbaa !13
  %57 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %58 = getelementptr inbounds i8, ptr %57, i64 1
  %59 = load i8, ptr %58, align 1, !tbaa !13
  store i8 %59, ptr %8, align 1, !tbaa !13
  %60 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %61 = getelementptr inbounds i8, ptr %60, i64 2
  %62 = load i8, ptr %61, align 1, !tbaa !13
  %63 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %64 = getelementptr inbounds i8, ptr %63, i64 1
  store i8 %62, ptr %64, align 1, !tbaa !13
  %65 = load i8, ptr %8, align 1, !tbaa !13
  %66 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %67 = getelementptr inbounds i8, ptr %66, i64 2
  store i8 %65, ptr %67, align 1, !tbaa !13
  br label %68

68:                                               ; preds = %45, %28
  br label %133

69:                                               ; preds = %2
  %70 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %71 = load i64, ptr %70, align 8, !tbaa !9
  %72 = lshr i64 %71, 3
  %73 = and i64 %72, 1
  %74 = icmp ne i64 %73, 0
  br i1 %74, label %75, label %109

75:                                               ; preds = %69
  %76 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %77 = getelementptr inbounds i32, ptr %76, i64 0
  %78 = load i32, ptr %77, align 4, !tbaa !11
  store i32 %78, ptr %9, align 4, !tbaa !11
  %79 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %80 = getelementptr inbounds i32, ptr %79, i64 1
  %81 = load i32, ptr %80, align 4, !tbaa !11
  %82 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %83 = getelementptr inbounds i32, ptr %82, i64 0
  store i32 %81, ptr %83, align 4, !tbaa !11
  %84 = load i32, ptr %9, align 4, !tbaa !11
  %85 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %86 = getelementptr inbounds i32, ptr %85, i64 1
  store i32 %84, ptr %86, align 4, !tbaa !11
  %87 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %88 = getelementptr inbounds i8, ptr %87, i64 0
  %89 = load i8, ptr %88, align 1, !tbaa !13
  store i8 %89, ptr %10, align 1, !tbaa !13
  %90 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %91 = getelementptr inbounds i8, ptr %90, i64 3
  %92 = load i8, ptr %91, align 1, !tbaa !13
  %93 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %94 = getelementptr inbounds i8, ptr %93, i64 0
  store i8 %92, ptr %94, align 1, !tbaa !13
  %95 = load i8, ptr %10, align 1, !tbaa !13
  %96 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %97 = getelementptr inbounds i8, ptr %96, i64 3
  store i8 %95, ptr %97, align 1, !tbaa !13
  %98 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %99 = getelementptr inbounds i8, ptr %98, i64 5
  %100 = load i8, ptr %99, align 1, !tbaa !13
  store i8 %100, ptr %10, align 1, !tbaa !13
  %101 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %102 = getelementptr inbounds i8, ptr %101, i64 7
  %103 = load i8, ptr %102, align 1, !tbaa !13
  %104 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %105 = getelementptr inbounds i8, ptr %104, i64 5
  store i8 %103, ptr %105, align 1, !tbaa !13
  %106 = load i8, ptr %10, align 1, !tbaa !13
  %107 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %108 = getelementptr inbounds i8, ptr %107, i64 7
  store i8 %106, ptr %108, align 1, !tbaa !13
  br label %132

109:                                              ; preds = %69
  %110 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %111 = getelementptr inbounds i16, ptr %110, i64 2
  %112 = load i16, ptr %111, align 2, !tbaa !14
  store i16 %112, ptr %11, align 2, !tbaa !14
  %113 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %114 = getelementptr inbounds i16, ptr %113, i64 1
  %115 = load i16, ptr %114, align 2, !tbaa !14
  %116 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %117 = getelementptr inbounds i16, ptr %116, i64 2
  store i16 %115, ptr %117, align 2, !tbaa !14
  %118 = load i16, ptr %11, align 2, !tbaa !14
  %119 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %120 = getelementptr inbounds i16, ptr %119, i64 1
  store i16 %118, ptr %120, align 2, !tbaa !14
  %121 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %122 = getelementptr inbounds i16, ptr %121, i64 0
  %123 = load i16, ptr %122, align 2, !tbaa !14
  store i16 %123, ptr %12, align 2, !tbaa !14
  %124 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %125 = getelementptr inbounds i16, ptr %124, i64 2
  %126 = load i16, ptr %125, align 2, !tbaa !14
  %127 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %128 = getelementptr inbounds i16, ptr %127, i64 0
  store i16 %126, ptr %128, align 2, !tbaa !14
  %129 = load i16, ptr %12, align 2, !tbaa !14
  %130 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %131 = getelementptr inbounds i16, ptr %130, i64 2
  store i16 %129, ptr %131, align 2, !tbaa !14
  br label %132

132:                                              ; preds = %109, %75
  br label %133

133:                                              ; preds = %132, %68
  %134 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %135 = load i64, ptr %134, align 8, !tbaa !9
  %136 = add i64 %135, 622214515
  %137 = sub i64 %136, -397231775
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds i64, ptr %138, i64 0
  store i64 %137, ptr %139, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 4, 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 4, 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 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"short", !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 = mul i64 %3, 67330564296145686
  %5 = add i64 %4, -2350340661842412260
  %.sroa.0.sroa.20.0.extract.shift280447 = lshr i64 %5, 16
  %.sroa.28.0.extract.shift = lshr i64 %5, 32
  %.sroa.28.sroa.20.0.extract.shift450 = lshr i64 %5, 48
  %sum.shift = lshr i64 %5, 56
  %6 = and i64 %5, 8
  %.not = icmp eq i64 %6, 0
  %.sroa.0.sroa.20.sroa.20.0.extract.shift375455 = lshr i64 %5, 40
  br i1 %.not, label %8, label %7

7:                                                ; preds = %2
  %.sroa.28.sroa.0.sroa.18.0.extract.shift247462 = lshr i64 %5, 8
  %.sroa.28.sroa.20136.0.extract.shift169463 = lshr i64 %5, 24
  br label %10

8:                                                ; preds = %2
  %sum.shift458 = lshr i64 %5, 24
  %.sroa.28.sroa.0.sroa.18.0.extract.shift207460 = lshr i64 %5, 8
  %9 = and i64 %.sroa.0.sroa.20.0.extract.shift280447, 255
  br label %10

10:                                               ; preds = %7, %8
  %.sroa.28.sroa.20.0 = phi i64 [ %.sroa.0.sroa.20.0.extract.shift280447, %7 ], [ %.sroa.28.sroa.20.0.extract.shift450, %8 ]
  %.sroa.28.sroa.20136.0 = phi i64 [ %.sroa.28.sroa.0.sroa.18.0.extract.shift247462, %7 ], [ %sum.shift, %8 ]
  %.sroa.28.sroa.0.sroa.18.0 = phi i64 [ %.sroa.28.sroa.20136.0.extract.shift169463, %7 ], [ %.sroa.28.sroa.0.sroa.18.0.extract.shift207460, %8 ]
  %.sroa.0.sroa.20.sroa.0.0 = phi i64 [ %.sroa.28.sroa.20.0.extract.shift450, %7 ], [ %.sroa.28.0.extract.shift, %8 ]
  %.sroa.0.sroa.20.sroa.20.0 = phi i64 [ %.sroa.28.0.extract.shift, %7 ], [ %.sroa.0.sroa.20.sroa.20.0.extract.shift375455, %8 ]
  %.sroa.0.sroa.0.sroa.0.0 = phi i64 [ %sum.shift, %7 ], [ %9, %8 ]
  %.sroa.0.sroa.0.sroa.18.0 = phi i64 [ %.sroa.0.sroa.20.sroa.20.0.extract.shift375455, %7 ], [ %sum.shift458, %8 ]
  %.sroa.0.sroa.0.sroa.18.0.insert.ext441 = shl nuw nsw i64 %.sroa.0.sroa.0.sroa.18.0, 8
  %.sroa.0.sroa.20.sroa.20.0.insert.ext367 = shl nuw nsw i64 %.sroa.0.sroa.20.sroa.20.0, 8
  %.sroa.0.sroa.20.sroa.0.0.insert.ext330 = and i64 %.sroa.0.sroa.20.sroa.0.0, 255
  %.sroa.0.sroa.20.sroa.20.0.insert.ext367.masked = and i64 %.sroa.0.sroa.20.sroa.20.0.insert.ext367, 65280
  %.sroa.0.sroa.20.0.insert.ext304 = or disjoint i64 %.sroa.0.sroa.20.sroa.20.0.insert.ext367.masked, %.sroa.0.sroa.20.sroa.0.0.insert.ext330
  %.sroa.0.sroa.20.0.insert.shift305 = shl nuw nsw i64 %.sroa.0.sroa.20.0.insert.ext304, 16
  %.sroa.0.sroa.0.sroa.18.0.insert.ext441.masked = and i64 %.sroa.0.sroa.0.sroa.18.0.insert.ext441, 65280
  %.sroa.0.sroa.0.0.insert.ext270 = or disjoint i64 %.sroa.0.sroa.0.sroa.0.0, %.sroa.0.sroa.0.sroa.18.0.insert.ext441.masked
  %.sroa.28.sroa.0.sroa.18.0.insert.ext233 = shl nuw i64 %.sroa.28.sroa.0.sroa.18.0, 8
  %.sroa.28.sroa.0.sroa.0.0.insert.ext192 = and i64 %5, 254
  %.sroa.28.sroa.20136.0.insert.ext155 = shl i64 %.sroa.28.sroa.20136.0, 24
  %.sroa.28.sroa.20.0.insert.ext120 = shl nuw i64 %.sroa.28.sroa.20.0, 16
  %.sroa.28.sroa.20.0.insert.shift121 = and i64 %.sroa.28.sroa.20.0.insert.ext120, 16711680
  %.sroa.28.sroa.0.sroa.18.0.insert.ext233.masked = and i64 %.sroa.28.sroa.0.sroa.18.0.insert.ext233, 65280
  %.sroa.28.sroa.0.0.insert.ext90 = or disjoint i64 %.sroa.28.sroa.0.sroa.0.0.insert.ext192, %.sroa.28.sroa.0.sroa.18.0.insert.ext233.masked
  %.sroa.28.sroa.20136.0.insert.ext155.masked = and i64 %.sroa.28.sroa.20136.0.insert.ext155, 4278190080
  %.sroa.28.sroa.20.0.insert.insert123.masked = or disjoint i64 %.sroa.28.sroa.20.0.insert.shift121, %.sroa.28.sroa.20136.0.insert.ext155.masked
  %.sroa.28.0.insert.ext65 = or disjoint i64 %.sroa.28.sroa.0.0.insert.ext90, %.sroa.28.sroa.20.0.insert.insert123.masked
  %.sroa.28.0.insert.shift66 = shl nuw i64 %.sroa.28.0.insert.ext65, 32
  %.sroa.0.sroa.0.0.insert.insert272 = or disjoint i64 %.sroa.28.0.insert.shift66, 1019446290
  %.sroa.0.0.insert.insert32 = add nuw nsw i64 %.sroa.0.sroa.0.0.insert.insert272, %.sroa.0.sroa.20.0.insert.shift305
  %11 = add nuw nsw i64 %.sroa.0.0.insert.insert32, %.sroa.0.sroa.0.0.insert.ext270
  store i64 %11, 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