; 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 i8, align 1
  %7 = alloca i16, align 2
  %8 = 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 1, 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
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds i64, ptr %9, i64 0
  %11 = load i64, ptr %10, align 8, !tbaa !9
  %12 = add i64 %11, 51238316
  %13 = add i64 %12, 274866410
  %14 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  store i64 %13, ptr %14, align 8, !tbaa !9
  %15 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %16 = load i64, ptr %15, align 8, !tbaa !9
  %17 = lshr i64 %16, 4
  %18 = and i64 %17, 1
  %19 = icmp ne i64 %18, 0
  br i1 %19, label %20, label %96

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

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

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

43:                                               ; preds = %26
  %44 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %45 = getelementptr inbounds i8, ptr %44, i64 3
  %46 = load i8, ptr %45, align 1, !tbaa !11
  store i8 %46, ptr %6, align 1, !tbaa !11
  %47 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %48 = getelementptr inbounds i8, ptr %47, i64 2
  %49 = load i8, ptr %48, align 1, !tbaa !11
  %50 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %51 = getelementptr inbounds i8, ptr %50, i64 3
  store i8 %49, ptr %51, align 1, !tbaa !11
  %52 = load i8, ptr %6, align 1, !tbaa !11
  %53 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %54 = getelementptr inbounds i8, ptr %53, i64 2
  store i8 %52, ptr %54, align 1, !tbaa !11
  %55 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %56 = getelementptr inbounds i16, ptr %55, i64 3
  %57 = load i16, ptr %56, align 2, !tbaa !12
  store i16 %57, ptr %7, align 2, !tbaa !12
  %58 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %59 = getelementptr inbounds i16, ptr %58, i64 2
  %60 = load i16, ptr %59, align 2, !tbaa !12
  %61 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %62 = getelementptr inbounds i16, ptr %61, i64 3
  store i16 %60, ptr %62, align 2, !tbaa !12
  %63 = load i16, ptr %7, align 2, !tbaa !12
  %64 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %65 = getelementptr inbounds i16, ptr %64, i64 2
  store i16 %63, ptr %65, align 2, !tbaa !12
  %66 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %67 = getelementptr inbounds i16, ptr %66, i64 0
  %68 = load i16, ptr %67, align 2, !tbaa !12
  store i16 %68, ptr %7, align 2, !tbaa !12
  %69 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %70 = getelementptr inbounds i16, ptr %69, i64 1
  %71 = load i16, ptr %70, align 2, !tbaa !12
  %72 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %73 = getelementptr inbounds i16, ptr %72, i64 0
  store i16 %71, ptr %73, align 2, !tbaa !12
  %74 = load i16, ptr %7, align 2, !tbaa !12
  %75 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %76 = getelementptr inbounds i16, ptr %75, i64 1
  store i16 %74, ptr %76, align 2, !tbaa !12
  br label %77

77:                                               ; preds = %43, %32
  br label %95

78:                                               ; preds = %20
  %79 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %80 = load i64, ptr %79, align 8, !tbaa !9
  %81 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %82 = load i64, ptr %81, align 8, !tbaa !9
  %83 = add i64 %82, %80
  store i64 %83, ptr %81, align 8, !tbaa !9
  %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 !12
  store i16 %86, ptr %8, align 2, !tbaa !12
  %87 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %88 = getelementptr inbounds i16, ptr %87, i64 3
  %89 = load i16, ptr %88, align 2, !tbaa !12
  %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 !12
  %92 = load i16, ptr %8, align 2, !tbaa !12
  %93 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %94 = getelementptr inbounds i16, ptr %93, i64 3
  store i16 %92, ptr %94, align 2, !tbaa !12
  br label %95

95:                                               ; preds = %78, %77
  br label %107

96:                                               ; preds = %2
  %97 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %98 = load i64, ptr %97, align 8, !tbaa !9
  %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, %98
  store i64 %101, ptr %99, align 8, !tbaa !9
  %102 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %103 = load i64, ptr %102, align 8, !tbaa !9
  %104 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %105 = load i64, ptr %104, align 8, !tbaa !9
  %106 = add i64 %105, %103
  store i64 %106, ptr %104, align 8, !tbaa !9
  br label %107

107:                                              ; preds = %96, %95
  %108 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %109 = load i64, ptr %108, align 8, !tbaa !9
  %110 = add i64 %109, 588148601
  %111 = add i64 %110, 193596760666482690
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds i64, ptr %112, i64 0
  store i64 %111, ptr %113, align 8, !tbaa !9
  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 1, 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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"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, 326104726
  %.sroa.26.0.extract.shift = lshr i64 %4, 16
  %.sroa.26.sroa.0.0.extract.trunc = trunc i64 %.sroa.26.0.extract.shift to i16
  %.sroa.26.sroa.26.0.extract.shift408 = lshr i64 %4, 24
  %.sroa.26.sroa.26.0.extract.trunc = trunc i64 %.sroa.26.sroa.26.0.extract.shift408 to i16
  %.sroa.32.0.extract.shift = lshr i64 %4, 32
  %.sroa.34.0.extract.shift = lshr i64 %4, 48
  %.sroa.26.sroa.26.0.insert.ext = and i16 %.sroa.26.sroa.26.0.extract.trunc, 255
  %.sroa.26.sroa.26.0.insert.shift = shl nuw i16 %.sroa.26.sroa.26.0.insert.ext, 8
  %.sroa.26.sroa.0.0.insert.ext = and i16 %.sroa.26.sroa.0.0.extract.trunc, 255
  %.sroa.26.sroa.0.0.insert.insert = or disjoint i16 %.sroa.26.sroa.26.0.insert.shift, %.sroa.26.sroa.0.0.insert.ext
  %.sroa.26.0.insert.ext = zext i16 %.sroa.26.sroa.0.0.insert.insert to i64
  %.sroa.26.0.insert.shift = shl nuw nsw i64 %.sroa.26.0.insert.ext, 16
  %5 = and i64 %4, -4294901761
  %.sroa.0.0.insert.insert = or disjoint i64 %.sroa.26.0.insert.shift, %5
  %6 = and i64 %4, 16
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %16, label %7

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

9:                                                ; preds = %7
  %10 = and i64 %4, 4
  %.not413 = icmp eq i64 %10, 0
  br i1 %.not413, label %13, label %11

11:                                               ; preds = %9
  %12 = shl i64 %.sroa.0.0.insert.insert, 2
  %.sroa.0.0.extract.trunc31 = trunc i64 %12 to i16
  %.sroa.26.0.extract.shift95 = lshr i64 %12, 16
  %.sroa.26.sroa.26.0.extract.shift365416 = lshr i64 %12, 24
  %.sroa.32.0.extract.shift172 = lshr i64 %12, 32
  %.sroa.34.0.extract.shift247 = lshr i64 %12, 48
  br label %18

13:                                               ; preds = %9
  %.sroa.26.sroa.26.0.insert.shift402 = shl nuw i16 %.sroa.26.sroa.0.0.insert.ext, 8
  %.sroa.26.sroa.0.0.insert.insert337 = or disjoint i16 %.sroa.26.sroa.26.0.insert.shift402, %.sroa.26.sroa.26.0.insert.ext
  %.sroa.26.sroa.26.0.extract.shift405414 = lshr i64 %4, 8
  br label %18

14:                                               ; preds = %7
  %15 = shl i64 %.sroa.0.0.insert.insert, 1
  %.sroa.26.0.extract.shift107 = lshr i64 %15, 16
  %.sroa.26.sroa.26.0.extract.shift375412 = lshr i64 %15, 24
  %.sroa.32.0.extract.shift184 = lshr i64 %15, 32
  %.sroa.34.0.extract.shift259 = lshr i64 %15, 48
  %.sroa.34.0.extract.trunc260 = trunc nuw i64 %.sroa.34.0.extract.shift259 to i16
  br label %18

16:                                               ; preds = %2
  %17 = shl i64 %.sroa.0.0.insert.insert, 2
  %.sroa.0.0.extract.trunc58 = trunc i64 %17 to i16
  %.sroa.26.0.extract.shift131 = lshr i64 %17, 16
  %.sroa.26.sroa.26.0.extract.shift395410 = lshr i64 %17, 24
  %.sroa.32.0.extract.shift208 = lshr i64 %17, 32
  %.sroa.34.0.extract.shift283 = lshr i64 %17, 48
  br label %18

18:                                               ; preds = %14, %13, %11, %16
  %.sroa.32.0.in = phi i64 [ %.sroa.32.0.extract.shift172, %11 ], [ %.sroa.34.0.extract.shift, %13 ], [ %.sroa.32.0.extract.shift184, %14 ], [ %.sroa.32.0.extract.shift208, %16 ]
  %.sroa.0.0 = phi i16 [ %.sroa.0.0.extract.trunc31, %11 ], [ %.sroa.26.sroa.0.0.insert.insert337, %13 ], [ %.sroa.34.0.extract.trunc260, %14 ], [ %.sroa.0.0.extract.trunc58, %16 ]
  %.sroa.34.0.in = phi i64 [ %.sroa.34.0.extract.shift247, %11 ], [ %.sroa.32.0.extract.shift, %13 ], [ %15, %14 ], [ %.sroa.34.0.extract.shift283, %16 ]
  %.sroa.26.sroa.0.0.in = phi i64 [ %.sroa.26.0.extract.shift95, %11 ], [ %4, %13 ], [ %.sroa.26.0.extract.shift107, %14 ], [ %.sroa.26.0.extract.shift131, %16 ]
  %.sroa.26.sroa.26.0.in = phi i64 [ %.sroa.26.sroa.26.0.extract.shift365416, %11 ], [ %.sroa.26.sroa.26.0.extract.shift405414, %13 ], [ %.sroa.26.sroa.26.0.extract.shift375412, %14 ], [ %.sroa.26.sroa.26.0.extract.shift395410, %16 ]
  %.sroa.26.sroa.26.0.insert.ext397 = shl nuw i64 %.sroa.26.sroa.26.0.in, 8
  %.sroa.26.sroa.0.0.insert.ext332 = and i64 %.sroa.26.sroa.0.0.in, 255
  %.sroa.34.0.insert.ext286 = shl i64 %.sroa.34.0.in, 48
  %.sroa.32.0.insert.ext211 = shl nuw i64 %.sroa.32.0.in, 32
  %.sroa.32.0.insert.shift212 = and i64 %.sroa.32.0.insert.ext211, 281470681743360
  %.sroa.26.sroa.26.0.insert.ext397.masked = and i64 %.sroa.26.sroa.26.0.insert.ext397, 65280
  %.sroa.26.0.insert.ext134 = or disjoint i64 %.sroa.26.sroa.26.0.insert.ext397.masked, %.sroa.26.sroa.0.0.insert.ext332
  %.sroa.26.0.insert.shift135 = shl nuw nsw i64 %.sroa.26.0.insert.ext134, 16
  %.sroa.0.0.insert.ext60 = zext i16 %.sroa.0.0 to i64
  %.sroa.32.0.insert.insert214 = add nuw nsw i64 %.sroa.0.0.insert.ext60, 193596761254631291
  %.sroa.26.0.insert.insert137 = add nuw nsw i64 %.sroa.32.0.insert.insert214, %.sroa.32.0.insert.shift212
  %.sroa.0.0.insert.insert62 = add i64 %.sroa.26.0.insert.insert137, %.sroa.34.0.insert.ext286
  %19 = add i64 %.sroa.0.0.insert.insert62, %.sroa.26.0.insert.shift135
  store i64 %19, 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