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

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

25:                                               ; preds = %19
  %26 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %27 = load i64, ptr %26, align 8, !tbaa !9
  %28 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %29 = load i64, ptr %28, align 8, !tbaa !9
  %30 = mul i64 %29, %27
  store i64 %30, ptr %28, align 8, !tbaa !9
  %31 = getelementptr inbounds [1 x i64], 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 i64], ptr %5, i64 0, i64 0
  %35 = getelementptr inbounds i8, ptr %34, i64 7
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %37 = getelementptr inbounds [1 x i64], 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 i64], ptr %5, i64 0, i64 0
  %41 = getelementptr inbounds i8, ptr %40, i64 7
  store i8 %39, ptr %41, align 1, !tbaa !11
  %42 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %43 = getelementptr inbounds i8, ptr %42, i64 5
  %44 = load i8, ptr %43, align 1, !tbaa !11
  store i8 %44, ptr %6, align 1, !tbaa !11
  %45 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %46 = getelementptr inbounds i8, ptr %45, i64 2
  %47 = load i8, ptr %46, align 1, !tbaa !11
  %48 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %49 = getelementptr inbounds i8, ptr %48, i64 5
  store i8 %47, ptr %49, align 1, !tbaa !11
  %50 = load i8, ptr %6, align 1, !tbaa !11
  %51 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %52 = getelementptr inbounds i8, ptr %51, i64 2
  store i8 %50, ptr %52, align 1, !tbaa !11
  br label %64

53:                                               ; preds = %19
  %54 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = add i64 %57, %55
  store i64 %58, ptr %56, align 8, !tbaa !9
  %59 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %60 = load i64, ptr %59, align 8, !tbaa !9
  %61 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %62 = load i64, ptr %61, align 8, !tbaa !9
  %63 = add i64 %62, %60
  store i64 %63, ptr %61, align 8, !tbaa !9
  br label %64

64:                                               ; preds = %53, %25
  br label %99

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

99:                                               ; preds = %65, %64
  %100 = getelementptr inbounds [1 x i64], ptr %5, i64 0, i64 0
  %101 = load i64, ptr %100, align 8, !tbaa !9
  %102 = sub i64 %101, 608351785
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds i64, ptr %103, i64 0
  store i64 %102, ptr %104, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !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 i64, ptr %0, align 8, !tbaa !5
  %4 = add i64 %3, -10089659
  %5 = and i64 %4, 16
  %.not = icmp eq i64 %5, 0
  br i1 %.not, label %8, label %6

6:                                                ; preds = %2
  %7 = mul i64 %4, %4
  %.sroa.0.sroa.21.0.extract.shift372551 = lshr i64 %7, 8
  %.sroa.0.sroa.23.0.extract.shift428552 = lshr i64 %7, 16
  %.sroa.0.sroa.25.0.extract.shift484553 = lshr i64 %7, 24
  %.sroa.25.0.extract.shift60 = lshr i64 %7, 32
  %.sroa.25.sroa.21.0.extract.shift146554 = lshr i64 %7, 40
  %.sroa.25.sroa.23.0.extract.shift202555 = lshr i64 %7, 48
  %sum.shift556 = lshr i64 %7, 56
  br label %9

8:                                                ; preds = %2
  %.sroa.25.0.extract.shift = lshr i64 %4, 32
  %.sroa.25.sroa.21.0.extract.shift188545 = lshr i64 %4, 8
  %.sroa.25.sroa.23.0.extract.shift244546 = lshr i64 %4, 16
  %.sroa.25.sroa.23246.0.extract.shift301547 = lshr i64 %4, 24
  %.sroa.0.sroa.21.0.extract.shift352548 = lshr i64 %4, 40
  %.sroa.0.sroa.23.0.extract.shift408549 = lshr i64 %4, 48
  %sum.shift = lshr i64 %4, 56
  br label %9

9:                                                ; preds = %6, %8
  %.sroa.0.sroa.0.0.in = phi i64 [ %7, %6 ], [ %.sroa.25.0.extract.shift, %8 ]
  %.sroa.25.sroa.23246.0.in = phi i64 [ %.sroa.0.sroa.21.0.extract.shift372551, %6 ], [ %.sroa.25.sroa.23246.0.extract.shift301547, %8 ]
  %.sroa.25.sroa.23.0.in = phi i64 [ %.sroa.25.sroa.23.0.extract.shift202555, %6 ], [ %.sroa.25.sroa.23.0.extract.shift244546, %8 ]
  %.sroa.25.sroa.21.0.in = phi i64 [ %.sroa.0.sroa.23.0.extract.shift428552, %6 ], [ %.sroa.25.sroa.21.0.extract.shift188545, %8 ]
  %.sroa.25.sroa.0.0.in = phi i64 [ %.sroa.25.0.extract.shift60, %6 ], [ %4, %8 ]
  %.sroa.0.sroa.21.0.in = phi i64 [ %sum.shift556, %6 ], [ %.sroa.0.sroa.21.0.extract.shift352548, %8 ]
  %.sroa.0.sroa.23.0.in = phi i64 [ %.sroa.25.sroa.21.0.extract.shift146554, %6 ], [ %.sroa.0.sroa.23.0.extract.shift408549, %8 ]
  %.sroa.0.sroa.25.0.in = phi i64 [ %.sroa.0.sroa.25.0.extract.shift484553, %6 ], [ %sum.shift, %8 ]
  %.sroa.0.sroa.25.0.insert.ext506 = shl nuw i64 %.sroa.0.sroa.25.0.in, 24
  %.sroa.0.sroa.23.0.insert.ext450 = shl nuw nsw i64 %.sroa.0.sroa.23.0.in, 16
  %.sroa.0.sroa.23.0.insert.shift451 = and i64 %.sroa.0.sroa.23.0.insert.ext450, 16711680
  %.sroa.0.sroa.21.0.insert.ext394 = shl nuw nsw i64 %.sroa.0.sroa.21.0.in, 8
  %.sroa.0.sroa.21.0.insert.shift395 = and i64 %.sroa.0.sroa.21.0.insert.ext394, 65280
  %.sroa.0.sroa.0.0.insert.ext339 = and i64 %.sroa.0.sroa.0.0.in, 255
  %.sroa.25.sroa.23246.0.insert.ext281 = shl i64 %.sroa.25.sroa.23246.0.in, 24
  %.sroa.25.sroa.23.0.insert.ext224 = shl nuw i64 %.sroa.25.sroa.23.0.in, 16
  %.sroa.25.sroa.23.0.insert.shift225 = and i64 %.sroa.25.sroa.23.0.insert.ext224, 16711680
  %.sroa.25.sroa.21.0.insert.ext168 = shl nuw i64 %.sroa.25.sroa.21.0.in, 8
  %.sroa.25.sroa.21.0.insert.shift169 = and i64 %.sroa.25.sroa.21.0.insert.ext168, 65280
  %.sroa.25.sroa.0.0.insert.ext119 = and i64 %.sroa.25.sroa.0.0.in, 255
  %.sroa.25.sroa.23246.0.insert.ext281.masked = and i64 %.sroa.25.sroa.23246.0.insert.ext281, 4278190080
  %.sroa.25.sroa.23.0.insert.insert227.masked = or disjoint i64 %.sroa.25.sroa.23.0.insert.shift225, %.sroa.25.sroa.23246.0.insert.ext281.masked
  %.sroa.25.sroa.21.0.insert.insert171.masked = or disjoint i64 %.sroa.25.sroa.23.0.insert.insert227.masked, %.sroa.25.sroa.21.0.insert.shift169
  %.sroa.25.0.insert.ext87 = or disjoint i64 %.sroa.25.sroa.21.0.insert.insert171.masked, %.sroa.25.sroa.0.0.insert.ext119
  %.sroa.25.0.insert.shift88 = shl nuw i64 %.sroa.25.0.insert.ext87, 32
  %.sroa.0.sroa.25.0.insert.ext506.masked = and i64 %.sroa.0.sroa.25.0.insert.ext506, 4278190080
  %.sroa.0.sroa.23.0.insert.insert453.masked = add nuw nsw i64 %.sroa.0.sroa.0.0.insert.ext339, -608351785
  %.sroa.0.sroa.21.0.insert.insert397.masked = add nuw nsw i64 %.sroa.0.sroa.23.0.insert.insert453.masked, %.sroa.0.sroa.21.0.insert.shift395
  %.sroa.0.0.insert.ext40 = add i64 %.sroa.0.sroa.21.0.insert.insert397.masked, %.sroa.25.0.insert.shift88
  %.sroa.0.0.insert.insert42 = add nuw nsw i64 %.sroa.0.0.insert.ext40, %.sroa.0.sroa.23.0.insert.shift451
  %10 = add i64 %.sroa.0.0.insert.insert42, %.sroa.0.sroa.25.0.insert.ext506.masked
  store i64 %10, ptr %1, align 8, !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 = !{!"long", !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