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

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 = and i32 %26, 1
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %63

29:                                               ; preds = %24
  %30 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %31 = getelementptr inbounds i8, ptr %30, i64 3
  %32 = load i8, ptr %31, align 1, !tbaa !11
  store i8 %32, ptr %6, align 1, !tbaa !11
  %33 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %34 = getelementptr inbounds i8, ptr %33, i64 0
  %35 = load i8, ptr %34, align 1, !tbaa !11
  %36 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %37 = getelementptr inbounds i8, ptr %36, i64 3
  store i8 %35, ptr %37, align 1, !tbaa !11
  %38 = load i8, ptr %6, align 1, !tbaa !11
  %39 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %40 = getelementptr inbounds i8, ptr %39, i64 0
  store i8 %38, ptr %40, align 1, !tbaa !11
  %41 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %42 = getelementptr inbounds i8, ptr %41, i64 0
  %43 = load i8, ptr %42, align 1, !tbaa !11
  store i8 %43, ptr %6, align 1, !tbaa !11
  %44 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %45 = getelementptr inbounds i8, ptr %44, i64 3
  %46 = load i8, ptr %45, align 1, !tbaa !11
  %47 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %48 = getelementptr inbounds i8, ptr %47, i64 0
  store i8 %46, ptr %48, align 1, !tbaa !11
  %49 = load i8, ptr %6, align 1, !tbaa !11
  %50 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %51 = getelementptr inbounds i8, ptr %50, i64 3
  store i8 %49, ptr %51, align 1, !tbaa !11
  %52 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %53 = getelementptr inbounds i8, ptr %52, i64 3
  %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 1
  %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 3
  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 1
  store i8 %60, ptr %62, align 1, !tbaa !11
  br label %86

63:                                               ; preds = %24
  %64 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %65 = getelementptr inbounds i8, ptr %64, i64 2
  %66 = load i8, ptr %65, align 1, !tbaa !11
  store i8 %66, ptr %8, align 1, !tbaa !11
  %67 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %68 = getelementptr inbounds i8, ptr %67, i64 0
  %69 = load i8, ptr %68, align 1, !tbaa !11
  %70 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %71 = getelementptr inbounds i8, ptr %70, i64 2
  store i8 %69, ptr %71, align 1, !tbaa !11
  %72 = load i8, ptr %8, align 1, !tbaa !11
  %73 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %74 = getelementptr inbounds i8, ptr %73, i64 0
  store i8 %72, ptr %74, align 1, !tbaa !11
  %75 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %76 = getelementptr inbounds i16, ptr %75, i64 1
  %77 = load i16, ptr %76, align 2, !tbaa !12
  store i16 %77, ptr %9, align 2, !tbaa !12
  %78 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %79 = getelementptr inbounds i16, ptr %78, i64 0
  %80 = load i16, ptr %79, align 2, !tbaa !12
  %81 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %82 = getelementptr inbounds i16, ptr %81, i64 1
  store i16 %80, ptr %82, align 2, !tbaa !12
  %83 = load i16, ptr %9, align 2, !tbaa !12
  %84 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %85 = getelementptr inbounds i16, ptr %84, i64 0
  store i16 %83, ptr %85, align 2, !tbaa !12
  br label %86

86:                                               ; preds = %63, %29
  br label %129

87:                                               ; preds = %2
  %88 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %89 = load i32, ptr %88, align 4, !tbaa !9
  %90 = lshr i32 %89, 4
  %91 = and i32 %90, 1
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %116

93:                                               ; preds = %87
  %94 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %95 = getelementptr inbounds i8, ptr %94, i64 2
  %96 = load i8, ptr %95, align 1, !tbaa !11
  store i8 %96, ptr %10, align 1, !tbaa !11
  %97 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %98 = getelementptr inbounds i8, ptr %97, i64 0
  %99 = load i8, ptr %98, align 1, !tbaa !11
  %100 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %101 = getelementptr inbounds i8, ptr %100, i64 2
  store i8 %99, ptr %101, align 1, !tbaa !11
  %102 = load i8, ptr %10, align 1, !tbaa !11
  %103 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %104 = getelementptr inbounds i8, ptr %103, i64 0
  store i8 %102, ptr %104, align 1, !tbaa !11
  %105 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %106 = getelementptr inbounds i8, ptr %105, i64 0
  %107 = load i8, ptr %106, align 1, !tbaa !11
  store i8 %107, ptr %10, align 1, !tbaa !11
  %108 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %109 = getelementptr inbounds i8, ptr %108, i64 3
  %110 = load i8, ptr %109, align 1, !tbaa !11
  %111 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %112 = getelementptr inbounds i8, ptr %111, i64 0
  store i8 %110, ptr %112, align 1, !tbaa !11
  %113 = load i8, ptr %10, align 1, !tbaa !11
  %114 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %115 = getelementptr inbounds i8, ptr %114, i64 3
  store i8 %113, ptr %115, align 1, !tbaa !11
  br label %128

116:                                              ; preds = %87
  %117 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %118 = getelementptr inbounds i8, ptr %117, i64 0
  %119 = load i8, ptr %118, align 1, !tbaa !11
  store i8 %119, ptr %11, align 1, !tbaa !11
  %120 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %121 = getelementptr inbounds i8, ptr %120, i64 2
  %122 = load i8, ptr %121, align 1, !tbaa !11
  %123 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %124 = getelementptr inbounds i8, ptr %123, i64 0
  store i8 %122, ptr %124, align 1, !tbaa !11
  %125 = load i8, ptr %11, align 1, !tbaa !11
  %126 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %127 = getelementptr inbounds i8, ptr %126, i64 2
  store i8 %125, ptr %127, align 1, !tbaa !11
  br label %128

128:                                              ; preds = %116, %93
  br label %129

129:                                              ; preds = %128, %86
  %130 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %131 = load i32, ptr %130, align 4, !tbaa !9
  %132 = sub i32 %131, 1355633607
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = getelementptr inbounds i32, ptr %133, i64 0
  store i32 %132, ptr %134, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #2
  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 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}
!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 = mul i32 %3, -1620706538
  %5 = add i32 %4, -440795876
  %.sroa.23.0.extract.shift = lshr i32 %5, 16
  %sum.shift = lshr i32 %5, 24
  %6 = and i32 %5, 16
  %.not = icmp eq i32 %6, 0
  %7 = and i32 %.sroa.23.0.extract.shift, 255
  %.sroa.23.sroa.15.0 = select i1 %.not, i32 %sum.shift, i32 %7
  %.sroa.0.sroa.0.0 = select i1 %.not, i32 %7, i32 %sum.shift
  %.sroa.0.sroa.21.0.insert.shift115 = and i32 %5, 65280
  %.sroa.0.sroa.0.0.insert.insert99 = or disjoint i32 %.sroa.0.sroa.21.0.insert.shift115, %.sroa.0.sroa.0.0
  %8 = shl nuw i32 %.sroa.23.sroa.15.0, 24
  %.sroa.23.sroa.0.0.insert.ext62 = shl i32 %5, 16
  %9 = and i32 %.sroa.23.sroa.0.0.insert.ext62, 16646144
  %.sroa.23.0.insert.shift40 = add nuw nsw i32 %9, -1355633607
  %.sroa.0.0.insert.insert26 = add nuw nsw i32 %.sroa.23.0.insert.shift40, %.sroa.0.sroa.0.0.insert.insert99
  %10 = add i32 %.sroa.0.0.insert.insert26, %8
  store i32 %10, 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: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass