; 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 i32, align 4
  %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 1, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 4, 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 %63

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 %39

27:                                               ; preds = %21
  %28 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %29 = getelementptr inbounds i16, ptr %28, i64 0
  %30 = load i16, ptr %29, align 2, !tbaa !11
  store i16 %30, ptr %6, align 2, !tbaa !11
  %31 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %32 = getelementptr inbounds i16, ptr %31, i64 3
  %33 = load i16, ptr %32, align 2, !tbaa !11
  %34 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %35 = getelementptr inbounds i16, ptr %34, i64 0
  store i16 %33, ptr %35, align 2, !tbaa !11
  %36 = load i16, ptr %6, align 2, !tbaa !11
  %37 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %38 = getelementptr inbounds i16, ptr %37, i64 3
  store i16 %36, ptr %38, align 2, !tbaa !11
  br label %62

39:                                               ; preds = %21
  %40 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %41 = getelementptr inbounds i8, ptr %40, i64 0
  %42 = load i8, ptr %41, align 1, !tbaa !13
  store i8 %42, ptr %7, align 1, !tbaa !13
  %43 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %44 = getelementptr inbounds i8, ptr %43, i64 1
  %45 = load i8, ptr %44, align 1, !tbaa !13
  %46 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %47 = getelementptr inbounds i8, ptr %46, i64 0
  store i8 %45, ptr %47, align 1, !tbaa !13
  %48 = load i8, 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 1
  store i8 %48, ptr %50, align 1, !tbaa !13
  %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 !14
  store i32 %53, ptr %8, align 4, !tbaa !14
  %54 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %55 = getelementptr inbounds i32, ptr %54, i64 0
  %56 = load i32, ptr %55, align 4, !tbaa !14
  %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 !14
  %59 = load i32, ptr %8, align 4, !tbaa !14
  %60 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %61 = getelementptr inbounds i32, ptr %60, i64 0
  store i32 %59, ptr %61, align 4, !tbaa !14
  br label %62

62:                                               ; preds = %39, %27
  br label %91

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

91:                                               ; preds = %63, %62
  %92 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %93 = load i64, ptr %92, align 8, !tbaa !9
  %94 = sub i64 %93, 49080916
  %95 = add i64 %94, -82243975
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds i64, ptr %96, i64 0
  store i64 %95, ptr %97, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 4, 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}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !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.0.sroa.0.0.extract.trunc221 = trunc i64 %4 to i16
  %.sroa.0.sroa.21.0.extract.shift169270 = lshr i64 %4, 16
  %.sroa.0.sroa.23.0.extract.shift193271 = lshr i64 %4, 24
  %.sroa.23.0.extract.shift = lshr i64 %4, 32
  %.sroa.23.sroa.0.0.extract.trunc = trunc i64 %.sroa.23.0.extract.shift to i16
  %sum.shift = lshr i64 %4, 48
  %5 = and i64 %4, 16
  %.not = icmp eq i64 %5, 0
  br i1 %.not, label %10, label %6

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

8:                                                ; preds = %6
  %.sroa.0.sroa.0.sroa.17.0.extract.shift287 = lshr i64 %4, 56
  %.sroa.23.sroa.11.sroa.15.0.extract.shift147288 = lshr i64 %4, 8
  br label %16

9:                                                ; preds = %6
  %.sroa.0.sroa.0.sroa.0.0.insert.insert219 = tail call i16 @llvm.bswap.i16(i16 %.sroa.0.sroa.0.sroa.0.0.extract.trunc221)
  %.sroa.0.sroa.0.sroa.17.0.extract.shift242285 = lshr i64 %4, 40
  %.sroa.0.sroa.23.0.extract.shift286 = lshr i64 %4, 56
  br label %16

10:                                               ; preds = %2
  %11 = shl i64 %sum.shift, 49
  %.sroa.23.sroa.0.0.insert.ext = shl i64 %.sroa.23.0.extract.shift, 33
  %12 = and i64 %.sroa.23.sroa.0.0.insert.ext, 562941363486720
  %13 = or disjoint i64 %12, %11
  %.sroa.0.0.insert.ext = shl i64 %4, 1
  %14 = and i64 %.sroa.0.0.insert.ext, 8589934558
  %15 = or disjoint i64 %13, %14
  %.sroa.0.sroa.0.sroa.17.0.extract.shift262275 = lshr i64 %15, 8
  %.sroa.0.sroa.21.0.extract.shift187276 = lshr i64 %15, 16
  %.sroa.0.sroa.23.0.extract.shift211277 = lshr i64 %15, 24
  %.sroa.23.0.extract.shift46 = lshr i64 %15, 32
  %.sroa.23.sroa.0.0.extract.trunc66 = trunc i64 %.sroa.23.0.extract.shift46 to i16
  %sum.shift278 = lshr i64 %13, 48
  %sum.shift280 = lshr i64 %11, 56
  br label %16

