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

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

30:                                               ; preds = %24
  %31 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %32 = getelementptr inbounds i8, ptr %31, i64 1
  %33 = load i8, ptr %32, align 1, !tbaa !11
  store i8 %33, ptr %6, align 1, !tbaa !11
  %34 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %35 = getelementptr inbounds i8, ptr %34, i64 3
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %37 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %38 = getelementptr inbounds i8, ptr %37, i64 1
  store i8 %36, ptr %38, align 1, !tbaa !11
  %39 = load i8, ptr %6, align 1, !tbaa !11
  %40 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %41 = getelementptr inbounds i8, ptr %40, i64 3
  store i8 %39, ptr %41, align 1, !tbaa !11
  %42 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %43 = getelementptr inbounds i8, ptr %42, i64 3
  %44 = load i8, ptr %43, align 1, !tbaa !11
  store i8 %44, ptr %6, align 1, !tbaa !11
  %45 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %46 = getelementptr inbounds i8, ptr %45, i64 0
  %47 = load i8, ptr %46, align 1, !tbaa !11
  %48 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %49 = getelementptr inbounds i8, ptr %48, i64 3
  store i8 %47, ptr %49, align 1, !tbaa !11
  %50 = load i8, ptr %6, align 1, !tbaa !11
  %51 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %52 = getelementptr inbounds i8, ptr %51, i64 0
  store i8 %50, ptr %52, align 1, !tbaa !11
  %53 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %54 = getelementptr inbounds i8, ptr %53, i64 1
  %55 = load i8, ptr %54, align 1, !tbaa !11
  store i8 %55, ptr %7, align 1, !tbaa !11
  %56 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %57 = getelementptr inbounds i8, ptr %56, i64 2
  %58 = load i8, ptr %57, align 1, !tbaa !11
  %59 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %60 = getelementptr inbounds i8, ptr %59, i64 1
  store i8 %58, ptr %60, align 1, !tbaa !11
  %61 = load i8, ptr %7, align 1, !tbaa !11
  %62 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %63 = getelementptr inbounds i8, ptr %62, i64 2
  store i8 %61, ptr %63, align 1, !tbaa !11
  br label %98

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

98:                                               ; preds = %64, %30
  br label %111

99:                                               ; preds = %2
  %100 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %101 = getelementptr inbounds i16, ptr %100, i64 1
  %102 = load i16, ptr %101, align 2, !tbaa !12
  store i16 %102, ptr %10, align 2, !tbaa !12
  %103 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %104 = getelementptr inbounds i16, ptr %103, i64 0
  %105 = load i16, ptr %104, align 2, !tbaa !12
  %106 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %107 = getelementptr inbounds i16, ptr %106, i64 1
  store i16 %105, ptr %107, align 2, !tbaa !12
  %108 = load i16, ptr %10, align 2, !tbaa !12
  %109 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %110 = getelementptr inbounds i16, ptr %109, i64 0
  store i16 %108, ptr %110, align 2, !tbaa !12
  br label %111

111:                                              ; preds = %99, %98
  %112 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = add i32 %113, 1684401988
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds i32, ptr %115, i64 0
  store i32 %114, ptr %116, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #2
  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.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 = !{!"int", !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 i32, ptr %0, align 4, !tbaa !5
  %4 = add i32 %3, 326104726
  %.sroa.0.sroa.12.0.extract.shift8297 = lshr i32 %4, 8
  %.sroa.20.0.extract.shift = lshr i32 %4, 16
  %sum.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
  %.not99 = icmp eq i32 %7, 0
  %.sroa.0.sroa.12.0.extract.shift8297. = select i1 %.not99, i32 %.sroa.0.sroa.12.0.extract.shift8297, i32 %4
  %.sroa.20.0.extract.shift..sroa.0.sroa.12.0.extract.shift8297 = select i1 %.not99, i32 %.sroa.20.0.extract.shift, i32 %.sroa.0.sroa.12.0.extract.shift8297
  %..sroa.20.0.extract.shift = select i1 %.not99, i32 %4, i32 %.sroa.20.0.extract.shift
  br label %10

8:                                                ; preds = %2
  %9 = and i32 %4, 239
  br label %10

10:                                               ; preds = %6, %8
  %.sroa.20.sroa.0.0.in = phi i32 [ %9, %8 ], [ %sum.shift, %6 ]
  %.sroa.20.sroa.14.0 = phi i32 [ %.sroa.0.sroa.12.0.extract.shift8297, %8 ], [ %.sroa.0.sroa.12.0.extract.shift8297., %6 ]
  %.sroa.0.sroa.0.0 = phi i32 [ %.sroa.20.0.extract.shift, %8 ], [ %.sroa.20.0.extract.shift..sroa.0.sroa.12.0.extract.shift8297, %6 ]
  %.sroa.0.sroa.12.0 = phi i32 [ %sum.shift, %8 ], [ %..sroa.20.0.extract.shift, %6 ]
  %.sroa.0.sroa.12.0.insert.ext92 = shl i32 %.sroa.0.sroa.12.0, 8
  %.sroa.0.sroa.12.0.insert.shift93 = and i32 %.sroa.0.sroa.12.0.insert.ext92, 65280
  %.sroa.0.sroa.0.0.insert.ext79 = and i32 %.sroa.0.sroa.0.0, 255
  %.sroa.0.sroa.0.0.insert.insert81 = or disjoint i32 %.sroa.0.sroa.0.0.insert.ext79, %.sroa.0.sroa.12.0.insert.shift93
  %.sroa.20.sroa.14.0.insert.ext62 = shl i32 %.sroa.20.sroa.14.0, 8
  %.sroa.20.sroa.14.0.insert.shift63 = and i32 %.sroa.20.sroa.14.0.insert.ext62, 65280
  %.sroa.20.sroa.0.0.insert.insert53 = or disjoint i32 %.sroa.20.sroa.14.0.insert.shift63, %.sroa.20.sroa.0.0.in
  %.sroa.20.0.insert.shift35 = shl nuw i32 %.sroa.20.sroa.0.0.insert.insert53, 16
  %.sroa.0.0.insert.insert17 = add i32 %.sroa.20.0.insert.shift35, 1684401988
  %11 = add i32 %.sroa.0.0.insert.insert17, %.sroa.0.sroa.0.0.insert.insert81
  store i32 %11, 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