; 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 i16, align 2
  %8 = alloca i8, align 1
  %9 = alloca i16, align 2
  %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 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
  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 = add i32 %13, -10089659
  %15 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  store i32 %14, ptr %15, align 4, !tbaa !9
  %16 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %17 = load i32, ptr %16, align 4, !tbaa !9
  %18 = lshr i32 %17, 4
  %19 = and i32 %18, 1
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %125

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

27:                                               ; preds = %21
  %28 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %29 = load i32, ptr %28, align 4, !tbaa !9
  %30 = lshr i32 %29, 2
  %31 = and i32 %30, 1
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %50

33:                                               ; preds = %27
  %34 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %37 = load i32, ptr %36, align 4, !tbaa !9
  %38 = add i32 %37, %35
  store i32 %38, ptr %36, align 4, !tbaa !9
  %39 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %40 = getelementptr inbounds i8, ptr %39, i64 3
  %41 = load i8, ptr %40, align 1, !tbaa !11
  store i8 %41, ptr %6, align 1, !tbaa !11
  %42 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %43 = getelementptr inbounds i8, ptr %42, i64 0
  %44 = load i8, ptr %43, align 1, !tbaa !11
  %45 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %46 = getelementptr inbounds i8, ptr %45, i64 3
  store i8 %44, ptr %46, align 1, !tbaa !11
  %47 = load i8, ptr %6, align 1, !tbaa !11
  %48 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %49 = getelementptr inbounds i8, ptr %48, i64 0
  store i8 %47, ptr %49, align 1, !tbaa !11
  br label %95

50:                                               ; preds = %27
  %51 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %52 = getelementptr inbounds i16, ptr %51, i64 0
  %53 = load i16, ptr %52, align 2, !tbaa !12
  store i16 %53, ptr %7, align 2, !tbaa !12
  %54 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %55 = getelementptr inbounds i16, ptr %54, i64 1
  %56 = load i16, ptr %55, align 2, !tbaa !12
  %57 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %58 = getelementptr inbounds i16, ptr %57, i64 0
  store i16 %56, ptr %58, align 2, !tbaa !12
  %59 = load i16, ptr %7, align 2, !tbaa !12
  %60 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %61 = getelementptr inbounds i16, ptr %60, i64 1
  store i16 %59, ptr %61, align 2, !tbaa !12
  %62 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %63 = getelementptr inbounds i16, ptr %62, i64 1
  %64 = load i16, ptr %63, align 2, !tbaa !12
  store i16 %64, ptr %7, align 2, !tbaa !12
  %65 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %66 = getelementptr inbounds i16, ptr %65, i64 0
  %67 = load i16, ptr %66, align 2, !tbaa !12
  %68 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %69 = getelementptr inbounds i16, ptr %68, i64 1
  store i16 %67, ptr %69, align 2, !tbaa !12
  %70 = load i16, ptr %7, align 2, !tbaa !12
  %71 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %72 = getelementptr inbounds i16, ptr %71, i64 0
  store i16 %70, ptr %72, align 2, !tbaa !12
  %73 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %74 = getelementptr inbounds i8, ptr %73, i64 2
  %75 = load i8, ptr %74, align 1, !tbaa !11
  store i8 %75, ptr %8, align 1, !tbaa !11
  %76 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %77 = getelementptr inbounds i8, ptr %76, i64 3
  %78 = load i8, ptr %77, align 1, !tbaa !11
  %79 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %80 = getelementptr inbounds i8, ptr %79, i64 2
  store i8 %78, ptr %80, align 1, !tbaa !11
  %81 = load i8, ptr %8, align 1, !tbaa !11
  %82 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %83 = getelementptr inbounds i8, ptr %82, i64 3
  store i8 %81, ptr %83, align 1, !tbaa !11
  %84 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %85 = getelementptr inbounds i8, ptr %84, i64 1
  %86 = load i8, ptr %85, align 1, !tbaa !11
  store i8 %86, ptr %8, align 1, !tbaa !11
  %87 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %88 = getelementptr inbounds i8, ptr %87, i64 0
  %89 = load i8, ptr %88, align 1, !tbaa !11
  %90 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %91 = getelementptr inbounds i8, ptr %90, i64 1
  store i8 %89, ptr %91, align 1, !tbaa !11
  %92 = load i8, ptr %8, align 1, !tbaa !11
  %93 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %94 = getelementptr inbounds i8, ptr %93, i64 0
  store i8 %92, ptr %94, align 1, !tbaa !11
  br label %95

95:                                               ; preds = %50, %33
  br label %124

96:                                               ; preds = %21
  %97 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %98 = load i32, ptr %97, align 4, !tbaa !9
  %99 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %100 = load i32, ptr %99, align 4, !tbaa !9
  %101 = add i32 %100, %98
  store i32 %101, ptr %99, align 4, !tbaa !9
  %102 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %103 = getelementptr inbounds i16, ptr %102, i64 0
  %104 = load i16, ptr %103, align 2, !tbaa !12
  store i16 %104, ptr %9, align 2, !tbaa !12
  %105 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %106 = getelementptr inbounds i16, ptr %105, i64 1
  %107 = load i16, ptr %106, align 2, !tbaa !12
  %108 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %109 = getelementptr inbounds i16, ptr %108, i64 0
  store i16 %107, ptr %109, align 2, !tbaa !12
  %110 = load i16, ptr %9, align 2, !tbaa !12
  %111 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %112 = getelementptr inbounds i16, ptr %111, i64 1
  store i16 %110, ptr %112, align 2, !tbaa !12
  %113 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %114 = getelementptr inbounds i16, ptr %113, i64 1
  %115 = load i16, ptr %114, align 2, !tbaa !12
  store i16 %115, ptr %9, align 2, !tbaa !12
  %116 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %117 = getelementptr inbounds i16, ptr %116, i64 0
  %118 = load i16, ptr %117, align 2, !tbaa !12
  %119 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %120 = getelementptr inbounds i16, ptr %119, i64 1
  store i16 %118, ptr %120, align 2, !tbaa !12
  %121 = load i16, ptr %9, align 2, !tbaa !12
  %122 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %123 = getelementptr inbounds i16, ptr %122, i64 0
  store i16 %121, ptr %123, align 2, !tbaa !12
  br label %124

124:                                              ; preds = %96, %95
  br label %137

125:                                              ; preds = %2
  %126 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %127 = getelementptr inbounds i16, ptr %126, i64 1
  %128 = load i16, ptr %127, align 2, !tbaa !12
  store i16 %128, ptr %10, align 2, !tbaa !12
  %129 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %130 = getelementptr inbounds i16, ptr %129, i64 0
  %131 = load i16, ptr %130, align 2, !tbaa !12
  %132 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %133 = getelementptr inbounds i16, ptr %132, i64 1
  store i16 %131, ptr %133, align 2, !tbaa !12
  %134 = load i16, ptr %10, align 2, !tbaa !12
  %135 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %136 = getelementptr inbounds i16, ptr %135, i64 0
  store i16 %134, ptr %136, align 2, !tbaa !12
  br label %137

137:                                              ; preds = %125, %124
  %138 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %139 = load i32, ptr %138, align 4, !tbaa !9
  %140 = zext i32 %139 to i64
  %141 = add i64 %140, 604758237
  %142 = add i64 %141, 900480495
  %143 = trunc i64 %142 to i32
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = getelementptr inbounds i32, ptr %144, i64 0
  store i32 %143, ptr %145, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, 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 2, 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, -10089659
  %.sroa.0.sroa.0.0.extract.trunc215 = trunc i32 %4 to i16
  %.sroa.29.0.extract.shift = lshr i32 %4, 16
  %5 = and i32 %4, 16
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %10, label %6

