; 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 i32], align 4
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = 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 4, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #2
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds i32, ptr %9, i64 0
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = zext i32 %11 to i64
  %13 = add i64 %12, 51238316
  %14 = add i64 %13, 274866410
  %15 = trunc i64 %14 to i32
  %16 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  store i32 %15, ptr %16, align 4, !tbaa !9
  %17 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %19 = lshr i32 %18, 4
  %20 = and i32 %19, 1
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %64

22:                                               ; preds = %2
  %23 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %24 = load i32, ptr %23, align 4, !tbaa !9
  %25 = lshr i32 %24, 3
  %26 = and i32 %25, 1
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %51

28:                                               ; preds = %22
  %29 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %30 = getelementptr inbounds i8, ptr %29, i64 1
  %31 = load i8, ptr %30, align 1, !tbaa !11
  store i8 %31, ptr %6, align 1, !tbaa !11
  %32 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %33 = getelementptr inbounds i8, ptr %32, i64 3
  %34 = load i8, ptr %33, align 1, !tbaa !11
  %35 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %36 = getelementptr inbounds i8, ptr %35, i64 1
  store i8 %34, ptr %36, align 1, !tbaa !11
  %37 = load i8, ptr %6, align 1, !tbaa !11
  %38 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %39 = getelementptr inbounds i8, ptr %38, i64 3
  store i8 %37, ptr %39, align 1, !tbaa !11
  %40 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %41 = getelementptr inbounds i8, ptr %40, i64 3
  %42 = load i8, ptr %41, align 1, !tbaa !11
  store i8 %42, ptr %6, align 1, !tbaa !11
  %43 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %44 = getelementptr inbounds i8, ptr %43, i64 0
  %45 = load i8, ptr %44, align 1, !tbaa !11
  %46 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %47 = getelementptr inbounds i8, ptr %46, i64 3
  store i8 %45, ptr %47, align 1, !tbaa !11
  %48 = load i8, ptr %6, align 1, !tbaa !11
  %49 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %50 = getelementptr inbounds i8, ptr %49, i64 0
  store i8 %48, ptr %50, align 1, !tbaa !11
  br label %63

51:                                               ; preds = %22
  %52 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %53 = getelementptr inbounds i8, ptr %52, i64 1
  %54 = load i8, ptr %53, align 1, !tbaa !11
  store i8 %54, ptr %7, align 1, !tbaa !11
  %55 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %56 = getelementptr inbounds i8, ptr %55, i64 2
  %57 = load i8, ptr %56, align 1, !tbaa !11
  %58 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %59 = getelementptr inbounds i8, ptr %58, i64 1
  store i8 %57, ptr %59, align 1, !tbaa !11
  %60 = load i8, ptr %7, align 1, !tbaa !11
  %61 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %62 = getelementptr inbounds i8, ptr %61, i64 2
  store i8 %60, ptr %62, align 1, !tbaa !11
  br label %63

63:                                               ; preds = %51, %28
  br label %100

64:                                               ; preds = %2
  %65 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = lshr i32 %66, 2
  %68 = and i32 %67, 1
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %76

70:                                               ; preds = %64
  %71 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %74 = load i32, ptr %73, align 4, !tbaa !9
  %75 = add i32 %74, %72
  store i32 %75, ptr %73, align 4, !tbaa !9
  br label %99

76:                                               ; preds = %64
  %77 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %78 = getelementptr inbounds i8, ptr %77, i64 1
  %79 = load i8, ptr %78, align 1, !tbaa !11
  store i8 %79, ptr %8, align 1, !tbaa !11
  %80 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %81 = getelementptr inbounds i8, ptr %80, i64 3
  %82 = load i8, ptr %81, align 1, !tbaa !11
  %83 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %84 = getelementptr inbounds i8, ptr %83, i64 1
  store i8 %82, ptr %84, align 1, !tbaa !11
  %85 = load i8, ptr %8, align 1, !tbaa !11
  %86 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %87 = getelementptr inbounds i8, ptr %86, i64 3
  store i8 %85, ptr %87, align 1, !tbaa !11
  %88 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %89 = getelementptr inbounds i8, ptr %88, i64 3
  %90 = load i8, ptr %89, align 1, !tbaa !11
  store i8 %90, ptr %8, align 1, !tbaa !11
  %91 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %92 = getelementptr inbounds i8, ptr %91, i64 0
  %93 = load i8, ptr %92, align 1, !tbaa !11
  %94 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %95 = getelementptr inbounds i8, ptr %94, i64 3
  store i8 %93, ptr %95, align 1, !tbaa !11
  %96 = load i8, ptr %8, align 1, !tbaa !11
  %97 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %98 = getelementptr inbounds i8, ptr %97, i64 0
  store i8 %96, ptr %98, align 1, !tbaa !11
  br label %99

99:                                               ; preds = %76, %70
  br label %100

100:                                              ; preds = %99, %63
  %101 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %102 = load i32, ptr %101, align 4, !tbaa !9
  %103 = zext i32 %102 to i64
  %104 = add i64 %103, 792485636
  %105 = trunc i64 %104 to i32
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds i32, ptr %106, i64 0
  store i32 %105, ptr %107, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 4, 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 = !{!"int", !7, i64 0}
!11 = !{!7, !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 i32, ptr %0, align 4, !tbaa !5
  %4 = add i32 %3, 326104726
  %.sroa.14.0.extract.shift = lshr i32 %4, 8
  %.sroa.20.0.extract.shift = lshr i32 %4, 16
  %.sroa.22.0.extract.shift = lshr i32 %4, 24
  %5 = and i32 %4, 16
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %8, label %6

6:                                                ; preds = %2
  %7 = and i32 %4, 8
  %.not116 = icmp eq i32 %7, 0
  %..sroa.14.0.extract.shift = lshr i32 %4, %7
  %.sroa.20.0.extract.shift..sroa.22.0.extract.shift = select i1 %.not116, i32 %.sroa.20.0.extract.shift, i32 %.sroa.22.0.extract.shift
  %.sroa.14.0.extract.shift..sroa.20.0.extract.shift = select i1 %.not116, i32 %.sroa.14.0.extract.shift, i32 %.sroa.20.0.extract.shift
  %.sroa.22.0.extract.shift. = select i1 %.not116, i32 %.sroa.22.0.extract.shift, i32 %4
  br label %12

8:                                                ; preds = %2
  %9 = and i32 %4, 4
  %.not115 = icmp eq i32 %9, 0
  br i1 %.not115, label %12, label %10

10:                                               ; preds = %8
  %11 = shl i32 %4, 1
  %.sroa.14.0.extract.shift48 = lshr i32 %11, 8
  %.sroa.20.0.extract.shift77 = lshr i32 %11, 16
  %.sroa.22.0.extract.shift104 = lshr i32 %11, 24
  br label %12

12:                                               ; preds = %8, %6, %10
  %.sroa.0.0 = phi i32 [ %11, %10 ], [ %..sroa.14.0.extract.shift, %6 ], [ %.sroa.14.0.extract.shift, %8 ]
  %.sroa.14.0.in = phi i32 [ %.sroa.14.0.extract.shift48, %10 ], [ %.sroa.20.0.extract.shift..sroa.22.0.extract.shift, %6 ], [ %.sroa.22.0.extract.shift, %8 ]
  %.sroa.20.0 = phi i32 [ %.sroa.20.0.extract.shift77, %10 ], [ %.sroa.14.0.extract.shift..sroa.20.0.extract.shift, %6 ], [ %.sroa.20.0.extract.shift, %8 ]
  %.sroa.22.0 = phi i32 [ %.sroa.22.0.extract.shift104, %10 ], [ %.sroa.22.0.extract.shift., %6 ], [ %4, %8 ]
  %.sroa.22.0.insert.ext107 = shl i32 %.sroa.22.0, 24
  %.sroa.20.0.insert.ext80 = shl i32 %.sroa.20.0, 16
  %.sroa.20.0.insert.shift81 = and i32 %.sroa.20.0.insert.ext80, 16711680
  %.sroa.14.0.insert.ext51 = shl nuw i32 %.sroa.14.0.in, 8
  %.sroa.14.0.insert.shift52 = and i32 %.sroa.14.0.insert.ext51, 65280
  %.sroa.0.0.insert.ext25 = and i32 %.sroa.0.0, 255
  %.sroa.20.0.insert.insert83 = add nuw nsw i32 %.sroa.0.0.insert.ext25, 792485636
  %.sroa.14.0.insert.insert54 = add nuw nsw i32 %.sroa.20.0.insert.insert83, %.sroa.14.0.insert.shift52
  %.sroa.0.0.insert.insert27 = add nuw nsw i32 %.sroa.14.0.insert.insert54, %.sroa.20.0.insert.shift81
  %13 = add i32 %.sroa.0.0.insert.insert27, %.sroa.22.0.insert.ext107
  store i32 %13, ptr %1, align 4, !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 = !{!"int", !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