; 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 i16, align 2
  %7 = alloca i16, align 2
  %8 = alloca i16, align 2
  %9 = alloca i8, align 1
  %10 = 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 2, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 1, 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, 914778474
  %16 = sub i64 %15, 981234615
  %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 = and i32 %20, 1
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %63

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

28:                                               ; preds = %23
  %29 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %30 = load i32, ptr %29, align 4, !tbaa !9
  %31 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %33 = add i32 %32, %30
  store i32 %33, ptr %31, align 4, !tbaa !9
  %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
  br label %62

39:                                               ; preds = %23
  %40 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %41 = getelementptr inbounds i16, ptr %40, i64 0
  %42 = load i16, ptr %41, align 2, !tbaa !11
  store i16 %42, ptr %6, align 2, !tbaa !11
  %43 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %44 = getelementptr inbounds i16, ptr %43, i64 1
  %45 = load i16, ptr %44, align 2, !tbaa !11
  %46 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %47 = getelementptr inbounds i16, ptr %46, i64 0
  store i16 %45, ptr %47, align 2, !tbaa !11
  %48 = load i16, ptr %6, align 2, !tbaa !11
  %49 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %50 = getelementptr inbounds i16, ptr %49, i64 1
  store i16 %48, ptr %50, align 2, !tbaa !11
  %51 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %52 = getelementptr inbounds i16, ptr %51, i64 1
  %53 = load i16, ptr %52, align 2, !tbaa !11
  store i16 %53, ptr %7, align 2, !tbaa !11
  %54 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %55 = getelementptr inbounds i16, ptr %54, i64 0
  %56 = load i16, ptr %55, align 2, !tbaa !11
  %57 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %58 = getelementptr inbounds i16, ptr %57, i64 1
  store i16 %56, ptr %58, align 2, !tbaa !11
  %59 = load i16, ptr %7, align 2, !tbaa !11
  %60 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %61 = getelementptr inbounds i16, ptr %60, i64 0
  store i16 %59, ptr %61, align 2, !tbaa !11
  br label %62

62:                                               ; preds = %39, %28
  br label %121

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

69:                                               ; preds = %63
  %70 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %71 = getelementptr inbounds i16, ptr %70, i64 1
  %72 = load i16, ptr %71, align 2, !tbaa !11
  store i16 %72, ptr %8, align 2, !tbaa !11
  %73 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %74 = getelementptr inbounds i16, ptr %73, i64 0
  %75 = load i16, ptr %74, align 2, !tbaa !11
  %76 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %77 = getelementptr inbounds i16, ptr %76, i64 1
  store i16 %75, ptr %77, align 2, !tbaa !11
  %78 = load i16, ptr %8, align 2, !tbaa !11
  %79 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %80 = getelementptr inbounds i16, ptr %79, i64 0
  store i16 %78, ptr %80, align 2, !tbaa !11
  %81 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %84 = load i32, ptr %83, align 4, !tbaa !9
  %85 = add i32 %84, %82
  store i32 %85, ptr %83, align 4, !tbaa !9
  br label %120

86:                                               ; preds = %63
  %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 !13
  store i8 %89, ptr %9, align 1, !tbaa !13
  %90 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %91 = getelementptr inbounds i8, ptr %90, i64 0
  %92 = load i8, ptr %91, align 1, !tbaa !13
  %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 !13
  %95 = load i8, ptr %9, align 1, !tbaa !13
  %96 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %97 = getelementptr inbounds i8, ptr %96, i64 0
  store i8 %95, ptr %97, align 1, !tbaa !13
  %98 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %99 = getelementptr inbounds i8, ptr %98, i64 0
  %100 = load i8, ptr %99, align 1, !tbaa !13
  store i8 %100, ptr %9, align 1, !tbaa !13
  %101 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %102 = getelementptr inbounds i8, ptr %101, i64 3
  %103 = load i8, ptr %102, align 1, !tbaa !13
  %104 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %105 = getelementptr inbounds i8, ptr %104, i64 0
  store i8 %103, ptr %105, align 1, !tbaa !13
  %106 = load i8, ptr %9, align 1, !tbaa !13
  %107 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %108 = getelementptr inbounds i8, ptr %107, i64 3
  store i8 %106, ptr %108, align 1, !tbaa !13
  %109 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %110 = getelementptr inbounds i8, ptr %109, i64 0
  %111 = load i8, ptr %110, align 1, !tbaa !13
  store i8 %111, ptr %10, align 1, !tbaa !13
  %112 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %113 = getelementptr inbounds i8, ptr %112, i64 2
  %114 = load i8, ptr %113, align 1, !tbaa !13
  %115 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %116 = getelementptr inbounds i8, ptr %115, i64 0
  store i8 %114, ptr %116, align 1, !tbaa !13
  %117 = load i8, ptr %10, align 1, !tbaa !13
  %118 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %119 = getelementptr inbounds i8, ptr %118, i64 2
  store i8 %117, ptr %119, align 1, !tbaa !13
  br label %120

120:                                              ; preds = %86, %69
  br label %121

121:                                              ; preds = %120, %62
  %122 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %123 = load i32, ptr %122, align 4, !tbaa !9
  %124 = zext i32 %123 to i64
  %125 = add i64 %124, 882016446
  %126 = add i64 %125, 1338648495
  %127 = trunc i64 %126 to i32
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds i32, ptr %128, i64 0
  store i32 %127, ptr %129, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 2, 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 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!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, -66456141
  %.sroa.0.sroa.0.0.extract.trunc217 = trunc i32 %4 to i16
  %.sroa.0.sroa.28.0.extract.shift263312 = lshr i32 %4, 8
  %.sroa.0.sroa.28.0.extract.trunc264 = trunc i32 %.sroa.0.sroa.28.0.extract.shift263312 to i16
  %.sroa.28.0.extract.shift = lshr i32 %4, 16
  %sum.shift = lshr i32 %4, 24
  %.sroa.0.sroa.28.0.insert.ext265 = shl i16 %.sroa.0.sroa.28.0.extract.trunc264, 8
  %.sroa.0.sroa.0.0.insert.ext218 = and i16 %.sroa.0.sroa.0.0.extract.trunc217, 255
  %.sroa.0.sroa.0.0.insert.insert220 = or disjoint i16 %.sroa.0.sroa.28.0.insert.ext265, %.sroa.0.sroa.0.0.insert.ext218
  %.sroa.0.0.insert.ext = zext i16 %.sroa.0.sroa.0.0.insert.insert220 to i32
  %5 = and i32 %.sroa.0.0.insert.ext, 1
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %11, label %6

6:                                                ; preds = %2
  %.sroa.0.sroa.0.0.extract.trunc230 = shl i16 %.sroa.0.sroa.0.0.extract.trunc217, 1
  %7 = shl i16 %.sroa.0.sroa.0.0.insert.insert220, 1
  %.sroa.0.sroa.28.0.insert.ext283 = and i16 %7, -256
  %.sroa.0.sroa.0.0.insert.ext231 = and i16 %.sroa.0.sroa.0.0.extract.trunc230, 128
  %.sroa.0.sroa.0.0.insert.insert233 = or disjoint i16 %.sroa.0.sroa.28.0.insert.ext283, %.sroa.0.sroa.0.0.insert.ext231
  %8 = and i32 %4, 1073676288
  %9 = or disjoint i32 %8, %.sroa.0.0.insert.ext
  %10 = shl nuw nsw i32 %9, 1
  %.sroa.28.0.insert.shift70 = and i32 %10, 2147418112
  %.sroa.0.0.insert.ext26 = zext i16 %7 to i32
  %.sroa.0.0.insert.insert28 = or disjoint i32 %.sroa.28.0.insert.shift70, %.sroa.0.0.insert.ext26
  %.sroa.0.sroa.0.0.extract.trunc237 = shl i16 %.sroa.0.sroa.0.0.extract.trunc217, 2
  %.sroa.0.sroa.28.0.extract.shift291320 = lshr exact i16 %.sroa.0.sroa.0.0.insert.insert233, 7
  %.sroa.28.0.extract.shift78 = lshr i32 %.sroa.0.0.insert.insert28, 15
  %.sroa.28.sroa.26.0.extract.shift171321 = lshr i32 %4, 22
  br label %19

11:                                               ; preds = %2
  %12 = and i32 %.sroa.0.0.insert.ext, 16
  %.not314 = icmp eq i32 %12, 0
  br i1 %.not314, label %19, label %13

13:                                               ; preds = %11
  %14 = shl i32 %4, 17
  %15 = shl nuw nsw i32 %sum.shift, 9
  %.sroa.0.sroa.0.0.insert.ext241 = shl nuw nsw i32 %.sroa.28.0.extract.shift, 1
  %16 = and i32 %.sroa.0.sroa.0.0.insert.ext241, 256
  %17 = or disjoint i32 %16, %15
  %18 = or disjoint i32 %15, %14
  %.sroa.0.sroa.0.0.extract.trunc247 = trunc i32 %.sroa.0.sroa.0.0.insert.ext241 to i16
  %.sroa.0.sroa.28.0.extract.shift305315 = lshr exact i32 %17, 8
  %.sroa.0.sroa.28.0.extract.trunc306 = trunc nuw nsw i32 %.sroa.0.sroa.28.0.extract.shift305315 to i16
  %.sroa.28.0.extract.shift95 = lshr i32 %18, 16
  %sum.shift316 = lshr i32 %14, 24
  br label %19

19:                                               ; preds = %11, %13, %6
  %.sroa.28.sroa.0.0.in = phi i32 [ %.sroa.28.0.extract.shift78, %6 ], [ %.sroa.28.0.extract.shift95, %13 ], [ %sum.shift, %11 ]
  %.sroa.28.sroa.26.0.in = phi i32 [ %.sroa.28.sroa.26.0.extract.shift171321, %6 ], [ %sum.shift316, %13 ], [ %.sroa.28.0.extract.shift, %11 ]
  %.sroa.0.sroa.0.0 = phi i16 [ %.sroa.0.sroa.0.0.extract.trunc237, %6 ], [ %.sroa.0.sroa.0.0.extract.trunc247, %13 ], [ %.sroa.0.sroa.0.0.extract.trunc217, %11 ]
  %.sroa.0.sroa.28.0 = phi i16 [ %.sroa.0.sroa.28.0.extract.shift291320, %6 ], [ %.sroa.0.sroa.28.0.extract.trunc306, %13 ], [ %.sroa.0.sroa.28.0.extract.trunc264, %11 ]
  %.sroa.0.sroa.28.0.insert.ext307 = shl i16 %.sroa.0.sroa.28.0, 8
  %.sroa.0.sroa.0.0.insert.ext248 = and i16 %.sroa.0.sroa.0.0, 255
  %.sroa.0.sroa.0.0.insert.insert250 = or disjoint i16 %.sroa.0.sroa.28.0.insert.ext307, %.sroa.0.sroa.0.0.insert.ext248
  %.sroa.28.sroa.26.0.insert.ext187 = shl nuw nsw i32 %.sroa.28.sroa.26.0.in, 8
  %.sroa.28.sroa.0.0.insert.ext134 = and i32 %.sroa.28.sroa.0.0.in, 255
  %.sroa.28.sroa.26.0.insert.ext187.masked = and i32 %.sroa.28.sroa.26.0.insert.ext187, 65280
  %.sroa.28.0.insert.ext98 = or disjoint i32 %.sroa.28.sroa.26.0.insert.ext187.masked, %.sroa.28.sroa.0.0.insert.ext134
  %.sroa.28.0.insert.shift99 = shl nuw i32 %.sroa.28.0.insert.ext98, 16
  %.sroa.0.0.insert.ext48 = zext i16 %.sroa.0.sroa.0.0.insert.insert250 to i32
  %.sroa.0.0.insert.insert50 = add i32 %.sroa.28.0.insert.shift99, -2074302355
  %20 = add i32 %.sroa.0.0.insert.insert50, %.sroa.0.0.insert.ext48
  store i32 %20, 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