16:                                               ; preds = %8, %9, %10
  %.sroa.23.sroa.11.sroa.15.0.in = phi i64 [ %.sroa.23.sroa.11.sroa.15.0.extract.shift147288, %8 ], [ %.sroa.0.sroa.23.0.extract.shift193271, %9 ], [ %sum.shift280, %10 ]
  %.sroa.23.sroa.11.sroa.0.0.in = phi i64 [ %4, %8 ], [ %.sroa.0.sroa.21.0.extract.shift169270, %9 ], [ %.sroa.0.sroa.0.sroa.17.0.extract.shift262275, %10 ]
  %.sroa.23.sroa.0.0 = phi i16 [ %.sroa.23.sroa.0.0.extract.trunc, %8 ], [ %.sroa.0.sroa.0.sroa.0.0.insert.insert219, %9 ], [ %.sroa.23.sroa.0.0.extract.trunc66, %10 ]
  %.sroa.0.sroa.21.0.in = phi i64 [ %.sroa.0.sroa.21.0.extract.shift169270, %8 ], [ %sum.shift, %9 ], [ %14, %10 ]
  %.sroa.0.sroa.23.0.in = phi i64 [ %.sroa.0.sroa.23.0.extract.shift193271, %8 ], [ %.sroa.0.sroa.23.0.extract.shift286, %9 ], [ %.sroa.0.sroa.23.0.extract.shift211277, %10 ]
  %.sroa.0.sroa.0.sroa.0.0.in = phi i64 [ %sum.shift, %8 ], [ %.sroa.23.0.extract.shift, %9 ], [ %.sroa.0.sroa.21.0.extract.shift187276, %10 ]
  %.sroa.0.sroa.0.sroa.17.0.in = phi i64 [ %.sroa.0.sroa.0.sroa.17.0.extract.shift287, %8 ], [ %.sroa.0.sroa.0.sroa.17.0.extract.shift242285, %9 ], [ %sum.shift278, %10 ]
  %.sroa.0.sroa.0.sroa.17.0.insert.ext264 = shl nuw nsw i64 %.sroa.0.sroa.0.sroa.17.0.in, 8
  %.sroa.0.sroa.0.sroa.0.0.insert.ext235 = and i64 %.sroa.0.sroa.0.sroa.0.0.in, 255
  %.sroa.0.sroa.23.0.insert.ext213 = shl nuw i64 %.sroa.0.sroa.23.0.in, 24
  %.sroa.0.sroa.21.0.insert.ext189 = shl nuw i64 %.sroa.0.sroa.21.0.in, 16
  %.sroa.0.sroa.21.0.insert.shift190 = and i64 %.sroa.0.sroa.21.0.insert.ext189, 16711680
  %.sroa.0.sroa.0.sroa.17.0.insert.ext264.masked = and i64 %.sroa.0.sroa.0.sroa.17.0.insert.ext264, 65280
  %.sroa.23.sroa.0.0.insert.ext67 = zext i16 %.sroa.23.sroa.0.0 to i64
  %17 = shl i64 %.sroa.23.sroa.11.sroa.15.0.in, 56
  %.sroa.23.sroa.11.sroa.0.0.insert.ext108 = shl i64 %.sroa.23.sroa.11.sroa.0.0.in, 48
  %18 = and i64 %.sroa.23.sroa.11.sroa.0.0.insert.ext108, 71776119061217280
  %19 = shl nuw nsw i64 %.sroa.23.sroa.0.0.insert.ext67, 32
  %.sroa.0.sroa.23.0.insert.ext213.masked = and i64 %.sroa.0.sroa.23.0.insert.ext213, 4278190080
  %.sroa.0.sroa.0.0.insert.ext163 = add i64 %17, -131324891
  %.sroa.0.sroa.21.0.insert.insert192.masked = add i64 %.sroa.0.sroa.0.0.insert.ext163, %18
  %.sroa.0.0.insert.ext23 = add i64 %.sroa.0.sroa.21.0.insert.insert192.masked, %19
  %20 = add nuw nsw i64 %.sroa.0.0.insert.ext23, %.sroa.0.sroa.21.0.insert.shift190
  %.sroa.23.0.insert.shift50 = add i64 %20, %.sroa.0.sroa.23.0.insert.ext213.masked
  %.sroa.0.0.insert.insert25 = add nuw nsw i64 %.sroa.23.0.insert.shift50, %.sroa.0.sroa.0.sroa.0.0.insert.ext235
  %21 = add i64 %.sroa.0.0.insert.insert25, %.sroa.0.sroa.0.sroa.17.0.insert.ext264.masked
  store i64 %21, ptr %1, align 8, !tbaa !5
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.bswap.i16(i16) #1

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" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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,TailCallElimPass