; 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 i64, align 8
  %7 = alloca i8, align 1
  %8 = alloca i16, align 2
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  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 8, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 4, 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, 51238316
  %15 = add i64 %14, 274866410
  %16 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  store i64 %15, ptr %16, align 8, !tbaa !9
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %17

17:                                               ; preds = %98, %2
  %18 = load i64, ptr %6, align 8, !tbaa !9
  %19 = icmp ult i64 %18, 1
  br i1 %19, label %20, label %101

20:                                               ; preds = %17
  %21 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %22 = load i64, ptr %21, align 8, !tbaa !9
  %23 = load i64, ptr %6, align 8, !tbaa !9
  %24 = icmp ult i64 %22, %23
  br i1 %24, label %25, label %71

25:                                               ; preds = %20
  %26 = load i64, ptr %6, align 8, !tbaa !9
  %27 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %26
  %28 = getelementptr inbounds i8, ptr %27, i64 5
  %29 = load i8, ptr %28, align 1, !tbaa !11
  store i8 %29, ptr %7, align 1, !tbaa !11
  %30 = load i64, ptr %6, align 8, !tbaa !9
  %31 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %30
  %32 = getelementptr inbounds i8, ptr %31, i64 3
  %33 = load i8, ptr %32, align 1, !tbaa !11
  %34 = load i64, ptr %6, align 8, !tbaa !9
  %35 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %34
  %36 = getelementptr inbounds i8, ptr %35, i64 5
  store i8 %33, ptr %36, align 1, !tbaa !11
  %37 = load i8, ptr %7, align 1, !tbaa !11
  %38 = load i64, ptr %6, align 8, !tbaa !9
  %39 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %38
  %40 = getelementptr inbounds i8, ptr %39, i64 3
  store i8 %37, ptr %40, align 1, !tbaa !11
  %41 = load i64, ptr %6, align 8, !tbaa !9
  %42 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %41
  %43 = getelementptr inbounds i8, ptr %42, i64 3
  %44 = load i8, ptr %43, align 1, !tbaa !11
  store i8 %44, ptr %7, align 1, !tbaa !11
  %45 = load i64, ptr %6, align 8, !tbaa !9
  %46 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %45
  %47 = getelementptr inbounds i8, ptr %46, i64 2
  %48 = load i8, ptr %47, align 1, !tbaa !11
  %49 = load i64, ptr %6, align 8, !tbaa !9
  %50 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %49
  %51 = getelementptr inbounds i8, ptr %50, i64 3
  store i8 %48, ptr %51, align 1, !tbaa !11
  %52 = load i8, ptr %7, align 1, !tbaa !11
  %53 = load i64, ptr %6, align 8, !tbaa !9
  %54 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %53
  %55 = getelementptr inbounds i8, ptr %54, i64 2
  store i8 %52, ptr %55, align 1, !tbaa !11
  %56 = load i64, ptr %6, align 8, !tbaa !9
  %57 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %56
  %58 = getelementptr inbounds i16, ptr %57, i64 0
  %59 = load i16, ptr %58, align 2, !tbaa !12
  store i16 %59, ptr %8, align 2, !tbaa !12
  %60 = load i64, ptr %6, align 8, !tbaa !9
  %61 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %60
  %62 = getelementptr inbounds i16, ptr %61, i64 3
  %63 = load i16, ptr %62, align 2, !tbaa !12
  %64 = load i64, ptr %6, align 8, !tbaa !9
  %65 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %64
  %66 = getelementptr inbounds i16, ptr %65, i64 0
  store i16 %63, ptr %66, align 2, !tbaa !12
  %67 = load i16, ptr %8, align 2, !tbaa !12
  %68 = load i64, ptr %6, align 8, !tbaa !9
  %69 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %68
  %70 = getelementptr inbounds i16, ptr %69, i64 3
  store i16 %67, ptr %70, align 2, !tbaa !12
  br label %98

71:                                               ; preds = %20
  %72 = load i64, ptr %6, align 8, !tbaa !9
  %73 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %72
  %74 = getelementptr inbounds i8, ptr %73, i64 7
  %75 = load i8, ptr %74, align 1, !tbaa !11
  store i8 %75, ptr %9, align 1, !tbaa !11
  %76 = load i64, ptr %6, align 8, !tbaa !9
  %77 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %76
  %78 = getelementptr inbounds i8, ptr %77, i64 6
  %79 = load i8, ptr %78, align 1, !tbaa !11
  %80 = load i64, ptr %6, align 8, !tbaa !9
  %81 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %80
  %82 = getelementptr inbounds i8, ptr %81, i64 7
  store i8 %79, ptr %82, align 1, !tbaa !11
  %83 = load i8, ptr %9, align 1, !tbaa !11
  %84 = load i64, ptr %6, align 8, !tbaa !9
  %85 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %84
  %86 = getelementptr inbounds i8, ptr %85, i64 6
  store i8 %83, ptr %86, align 1, !tbaa !11
  %87 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %88 = getelementptr inbounds i32, ptr %87, i64 0
  %89 = load i32, ptr %88, align 4, !tbaa !14
  store i32 %89, ptr %10, align 4, !tbaa !14
  %90 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %91 = getelementptr inbounds i32, ptr %90, i64 1
  %92 = load i32, ptr %91, align 4, !tbaa !14
  %93 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %94 = getelementptr inbounds i32, ptr %93, i64 0
  store i32 %92, ptr %94, align 4, !tbaa !14
  %95 = load i32, ptr %10, align 4, !tbaa !14
  %96 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %97 = getelementptr inbounds i32, ptr %96, i64 1
  store i32 %95, ptr %97, align 4, !tbaa !14
  br label %98

98:                                               ; preds = %71, %25
  %99 = load i64, ptr %6, align 8, !tbaa !9
  %100 = add i64 %99, 2
  store i64 %100, ptr %6, align 8, !tbaa !9
  br label %17, !llvm.loop !16

101:                                              ; preds = %17
  %102 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %103 = load i64, ptr %102, align 8, !tbaa !9
  %104 = add i64 %103, 6815031
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds i64, ptr %105, i64 0
  store i64 %104, ptr %106, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 8, 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}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; 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 {
.critedge:
  %2 = load i64, ptr %0, align 8, !tbaa !5
  %3 = add i64 %2, 326104726
  %.sroa.6.0.extract.shift = lshr i64 %3, 32
  %sh.diff = lshr i64 %3, 24
  %.sroa.6.sroa.8.0.insert.ext40 = and i64 %sh.diff, 4278190080
  %sh.diff46 = lshr i64 %3, 40
  %.sroa.6.sroa.6.0.insert.shift35 = and i64 %sh.diff46, 16711680
  %.sroa.6.sroa.0.0.insert.ext29 = and i64 %.sroa.6.0.extract.shift, 65535
  %.sroa.6.sroa.0.0.insert.insert = shl i64 %3, 32
  %.sroa.6.sroa.6.0.insert.insert37 = or disjoint i64 %.sroa.6.sroa.0.0.insert.insert, 6815031
  %.sroa.6.sroa.0.0.insert.insert31 = add nuw nsw i64 %.sroa.6.sroa.6.0.insert.insert37, %.sroa.6.sroa.0.0.insert.ext29
  %.sroa.0.0.insert.insert = add nuw nsw i64 %.sroa.6.sroa.0.0.insert.insert31, %.sroa.6.sroa.6.0.insert.shift35
  %4 = add i64 %.sroa.0.0.insert.insert, %.sroa.6.sroa.8.0.insert.ext40
  store i64 %4, 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