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

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 = and i64 %23, 1
  %25 = icmp ne i64 %24, 0
  br i1 %25, label %26, label %72

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

31:                                               ; preds = %26
  %32 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %33 = load i64, ptr %32, align 8, !tbaa !9
  %34 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %35 = load i64, ptr %34, align 8, !tbaa !9
  %36 = add i64 %35, %33
  store i64 %36, ptr %34, align 8, !tbaa !9
  %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
  store i32 %39, ptr %6, align 4, !tbaa !11
  %40 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %41 = getelementptr inbounds i32, ptr %40, i64 0
  %42 = load i32, ptr %41, 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
  %45 = load i32, ptr %6, align 4, !tbaa !11
  %46 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %47 = getelementptr inbounds i32, ptr %46, i64 0
  store i32 %45, ptr %47, align 4, !tbaa !11
  %48 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %49 = getelementptr inbounds i32, ptr %48, i64 0
  %50 = load i32, ptr %49, align 4, !tbaa !11
  store i32 %50, ptr %6, align 4, !tbaa !11
  %51 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %52 = getelementptr inbounds i32, ptr %51, i64 1
  %53 = load i32, ptr %52, align 4, !tbaa !11
  %54 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %55 = getelementptr inbounds i32, ptr %54, i64 0
  store i32 %53, ptr %55, align 4, !tbaa !11
  %56 = load i32, ptr %6, align 4, !tbaa !11
  %57 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %58 = getelementptr inbounds i32, ptr %57, i64 1
  store i32 %56, ptr %58, align 4, !tbaa !11
  br label %71

59:                                               ; preds = %26
  %60 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %61 = getelementptr inbounds i32, ptr %60, i64 0
  %62 = load i32, ptr %61, align 4, !tbaa !11
  store i32 %62, ptr %7, align 4, !tbaa !11
  %63 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %64 = getelementptr inbounds i32, ptr %63, i64 1
  %65 = load i32, ptr %64, align 4, !tbaa !11
  %66 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %67 = getelementptr inbounds i32, ptr %66, i64 0
  store i32 %65, ptr %67, align 4, !tbaa !11
  %68 = load i32, ptr %7, align 4, !tbaa !11
  %69 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %70 = getelementptr inbounds i32, ptr %69, i64 1
  store i32 %68, ptr %70, align 4, !tbaa !11
  br label %71

71:                                               ; preds = %59, %31
  br label %106

72:                                               ; preds = %21
  %73 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %74 = getelementptr inbounds i8, ptr %73, i64 5
  %75 = load i8, ptr %74, align 1, !tbaa !13
  store i8 %75, ptr %8, align 1, !tbaa !13
  %76 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %77 = getelementptr inbounds i8, ptr %76, i64 1
  %78 = load i8, ptr %77, align 1, !tbaa !13
  %79 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %80 = getelementptr inbounds i8, ptr %79, i64 5
  store i8 %78, ptr %80, align 1, !tbaa !13
  %81 = load i8, ptr %8, align 1, !tbaa !13
  %82 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %83 = getelementptr inbounds i8, ptr %82, i64 1
  store i8 %81, ptr %83, align 1, !tbaa !13
  %84 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %85 = getelementptr inbounds i8, ptr %84, i64 4
  %86 = load i8, ptr %85, align 1, !tbaa !13
  store i8 %86, ptr %9, align 1, !tbaa !13
  %87 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %88 = getelementptr inbounds i8, ptr %87, i64 2
  %89 = load i8, ptr %88, align 1, !tbaa !13
  %90 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %91 = getelementptr inbounds i8, ptr %90, i64 4
  store i8 %89, ptr %91, align 1, !tbaa !13
  %92 = load i8, ptr %9, align 1, !tbaa !13
  %93 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %94 = getelementptr inbounds i8, ptr %93, i64 2
  store i8 %92, ptr %94, align 1, !tbaa !13
  %95 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %96 = getelementptr inbounds i8, ptr %95, i64 0
  %97 = load i8, ptr %96, align 1, !tbaa !13
  store i8 %97, ptr %9, align 1, !tbaa !13
  %98 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %99 = getelementptr inbounds i8, ptr %98, i64 1
  %100 = load i8, ptr %99, align 1, !tbaa !13
  %101 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %102 = getelementptr inbounds i8, ptr %101, i64 0
  store i8 %100, ptr %102, align 1, !tbaa !13
  %103 = load i8, ptr %9, align 1, !tbaa !13
  %104 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %105 = getelementptr inbounds i8, ptr %104, i64 1
  store i8 %103, ptr %105, align 1, !tbaa !13
  br label %106

