; LLVM IR from tyalie/Sudoku-Generator-CPP :: src/Generator/SudokuProp.ll (ZN10SudokuProp20prop2_2ColumnInBlockER6Sudokuccc)

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10SudokuProp20prop2_2ColumnInBlockER6Sudokuccc(ptr noundef nonnull align 1 dereferenceable(82) %0, i8 noundef signext %1, i8 noundef signext %2, i8 noundef signext %3) #1 align 2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i8 %1, ptr %7, align 1, !tbaa !9
  store i8 %2, ptr %8, align 1, !tbaa !9
  store i8 %3, ptr %9, align 1, !tbaa !9
  %11 = load i8, ptr %8, align 1, !tbaa !9
  %12 = sext i8 %11 to i32
  %13 = load i8, ptr %9, align 1, !tbaa !9
  %14 = sext i8 %13 to i32
  %15 = icmp eq i32 %12, %14
  br i1 %15, label %16, label %17

16:                                               ; preds = %4
  store i1 false, ptr %5, align 1
  br label %53

17:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !10
  br label %18

18:                                               ; preds = %49, %17
  %19 = load i32, ptr %10, align 4, !tbaa !10
  %20 = icmp slt i32 %19, 9
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %52

22:                                               ; preds = %18
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %23)
  %25 = load i8, ptr %7, align 1, !tbaa !9
  %26 = sext i8 %25 to i32
  %27 = mul nsw i32 %26, 3
  %28 = load i8, ptr %8, align 1, !tbaa !9
  %29 = sext i8 %28 to i32
  %30 = add nsw i32 %27, %29
  %31 = load i32, ptr %10, align 4, !tbaa !10
  %32 = mul nsw i32 9, %31
  %33 = add nsw i32 %30, %32
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i8, ptr %24, i64 %34
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %36)
  %38 = load i8, ptr %7, align 1, !tbaa !9
  %39 = sext i8 %38 to i32
  %40 = mul nsw i32 %39, 3
  %41 = load i8, ptr %9, align 1, !tbaa !9
  %42 = sext i8 %41 to i32
  %43 = add nsw i32 %40, %42
  %44 = load i32, ptr %10, align 4, !tbaa !10
  %45 = mul nsw i32 9, %44
  %46 = add nsw i32 %43, %45
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i8, ptr %37, i64 %47
  call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) %35, ptr noundef nonnull align 1 dereferenceable(1) %48) #4
  br label %49

49:                                               ; preds = %22
  %50 = load i32, ptr %10, align 4, !tbaa !10
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %10, align 4, !tbaa !10
  br label %18, !llvm.loop !12

52:                                               ; preds = %21
  store i1 true, ptr %5, align 1
  br label %53

53:                                               ; preds = %52, %16
  %54 = load i1, ptr %5, align 1
  ret i1 %54
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82)) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { inlinehint mustprogress 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 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 #4 = { 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++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; 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 nounwind uwtable
define dso_local noundef zeroext i1 @_ZN10SudokuProp20prop2_2ColumnInBlockER6Sudokuccc(ptr noundef nonnull align 1 dereferenceable(82) %0, i8 noundef signext %1, i8 noundef signext %2, i8 noundef signext %3) local_unnamed_addr #0 align 2 {
  %5 = icmp ne i8 %2, %3
  br i1 %5, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %4
  %6 = sext i8 %3 to i32
  %7 = sext i8 %2 to i32
  %8 = sext i8 %1 to i32
  %9 = mul nsw i32 %8, 3
  %10 = add nsw i32 %9, %7
  %11 = add nsw i32 %9, %6
  %12 = sext i32 %11 to i64
  %13 = sext i32 %10 to i64
  %14 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %15 = getelementptr inbounds i8, ptr %14, i64 %13
  %16 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %17 = getelementptr inbounds i8, ptr %16, i64 %12
  tail call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) %15, ptr noundef nonnull align 1 dereferenceable(1) %17) #2
  %18 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %19 = getelementptr i8, ptr %18, i64 %13
  %20 = getelementptr i8, ptr %19, i64 9
  %21 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %22 = getelementptr i8, ptr %21, i64 %12
  %23 = getelementptr i8, ptr %22, i64 9
  tail call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) %20, ptr noundef nonnull align 1 dereferenceable(1) %23) #2
  %24 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %25 = getelementptr i8, ptr %24, i64 %13
  %26 = getelementptr i8, ptr %25, i64 18
  %27 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %28 = getelementptr i8, ptr %27, i64 %12
  %29 = getelementptr i8, ptr %28, i64 18
  tail call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) %26, ptr noundef nonnull align 1 dereferenceable(1) %29) #2
  %30 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %31 = getelementptr i8, ptr %30, i64 %13
  %32 = getelementptr i8, ptr %31, i64 27
  %33 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %34 = getelementptr i8, ptr %33, i64 %12
  %35 = getelementptr i8, ptr %34, i64 27
  tail call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) %32, ptr noundef nonnull align 1 dereferenceable(1) %35) #2
  %36 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %37 = getelementptr i8, ptr %36, i64 %13
  %38 = getelementptr i8, ptr %37, i64 36
  %39 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %40 = getelementptr i8, ptr %39, i64 %12
  %41 = getelementptr i8, ptr %40, i64 36
  tail call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) %38, ptr noundef nonnull align 1 dereferenceable(1) %41) #2
  %42 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %43 = getelementptr i8, ptr %42, i64 %13
  %44 = getelementptr i8, ptr %43, i64 45
  %45 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %46 = getelementptr i8, ptr %45, i64 %12
  %47 = getelementptr i8, ptr %46, i64 45
  tail call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) %44, ptr noundef nonnull align 1 dereferenceable(1) %47) #2
  %48 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %49 = getelementptr i8, ptr %48, i64 %13
  %50 = getelementptr i8, ptr %49, i64 54
  %51 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %52 = getelementptr i8, ptr %51, i64 %12
  %53 = getelementptr i8, ptr %52, i64 54
  tail call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) %50, ptr noundef nonnull align 1 dereferenceable(1) %53) #2
  %54 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %55 = getelementptr i8, ptr %54, i64 %13
  %56 = getelementptr i8, ptr %55, i64 63
  %57 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %58 = getelementptr i8, ptr %57, i64 %12
  %59 = getelementptr i8, ptr %58, i64 63
  tail call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) %56, ptr noundef nonnull align 1 dereferenceable(1) %59) #2
  %60 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %61 = getelementptr i8, ptr %60, i64 %13
  %62 = getelementptr i8, ptr %61, i64 72
  %63 = tail call noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82) %0)
  %64 = getelementptr i8, ptr %63, i64 %12
  %65 = getelementptr i8, ptr %64, i64 72
  tail call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) %62, ptr noundef nonnull align 1 dereferenceable(1) %65) #2
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader, %4
  ret i1 %5
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6Sudoku8getFieldEv(ptr noundef nonnull align 1 dereferenceable(82)) local_unnamed_addr #0 align 2

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass