; 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
  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
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds i32, ptr %9, i64 0
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = zext i32 %11 to i64
  %13 = add i64 %12, 51238316
  %14 = add i64 %13, 274866410
  %15 = trunc i64 %14 to i32
  %16 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  store i32 %15, ptr %16, align 4, !tbaa !9
  %17 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %19 = lshr i32 %18, 4
  %20 = and i32 %19, 1
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %98

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

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

34:                                               ; preds = %28
  %35 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %38 = load i32, ptr %37, align 4, !tbaa !9
  %39 = add i32 %38, %36
  store i32 %39, ptr %37, align 4, !tbaa !9
  br label %68

40:                                               ; preds = %28
  %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 1
  %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 1
  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 1
  %54 = load i8, ptr %53, align 1, !tbaa !11
  store i8 %54, ptr %6, align 1, !tbaa !11
  %55 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %56 = getelementptr inbounds i8, ptr %55, i64 0
  %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 1
  store i8 %57, ptr %59, align 1, !tbaa !11
  %60 = load i8, ptr %6, align 1, !tbaa !11
  %61 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %62 = getelementptr inbounds i8, ptr %61, i64 0
  store i8 %60, ptr %62, align 1, !tbaa !11
  %63 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = add i32 %66, %64
  store i32 %67, ptr %65, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %40, %34
  br label %97

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

97:                                               ; preds = %69, %68
  br label %110

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

110:                                              ; preds = %98, %97
  %111 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = zext i32 %112 to i64
  %114 = sub i64 %113, 945167787
  %115 = trunc i64 %114 to i32
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds i32, ptr %116, i64 0
  store i32 %115, ptr %117, align 4, !tbaa !9
  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}


; 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
  %5 = and i32 %4, 16
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %9, label %6

6:                                                ; preds = %2
  %7 = and i32 %4, 8
  %.not207 = icmp eq i32 %7, 0
  %8 = shl i32 %4, 1
  %.sroa.22.0.extract.shift91 = lshr i32 %8, 8
  %.sroa.30152.0.extract.shift197 = lshr i32 %8, 24
  %.sroa.22.0.extract.shift91. = select i1 %.not207, i32 %.sroa.22.0.extract.shift91, i32 %8
  %.sroa.30152.0.extract.shift197..sroa.22.0.extract.shift91 = select i1 %.not207, i32 %.sroa.30152.0.extract.shift197, i32 %.sroa.22.0.extract.shift91
  %..sroa.30152.0.extract.shift197 = select i1 %.not207, i32 %8, i32 %.sroa.30152.0.extract.shift197
  br label %10

9:                                                ; preds = %2
  %.sroa.22.0.extract.shift = lshr i32 %4, 8
  %.sroa.30152.0.extract.shift = lshr i32 %4, 24
  br label %10

10:                                               ; preds = %6, %9
  %.sroa.0.0.in = phi i32 [ %4, %9 ], [ %.sroa.22.0.extract.shift91., %6 ]
  %.sroa.22.0.in = phi i32 [ %.sroa.30152.0.extract.shift, %9 ], [ %.sroa.30152.0.extract.shift197..sroa.22.0.extract.shift91, %6 ]
  %.sroa.30.0.in.in = phi i32 [ %4, %9 ], [ %8, %6 ]
  %.sroa.30152.0.in = phi i32 [ %.sroa.22.0.extract.shift, %9 ], [ %..sroa.30152.0.extract.shift197, %6 ]
  %.sroa.30152.0.insert.ext200 = shl i32 %.sroa.30152.0.in, 24
  %.sroa.30.0.insert.ext148 = and i32 %.sroa.30.0.in.in, 16711680
  %.sroa.22.0.insert.ext94 = shl nuw i32 %.sroa.22.0.in, 8
  %.sroa.22.0.insert.shift95 = and i32 %.sroa.22.0.insert.ext94, 65280
  %.sroa.0.0.insert.ext44 = and i32 %.sroa.0.0.in, 255
  %.sroa.30.0.insert.insert151 = add nuw nsw i32 %.sroa.0.0.insert.ext44, -945167787
  %.sroa.22.0.insert.insert97 = add nuw nsw i32 %.sroa.30.0.insert.insert151, %.sroa.30.0.insert.ext148
  %.sroa.0.0.insert.insert46 = add nuw nsw i32 %.sroa.22.0.insert.insert97, %.sroa.22.0.insert.shift95
  %11 = add i32 %.sroa.0.0.insert.insert46, %.sroa.30152.0.insert.ext200
  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