106:                                              ; preds = %72, %71
  br label %119

107:                                              ; preds = %2
  %108 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %109 = getelementptr inbounds i16, ptr %108, i64 0
  %110 = load i16, ptr %109, align 2, !tbaa !14
  store i16 %110, ptr %10, align 2, !tbaa !14
  %111 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %112 = getelementptr inbounds i16, ptr %111, i64 2
  %113 = load i16, ptr %112, align 2, !tbaa !14
  %114 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %115 = getelementptr inbounds i16, ptr %114, i64 0
  store i16 %113, ptr %115, align 2, !tbaa !14
  %116 = load i16, ptr %10, align 2, !tbaa !14
  %117 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %118 = getelementptr inbounds i16, ptr %117, i64 2
  store i16 %116, ptr %118, align 2, !tbaa !14
  br label %119

119:                                              ; preds = %107, %106
  %120 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %121 = load i64, ptr %120, align 8, !tbaa !9
  %122 = add i64 %121, 886510463
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds i64, ptr %123, i64 0
  store i64 %122, ptr %124, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #2
  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 4, 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.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 = !{!"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 = add i64 %3, -66456141
  %.sroa.26.0.extract.shift = lshr i64 %4, 32
  %.sroa.26.sroa.0.sroa.0.0.extract.trunc139 = trunc i64 %.sroa.26.0.extract.shift to i16
  %5 = and i64 %4, 1
  %.not = icmp eq i64 %5, 0
  br i1 %.not, label %11, label %6

6:                                                ; preds = %2
  %.sroa.0.sroa.0.sroa.0.0.extract.trunc340 = trunc i64 %4 to i16
  %.sroa.0.sroa.0.sroa.0.0.extract.trunc356 = shl i16 %.sroa.0.sroa.0.sroa.0.0.extract.trunc340, 1
  %.sroa.0.0.insert.insert = lshr i64 %4, 31
  %7 = lshr i16 %.sroa.0.sroa.0.sroa.0.0.extract.trunc340, 7
  %.sroa.0.sroa.0.0.insert.insert228 = lshr i64 %4, 15
  %8 = and i64 %.sroa.0.sroa.0.0.insert.insert228, 131071
  %9 = lshr i64 %4, 23
  %10 = lshr i16 %.sroa.26.sroa.0.sroa.0.0.extract.trunc139, 7
  br label %12

11:                                               ; preds = %2
  %.sroa.0.sroa.24.0.extract.shift260408 = lshr i64 %4, 16
  %.sroa.0.sroa.26.0.extract.shift300409 = lshr i64 %4, 24
  %.sroa.0.sroa.0.sroa.20.0.extract.shift412 = lshr i64 %4, 40
  %.sroa.0.sroa.0.sroa.20.0.extract.trunc = trunc i64 %.sroa.0.sroa.0.sroa.20.0.extract.shift412 to i16
  %.sroa.26.sroa.0.sroa.20.0.extract.shift413 = lshr i64 %4, 8
  %.sroa.26.sroa.0.sroa.20.0.extract.trunc = trunc i64 %.sroa.26.sroa.0.sroa.20.0.extract.shift413 to i16
  br label %12

12:                                               ; preds = %6, %11
  %.sroa.26.sroa.0.sroa.0.0.in = phi i64 [ %.sroa.0.0.insert.insert, %6 ], [ %4, %11 ]
  %.sroa.26.sroa.22.0.in = phi i64 [ %.sroa.0.0.insert.insert, %6 ], [ %.sroa.26.0.extract.shift, %11 ]
  %.sroa.26.sroa.0.sroa.20.0 = phi i16 [ %10, %6 ], [ %.sroa.26.sroa.0.sroa.20.0.extract.trunc, %11 ]
  %.sroa.0.sroa.24.0.in = phi i64 [ %8, %6 ], [ %.sroa.0.sroa.24.0.extract.shift260408, %11 ]
  %.sroa.0.sroa.26.0.in = phi i64 [ %9, %6 ], [ %.sroa.0.sroa.26.0.extract.shift300409, %11 ]
  %.sroa.0.sroa.0.sroa.0.0 = phi i16 [ %.sroa.0.sroa.0.sroa.0.0.extract.trunc356, %6 ], [ %.sroa.26.sroa.0.sroa.0.0.extract.trunc139, %11 ]
  %.sroa.0.sroa.0.sroa.20.0 = phi i16 [ %7, %6 ], [ %.sroa.0.sroa.0.sroa.20.0.extract.trunc, %11 ]
  %.sroa.26.sroa.22.0 = and i64 %.sroa.26.sroa.22.0.in, 4294901760
  %.sroa.26.sroa.0.sroa.0.0 = trunc i64 %.sroa.26.sroa.0.sroa.0.0.in to i16
  %.sroa.0.sroa.0.sroa.20.0.insert.ext402 = shl i16 %.sroa.0.sroa.0.sroa.20.0, 8
  %.sroa.0.sroa.0.sroa.0.0.insert.ext357 = and i16 %.sroa.0.sroa.0.sroa.0.0, 255
  %.sroa.0.sroa.0.sroa.0.0.insert.insert359 = or disjoint i16 %.sroa.0.sroa.0.sroa.20.0.insert.ext402, %.sroa.0.sroa.0.sroa.0.0.insert.ext357
  %.sroa.0.sroa.26.0.insert.ext324 = shl i64 %.sroa.0.sroa.26.0.in, 24
  %.sroa.0.sroa.24.0.insert.ext284 = shl nuw i64 %.sroa.0.sroa.24.0.in, 16
  %.sroa.0.sroa.24.0.insert.shift285 = and i64 %.sroa.0.sroa.24.0.insert.ext284, 16711680
  %.sroa.0.sroa.0.0.insert.ext242 = zext i16 %.sroa.0.sroa.0.sroa.0.0.insert.insert359 to i64
  %.sroa.26.sroa.0.sroa.20.0.insert.ext195 = shl i16 %.sroa.26.sroa.0.sroa.20.0, 8
  %.sroa.26.sroa.0.sroa.0.0.insert.ext156 = and i16 %.sroa.26.sroa.0.sroa.0.0, 255
  %.sroa.26.sroa.0.sroa.0.0.insert.insert158 = or disjoint i16 %.sroa.26.sroa.0.sroa.20.0.insert.ext195, %.sroa.26.sroa.0.sroa.0.0.insert.ext156
  %.sroa.26.sroa.0.0.insert.ext83 = zext i16 %.sroa.26.sroa.0.sroa.0.0.insert.insert158 to i64
  %.sroa.26.0.insert.ext61 = or disjoint i64 %.sroa.26.sroa.22.0, %.sroa.26.sroa.0.0.insert.ext83
  %.sroa.26.0.insert.shift62 = shl nuw i64 %.sroa.26.0.insert.ext61, 32
  %.sroa.0.sroa.26.0.insert.ext324.masked = and i64 %.sroa.0.sroa.26.0.insert.ext324, 4278190080
  %.sroa.0.0.insert.ext30 = add nuw nsw i64 %.sroa.0.sroa.24.0.insert.shift285, 886510463
  %.sroa.0.sroa.24.0.insert.insert287.masked = add nuw nsw i64 %.sroa.0.0.insert.ext30, %.sroa.0.sroa.26.0.insert.ext324.masked
  %.sroa.0.0.insert.insert32 = add i64 %.sroa.0.sroa.24.0.insert.insert287.masked, %.sroa.26.0.insert.shift62
  %13 = add i64 %.sroa.0.0.insert.insert32, %.sroa.0.sroa.0.0.insert.ext242
  store i64 %13, 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: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass