; LLVM IR from mackorone/mms :: old/v2/src/sim (MouseInterface)

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

@.str.85 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.86 = external hidden unnamed_addr constant [74 x i8], align 1

declare noundef ptr @_ZN3sim1LEv() #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2el6Logger4warnIiJEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

declare noundef ptr @_ZN3sim1SEv() #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sim14MouseInterface29acknowledgeInputButtonPressedEi(ptr noundef nonnull align 8 dereferenceable(296) %0, i32 noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %5 = load ptr, ptr %3, align 8
  %6 = load i32, ptr %4, align 4, !tbaa !9
  %7 = icmp slt i32 %6, 0
  br i1 %7, label %11, label %8

8:                                                ; preds = %2
  %9 = load i32, ptr %4, align 4, !tbaa !9
  %10 = icmp slt i32 9, %9
  br i1 %10, label %11, label %13

11:                                               ; preds = %8, %2
  %12 = call noundef ptr @_ZN3sim1LEv()
  call void @_ZN2el6Logger4warnIiJEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %12, ptr noundef @.str.85, ptr noundef nonnull align 4 dereferenceable(4) %4)
  br label %17

13:                                               ; preds = %8
  %14 = call noundef ptr @_ZN3sim1SEv()
  %15 = load i32, ptr %4, align 4, !tbaa !9
  call void @_ZN3sim5State24setInputButtonWasPressedEib(ptr noundef nonnull align 8 dereferenceable(168) %14, i32 noundef %15, i1 noundef zeroext false)
  %16 = call noundef ptr @_ZN3sim1LEv()
  call void @_ZN2el6Logger4infoIiJEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %16, ptr noundef @.str.86, ptr noundef nonnull align 4 dereferenceable(4) %4)
  br label %17

17:                                               ; preds = %13, %11
  ret void
}

declare void @_ZN3sim5State24setInputButtonWasPressedEib(ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, i1 noundef zeroext) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2el6Logger4infoIiJEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

attributes #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 = { inlinehint mustprogress 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 = { mustprogress 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"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"

@.str.85 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.86 = external hidden unnamed_addr constant [74 x i8], align 1

declare noundef ptr @_ZN3sim1LEv() local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2el6Logger4warnIiJEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

declare noundef ptr @_ZN3sim1SEv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sim14MouseInterface29acknowledgeInputButtonPressedEi(ptr nocapture noundef nonnull readnone align 8 dereferenceable(296) %0, i32 noundef %1) local_unnamed_addr #2 align 2 {
  %3 = alloca i32, align 4
  store i32 %1, ptr %3, align 4, !tbaa !5
  %or.cond = icmp ugt i32 %1, 9
  br i1 %or.cond, label %4, label %6

4:                                                ; preds = %2
  %5 = tail call noundef ptr @_ZN3sim1LEv()
  call void @_ZN2el6Logger4warnIiJEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %5, ptr noundef nonnull @.str.85, ptr noundef nonnull align 4 dereferenceable(4) %3)
  br label %9

6:                                                ; preds = %2
  %7 = tail call noundef ptr @_ZN3sim1SEv()
  tail call void @_ZN3sim5State24setInputButtonWasPressedEib(ptr noundef nonnull align 8 dereferenceable(168) %7, i32 noundef %1, i1 noundef zeroext false)
  %8 = tail call noundef ptr @_ZN3sim1LEv()
  call void @_ZN2el6Logger4infoIiJEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728) %8, ptr noundef nonnull @.str.86, ptr noundef nonnull align 4 dereferenceable(4) %3)
  br label %9

9:                                                ; preds = %6, %4
  ret void
}

declare void @_ZN3sim5State24setInputButtonWasPressedEib(ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2el6Logger4infoIiJEEEvPKcRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(728), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

attributes #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 = { inlinehint mustprogress 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 = { mustprogress 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++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass