import gleam/int
pub fn spiral_wrap_signed(value: Int, bits: Int) -> Int {
  let half = int.bitwise_shift_left(1, bits - 1)
  int.bitwise_and(value + half, int.bitwise_shift_left(1, bits) - 1) - half
}

pub fn spiral_wrap_unsigned(value: Int, bits: Int) -> Int {
  int.bitwise_and(value, int.bitwise_shift_left(1, bits) - 1)
}

pub fn main() {
let v0 = -8
let v1 = 3
let v2 = 1
let v3 = 4294967295
let v4 = 4
let v5 = int.bitwise_shift_right(v0, v2)
let v6 = spiral_wrap_signed(int.bitwise_shift_left(v1, v2), 32)
let v7 = int.bitwise_shift_right(v3, v4)
let v8 = spiral_wrap_unsigned(int.bitwise_shift_left(v3, v2), 32)
let v9 = v5 == -4
case v9 {
    True -> {
        let v10 = v6 == 6
        case v10 {
            True -> {
                let v11 = v7 == 268435455
                case v11 {
                    True -> {
                        let v12 = v8 == 4294967294
                        case v12 {
                            True -> {
                                0
                            }
                            False -> {
                                4
                            }
                        }
                    }
                    False -> {
                        3
                    }
                }
            }
            False -> {
                2
            }
        }
    }
    False -> {
        1
    }
}
}
