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

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 = lshr i64 %65, 2
  %67 = and i64 %66, 1
  %68 = icmp ne i64 %67, 0
  br i1 %68, label %69, label %97

69:                                               ; preds = %63
  %70 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %71 = getelementptr inbounds i16, ptr %70, i64 1
  %72 = load i16, ptr %71, align 2, !tbaa !11
  store i16 %72, ptr %9, align 2, !tbaa !11
  %73 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %74 = getelementptr inbounds i16, ptr %73, i64 2
  %75 = load i16, ptr %74, align 2, !tbaa !11
  %76 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %77 = getelementptr inbounds i16, ptr %76, i64 1
  store i16 %75, ptr %77, align 2, !tbaa !11
  %78 = load i16, ptr %9, align 2, !tbaa !11
  %79 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %80 = getelementptr inbounds i16, ptr %79, i64 2
  store i16 %78, ptr %80, align 2, !tbaa !11
  %81 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %82 = getelementptr inbounds i16, ptr %81, i64 2
  %83 = load i16, ptr %82, align 2, !tbaa !11
  store i16 %83, ptr %9, align 2, !tbaa !11
  %84 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %85 = getelementptr inbounds i16, ptr %84, i64 0
  %86 = load i16, ptr %85, align 2, !tbaa !11
  %87 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %88 = getelementptr inbounds i16, ptr %87, i64 2
  store i16 %86, ptr %88, align 2, !tbaa !11
  %89 = load i16, ptr %9, align 2, !tbaa !11
  %90 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %91 = getelementptr inbounds i16, ptr %90, i64 0
  store i16 %89, ptr %91, align 2, !tbaa !11
  %92 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %93 = load i64, ptr %92, align 8, !tbaa !9
  %94 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %95 = load i64, ptr %94, align 8, !tbaa !9
  %96 = add i64 %95, %93
  store i64 %96, ptr %94, align 8, !tbaa !9
  br label %97

97:                                               ; preds = %69, %63
  br label %98

98:                                               ; preds = %97, %62
  %99 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %100 = load i64, ptr %99, align 8, !tbaa !9
  %101 = add i64 %100, 623241920
  %102 = add i64 %101, 270726957
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds i64, ptr %103, i64 0
  store i64 %102, ptr %104, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, 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.18.0.extract.shift199228 = lshr i64 %4, 8
  %.sroa.0.sroa.20.0.extract.shift131229 = lshr i64 %4, 16
  %.sroa.22.0.extract.shift = lshr i64 %4, 32
  %.sroa.22.sroa.0.0.extract.trunc = trunc i64 %.sroa.22.0.extract.shift to i16
  %sum.shift = lshr i64 %4, 48
  %5 = trunc i64 %.sroa.0.sroa.0.sroa.18.0.extract.shift199228 to i16
  %.sroa.0.sroa.0.sroa.18.0.insert.ext201 = shl i16 %5, 8
  %6 = trunc i64 %4 to i16
  %.sroa.0.sroa.0.sroa.0.0.insert.ext168 = and i16 %6, 255
  %.sroa.0.sroa.0.sroa.0.0.insert.insert170 = or disjoint i16 %.sroa.0.sroa.0.sroa.18.0.insert.ext201, %.sroa.0.sroa.0.sroa.0.0.insert.ext168
  %7 = trunc i64 %.sroa.0.sroa.20.0.extract.shift131229 to i32
  %.sroa.0.sroa.0.0.insert.ext111 = zext i16 %.sroa.0.sroa.0.sroa.0.0.insert.insert170 to i64
  %8 = trunc nuw i64 %.sroa.22.0.extract.shift to i32
  %.sroa.0.0.insert.ext = zext i16 %.sroa.0.sroa.0.sroa.0.0.insert.insert170 to i64
  %9 = and i64 %.sroa.0.0.insert.ext, 16
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %14, label %10

10:                                               ; preds = %2
  %11 = and i64 %.sroa.0.0.insert.ext, 8
  %.not237 = icmp eq i64 %11, 0
  br i1 %.not237, label %13, label %12

12:                                               ; preds = %10
  %.sroa.0.sroa.0.sroa.18.0.extract.shift239 = lshr i64 %4, 56
  br label %24

13:                                               ; preds = %10
  %.sroa.0.sroa.0.sroa.0.0.insert.insert165 = tail call i16 @llvm.bswap.i16(i16 %6)
  %.sroa.22.sroa.16.0.extract.trunc109 = trunc i64 %.sroa.0.sroa.20.0.extract.shift131229 to i16
  %.sroa.0.sroa.0.sroa.18.0.extract.shift197238 = lshr i64 %4, 40
  br label %24

14:                                               ; preds = %2
  %.sroa.22.sroa.16.0.extract.trunc = trunc nuw i64 %sum.shift to i16
  %15 = and i64 %.sroa.0.0.insert.ext, 4
  %.not231 = icmp eq i64 %15, 0
  br i1 %.not231, label %24, label %16

16:                                               ; preds = %14
  %17 = trunc i64 %4 to i32
  %18 = lshr i32 %17, 16
  %.sroa.0.sroa.0.sroa.18.0.insert.ext213 = and i32 %18, 65280
  %.sroa.0.sroa.0.sroa.0.0.insert.ext177 = and i32 %7, 255
  %.sroa.0.sroa.0.sroa.0.0.insert.insert179 = or disjoint i32 %.sroa.0.sroa.0.sroa.18.0.insert.ext213, %.sroa.0.sroa.0.sroa.0.0.insert.ext177
  %.sroa.22.sroa.0.0.insert.ext = shl i32 %8, 16
  %.sroa.0.sroa.0.0.insert.insert122 = or disjoint i32 %.sroa.0.sroa.0.sroa.0.0.insert.insert179, %.sroa.22.sroa.0.0.insert.ext
  %.sroa.0.0.insert.ext18 = zext i32 %.sroa.0.sroa.0.0.insert.insert122 to i64
  %19 = shl i64 %sum.shift, 49
  %20 = shl nuw nsw i64 %.sroa.0.sroa.0.0.insert.ext111, 33
  %21 = or disjoint i64 %19, %20
  %22 = shl nuw nsw i64 %.sroa.0.0.insert.ext18, 1
  %23 = or disjoint i64 %20, %22
  %.sroa.0.sroa.0.sroa.18.0.extract.shift221233 = lshr i64 %.sroa.0.0.insert.ext18, 7
  %.sroa.0.sroa.20.0.extract.shift153234 = lshr i32 %.sroa.0.sroa.0.0.insert.insert122, 15
  %.sroa.0.sroa.20.0.extract.trunc154 = zext nneg i32 %.sroa.0.sroa.20.0.extract.shift153234 to i64
  %.sroa.22.0.extract.shift52 = lshr i64 %23, 32
  %.sroa.22.sroa.0.0.extract.trunc74 = trunc i64 %.sroa.22.0.extract.shift52 to i16
  %sum.shift235 = lshr i64 %21, 48
  %.sroa.22.sroa.16.0.extract.trunc99 = trunc nuw i64 %sum.shift235 to i16
  br label %24

24:                                               ; preds = %14, %16, %12, %13
  %.sroa.22.sroa.0.0 = phi i16 [ %.sroa.22.sroa.0.0.extract.trunc, %12 ], [ %.sroa.0.sroa.0.sroa.0.0.insert.insert165, %13 ], [ %.sroa.22.sroa.0.0.extract.trunc74, %16 ], [ %.sroa.22.sroa.0.0.extract.trunc, %14 ]
  %.sroa.22.sroa.16.0 = phi i16 [ %.sroa.0.sroa.0.sroa.0.0.insert.insert170, %12 ], [ %.sroa.22.sroa.16.0.extract.trunc109, %13 ], [ %.sroa.22.sroa.16.0.extract.trunc99, %16 ], [ %.sroa.22.sroa.16.0.extract.trunc, %14 ]
  %.sroa.0.sroa.20.0 = phi i64 [ %.sroa.0.sroa.20.0.extract.shift131229, %12 ], [ %sum.shift, %13 ], [ %.sroa.0.sroa.20.0.extract.trunc154, %16 ], [ %.sroa.0.sroa.20.0.extract.shift131229, %14 ]
  %.sroa.0.sroa.0.sroa.0.0.in = phi i64 [ %sum.shift, %12 ], [ %.sroa.22.0.extract.shift, %13 ], [ %22, %16 ], [ %4, %14 ]
  %.sroa.0.sroa.0.sroa.18.0.in = phi i64 [ %.sroa.0.sroa.0.sroa.18.0.extract.shift239, %12 ], [ %.sroa.0.sroa.0.sroa.18.0.extract.shift197238, %13 ], [ %.sroa.0.sroa.0.sroa.18.0.extract.shift221233, %16 ], [ %.sroa.0.sroa.0.sroa.18.0.extract.shift199228, %14 ]
  %.sroa.0.sroa.0.sroa.18.0.insert.ext223 = shl nuw i64 %.sroa.0.sroa.0.sroa.18.0.in, 8
  %.sroa.0.sroa.0.sroa.0.0.insert.ext184 = and i64 %.sroa.0.sroa.0.sroa.0.0.in, 255
  %.sroa.0.sroa.20.0.insert.ext155 = shl nuw i64 %.sroa.0.sroa.20.0, 16
  %.sroa.0.sroa.20.0.insert.shift156 = and i64 %.sroa.0.sroa.20.0.insert.ext155, 4294901760
  %.sroa.0.sroa.0.sroa.18.0.insert.ext223.masked = and i64 %.sroa.0.sroa.0.sroa.18.0.insert.ext223, 65280
  %.sroa.22.sroa.16.0.insert.ext100 = zext i16 %.sroa.22.sroa.16.0 to i64
  %.sroa.22.sroa.0.0.insert.ext75 = zext i16 %.sroa.22.sroa.0.0 to i64
  %25 = shl nuw i64 %.sroa.22.sroa.16.0.insert.ext100, 48
  %26 = shl nuw nsw i64 %.sroa.22.sroa.0.0.insert.ext75, 32
  %.sroa.0.sroa.0.0.insert.ext127 = or disjoint i64 %26, %25
  %.sroa.0.sroa.0.0.insert.insert129 = or disjoint i64 %.sroa.0.sroa.0.0.insert.ext127, 893968877
  %.sroa.22.0.insert.shift56 = add i64 %.sroa.0.sroa.0.0.insert.insert129, %.sroa.0.sroa.20.0.insert.shift156
  %.sroa.0.0.insert.insert29 = add nuw nsw i64 %.sroa.22.0.insert.shift56, %.sroa.0.sroa.0.sroa.0.0.insert.ext184
  %27 = add i64 %.sroa.0.0.insert.insert29, %.sroa.0.sroa.0.sroa.18.0.insert.ext223.masked
  store i64 %27, 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: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass