; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_basicMath)

; 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"

@stderr = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
define dso_local void @Math_printBinaryVector(i32 noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca [33 x i8], align 16
  %4 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 33, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %5 = getelementptr inbounds [33 x i8], ptr %3, i64 0, i64 0
  %6 = call ptr @strcpy(ptr noundef %5, ptr noundef @.str.5) #3
  store i32 31, ptr %4, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %23, %1
  %8 = load i32, ptr %4, align 4, !tbaa !5
  %9 = icmp sge i32 %8, 0
  br i1 %9, label %10, label %26

10:                                               ; preds = %7
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr %4, align 4, !tbaa !5
  %13 = ashr i32 %11, %12
  %14 = and i32 %13, 1
  %15 = icmp eq i32 %14, 1
  br i1 %15, label %16, label %19

16:                                               ; preds = %10
  %17 = getelementptr inbounds [33 x i8], ptr %3, i64 0, i64 0
  %18 = call ptr @strcat(ptr noundef %17, ptr noundef @.str.6) #3
  br label %22

19:                                               ; preds = %10
  %20 = getelementptr inbounds [33 x i8], ptr %3, i64 0, i64 0
  %21 = call ptr @strcat(ptr noundef %20, ptr noundef @.str.7) #3
  br label %22

22:                                               ; preds = %19, %16
  br label %23

23:                                               ; preds = %22
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = add nsw i32 %24, -1
  store i32 %25, ptr %4, align 4, !tbaa !5
  br label %7, !llvm.loop !9

26:                                               ; preds = %7
  %27 = load ptr, ptr @stderr, align 8, !tbaa !11
  %28 = getelementptr inbounds [33 x i8], ptr %3, i64 0, i64 0
  %29 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef @.str.8, ptr noundef %28) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 33, ptr %3) #3
  ret void
}

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind
declare ptr @strcat(ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "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 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 #3 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nofree nounwind uwtable
define dso_local void @Math_printBinaryVector(i32 noundef %0) local_unnamed_addr #2 {
  %2 = alloca [33 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 33, ptr nonnull %2) #4
  %3 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.5) #4
  %.not = icmp sgt i32 %0, -1
  %.str.7..str.6 = select i1 %.not, ptr @.str.7, ptr @.str.6
  %4 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6) #4
  %5 = and i32 %0, 1073741824
  %.not.1 = icmp eq i32 %5, 0
  %.str.7..str.6.1 = select i1 %.not.1, ptr @.str.7, ptr @.str.6
  %6 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.1) #4
  %7 = and i32 %0, 536870912
  %.not.2 = icmp eq i32 %7, 0
  %.str.7..str.6.2 = select i1 %.not.2, ptr @.str.7, ptr @.str.6
  %8 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.2) #4
  %9 = and i32 %0, 268435456
  %.not.3 = icmp eq i32 %9, 0
  %.str.7..str.6.3 = select i1 %.not.3, ptr @.str.7, ptr @.str.6
  %10 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.3) #4
  %11 = and i32 %0, 134217728
  %.not.4 = icmp eq i32 %11, 0
  %.str.7..str.6.4 = select i1 %.not.4, ptr @.str.7, ptr @.str.6
  %12 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.4) #4
  %13 = and i32 %0, 67108864
  %.not.5 = icmp eq i32 %13, 0
  %.str.7..str.6.5 = select i1 %.not.5, ptr @.str.7, ptr @.str.6
  %14 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.5) #4
  %15 = and i32 %0, 33554432
  %.not.6 = icmp eq i32 %15, 0
  %.str.7..str.6.6 = select i1 %.not.6, ptr @.str.7, ptr @.str.6
  %16 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.6) #4
  %17 = and i32 %0, 16777216
  %.not.7 = icmp eq i32 %17, 0
  %.str.7..str.6.7 = select i1 %.not.7, ptr @.str.7, ptr @.str.6
  %18 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.7) #4
  %19 = and i32 %0, 8388608
  %.not.8 = icmp eq i32 %19, 0
  %.str.7..str.6.8 = select i1 %.not.8, ptr @.str.7, ptr @.str.6
  %20 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.8) #4
  %21 = and i32 %0, 4194304
  %.not.9 = icmp eq i32 %21, 0
  %.str.7..str.6.9 = select i1 %.not.9, ptr @.str.7, ptr @.str.6
  %22 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.9) #4
  %23 = and i32 %0, 2097152
  %.not.10 = icmp eq i32 %23, 0
  %.str.7..str.6.10 = select i1 %.not.10, ptr @.str.7, ptr @.str.6
  %24 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.10) #4
  %25 = and i32 %0, 1048576
  %.not.11 = icmp eq i32 %25, 0
  %.str.7..str.6.11 = select i1 %.not.11, ptr @.str.7, ptr @.str.6
  %26 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.11) #4
  %27 = and i32 %0, 524288
  %.not.12 = icmp eq i32 %27, 0
  %.str.7..str.6.12 = select i1 %.not.12, ptr @.str.7, ptr @.str.6
  %28 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.12) #4
  %29 = and i32 %0, 262144
  %.not.13 = icmp eq i32 %29, 0
  %.str.7..str.6.13 = select i1 %.not.13, ptr @.str.7, ptr @.str.6
  %30 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.13) #4
  %31 = and i32 %0, 131072
  %.not.14 = icmp eq i32 %31, 0
  %.str.7..str.6.14 = select i1 %.not.14, ptr @.str.7, ptr @.str.6
  %32 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.14) #4
  %33 = and i32 %0, 65536
  %.not.15 = icmp eq i32 %33, 0
  %.str.7..str.6.15 = select i1 %.not.15, ptr @.str.7, ptr @.str.6
  %34 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.15) #4
  %35 = and i32 %0, 32768
  %.not.16 = icmp eq i32 %35, 0
  %.str.7..str.6.16 = select i1 %.not.16, ptr @.str.7, ptr @.str.6
  %36 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.16) #4
  %37 = and i32 %0, 16384
  %.not.17 = icmp eq i32 %37, 0
  %.str.7..str.6.17 = select i1 %.not.17, ptr @.str.7, ptr @.str.6
  %38 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.17) #4
  %39 = and i32 %0, 8192
  %.not.18 = icmp eq i32 %39, 0
  %.str.7..str.6.18 = select i1 %.not.18, ptr @.str.7, ptr @.str.6
  %40 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.18) #4
  %41 = and i32 %0, 4096
  %.not.19 = icmp eq i32 %41, 0
  %.str.7..str.6.19 = select i1 %.not.19, ptr @.str.7, ptr @.str.6
  %42 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.19) #4
  %43 = and i32 %0, 2048
  %.not.20 = icmp eq i32 %43, 0
  %.str.7..str.6.20 = select i1 %.not.20, ptr @.str.7, ptr @.str.6
  %44 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.20) #4
  %45 = and i32 %0, 1024
  %.not.21 = icmp eq i32 %45, 0
  %.str.7..str.6.21 = select i1 %.not.21, ptr @.str.7, ptr @.str.6
  %46 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.21) #4
  %47 = and i32 %0, 512
  %.not.22 = icmp eq i32 %47, 0
  %.str.7..str.6.22 = select i1 %.not.22, ptr @.str.7, ptr @.str.6
  %48 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.22) #4
  %49 = and i32 %0, 256
  %.not.23 = icmp eq i32 %49, 0
  %.str.7..str.6.23 = select i1 %.not.23, ptr @.str.7, ptr @.str.6
  %50 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.23) #4
  %51 = and i32 %0, 128
  %.not.24 = icmp eq i32 %51, 0
  %.str.7..str.6.24 = select i1 %.not.24, ptr @.str.7, ptr @.str.6
  %52 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.24) #4
  %53 = and i32 %0, 64
  %.not.25 = icmp eq i32 %53, 0
  %.str.7..str.6.25 = select i1 %.not.25, ptr @.str.7, ptr @.str.6
  %54 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.25) #4
  %55 = and i32 %0, 32
  %.not.26 = icmp eq i32 %55, 0
  %.str.7..str.6.26 = select i1 %.not.26, ptr @.str.7, ptr @.str.6
  %56 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.26) #4
  %57 = and i32 %0, 16
  %.not.27 = icmp eq i32 %57, 0
  %.str.7..str.6.27 = select i1 %.not.27, ptr @.str.7, ptr @.str.6
  %58 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.27) #4
  %59 = and i32 %0, 8
  %.not.28 = icmp eq i32 %59, 0
  %.str.7..str.6.28 = select i1 %.not.28, ptr @.str.7, ptr @.str.6
  %60 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.28) #4
  %61 = and i32 %0, 4
  %.not.29 = icmp eq i32 %61, 0
  %.str.7..str.6.29 = select i1 %.not.29, ptr @.str.7, ptr @.str.6
  %62 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.29) #4
  %63 = and i32 %0, 2
  %.not.30 = icmp eq i32 %63, 0
  %.str.7..str.6.30 = select i1 %.not.30, ptr @.str.7, ptr @.str.6
  %64 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.30) #4
  %65 = and i32 %0, 1
  %.not.31 = icmp eq i32 %65, 0
  %.str.7..str.6.31 = select i1 %.not.31, ptr @.str.7, ptr @.str.6
  %66 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.str.7..str.6.31) #4
  %67 = load ptr, ptr @stderr, align 8, !tbaa !5
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.8, ptr noundef nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 33, ptr nonnull %2) #4
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nofree nounwind "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 = { nofree 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 #3 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 #4 = { nounwind }
attributes #5 = { cold 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"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass