def METHOD_NAME(self, index: int, seg_base: int, seg_limit: int, access: int) -> int:
    flags = QL_X86_F_OPSIZE_32
    # is this a huge segment?
    if seg_limit > (1 << 16):
        # on 4K granularity the lower 12 bits are implicitly all set
        assert seg_limit & ((1 << 12) - 1) == 0xfff
        seg_limit >>= 12
        flags |= QL_X86_F_GRANULARITY
    # create GDT entry, then write GDT entry into GDT table
    self.array[index] = GDTManager.make_entry(seg_base, seg_limit, access, flags)
    return GDTManager.make_selector(index, (access >> 5) & 0b11)