6:                                                ; preds = %2
  %7 = and i32 %4, 4
  %.not309 = icmp eq i32 %7, 0
  br i1 %.not309, label %9, label %8

8:                                                ; preds = %6
  %.sroa.0.sroa.0.0.extract.trunc231 = shl i32 %4, 1
  %.sroa.0.sroa.27.0.extract.shift288317 = lshr i16 %.sroa.0.sroa.0.0.extract.trunc215, 7
  %.sroa.0.0.insert.insert = lshr i32 %4, 15
  %.sroa.29.sroa.25.0.extract.shift153318 = lshr i32 %4, 23
  br label %11

9:                                                ; preds = %6
  %sum.shift = lshr i32 %4, 24
  %.sroa.0.sroa.27.0.extract.shift246315 = lshr i32 %4, 8
  br label %11

10:                                               ; preds = %2
  %.sroa.29.sroa.25.0.extract.shift197307 = lshr i32 %4, 8
  %.sroa.0.sroa.27.0.extract.shift264308 = lshr i32 %4, 24
  %.sroa.0.sroa.27.0.extract.trunc265 = trunc nuw nsw i32 %.sroa.0.sroa.27.0.extract.shift264308 to i16
  br label %11

11:                                               ; preds = %9, %8, %10
  %.sroa.29.sroa.0.0.in = phi i32 [ %.sroa.0.0.insert.insert, %8 ], [ %sum.shift, %9 ], [ %4, %10 ]
  %.sroa.29.sroa.25.0 = phi i32 [ %.sroa.0.sroa.0.0.extract.trunc231, %8 ], [ %.sroa.29.0.extract.shift, %9 ], [ %.sroa.29.sroa.25.0.extract.shift197307, %10 ]
  %.sroa.0.sroa.0.0.in = phi i32 [ %.sroa.29.sroa.25.0.extract.shift153318, %8 ], [ %.sroa.0.sroa.27.0.extract.shift246315, %9 ], [ %.sroa.29.0.extract.shift, %10 ]
  %.sroa.0.sroa.27.0 = phi i16 [ %.sroa.0.sroa.27.0.extract.shift288317, %8 ], [ %.sroa.0.sroa.0.0.extract.trunc215, %9 ], [ %.sroa.0.sroa.27.0.extract.trunc265, %10 ]
  %.sroa.0.sroa.0.0 = trunc i32 %.sroa.0.sroa.0.0.in to i16
  %.sroa.0.sroa.27.0.insert.ext300 = shl i16 %.sroa.0.sroa.27.0, 8
  %.sroa.0.sroa.0.0.insert.ext239 = and i16 %.sroa.0.sroa.0.0, 255
  %.sroa.0.sroa.0.0.insert.insert241 = or disjoint i16 %.sroa.0.sroa.27.0.insert.ext300, %.sroa.0.sroa.0.0.insert.ext239
  %.sroa.29.sroa.25.0.insert.ext165 = shl i32 %.sroa.29.sroa.25.0, 8
  %.sroa.29.sroa.0.0.insert.ext114 = and i32 %.sroa.29.sroa.0.0.in, 255
  %.sroa.29.sroa.25.0.insert.ext165.masked = and i32 %.sroa.29.sroa.25.0.insert.ext165, 65280
  %.sroa.29.0.insert.ext81 = or disjoint i32 %.sroa.29.sroa.25.0.insert.ext165.masked, %.sroa.29.sroa.0.0.insert.ext114
  %.sroa.29.0.insert.shift82 = shl nuw i32 %.sroa.29.0.insert.ext81, 16
  %.sroa.0.0.insert.ext42 = zext i16 %.sroa.0.sroa.0.0.insert.insert241 to i32
  %.sroa.0.0.insert.insert44 = add i32 %.sroa.29.0.insert.shift82, 1505238732
  %12 = add i32 %.sroa.0.0.insert.insert44, %.sroa.0.0.insert.ext42
  store i32 %12, 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: BDCEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass