; 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
  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
  %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, 914778474
  %14 = xor i64 %13, 3462201355
  %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 = and i32 %18, 1
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %85

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, 1
  %25 = and i32 %24, 1
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %49

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, 3
  %31 = and i32 %30, 1
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %48, label %33

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 = and i32 %35, 15
  %37 = shl i32 %36, 3
  %38 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = or i32 %39, %37
  store i32 %40, ptr %38, align 4, !tbaa !9
  %41 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = and i32 %42, 31
  %44 = shl i32 %43, 3
  %45 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = or i32 %46, %44
  store i32 %47, ptr %45, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %33, %27
  br label %84

49:                                               ; preds = %21
  %50 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %51 = getelementptr inbounds i8, ptr %50, i64 0
  %52 = load i8, ptr %51, align 1, !tbaa !11
  store i8 %52, ptr %6, align 1, !tbaa !11
  %53 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %54 = getelementptr inbounds i8, ptr %53, i64 3
  %55 = load i8, ptr %54, align 1, !tbaa !11
  %56 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %57 = getelementptr inbounds i8, ptr %56, i64 0
  store i8 %55, ptr %57, align 1, !tbaa !11
  %58 = load i8, ptr %6, align 1, !tbaa !11
  %59 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %60 = getelementptr inbounds i8, ptr %59, i64 3
  store i8 %58, ptr %60, align 1, !tbaa !11
  %61 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = lshr i32 %64, 1
  %66 = and i32 %65, 15
  %67 = zext i32 %66 to i64
  %68 = or i64 %67, 1
  %69 = trunc i64 %68 to i32
  %70 = shl i32 %62, %69
  %71 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %74 = load i32, ptr %73, align 4, !tbaa !9
  %75 = lshr i32 %74, 1
  %76 = and i32 %75, 15
  %77 = zext i32 %76 to i64
  %78 = or i64 %77, 1
  %79 = sub i64 32, %78
  %80 = trunc i64 %79 to i32
  %81 = lshr i32 %72, %80
  %82 = or i32 %70, %81
  %83 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  store i32 %82, ptr %83, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %49, %48
  br label %108

85:                                               ; preds = %2
  %86 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %87 = getelementptr inbounds i16, ptr %86, i64 1
  %88 = load i16, ptr %87, align 2, !tbaa !12
  store i16 %88, ptr %7, align 2, !tbaa !12
  %89 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %90 = getelementptr inbounds i16, ptr %89, i64 0
  %91 = load i16, ptr %90, align 2, !tbaa !12
  %92 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %93 = getelementptr inbounds i16, ptr %92, i64 1
  store i16 %91, ptr %93, align 2, !tbaa !12
  %94 = load i16, ptr %7, align 2, !tbaa !12
  %95 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %96 = getelementptr inbounds i16, ptr %95, i64 0
  store i16 %94, ptr %96, align 2, !tbaa !12
  %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
  store i8 %99, ptr %8, align 1, !tbaa !11
  %100 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %101 = getelementptr inbounds i8, ptr %100, i64 2
  %102 = load i8, ptr %101, 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 = load i8, ptr %8, align 1, !tbaa !11
  %106 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %107 = getelementptr inbounds i8, ptr %106, i64 2
  store i8 %105, ptr %107, align 1, !tbaa !11
  br label %108

108:                                              ; preds = %85, %84
  %109 = getelementptr inbounds [1 x i32], ptr %5, i64 0, i64 0
  %110 = load i32, ptr %109, align 4, !tbaa !9
  %111 = zext i32 %110 to i64
  %112 = add i64 %111, 494122716
  %113 = trunc i64 %112 to i32
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds i32, ptr %114, i64 0
  store i32 %113, ptr %115, align 4, !tbaa !9
  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, 914778474
  %5 = xor i32 %4, -832765941
  %.sroa.0.sroa.24.0.extract.shift252309 = lshr i32 %4, 8
  %.sroa.24.0.extract.shift = lshr i32 %5, 16
  %sum.shift = lshr i32 %5, 24
  %6 = trunc i32 %.sroa.0.sroa.24.0.extract.shift252309 to i16
  %.sroa.0.sroa.24.0.insert.ext254 = shl i16 %6, 8
  %7 = trunc i32 %5 to i16
  %.sroa.0.sroa.0.0.insert.ext213 = and i16 %7, 255
  %.sroa.0.sroa.0.0.insert.insert215 = or disjoint i16 %.sroa.0.sroa.24.0.insert.ext254, %.sroa.0.sroa.0.0.insert.ext213
  %8 = trunc nuw nsw i32 %sum.shift to i16
  %9 = trunc nuw i32 %.sroa.24.0.extract.shift to i16
  %.sroa.24.sroa.0.0.insert.ext = and i16 %9, 255
  %.sroa.0.0.insert.ext = zext i16 %.sroa.0.sroa.0.0.insert.insert215 to i32
  %10 = and i32 %.sroa.0.0.insert.ext, 1
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %26, label %11

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

13:                                               ; preds = %11
  %14 = and i32 %.sroa.0.0.insert.ext, 8
  %.not315 = icmp eq i32 %14, 0
  br i1 %.not315, label %15, label %26

15:                                               ; preds = %13
  %16 = shl nuw nsw i16 %.sroa.0.sroa.0.0.insert.ext213, 3
  %17 = and i16 %16, 56
  %18 = or disjoint i16 %.sroa.0.sroa.24.0.insert.ext254, %17
  %.sroa.0.sroa.0.0.insert.insert231 = or i16 %18, %.sroa.0.sroa.0.0.insert.ext213
  %.sroa.0.0.insert.ext24 = zext i16 %.sroa.0.sroa.0.0.insert.insert231 to i32
  %19 = shl nuw nsw i32 %.sroa.0.0.insert.ext24, 3
  %20 = or i32 %19, %.sroa.0.0.insert.ext24
  br label %26

21:                                               ; preds = %11
  %.sroa.0.sroa.0.0.insert.insert238 = or disjoint i16 %.sroa.0.sroa.24.0.insert.ext254, %8
  %.sroa.24.sroa.22.0.insert.shift185 = shl nuw i16 %.sroa.0.sroa.0.0.insert.ext213, 8
  %.sroa.24.sroa.0.0.insert.insert138 = or disjoint i16 %.sroa.24.sroa.22.0.insert.shift185, %.sroa.24.sroa.0.0.insert.ext
  %.sroa.24.0.insert.ext88 = zext i16 %.sroa.24.sroa.0.0.insert.insert138 to i32
  %.sroa.24.0.insert.shift89 = shl nuw i32 %.sroa.24.0.insert.ext88, 16
  %.sroa.0.0.insert.ext33 = zext i16 %.sroa.0.sroa.0.0.insert.insert238 to i32
  %.sroa.0.0.insert.insert35 = or disjoint i32 %.sroa.24.0.insert.shift89, %.sroa.0.0.insert.ext33
  %22 = lshr i32 %.sroa.0.0.insert.ext33, 1
  %23 = and i32 %22, 14
  %24 = or disjoint i32 %23, 1
  %25 = tail call i32 @llvm.fshl.i32(i32 %.sroa.0.0.insert.insert35, i32 %.sroa.0.0.insert.insert35, i32 %24)
  %.sroa.0.sroa.24.0.extract.shift302312 = lshr i32 %25, 8
  %.sroa.24.0.extract.shift107 = lshr i32 %25, 16
  %sum.shift313 = lshr i32 %25, 24
  br label %26

26:                                               ; preds = %2, %21, %15, %13
  %.sroa.24.sroa.0.0.in = phi i32 [ %.sroa.24.0.extract.shift, %13 ], [ %.sroa.24.0.extract.shift, %15 ], [ %.sroa.24.0.extract.shift107, %21 ], [ %.sroa.24.0.extract.shift, %2 ]
  %.sroa.24.sroa.22.0.in = phi i32 [ %sum.shift, %13 ], [ %sum.shift, %15 ], [ %sum.shift313, %21 ], [ %.sroa.0.sroa.24.0.extract.shift252309, %2 ]
  %.sroa.0.sroa.0.0.in = phi i32 [ %5, %13 ], [ %20, %15 ], [ %25, %21 ], [ %5, %2 ]
  %.sroa.0.sroa.24.0.in = phi i32 [ %.sroa.0.sroa.24.0.extract.shift252309, %13 ], [ %.sroa.0.sroa.24.0.extract.shift252309, %15 ], [ %.sroa.0.sroa.24.0.extract.shift302312, %21 ], [ %sum.shift, %2 ]
  %.sroa.0.sroa.24.0.insert.ext304 = shl nuw i32 %.sroa.0.sroa.24.0.in, 8
  %.sroa.0.sroa.0.0.insert.ext249 = and i32 %.sroa.0.sroa.0.0.in, 255
  %.sroa.24.sroa.22.0.insert.ext202 = shl nuw i32 %.sroa.24.sroa.22.0.in, 8
  %.sroa.24.sroa.0.0.insert.ext149 = and i32 %.sroa.24.sroa.0.0.in, 255
  %.sroa.24.sroa.22.0.insert.ext202.masked = and i32 %.sroa.24.sroa.22.0.insert.ext202, 65280
  %.sroa.24.0.insert.ext110 = or disjoint i32 %.sroa.24.sroa.22.0.insert.ext202.masked, %.sroa.24.sroa.0.0.insert.ext149
  %.sroa.24.0.insert.shift111 = shl nuw i32 %.sroa.24.0.insert.ext110, 16
  %.sroa.0.sroa.24.0.insert.ext304.masked = and i32 %.sroa.0.sroa.24.0.insert.ext304, 65280
  %.sroa.0.0.insert.ext50 = or disjoint i32 %.sroa.0.sroa.0.0.insert.ext249, %.sroa.0.sroa.24.0.insert.ext304.masked
  %.sroa.0.0.insert.insert52 = add i32 %.sroa.24.0.insert.shift111, 494122716
  %27 = add i32 %.sroa.0.0.insert.insert52, %.sroa.0.0.insert.ext50
  store i32 %27, ptr %1, align 4, !tbaa !5
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.fshl.i32(i32, i32, i32) #1

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" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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,TailCallElimPass