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

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

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

24:                                               ; preds = %19
  %25 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %26 = getelementptr inbounds i16, ptr %25, i64 0
  %27 = load i16, ptr %26, align 2, !tbaa !11
  store i16 %27, ptr %7, align 2, !tbaa !11
  %28 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %29 = getelementptr inbounds i16, ptr %28, i64 1
  %30 = load i16, ptr %29, align 2, !tbaa !11
  %31 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %32 = getelementptr inbounds i16, ptr %31, i64 0
  store i16 %30, ptr %32, align 2, !tbaa !11
  %33 = load i16, ptr %7, align 2, !tbaa !11
  %34 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %35 = getelementptr inbounds i16, ptr %34, i64 1
  store i16 %33, ptr %35, align 2, !tbaa !11
  %36 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %37 = load i64, ptr %36, 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 = add i64 %39, %37
  store i64 %40, ptr %38, align 8, !tbaa !9
  br label %50

41:                                               ; preds = %19
  %42 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %43 = load i64, ptr %42, align 8, !tbaa !9
  %44 = load i64, ptr %6, align 8, !tbaa !9
  %45 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !9
  %47 = sub i64 %43, %46
  %48 = load i64, ptr %6, align 8, !tbaa !9
  %49 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 %48
  store i64 %47, ptr %49, align 8, !tbaa !9
  br label %50

50:                                               ; preds = %41, %24
  %51 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %52 = load i64, ptr %51, align 8, !tbaa !9
  %53 = load i64, ptr %6, align 8, !tbaa !9
  %54 = icmp ult i64 %52, %53
  br i1 %54, label %55, label %67

55:                                               ; preds = %50
  %56 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %57 = getelementptr inbounds i8, ptr %56, i64 0
  %58 = load i8, ptr %57, align 1, !tbaa !13
  store i8 %58, ptr %8, align 1, !tbaa !13
  %59 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %60 = getelementptr inbounds i8, ptr %59, i64 5
  %61 = load i8, ptr %60, align 1, !tbaa !13
  %62 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %63 = getelementptr inbounds i8, ptr %62, i64 0
  store i8 %61, ptr %63, align 1, !tbaa !13
  %64 = load i8, ptr %8, align 1, !tbaa !13
  %65 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %66 = getelementptr inbounds i8, ptr %65, i64 5
  store i8 %64, ptr %66, align 1, !tbaa !13
  br label %90

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

90:                                               ; preds = %67, %55
  %91 = load i64, ptr %6, align 8, !tbaa !9
  %92 = add i64 %91, 1
  store i64 %92, ptr %6, align 8, !tbaa !9
  br label %16, !llvm.loop !14

93:                                               ; preds = %16
  %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, 726088550
  %97 = add i64 %96, 1978066674
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds i64, ptr %98, i64 0
  store i64 %97, ptr %99, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 2, 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 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"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: write) uwtable
define dso_local void @RandomFunc(ptr nocapture noundef readonly %0, ptr nocapture noundef writeonly %1) local_unnamed_addr #0 {
.critedge:
  store i64 2704155224, ptr %1, align 8, !tbaa !5
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) 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,SROAPass,SimplifyCFGPass